| 66 | 
  | 
 | 
| 67 | 
  | 
  MakeStamps *the_stamps; | 
| 68 | 
  | 
  Globals* the_globals; | 
| 69 | 
+ | 
  ExtendedSystem* the_extendedsystem; | 
| 70 | 
  | 
  int i, j; | 
| 71 | 
  | 
 | 
| 72 | 
  | 
  // get the stamps and globals; | 
| 81 | 
  | 
  // get the ones we know are there, yet still may need some work. | 
| 82 | 
  | 
  n_components = the_globals->getNComponents(); | 
| 83 | 
  | 
  strcpy( force_field, the_globals->getForceField() ); | 
| 84 | 
+ | 
 | 
| 85 | 
+ | 
  // get the ensemble and set up an extended system if we need it: | 
| 86 | 
  | 
  strcpy( ensemble, the_globals->getEnsemble() ); | 
| 87 | 
+ | 
  if( !strcasecmp( ensemble, "NPT" ) ) { | 
| 88 | 
+ | 
    the_extendedsystem = new ExtendedSystem( simnfo ); | 
| 89 | 
+ | 
    the_extendedsystem->setTargetTemp(the_globals->getTargetTemp()); | 
| 90 | 
+ | 
    the_extendedsystem->setTargetPressure(the_globals->getTargetPressure()); | 
| 91 | 
+ | 
  } else if ( !strcasecmp( ensemble, "NVT") ) { | 
| 92 | 
+ | 
    the_extendedsystem = new ExtendedSystem( simnfo ); | 
| 93 | 
+ | 
    the_extendedsystem->setTargetTemp(the_globals->getTargetTemp()); | 
| 94 | 
+ | 
  } else if ( !strcasecmp( ensemble, "NVE") ) { | 
| 95 | 
+ | 
  } else { | 
| 96 | 
+ | 
    sprintf( painCave.errMsg, | 
| 97 | 
+ | 
             "SimSetup Warning. Unrecognized Ensemble -> %s, " | 
| 98 | 
+ | 
             "reverting to NVE for this simulation.\n", | 
| 99 | 
+ | 
             ensemble ); | 
| 100 | 
+ | 
    painCave.isFatal = 0; | 
| 101 | 
+ | 
    simError(); | 
| 102 | 
+ | 
    strcpy( ensemble, "NVE" ); | 
| 103 | 
+ | 
  }   | 
| 104 | 
  | 
  strcpy( simnfo->ensemble, ensemble ); | 
| 105 | 
  | 
 | 
| 106 | 
  | 
  strcpy( simnfo->mixingRule, the_globals->getMixingRule() ); | 
| 107 | 
  | 
  simnfo->usePBC = the_globals->getPBC(); | 
| 108 | 
  | 
           | 
| 109 | 
< | 
 | 
| 110 | 
< | 
 | 
| 91 | 
< | 
  if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); | 
| 92 | 
< | 
  else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); | 
| 93 | 
< | 
  else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); | 
| 94 | 
< | 
  else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); | 
| 109 | 
> | 
  if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); | 
| 110 | 
> | 
  else if( !strcasecmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); | 
