89 |
|
int nRestraintStamps = simParam->getNRestraintStamps(); |
90 |
|
std::vector<RestraintStamp*> stamp = simParam->getRestraintStamps(); |
91 |
|
|
92 |
+ |
std::vector<int> stuntDoubleIndex; |
93 |
+ |
|
94 |
|
for (int i = 0; i < nRestraintStamps; i++){ |
95 |
|
|
96 |
|
std::string myType = toUpperCopy(stamp[i]->getType()); |
136 |
|
|
137 |
|
int myrank = MPI::COMM_WORLD.Get_rank(); |
138 |
|
if (info_->getMolToProc(molIndex) == myrank) { |
139 |
+ |
|
140 |
|
// If we were supposed to have it but got a null, then freak out. |
141 |
|
#endif |
142 |
|
|
152 |
|
#endif |
153 |
|
} |
154 |
|
|
155 |
+ |
|
156 |
+ |
#ifdef IS_MPI |
157 |
+ |
// only handle this molecular restraint if this processor owns the |
158 |
+ |
// molecule |
159 |
+ |
int myrank = MPI::COMM_WORLD.Get_rank(); |
160 |
+ |
if (info_->getMolToProc(molIndex) == myrank) { |
161 |
+ |
|
162 |
+ |
#endif |
163 |
+ |
|
164 |
|
MolecularRestraint* rest = new MolecularRestraint(); |
165 |
|
|
166 |
|
std::string restPre("mol_"); |
196 |
|
restraints_.push_back(rest); |
197 |
|
mol->addProperty(new RestraintData("Restraint", rest)); |
198 |
|
restrainedMols_.push_back(mol); |
199 |
< |
|
199 |
> |
#ifdef IS_MPI |
200 |
> |
} |
201 |
> |
#endif |
202 |
|
} else if (myType.compare("OBJECT") == 0) { |
203 |
|
|
204 |
|
std::string objectSelection; |
234 |
|
|
235 |
|
for (sd = seleMan.beginSelected(selei); sd != NULL; |
236 |
|
sd = seleMan.nextSelected(selei)) { |
237 |
< |
|
237 |
> |
stuntDoubleIndex.push_back(sd->getGlobalIntegrableObjectIndex()); |
238 |
> |
|
239 |
|
ObjectRestraint* rest = new ObjectRestraint(); |
240 |
|
|
241 |
|
if (stamp[i]->haveDisplacementSpringConstant()) { |
275 |
|
// are times when it won't use restraints at all, so only open the |
276 |
|
// restraint file if we are actually using restraints: |
277 |
|
|
278 |
< |
if (simParam->getUseRestraints()) { |
278 |
> |
if (simParam->getUseRestraints()) { |
279 |
|
std::string refFile = simParam->getRestraint_file(); |
280 |
< |
RestReader* rr = new RestReader(info, refFile); |
266 |
< |
|
280 |
> |
RestReader* rr = new RestReader(info, refFile, stuntDoubleIndex); |
281 |
|
rr->readReferenceStructure(); |
282 |
|
} |
283 |
|
|
284 |
|
restOutput_ = getPrefix(info_->getFinalConfigFileName()) + ".rest"; |
285 |
|
restOut = new RestWriter(info_, restOutput_.c_str(), restraints_); |
272 |
– |
|
286 |
|
if(!restOut){ |
287 |
|
sprintf(painCave.errMsg, "Restraint error: Failed to create RestWriter\n"); |
288 |
|
painCave.isFatal = 1; |
305 |
|
currRestTime_ = currSnapshot_->getTime(); |
306 |
|
} |
307 |
|
|
308 |
< |
void RestraintForceManager::calcForces(bool needPotential, bool needStress){ |
308 |
> |
void RestraintForceManager::calcForces(){ |
309 |
|
|
310 |
< |
ForceManager::calcForces(needPotential, needStress); |
310 |
> |
ForceManager::calcForces(); |
311 |
|
RealType restPot_local, restPot; |
312 |
|
|
313 |
|
restPot_local = doRestraints(1.0); |
387 |
|
std::vector<Vector3d> forces; |
388 |
|
|
389 |
|
for(sd = (*rm)->beginIntegrableObject(ioi); sd != NULL; |
390 |
< |
sd = (*rm)->nextIntegrableObject(ioi)) { |
390 |
> |
sd = (*rm)->nextIntegrableObject(ioi)) { |
391 |
|
struc.push_back(sd->getPos()); |
392 |
|
} |
393 |
|
|