322 |
|
int SimInfo::getNDF(){ |
323 |
|
int ndf_local; |
324 |
|
|
325 |
+ |
ndf_local = 0; |
326 |
+ |
|
327 |
|
for(int i = 0; i < integrableObjects.size(); i++){ |
328 |
|
ndf_local += 3; |
329 |
< |
if (integrableObjects[i]->isDirectional()) |
330 |
< |
ndf_local += 3; |
329 |
> |
if (integrableObjects[i]->isDirectional()) { |
330 |
> |
if (integrableObjects[i]->isLinear()) |
331 |
> |
ndf_local += 2; |
332 |
> |
else |
333 |
> |
ndf_local += 3; |
334 |
> |
} |
335 |
|
} |
336 |
|
|
337 |
|
// n_constraints is local, so subtract them on each processor: |
356 |
|
int ndfRaw_local; |
357 |
|
|
358 |
|
// Raw degrees of freedom that we have to set |
359 |
+ |
ndfRaw_local = 0; |
360 |
|
|
361 |
|
for(int i = 0; i < integrableObjects.size(); i++){ |
362 |
|
ndfRaw_local += 3; |
363 |
< |
if (integrableObjects[i]->isDirectional()) |
364 |
< |
ndfRaw_local += 3; |
363 |
> |
if (integrableObjects[i]->isDirectional()) { |
364 |
> |
if (integrableObjects[i]->isLinear()) |
365 |
> |
ndfRaw_local += 2; |
366 |
> |
else |
367 |
> |
ndfRaw_local += 3; |
368 |
> |
} |
369 |
|
} |
370 |
|
|
371 |
|
#ifdef IS_MPI |
392 |
|
ndfTrans = ndfTrans - 3 - nZconstraints; |
393 |
|
|
394 |
|
return ndfTrans; |
395 |
+ |
} |
396 |
+ |
|
397 |
+ |
int SimInfo::getTotIntegrableObjects() { |
398 |
+ |
int nObjs_local; |
399 |
+ |
int nObjs; |
400 |
+ |
|
401 |
+ |
nObjs_local = integrableObjects.size(); |
402 |
+ |
|
403 |
+ |
|
404 |
+ |
#ifdef IS_MPI |
405 |
+ |
MPI_Allreduce(&nObjs_local,&nObjs,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); |
406 |
+ |
#else |
407 |
+ |
nObjs = nObjs_local; |
408 |
+ |
#endif |
409 |
+ |
|
410 |
+ |
|
411 |
+ |
return nObjs; |
412 |
|
} |
413 |
|
|
414 |
|
void SimInfo::refreshSim(){ |
510 |
|
"\tCurrent Value of LJrcut = %G at time %G\n " |
511 |
|
"\tThis is larger than half of at least one of the\n" |
512 |
|
"\tperiodic box vectors. Right now, the Box matrix is:\n" |
513 |
< |
"\n, %G" |
513 |
> |
"\n" |
514 |
|
"\t[ %G %G %G ]\n" |
515 |
|
"\t[ %G %G %G ]\n" |
516 |
|
"\t[ %G %G %G ]\n", |
517 |
< |
rCut, currentTime, maxCutoff, |
517 |
> |
rCut, currentTime, |
518 |
|
Hmat[0][0], Hmat[0][1], Hmat[0][2], |
519 |
|
Hmat[1][0], Hmat[1][1], Hmat[1][2], |
520 |
|
Hmat[2][0], Hmat[2][1], Hmat[2][2]); |
589 |
|
return NULL; |
590 |
|
} |
591 |
|
|
564 |
– |
vector<GenericData*> SimInfo::getProperties(){ |
565 |
– |
|
566 |
– |
vector<GenericData*> result; |
567 |
– |
map<string, GenericData*>::iterator i; |
568 |
– |
|
569 |
– |
for(i = properties.begin(); i != properties.end(); i++) |
570 |
– |
result.push_back((*i).second); |
571 |
– |
|
572 |
– |
return result; |
573 |
– |
} |