| 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]) { | 
| 352 | 
  | 
 | 
| 353 | 
  | 
  ndf = ndf - 3 - nZconstraints; | 
| 354 | 
  | 
 | 
| 352 | 
– | 
  std::cerr << "ndf = " << ndf; | 
| 353 | 
– | 
 | 
| 355 | 
  | 
  return ndf; | 
| 356 | 
  | 
} | 
| 357 | 
  | 
 | 
| 442 | 
  | 
 | 
| 443 | 
  | 
  n_exclude = excludes->getSize(); | 
| 444 | 
  | 
  excl = excludes->getFortranArray(); | 
| 445 | 
< | 
 | 
| 445 | 
> | 
   | 
| 446 | 
  | 
#ifdef IS_MPI | 
| 447 | 
  | 
  n_global = mpiSim->getTotAtoms(); | 
| 448 | 
  | 
#else | 
| 451 | 
  | 
 | 
| 452 | 
  | 
  isError = 0; | 
| 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 | 
< | 
                  &isError ); | 
| 457 | 
> | 
                                    &nGlobalExcludes, globalExcludes, molMembershipArray,  | 
| 458 | 
> | 
                                    &mfact[0], &ngroup, &groupList[0], &groupStart[0], &isError ); | 
| 459 | 
  | 
 | 
| 460 | 
  | 
  if( isError ){ | 
| 461 | 
  | 
 | 
| 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 | 
  | 
 | 
| 597 | 
+ | 
 | 
| 598 | 
+ | 
void getFortranGroupArray(SimInfo* info, vector<double>& mfact, int& ngroup,  | 
| 599 | 
+ | 
                                                          vector<int>& groupList, vector<int>& groupStart){ | 
| 600 | 
+ | 
  Molecule* mol; | 
| 601 | 
+ | 
  int numAtom; | 
| 602 | 
+ | 
  int curIndex; | 
| 603 | 
+ | 
 | 
| 604 | 
+ | 
  mfact.clear(); | 
| 605 | 
+ | 
  groupList.clear(); | 
| 606 | 
+ | 
  groupStart.clear(); | 
| 607 | 
+ | 
 | 
| 608 | 
+ | 
  //Be careful, fortran array begin at 1 | 
| 609 | 
+ | 
  curIndex = 1; | 
| 610 | 
+ | 
     | 
| 611 | 
+ | 
  if(info->useMolecularCutoffs){ | 
| 612 | 
+ | 
    //if using molecular cutoff | 
| 613 | 
+ | 
    ngroup = info->n_mol; | 
| 614 | 
+ | 
 | 
| 615 | 
+ | 
    for(int i = 0; i < ngroup; i ++){ | 
| 616 | 
+ | 
      mol = &(info->molecules[i]); | 
| 617 | 
+ | 
      numAtom = mol->getNAtoms(); | 
| 618 | 
+ | 
       | 
| 619 | 
+ | 
      for(int j=0; j < numAtom; j++){ | 
| 620 | 
+ | 
#ifdef IS_MPI | 
| 621 | 
+ | 
        groupList.push_back((info->atoms[i])->getGlobalIndex() + 1); | 
| 622 | 
+ | 
#else | 
| 623 | 
+ | 
        groupList.push_back((info->atoms[i])->getIndex() + 1); | 
| 624 | 
+ | 
#endif | 
| 625 | 
+ | 
      }//for(int j=0; j < numAtom; j++) | 
| 626 | 
+ | 
             | 
| 627 | 
+ | 
      groupStart.push_back(curIndex); | 
| 628 | 
+ | 
      curIndex += numAtom; | 
| 629 | 
+ | 
       | 
| 630 | 
+ | 
    }//end for(int i =0 ; i < ngroup; i++)     | 
| 631 | 
+ | 
  } | 
| 632 | 
+ | 
  else{ | 
| 633 | 
+ | 
    //using atomic cutoff, every single atom is just a group | 
| 634 | 
+ | 
    ngroup = info->n_atoms; | 
| 635 | 
+ | 
    for(int i =0 ; i < ngroup; i++){ | 
| 636 | 
+ | 
      groupStart.push_back(curIndex++);  | 
| 637 | 
+ | 
 | 
| 638 | 
+ | 
#ifdef IS_MPI | 
| 639 | 
+ | 
      groupList.push_back((info->atoms[i])->getGlobalIndex() + 1); | 
| 640 | 
+ | 
#else | 
| 641 | 
+ | 
      groupList.push_back((info->atoms[i])->getIndex() + 1); | 
| 642 | 
+ | 
#endif | 
| 643 | 
+ | 
 | 
| 644 | 
+ | 
    }//end for(int i =0 ; i < ngroup; i++) | 
| 645 | 
+ | 
 | 
| 646 | 
+ | 
  }//end if (info->useMolecularCutoffs) | 
| 647 | 
+ | 
 | 
| 648 | 
+ | 
} |