| 111 | 
  | 
  else{ | 
| 112 | 
  | 
    sprintf( painCave.errMsg, | 
| 113 | 
  | 
             "SimSetup Error. Unrecognized force field -> %s\n", | 
| 258 | 
  | 
 | 
| 259 | 
  | 
  globalIndex = mpiSim->divideLabor(); | 
| 260 | 
  | 
 | 
| 245 | 
– | 
 | 
| 246 | 
– | 
 | 
| 261 | 
  | 
  // set up the local variables  | 
| 262 | 
  | 
   | 
| 263 | 
  | 
  int localMol, allMol; | 
| 332 | 
  | 
     | 
| 333 | 
  | 
    if(mol2proc[i] == worldRank ){ | 
| 334 | 
  | 
      the_molecules[molIndex].setStampID( molCompType[i] ); | 
| 335 | 
+ | 
      the_molecules[molIndex].setMyIndex( molIndex ); | 
| 336 | 
  | 
      molIndex++; | 
| 337 | 
  | 
    } | 
| 338 | 
  | 
  } | 
| 343 | 
  | 
  for(i=0; i<n_components; i++){ | 
| 344 | 
  | 
    for(j=0; j<components_nmol[i]; j++ ){ | 
| 345 | 
  | 
      the_molecules[molIndex].setStampID( i ); | 
| 346 | 
+ | 
      the_molecules[molIndex].setMyIndex( molIndex ); | 
| 347 | 
  | 
      molIndex++; | 
| 348 | 
  | 
    } | 
| 349 | 
  | 
  } | 
| 353 | 
  | 
 | 
| 354 | 
  | 
 | 
| 355 | 
  | 
  if( simnfo->n_SRI ){ | 
| 356 | 
+ | 
     | 
| 357 | 
  | 
    Exclude::createArray(simnfo->n_SRI); | 
| 358 | 
  | 
    the_excludes = new Exclude*[simnfo->n_SRI]; | 
| 359 | 
+ | 
    for( int ex=0; ex<simnfo->n_SRI; ex++) the_excludes[ex] = new Exclude(ex); | 
| 360 | 
  | 
    simnfo->globalExcludes = new int; | 
| 361 | 
< | 
    simnfo->n_exclude = tot_SRI; | 
| 361 | 
> | 
    simnfo->n_exclude = simnfo->n_SRI; | 
| 362 | 
  | 
  } | 
| 363 | 
  | 
  else{ | 
| 364 | 
  | 
     | 
| 374 | 
  | 
  // set the arrays into the SimInfo object | 
| 375 | 
  | 
 | 
| 376 | 
  | 
  simnfo->atoms = the_atoms; | 
| 377 | 
+ | 
  simnfo->molecules = the_molecules; | 
| 378 | 
  | 
  simnfo->nGlobalExcludes = 0; | 
| 379 | 
  | 
  simnfo->excludes = the_excludes; | 
| 380 | 
  | 
 | 
| 673 | 
  | 
 | 
| 674 | 
  | 
//   new AllLong( simnfo ); | 
| 675 | 
  | 
 | 
| 676 | 
< | 
  if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); | 
| 677 | 
< | 
  if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo, the_ff ); | 
| 678 | 
< | 
  if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo, the_ff ); | 
| 679 | 
< | 
  if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); | 
| 680 | 
< | 
 | 
| 676 | 
> | 
  if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic(simnfo,  | 
| 677 | 
> | 
                                                           the_ff,  | 
| 678 | 
> | 
                                                           the_extendedsystem); | 
| 679 | 
> | 
  if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo,  | 
| 680 | 
> | 
                                                 the_ff,  | 
| 681 | 
> | 
                                                 the_extendedsystem ); | 
| 682 | 
  | 
 | 
| 683 | 
+ | 
#ifdef IS_MPI | 
| 684 | 
+ | 
  mpiSim->mpiRefresh(); | 
| 685 | 
+ | 
#endif | 
| 686 | 
  | 
 | 
| 687 | 
  | 
  // initialize the Fortran | 
| 688 | 
< | 
   | 
| 688 | 
> | 
 | 
| 689 | 
> | 
 | 
| 690 | 
  | 
  simnfo->refreshSim(); | 
| 691 | 
  | 
   | 
