76 tmp.first += forces[i];
102 axis = (1/nrm) * diff;
105 c = force_torque.second *
axis;
118 const fl torsion = *c;
151 b[i].set_conf(parent, atoms, coords, c);
157 vecp force_torque = b[i].derivative(coords, forces, d);
158 out.first += force_torque.first;
159 vec r; r = b[i].node.get_origin() - origin;
160 out.second +=
cross_product(r, force_torque.first) + force_torque.second;
170 node.set_conf(parent, atoms, coords, c);
174 vecp force_torque =
node.sum_force_and_torque(coords, forces);
178 node.set_derivative(force_torque, d);
186 template<
typename Node>
193 flv::const_iterator p = c.
torsions.begin();
198 flv::const_iterator p = c.
torsions.begin();
199 node.set_conf(atoms, coords, *p);
205 vecp force_torque =
node.sum_force_and_torque(coords, forces);
206 flv::iterator p = c.
torsions.begin();
208 node.set_derivative(force_torque, c.
rigid);
212 vecp force_torque =
node.sum_force_and_torque(coords, forces);
213 flv::iterator p = c.
torsions.begin();
217 node.set_derivative(force_torque, d);
224 t.node.count_torsions(s);
237 (*this)[i].set_conf(atoms, coords, c[i]);
240 szv tmp(this->size(), 0);
248 (*this)[i].derivative(coords, forces, c[i]);
252 template<
typename T,
typename F>