| 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]) { |
| 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 |
|
|
| 593 |
|
else |
| 594 |
|
return NULL; |
| 595 |
|
} |
| 596 |
+ |
|
| 597 |
+ |
|
| 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 |
+ |
#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 |
+ |
} |