53 |
|
#define __C |
54 |
|
#include "UseTheForce/DarkSide/fInteractionMap.h" |
55 |
|
#include "utils/simError.h" |
56 |
+ |
#include "primitives/Bond.hpp" |
57 |
|
#include "primitives/Bend.hpp" |
57 |
– |
#include "primitives/Bend.hpp" |
58 |
|
namespace oopse { |
59 |
|
|
60 |
|
void ForceManager::calcForces(bool needPotential, bool needStress) { |
83 |
|
|
84 |
|
// forces are zeroed here, before any are accumulated. |
85 |
|
// NOTE: do not rezero the forces in Fortran. |
86 |
< |
|
86 |
> |
|
87 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; |
88 |
|
mol = info_->nextMolecule(mi)) { |
89 |
|
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { |
90 |
|
atom->zeroForcesAndTorques(); |
91 |
|
} |
92 |
< |
|
92 |
> |
|
93 |
|
//change the positions of atoms which belong to the rigidbodies |
94 |
|
for (rb = mol->beginRigidBody(rbIter); rb != NULL; |
95 |
|
rb = mol->nextRigidBody(rbIter)) { |
96 |
|
rb->zeroForcesAndTorques(); |
97 |
|
} |
98 |
+ |
|
99 |
|
} |
100 |
|
|
101 |
|
// Zero out the stress tensor |
202 |
|
RealType* A; |
203 |
|
RealType* electroFrame; |
204 |
|
RealType* rc; |
205 |
+ |
RealType* particlePot; |
206 |
|
|
207 |
|
//get current snapshot from SimInfo |
208 |
|
curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
214 |
|
trq = config->getArrayPointer(DataStorage::dslTorque); |
215 |
|
A = config->getArrayPointer(DataStorage::dslAmat); |
216 |
|
electroFrame = config->getArrayPointer(DataStorage::dslElectroFrame); |
217 |
+ |
particlePot = config->getArrayPointer(DataStorage::dslParticlePot); |
218 |
|
|
219 |
|
//calculate the center of mass of cutoff group |
220 |
|
SimInfo::MoleculeIterator mi; |
254 |
|
longRangePotential[i]=0.0; //Initialize array |
255 |
|
} |
256 |
|
|
257 |
< |
doForceLoop( pos, |
258 |
< |
rc, |
259 |
< |
A, |
260 |
< |
electroFrame, |
261 |
< |
frc, |
262 |
< |
trq, |
263 |
< |
tau.getArrayPointer(), |
264 |
< |
longRangePotential, |
265 |
< |
&passedCalcPot, |
266 |
< |
&passedCalcStress, |
267 |
< |
&isError ); |
268 |
< |
|
257 |
> |
doForceLoop(pos, |
258 |
> |
rc, |
259 |
> |
A, |
260 |
> |
electroFrame, |
261 |
> |
frc, |
262 |
> |
trq, |
263 |
> |
tau.getArrayPointer(), |
264 |
> |
longRangePotential, |
265 |
> |
particlePot, |
266 |
> |
&passedCalcPot, |
267 |
> |
&passedCalcStress, |
268 |
> |
&isError ); |
269 |
> |
|
270 |
|
if( isError ){ |
271 |
|
sprintf( painCave.errMsg, |
272 |
|
"Error returned from the fortran force calculation.\n" ); |