@@ -34,7 +34,7 @@ Add units to function outputs.
3434*/
3535
3636%pythonappend OpenMMCPPForces::CompositeRMSDForce::getReferencePositions () const %{
37- val= unit.nanometers
37+ val * = unit.nanometers
3838%}
3939
4040/*
@@ -56,20 +56,21 @@ namespace OpenMMCPPForces {
5656This is a force whose energy equals the root mean squared deviation (RMSD) between the
5757current coordinates of multiple particle groups and reference structures defined for
5858each group. The composite RMSD is computed after aligning every particle group to its
59- reference while keeping the relative orientations of all groups fixed. Therefore, it is
60- not a mere composition of independent RMSD calculations done in the usual way.
59+ reference while keeping the relative orientations of all groups fixed. In other words,
60+ every group can translate independently in search for the best alignment, but all
61+ groups must rotate in unison.
6162
6263Consider `m` particle groups, with each group :math:`{\bf g}_j` containing
6364:math:`n_j` particles. The centroid of each group is given by
6465
6566.. math::
6667
67- {\bf c}_j = \frac{1 }{n_j} \sum_{k \in {\bf g}_j} {\bf r}_k
68+ {\bf c}_j = \frac{1 }{n_j} \sum_{i \in {\bf g}_j} {\bf r}_i
6869
69- where :math:`{\bf r}_k ` is the position of particle :math:`k` and the sum is over
70+ where :math:`{\bf r}_i ` is the position of particle :math:`k` and the sum is over
7071all particles in the group. Analogously, :math:`{\bf c}_j^{\rm ref}` is the
7172centroid of the reference structure for group :math:`j`, whose each particle
72- :math:`k` is located at :math:`{\bf r}_k ^{\rm ref}`.
73+ :math:`k` is located at :math:`{\bf r}_i ^{\rm ref}`.
7374
7475The composite RMSD is then defined as
7576
@@ -78,9 +79,9 @@ The composite RMSD is then defined as
7879 d_{\rm crms}({\bf r}) = \sqrt{
7980 \frac{1 }{n} \min_{
8081 \bf q \in \mathbb{R}^4 \atop \|{\bf q}\| = 1
81- } \sum_{j=1 }^m \sum_{k \in {\bf g}_j} \left\|
82- {\bf A}({\bf q})\left ({\bf r}_k - {\bf c}_j\right) -
83- {\bf r}_k ^{\rm ref} + {\bf c}_j^{\rm ref}
82+ } \sum_{j=1 }^m \sum_{i \in {\bf g}_j} \left\|
83+ {\bf A}({\bf q})\left ({\bf r}_i - {\bf c}_j\right) -
84+ {\bf r}_i ^{\rm ref} + {\bf c}_j^{\rm ref}
8485 \right\|^2
8586 }
8687
@@ -217,14 +218,23 @@ public:
217218 %}
218219 bool usesPeriodicBoundaryConditions();
219220
221+
220222 %extend {
223+ %feature("docstring") %{Cast a :OpenMM:`Force` to a :class:`CompositeRMSDForce`.%}
221224 static OpenMMCPPForces::CompositeRMSDForce& cast(OpenMM::Force& force) {
222225 return dynamic_cast<OpenMMCPPForces::CompositeRMSDForce&>(force);
223226 }
224227
228+ %feature("docstring") %{Check if a :OpenMM:`Force` is a :class:`CompositeRMSDForce`.%}
225229 static bool isinstance(OpenMM::Force& force) {
226230 return (dynamic_cast<OpenMMCPPForces::CompositeRMSDForce*>(&force) != NULL);
227231 }
232+
233+ %feature("docstring") %{Clone a :class:`CompositeRMSDForce` object.%}
234+ %newobject __copy__;
235+ OpenMMCPPForces::CompositeRMSDForce* __copy__() {
236+ return OpenMM::XmlSerializer::clone<OpenMMCPPForces::CompositeRMSDForce>(*self);
237+ }
228238 }
229239};
230240
0 commit comments