| 692 | 
  | 
  if( !strcmp( simnfo->mixingRule, "standard") ){ | 
| 723 | 
  | 
  BondStamp* currentBond; | 
| 724 | 
  | 
  BendStamp* currentBend; | 
| 725 | 
  | 
  TorsionStamp* currentTorsion; | 
| 726 | 
+ | 
 | 
| 727 | 
+ | 
  bond_pair* theBonds; | 
| 728 | 
+ | 
  bend_set* theBends; | 
| 729 | 
+ | 
  torsion_set* theTorsions; | 
| 730 | 
+ | 
 | 
| 731 | 
  | 
   | 
| 732 | 
  | 
  //init the forceField paramters | 
| 733 | 
  | 
 | 
| 734 | 
  | 
  the_ff->readParams(); | 
| 735 | 
  | 
 | 
| 736 | 
  | 
   | 
| 737 | 
< | 
  // init the molecules | 
| 737 | 
> | 
  // init the atoms | 
| 738 | 
  | 
 | 
| 739 | 
+ | 
  double ux, uy, uz, u, uSqr; | 
| 740 | 
+ | 
   | 
| 741 | 
  | 
  atomOffset = 0; | 
| 742 | 
  | 
  excludeOffset = 0; | 
| 743 | 
  | 
  for(i=0; i<simnfo->n_mol; i++){ | 
| 754 | 
  | 
    info.myExcludes = &the_excludes[excludeOffset]; | 
| 755 | 
  | 
    info.myBonds = new Bond*[info.nBonds]; | 
| 756 | 
  | 
    info.myBends = new Bend*[info.nBends]; | 
| 757 | 
< | 
    info.myTorsions = new Torsions*[info.nTorsions]; | 
| 757 | 
> | 
    info.myTorsions = new Torsion*[info.nTorsions]; | 
| 758 | 
  | 
 | 
| 759 | 
  | 
    theBonds = new bond_pair[info.nBonds]; | 
| 760 | 
  | 
    theBends = new bend_set[info.nBends]; | 
| 764 | 
  | 
     | 
| 765 | 
  | 
    for(j=0; j<info.nAtoms; j++){ | 
| 766 | 
  | 
       | 
| 767 | 
< | 
      currentAtom = theComponents[stampID]->getAtom( j ); | 
| 767 | 
> | 
      currentAtom = comp_stamps[stampID]->getAtom( j ); | 
| 768 | 
  | 
      if( currentAtom->haveOrientation() ){ | 
| 769 | 
  | 
         | 
| 770 | 
  | 
        dAtom = new DirectionalAtom(j + atomOffset); | 
| 805 | 
  | 
      theBonds[j].a = currentBond->getA() + atomOffset; | 
| 806 | 
  | 
      theBonds[j].b = currentBond->getB() + atomOffset; | 
| 807 | 
  | 
 | 
| 808 | 
< | 
      exI = theBonds[i].a; | 
| 809 | 
< | 
      exJ = theBonds[i].b; | 
| 808 | 
> | 
      exI = theBonds[j].a; | 
| 809 | 
> | 
      exJ = theBonds[j].b; | 
| 810 | 
  | 
 | 
| 811 | 
  | 
      // exclude_I must always be the smaller of the pair | 
| 812 | 
  | 
      if( exI > exJ ){ | 
| 822 | 
  | 
       | 
| 823 | 
  | 
      the_excludes[j+excludeOffset]->setPair( exI, exJ ); | 
| 824 | 
  | 
#else  // isn't MPI | 
| 825 | 
+ | 
 | 
| 826 | 
  | 
      the_excludes[j+excludeOffset]->setPair( (exI+1), (exJ+1) ); | 
| 827 | 
  | 
#endif  //is_mpi | 
| 828 | 
  | 
    } | 
| 838 | 
  | 
           | 
| 839 | 
  | 
      if( currentBend->haveExtras() ){ | 
| 840 | 
  | 
             | 
| 841 | 
< | 
        extras = current_bend->getExtras(); | 
| 841 | 
> | 
        extras = currentBend->getExtras(); | 
| 842 | 
  | 
        current_extra = extras; | 
| 843 | 
  | 
             | 
| 844 | 
  | 
        while( current_extra != NULL ){ | 
| 860 | 
  | 
               | 
| 861 | 
  | 
            default: | 
| 862 | 
  | 
              sprintf( painCave.errMsg, | 
| 863 | 
< | 
                       "SimSetup Error: ghostVectorSource was neiter a " | 
| 863 | 
> | 
                       "SimSetup Error: ghostVectorSource was neither a " | 
| 864 | 
  | 
                       "double nor an int.\n" | 
| 865 | 
  | 
                       "-->Bend[%d] in %s\n", | 
| 866 | 
  | 
                       j, comp_stamps[stampID]->getID() ); | 
| 954 | 
  | 
 | 
| 955 | 
  | 
 | 
| 956 | 
  | 
    the_molecules[i].initialize( info ); | 
| 957 | 
+ | 
 | 
| 958 | 
+ | 
 | 
| 959 | 
  | 
    atomOffset += info.nAtoms; | 
| 960 | 
+ | 
    delete[] theBonds; | 
| 961 | 
+ | 
    delete[] theBends; | 
| 962 | 
+ | 
    delete[] theTorsions; | 
| 963 | 
  | 
  } | 
| 964 | 
  | 
 | 
| 965 | 
+ | 
#ifdef IS_MPI | 
| 966 | 
+ | 
  sprintf( checkPointMsg, "all molecules initialized succesfully" ); | 
| 967 | 
+ | 
  MPIcheckPoint(); | 
| 968 | 
+ | 
#endif // is_mpi | 
| 969 | 
+ | 
 | 
| 970 | 
  | 
  // clean up the forcefield | 
| 971 | 
  | 
  the_ff->calcRcut(); | 
| 972 | 
  | 
  the_ff->cleanMe(); | 
| 973 | 
+ | 
 | 
| 974 | 
  | 
} | 
| 975 | 
  | 
 | 
| 976 | 
  | 
void SimSetup::initFromBass( void ){ |