ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/SimSetup.cpp
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/SimSetup.cpp (file contents):
Revision 348 by mmeineke, Fri Mar 14 21:33:10 2003 UTC vs.
Revision 363 by mmeineke, Tue Mar 18 21:27:53 2003 UTC

# Line 308 | Line 308 | void SimSetup::createSim( void ){
308  
309    if( simnfo->n_SRI ){
310      the_sris = new SRI*[simnfo->n_SRI];
311 <    the_excludes = new ex_pair[simnfo->n_SRI];
311 >    the_excludes = new int[2 * simnfo->n_SRI];
312 >    simnfo->globalExcludes = new int;
313 >  }
314 >  else{
315 >    the_excludes = new int;
316 >    simnfo->globalExcludes = new int;
317    }
318  
319    // set the arrays into the SimInfo object
# Line 316 | Line 321 | void SimSetup::createSim( void ){
321    simnfo->atoms = the_atoms;
322    simnfo->sr_interactions = the_sris;
323    simnfo->n_exclude = tot_SRI;
324 +  simnfo->nGlobalExcludes = 0;
325    simnfo->excludes = the_excludes;
326  
327  
# Line 396 | Line 402 | void SimSetup::createSim( void ){
402    the_ff->setSimInfo( simnfo );
403  
404    makeAtoms();
405 <  //
405 >  simnfo->identArray = new int[simnfo->n_atoms];
406 >  for(i=0; i<simnfo->n_atoms; i++){
407 >    simnfo->identArray[i] = the_atoms[i]->getIdent();
408 >  }
409 >  
410    if( tot_bonds ){
411      makeBonds();
412    }
# Line 575 | Line 585 | void SimSetup::createSim( void ){
585    if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo, the_ff );
586    if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo, the_ff );
587    if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff );
588 +
589 +
590 +
591 +  // initialize the Fortran
592 +  
593 +  simnfo->refreshSim();
594 +  
595 +  if( !stcmp( simnfo->mixingRule, "standard") ){
596 +    the_ff->initForceField( LB_MIXING_RULE );
597 +  }
598 +  else if( !stcmp( simnfo->mixingRule, "explicit") ){
599 +    the_ff->initForceField( EXPLICIT_MIXING_RULE );
600 +  }
601 +  else{
602 +    sprintf( painCave.errMsg,
603 +             "SimSetup Error: unknown mixing rule -> \"%s\"\n",
604 +             simnfo->mixingRule );
605 +    painCave.isFatal = 1;
606 +    simError();
607 +  }
608  
609 +
610 + #ifdef IS_MPI
611 +  strcpy( checkPointMsg,
612 +          "Successfully intialized the mixingRule for Fortran." );
613 +  MPIcheckPoint();
614 + #endif // is_mpi
615   }
616  
617   void SimSetup::makeAtoms( void ){
# Line 583 | Line 619 | void SimSetup::makeAtoms( void ){
619    int i, j, k, index;
620    double ux, uy, uz, uSqr, u;
621    AtomStamp* current_atom;
622 +
623    DirectionalAtom* dAtom;
624    int molIndex, molStart, molEnd, nMemb, lMolIndex;
625  
# Line 685 | Line 722 | void SimSetup::makeBonds( void ){
722            current_bond = comp_stamps[i]->getBond( k );
723            the_bonds[index].a = current_bond->getA() + offset;
724            the_bonds[index].b = current_bond->getB() + offset;
725 +
726 +          exI = the_bonds[index].a;
727 +          exJ = the_bonds[index].b;
728 +
729 +          // exclude_I must always be the smaller of the pair
730 +          if( exI > exJ ){
731 +            tempEx = exI;
732 +            exI = exJ;
733 +            exJ = tempEx;
734 +          }
735 +
736            
737 <          the_excludes[index].i = the_bonds[index].a;
738 <          the_excludes[index].j = the_bonds[index].b;
737 > #ifdef IS_MPI
738 >
739 >          the_excludes[index*2] =    
740 >            the_atoms[exI]->getGlobalIndex() + 1;
741 >          the_excludes[index*2 + 1] =
742 >            the_atoms[exJ]->getGlobalIndex() + 1;
743 >
744 > #else  // isn't MPI
745 >          
746 >          the_excludes[index*2] =     exI + 1;
747 >          the_excludes[index*2 + 1] = exJ + 1;
748 >          // fortran index from 1 (hence the +1 in the indexing)
749 > #endif  //is_mpi
750            
751            // increment the index and repeat;
752            index++;
# Line 707 | Line 766 | void SimSetup::makeBends( void ){
766  
767   void SimSetup::makeBends( void ){
768  
769 <  int i, j, k, index, offset, molIndex;
769 >  int i, j, k, index, offset, molIndex, exI, exJ;
770    bend_set* the_bends;
771    BendStamp* current_bend;
772    LinkedAssign* extras;
# Line 784 | Line 843 | void SimSetup::makeBends( void ){
843            
844            if( !the_bends[index].isGhost ){
845              
846 <            the_excludes[index + tot_bonds].i = the_bends[index].a;
847 <            the_excludes[index + tot_bonds].j = the_bends[index].c;
846 >            exI = the_bends[index].a;
847 >            exJ = the_bends[index].c;
848            }
849            else{
850              
851 <            the_excludes[index + tot_bonds].i = the_bends[index].a;
852 <            the_excludes[index + tot_bonds].j = the_bends[index].b;
851 >            exI = the_bends[index].a;
852 >            exJ = the_bends[index].b;
853            }
854            
855 +          // exclude_I must always be the smaller of the pair
856 +          if( exI > exJ ){
857 +            tempEx = exI;
858 +            exI = exJ;
859 +            exJ = tempEx;
860 +          }
861 +
862 +
863 + #ifdef IS_MPI
864 +
865 +          the_excludes[(index + tot_bonds)*2] =    
866 +            the_atoms[exI]->getGlobalIndex() + 1;
867 +          the_excludes[(index + tot_bonds)*2 + 1] =
868 +            the_atoms[exJ]->getGlobalIndex() + 1;
869 +          
870 + #else  // isn't MPI
871 +          
872 +          the_excludes[(index + tot_bonds)*2] =     exI + 1;
873 +          the_excludes[(index + tot_bonds)*2 + 1] = exJ + 1;
874 +          // fortran index from 1 (hence the +1 in the indexing)
875 + #endif  //is_mpi
876 +          
877 +          
878            // increment the index and repeat;
879            index++;
880          }
# Line 818 | Line 900 | void SimSetup::makeTorsions( void ){
900  
901   void SimSetup::makeTorsions( void ){
902  
903 <  int i, j, k, index, offset, molIndex;
903 >  int i, j, k, index, offset, molIndex, exI, exJ, tempEx;
904    torsion_set* the_torsions;
905    TorsionStamp* current_torsion;
906  
# Line 843 | Line 925 | void SimSetup::makeTorsions( void ){
925          the_torsions[index].c = current_torsion->getC() + offset;
926          the_torsions[index].d = current_torsion->getD() + offset;
927  
928 <        the_excludes[index + tot_bonds + tot_bends].i = the_torsions[index].a;
929 <        the_excludes[index + tot_bonds + tot_bends].j = the_torsions[index].d;
928 >        exI = the_torsions[index].a;
929 >        exJ = the_torsions[index].d;
930  
931 +        
932 +        // exclude_I must always be the smaller of the pair
933 +        if( exI > exJ ){
934 +          tempEx = exI;
935 +          exI = exJ;
936 +          exJ = tempEx;
937 +        }
938 +
939 +
940 + #ifdef IS_MPI
941 +        
942 +        the_excludes[(index + tot_bonds + tot_bends)*2] =    
943 +          the_atoms[exI]->getGlobalIndex() + 1;
944 +        the_excludes[(index + tot_bonds + tot_bends)*2 + 1] =
945 +          the_atoms[exJ]->getGlobalIndex() + 1;
946 +        
947 + #else  // isn't MPI
948 +        
949 +        the_excludes[(index + tot_bonds + tot_bends)*2] =     exI + 1;
950 +        the_excludes[(index + tot_bonds + tot_bends)*2 + 1] = exJ + 1;
951 +        // fortran indexes from 1 (hence the +1 in the indexing)
952 + #endif  //is_mpi
953 +        
954 +
955          // increment the index and repeat;
956          index++;
957        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines