50 |
|
#include "brains/ForceManager.hpp" |
51 |
|
#include "primitives/Molecule.hpp" |
52 |
|
#include "UseTheForce/doForces_interface.h" |
53 |
+ |
#define __C |
54 |
+ |
#include "UseTheForce/DarkSide/fInteractionMap.h" |
55 |
|
#include "utils/simError.h" |
56 |
|
namespace oopse { |
57 |
|
|
165 |
|
CutoffGroup* cg; |
166 |
|
Vector3d com; |
167 |
|
std::vector<Vector3d> rcGroup; |
166 |
– |
|
167 |
– |
if(info_->getNCutoffGroups() > 0){ |
168 |
|
|
169 |
+ |
if(info_->getNCutoffGroups() > 0){ |
170 |
+ |
|
171 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { |
172 |
|
for(cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) { |
173 |
|
cg->getCOM(com); |
182 |
|
} |
183 |
|
|
184 |
|
//initialize data before passing to fortran |
185 |
< |
double longRangePotential = 0.0; |
185 |
> |
double longRangePotential[LR_POT_TYPES]; |
186 |
> |
double lrPot = 0.0; |
187 |
> |
|
188 |
|
Mat3x3d tau; |
189 |
|
short int passedCalcPot = needPotential; |
190 |
|
short int passedCalcStress = needStress; |
191 |
|
int isError = 0; |
192 |
|
|
193 |
+ |
for (int i=0; i<LR_POT_TYPES;i++){ |
194 |
+ |
longRangePotential[i]=0.0; //Initialize array |
195 |
+ |
} |
196 |
+ |
|
197 |
+ |
|
198 |
+ |
|
199 |
|
doForceLoop( pos, |
200 |
|
rc, |
201 |
|
A, |
203 |
|
frc, |
204 |
|
trq, |
205 |
|
tau.getArrayPointer(), |
206 |
< |
&longRangePotential, |
206 |
> |
longRangePotential, |
207 |
|
&passedCalcPot, |
208 |
|
&passedCalcStress, |
209 |
|
&isError ); |
214 |
|
painCave.isFatal = 1; |
215 |
|
simError(); |
216 |
|
} |
217 |
+ |
for (int i=0; i<LR_POT_TYPES;i++){ |
218 |
+ |
lrPot += longRangePotential[i]; //Quick hack |
219 |
+ |
} |
220 |
|
|
221 |
|
//store the tau and long range potential |
222 |
< |
curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential; |
222 |
> |
curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot; |
223 |
> |
// curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential; |
224 |
|
curSnapshot->statData.setTau(tau); |
225 |
|
} |
226 |
|
|