ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/primitives/Molecule.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-4/src/primitives/Molecule.cpp (file contents):
Revision 1733 by tim, Fri Nov 12 06:19:04 2004 UTC vs.
Revision 1738 by tim, Sat Nov 13 05:08:12 2004 UTC

# Line 112 | Line 112 | void Molecule::complete() {
112      //element that is contained in [allAtoms.begin(), allAtoms.end()) and not contained in
113      //[rigidAtoms.begin(), rigidAtoms.end()).
114      std::set_difference(allAtoms.begin(), allAtoms.end(), rigidAtoms.begin(), rigidAtoms.end(),
115 <                            std::back_inserter(integrableObjects_));
115 >                            std::back_inserter(integrableObjects_.end()));
116  
117      if (integrableObjects_.size() != allAtoms.size() - rigidAtoms.size()) {
118          //Some atoms in rigidAtoms are not in allAtoms, something must be wrong
# Line 196 | Line 196 | CutoffGroup* Molecule::nextCutoffGroup(std::vector<Cut
196      ++i;
197      return (i == cutoffGroups_.end()) ? NULL : *i;    
198   }
199
200 void Molecule::calcForces() {
201    RigidBody* rb;
202    Bond* bond;
203    Bend* bend;
204    Torsion* torsion;
205    std::vector<RigidBody*>::iterator rbIter;
206    std::vector<Bond*>::iterator bondIter;;
207    std::vector<Bend*>::iterator bendIter;
208    std::vector<Torsion*>::iterator torsionIter;
209
210    for (rb = beginRigidBody(rbIter); rb != NULL; rb = nextRigidBody(rbIter)) {
211        rb->updateAtoms();
212    }
213
214    for (bond = beginBond(bondIter); bond != NULL; bond = nextBond(bondIter)) {
215        bond->calc_forces();
216    }
217
218    for (bend = beginBend(bendIter); bend != NULL; bend = nextBend(bendIter)) {
219        bend->calc_forces();
220    }
221
222    for (torsion = beginTorsion(torsionIter); torsion != NULL; torsion = nextTorsion(torsionIter)) {
223        torsion->calc_forces();
224    }
225    
226 }
227
228 double Molecule::getPotential() {
229    //RigidBody* rb;
230    Bond* bond;
231    Bend* bend;
232    Torsion* torsion;
233    //std::vector<RigidBody*> rbIter;
234    std::vector<Bond*>::iterator bondIter;;
235    std::vector<Bend*>::iterator bendIter;
236    std::vector<Torsion*>::iterator torsionIter;
199  
238    double potential = 0;
239    
240    //for (rb = beginRigidBody(rbIter); rb != NULL; rb = nextRigidBody(rbIter)) {
241    //    rb->updateAtoms();
242    //}
200  
244    for (bond = beginBond(bondIter); bond != NULL; bond = nextBond(bondIter)) {
245        potential += bond->get_potential();
246    }
247
248    for (bend = beginBend(bendIter); bend != NULL; bend = nextBend(bendIter)) {
249        potential += bend->get_potential();
250    }
251
252    for (torsion = beginTorsion(torsionIter); torsion != NULL; torsion = nextTorsion(torsionIter)) {
253        potential += torsion->get_potential();
254    }
255    
256    return potential;
257 }
258
201   Vector3d Molecule::getCom() {
202      StuntDouble* sd;
203      std::vector<StuntDouble*>::iterator i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines