| 63 |
|
useReactionField = 0; |
| 64 |
|
useGB = 0; |
| 65 |
|
useEAM = 0; |
| 66 |
+ |
useMolecularCutoffs = 0; |
| 67 |
|
|
| 68 |
|
excludes = Exclude::Instance(); |
| 69 |
|
|
| 72 |
|
has_minimizer = false; |
| 73 |
|
the_minimizer =NULL; |
| 74 |
|
|
| 75 |
+ |
ngroup = 0; |
| 76 |
+ |
|
| 77 |
|
wrapMeSimInfo( this ); |
| 78 |
|
} |
| 79 |
|
|
| 86 |
|
|
| 87 |
|
for(i = properties.begin(); i != properties.end(); i++) |
| 88 |
|
delete (*i).second; |
| 89 |
< |
|
| 89 |
> |
|
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
void SimInfo::setBox(double newBox[3]) { |
| 325 |
|
int SimInfo::getNDF(){ |
| 326 |
|
int ndf_local; |
| 327 |
|
|
| 328 |
+ |
ndf_local = 0; |
| 329 |
+ |
|
| 330 |
|
for(int i = 0; i < integrableObjects.size(); i++){ |
| 331 |
|
ndf_local += 3; |
| 332 |
< |
if (integrableObjects[i]->isDirectional()) |
| 333 |
< |
ndf_local += 3; |
| 332 |
> |
if (integrableObjects[i]->isDirectional()) { |
| 333 |
> |
if (integrableObjects[i]->isLinear()) |
| 334 |
> |
ndf_local += 2; |
| 335 |
> |
else |
| 336 |
> |
ndf_local += 3; |
| 337 |
> |
} |
| 338 |
|
} |
| 339 |
|
|
| 340 |
|
// n_constraints is local, so subtract them on each processor: |
| 359 |
|
int ndfRaw_local; |
| 360 |
|
|
| 361 |
|
// Raw degrees of freedom that we have to set |
| 362 |
+ |
ndfRaw_local = 0; |
| 363 |
|
|
| 364 |
|
for(int i = 0; i < integrableObjects.size(); i++){ |
| 365 |
|
ndfRaw_local += 3; |
| 366 |
< |
if (integrableObjects[i]->isDirectional()) |
| 367 |
< |
ndfRaw_local += 3; |
| 366 |
> |
if (integrableObjects[i]->isDirectional()) { |
| 367 |
> |
if (integrableObjects[i]->isLinear()) |
| 368 |
> |
ndfRaw_local += 2; |
| 369 |
> |
else |
| 370 |
> |
ndfRaw_local += 3; |
| 371 |
> |
} |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
#ifdef IS_MPI |
| 442 |
|
|
| 443 |
|
n_exclude = excludes->getSize(); |
| 444 |
|
excl = excludes->getFortranArray(); |
| 445 |
< |
|
| 445 |
> |
|
| 446 |
|
#ifdef IS_MPI |
| 447 |
|
n_global = mpiSim->getTotAtoms(); |
| 448 |
|
#else |
| 449 |
|
n_global = n_atoms; |
| 450 |
|
#endif |
| 451 |
< |
|
| 451 |
> |
|
| 452 |
|
isError = 0; |
| 453 |
< |
|
| 454 |
< |
setFsimulation( &fInfo, &n_global, &n_atoms, identArray, &n_exclude, excl, |
| 455 |
< |
&nGlobalExcludes, globalExcludes, molMembershipArray, |
| 456 |
< |
&isError ); |
| 457 |
< |
|
| 453 |
> |
|
| 454 |
> |
getFortranGroupArray(this, mfact, ngroup, groupList, groupStart); |
| 455 |
> |
|
| 456 |
> |
setFsimulation( &fInfo, &n_global, &n_atoms, identArray, &n_exclude, excl, |
| 457 |
> |
&nGlobalExcludes, globalExcludes, molMembershipArray, |
| 458 |
> |
&mfact[0], &ngroup, &groupList[0], &groupStart[0], &isError); |
| 459 |
> |
|
| 460 |
|
if( isError ){ |
| 461 |
< |
|
| 461 |
> |
|
| 462 |
|
sprintf( painCave.errMsg, |
| 463 |
< |
"There was an error setting the simulation information in fortran.\n" ); |
| 463 |
> |
"There was an error setting the simulation information in fortran.\n" ); |
| 464 |
|
painCave.isFatal = 1; |
| 465 |
|
simError(); |
| 466 |
|
} |
| 467 |
< |
|
| 467 |
> |
|
| 468 |
|
#ifdef IS_MPI |
| 469 |
|
sprintf( checkPointMsg, |
| 470 |
|
"succesfully sent the simulation information to fortran.\n"); |
| 471 |
|
MPIcheckPoint(); |
| 472 |
|
#endif // is_mpi |
| 473 |
< |
|
| 473 |
> |
|
| 474 |
|
this->ndf = this->getNDF(); |
| 475 |
|
this->ndfRaw = this->getNDFraw(); |
| 476 |
|
this->ndfTrans = this->getNDFtranslational(); |
| 477 |
|
} |
| 478 |
|
|
| 479 |
|
void SimInfo::setDefaultRcut( double theRcut ){ |
| 480 |
< |
|
| 480 |
> |
|
| 481 |
|
haveRcut = 1; |
| 482 |
|
rCut = theRcut; |
| 483 |
< |
|
| 483 |
> |
|
| 484 |
|
( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; |
| 485 |
< |
|
| 485 |
> |
|
| 486 |
|
notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); |
| 487 |
|
} |
| 488 |
|
|
| 515 |
|
"\tCurrent Value of LJrcut = %G at time %G\n " |
| 516 |
|
"\tThis is larger than half of at least one of the\n" |
| 517 |
|
"\tperiodic box vectors. Right now, the Box matrix is:\n" |
| 518 |
< |
"\n, %G" |
| 518 |
> |
"\n" |
| 519 |
|
"\t[ %G %G %G ]\n" |
| 520 |
|
"\t[ %G %G %G ]\n" |
| 521 |
|
"\t[ %G %G %G ]\n", |
| 522 |
< |
rCut, currentTime, maxCutoff, |
| 522 |
> |
rCut, currentTime, |
| 523 |
|
Hmat[0][0], Hmat[0][1], Hmat[0][2], |
| 524 |
|
Hmat[1][0], Hmat[1][1], Hmat[1][2], |
| 525 |
|
Hmat[2][0], Hmat[2][1], Hmat[2][2]); |
| 594 |
|
return NULL; |
| 595 |
|
} |
| 596 |
|
|
| 581 |
– |
vector<GenericData*> SimInfo::getProperties(){ |
| 597 |
|
|
| 598 |
< |
vector<GenericData*> result; |
| 599 |
< |
map<string, GenericData*>::iterator i; |
| 600 |
< |
|
| 601 |
< |
for(i = properties.begin(); i != properties.end(); i++) |
| 602 |
< |
result.push_back((*i).second); |
| 598 |
> |
void getFortranGroupArray(SimInfo* info, vector<double>& mfact, int& ngroup, |
| 599 |
> |
vector<int>& groupList, vector<int>& groupStart){ |
| 600 |
> |
Molecule* mol; |
| 601 |
> |
Atom** myAtoms; |
| 602 |
> |
int numAtom; |
| 603 |
> |
int curIndex; |
| 604 |
> |
double mtot; |
| 605 |
> |
|
| 606 |
> |
mfact.clear(); |
| 607 |
> |
groupList.clear(); |
| 608 |
> |
groupStart.clear(); |
| 609 |
> |
|
| 610 |
> |
//Be careful, fortran array begin at 1 |
| 611 |
> |
curIndex = 1; |
| 612 |
> |
|
| 613 |
> |
if(info->useMolecularCutoffs){ |
| 614 |
|
|
| 615 |
< |
return result; |
| 615 |
> |
#ifdef IS_MPI |
| 616 |
> |
ngroup = mpiSim->getMyNMol(); |
| 617 |
> |
#else |
| 618 |
> |
ngroup = info->n_mol; |
| 619 |
> |
#endif |
| 620 |
> |
|
| 621 |
> |
for(int i = 0; i < ngroup; i ++){ |
| 622 |
> |
mol = &(info->molecules[i]); |
| 623 |
> |
numAtom = mol->getNAtoms(); |
| 624 |
> |
myAtoms = mol->getMyAtoms(); |
| 625 |
> |
mtot = 0.0; |
| 626 |
> |
|
| 627 |
> |
for(int j=0; j < numAtom; j++) |
| 628 |
> |
mtot += myAtoms[j]->getMass(); |
| 629 |
> |
|
| 630 |
> |
for(int j=0; j < numAtom; j++){ |
| 631 |
> |
|
| 632 |
> |
// We want the local Index: |
| 633 |
> |
groupList.push_back(myAtoms[j]->getIndex() + 1); |
| 634 |
> |
mfact.push_back(myAtoms[j]->getMass() / mtot); |
| 635 |
> |
|
| 636 |
> |
} |
| 637 |
> |
|
| 638 |
> |
groupStart.push_back(curIndex); |
| 639 |
> |
curIndex += numAtom; |
| 640 |
> |
|
| 641 |
> |
} //end for(int i =0 ; i < ngroup; i++) |
| 642 |
> |
} |
| 643 |
> |
else{ |
| 644 |
> |
//using atomic cutoff, every single atom is just a group |
| 645 |
> |
|
| 646 |
> |
#ifdef IS_MPI |
| 647 |
> |
ngroup = mpiSim->getMyNlocal(); |
| 648 |
> |
#else |
| 649 |
> |
ngroup = info->n_atoms; |
| 650 |
> |
#endif |
| 651 |
> |
|
| 652 |
> |
for(int i =0 ; i < ngroup; i++){ |
| 653 |
> |
groupStart.push_back(curIndex++); |
| 654 |
> |
groupList.push_back((info->atoms[i])->getIndex() + 1); |
| 655 |
> |
mfact.push_back(1.0); |
| 656 |
> |
|
| 657 |
> |
}//end for(int i =0 ; i < ngroup; i++) |
| 658 |
> |
|
| 659 |
> |
}//end if (info->useMolecularCutoffs) |
| 660 |
> |
|
| 661 |
|
} |