2
2
*
3
3
* Sire - Molecular Simulation Framework
4
4
*
5
- * Copyright (C) 2009 Christopher Woods
5
+ * Copyright (C) 2025 Christopher Woods
6
6
*
7
7
* This program is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
28
28
#include " dihedralrestraints.h"
29
29
30
30
#include " SireID/index.h"
31
- #include " SireUnits/units.h"
32
31
#include " SireStream/datastream.h"
33
32
#include " SireStream/shareddatastream.h"
33
+ #include " SireUnits/units.h"
34
34
35
35
#include " SireCAS/errors.h"
36
36
@@ -80,37 +80,24 @@ QDataStream &operator>>(QDataStream &ds, DihedralRestraint &dihrest)
80
80
return ds;
81
81
}
82
82
83
-
84
83
/* * Null constructor */
85
84
DihedralRestraint::DihedralRestraint ()
86
85
: ConcreteProperty<DihedralRestraint, Property>(),
87
86
_phi0(0 ), _kphi(0 )
88
87
{
89
88
}
90
89
91
-
92
90
/* * Construct a restraint that acts on the angle within the
93
91
four atoms 'atom0', 'atom1', 'atom2' 'atom3' (phi == a(0123)),
94
92
restraining the angle within these atoms */
95
93
DihedralRestraint::DihedralRestraint (const QList<qint64> &atoms,
96
- const SireUnits::Dimension::Angle &phi0,
97
- const SireUnits::Dimension::HarmonicAngleConstant &kphi)
94
+ const SireUnits::Dimension::Angle &phi0,
95
+ const SireUnits::Dimension::HarmonicAngleConstant &kphi)
98
96
: ConcreteProperty<DihedralRestraint, Property>(),
99
97
_phi0(phi0), _kphi(kphi)
100
98
{
101
- // Need to think here about validating the angle and force constant values
102
- // if (atoms.count() != 3)
103
- // {
104
- // throw SireError::invalid_arg(QObject::tr(
105
- // "Wrong number of inputs for an Angle restraint. You need to "
106
- // "provide 3 atoms (%1).")
107
- // .arg(atoms.count()),
108
- // // .arg(phi0.count())
109
- // // .arg(kphi.count()),
110
- // CODELOC);
111
- // }
112
-
113
- // make sure that we have 3 distinct atoms
99
+
100
+ // Make sure that we have 4 distinct atoms
114
101
QSet<qint64> distinct;
115
102
distinct.reserve (4 );
116
103
@@ -120,12 +107,6 @@ DihedralRestraint::DihedralRestraint(const QList<qint64> &atoms,
120
107
distinct.insert (atom);
121
108
}
122
109
123
- // if (distinct.count() != 3)
124
- // throw SireError::invalid_arg(QObject::tr(
125
- // "There is something wrong with the atoms provided. "
126
- // "They should all be unique and all greater than or equal to 0."),
127
- // CODELOC);
128
-
129
110
atms = atoms.toVector ();
130
111
}
131
112
@@ -301,15 +282,15 @@ DihedralRestraints::DihedralRestraints(const QList<DihedralRestraint> &restraint
301
282
}
302
283
303
284
DihedralRestraints::DihedralRestraints (const QString &name,
304
- const DihedralRestraint &restraint)
285
+ const DihedralRestraint &restraint)
305
286
: ConcreteProperty<DihedralRestraints, Restraints>(name)
306
287
{
307
288
if (not restraint.isNull ())
308
289
r.append (restraint);
309
290
}
310
291
311
292
DihedralRestraints::DihedralRestraints (const QString &name,
312
- const QList<DihedralRestraint> &restraints)
293
+ const QList<DihedralRestraint> &restraints)
313
294
: ConcreteProperty<DihedralRestraints, Restraints>(name)
314
295
{
315
296
for (const auto &restraint : restraints)
0 commit comments