35 |
|
* |
36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
< |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
|
68 |
|
namespace OpenMD { |
69 |
|
|
70 |
|
void RestReader::scanFile(){ |
71 |
< |
int lineNo = 0; |
71 |
> |
|
72 |
|
std::streampos prevPos; |
73 |
|
std::streampos currPos; |
74 |
|
|
82 |
|
prevPos = currPos; |
83 |
|
|
84 |
|
bool foundOpenSnapshotTag = false; |
85 |
< |
|
85 |
> |
int lineNo = 0; |
86 |
|
while(!foundOpenSnapshotTag && inFile_->getline(buffer, bufferSize)) { |
87 |
|
++lineNo; |
88 |
|
|
97 |
|
|
98 |
|
#ifdef IS_MPI |
99 |
|
} |
100 |
< |
MPI_Bcast(&framePos_, 1, MPI_INT, 0, MPI_COMM_WORLD); |
100 |
> |
MPI::COMM_WORLD.Bcast(&framePos_, 1, MPI::INT, 0); |
101 |
|
#endif // is_mpi |
102 |
|
} |
103 |
|
|
132 |
|
} |
133 |
|
|
134 |
|
int sendBufferSize = sendBuffer.size(); |
135 |
< |
MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
136 |
< |
MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD); |
135 |
> |
MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode); |
136 |
> |
MPI::COMM_WORLD.Bcast((void *)sendBuffer.c_str(), sendBufferSize, |
137 |
> |
MPI::CHAR, masterNode); |
138 |
|
|
139 |
|
sstream.str(sendBuffer); |
140 |
|
} else { |
141 |
|
int sendBufferSize; |
142 |
< |
MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
142 |
> |
MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode); |
143 |
|
char * recvBuffer = new char[sendBufferSize+1]; |
144 |
|
assert(recvBuffer); |
145 |
|
recvBuffer[sendBufferSize] = '\0'; |
146 |
< |
MPI_Bcast(recvBuffer, sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD); |
146 |
> |
MPI::COMM_WORLD.Bcast(recvBuffer, sendBufferSize, MPI::CHAR, masterNode); |
147 |
|
sstream.str(recvBuffer); |
148 |
|
delete [] recvBuffer; |
149 |
|
} |
281 |
|
|
282 |
|
int index = tokenizer.nextTokenAsInt(); |
283 |
|
|
284 |
< |
StuntDouble* integrableObject = info_->getIOIndexToIntegrableObject(index); |
284 |
> |
StuntDouble* sd = info_->getIOIndexToIntegrableObject(index); |
285 |
|
|
286 |
< |
if (integrableObject == NULL) { |
286 |
> |
if (sd == NULL) { |
287 |
|
return; |
288 |
|
} |
289 |
|
|
311 |
|
} |
312 |
|
|
313 |
|
case 'q' : { |
314 |
< |
if (integrableObject->isDirectional()) { |
314 |
> |
if (sd->isDirectional()) { |
315 |
|
|
316 |
|
q[0] = tokenizer.nextTokenAsDouble(); |
317 |
|
q[1] = tokenizer.nextTokenAsDouble(); |
333 |
|
} |
334 |
|
case 'j' : { |
335 |
|
Vector3d ji; |
336 |
< |
if (integrableObject->isDirectional()) { |
336 |
> |
if (sd->isDirectional()) { |
337 |
|
ji[0] = tokenizer.nextTokenAsDouble(); |
338 |
|
ji[1] = tokenizer.nextTokenAsDouble(); |
339 |
|
ji[2] = tokenizer.nextTokenAsDouble(); |
367 |
|
all_pos_[index] = pos; |
368 |
|
|
369 |
|
// is this io restrained? |
370 |
< |
GenericData* data = integrableObject->getPropertyByName("Restraint"); |
369 |
< |
ObjectRestraint* oRest; |
370 |
> |
GenericData* data = sd->getPropertyByName("Restraint"); |
371 |
|
|
372 |
|
if (data != NULL) { |
373 |
|
// make sure we can reinterpret the generic data as restraint data: |
375 |
|
if (restData != NULL) { |
376 |
|
// make sure we can reinterpet the restraint data as a pointer to |
377 |
|
// an ObjectRestraint: |
378 |
< |
oRest = dynamic_cast<ObjectRestraint*>(restData->getData()); |
378 |
> |
ObjectRestraint* oRest = dynamic_cast<ObjectRestraint*>(restData->getData()); |
379 |
|
if (oRest != NULL) { |
380 |
< |
if (integrableObject->isDirectional()) { |
380 |
> |
if (sd->isDirectional()) { |
381 |
|
oRest->setReferenceStructure(pos, q.toRotationMatrix3()); |
382 |
|
} else { |
383 |
|
oRest->setReferenceStructure(pos); |