ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DUFF.cpp (file contents):
Revision 829 by gezelter, Tue Oct 28 16:03:37 2003 UTC vs.
Revision 1224 by gezelter, Wed Jun 2 18:27:52 2004 UTC

# Line 32 | Line 32 | namespace DUFF_NS {  // restrict the access of the fol
32      double mass;
33      double epslon;
34      double sigma;
35 +    double charge;
36      double dipole;
37      double w0;
38      double v0;
# Line 41 | Line 42 | namespace DUFF_NS {  // restrict the access of the fol
42      double rlp;
43      double rup;
44      int isSSD;
45 +    int isCharge;
46      int isDipole;
47      int ident;
48      int last;      //  0  -> default
# Line 114 | Line 116 | namespace DUFF_NS {  // restrict the access of the fol
116      void printMe( void ){
117        
118        std::cerr << "LinkedAtype " << name << ": ident = " << ident << "\n";
119 <      if( next != NULL ) next->printMe();
119 >      //      if( next != NULL ) next->printMe();
120  
121      }
122  
# Line 475 | Line 477 | DUFF::DUFF(){
477    // Init the atomStruct mpi type
478  
479    atomStruct atomProto; // mpiPrototype
480 <  int atomBC[3] = {15,11,4};  // block counts
480 >  int atomBC[3] = {15,12,5};  // block counts
481    MPI_Aint atomDspls[3];           // displacements
482    MPI_Datatype atomMbrTypes[3];    // member mpi types
483  
# Line 593 | Line 595 | DUFF::DUFF(){
595        if( frcFile == NULL ){
596          
597          sprintf( painCave.errMsg,
598 <                 "Error opening the force field parameter file: %s\n"
599 <                 "Have you tried setting the FORCE_PARAM_PATH environment "
600 <                 "vairable?\n",
598 >                 "Error opening the force field parameter file:\n"
599 >                 "\t%s\n"
600 >                 "\tHave you tried setting the FORCE_PARAM_PATH environment "
601 >                 "variable?\n",
602                   fileName );
603 +        painCave.severity = OOPSE_ERROR;
604          painCave.isFatal = 1;
605          simError();
606        }
# Line 728 | Line 732 | void DUFF::readParams( void ){
732      currentAtomType = headAtomType->next; //skip the first element who is a place holder.
733      while( currentAtomType != NULL ){
734        currentAtomType->duplicate( atomInfo );
731
732
735  
736        sendFrcStruct( &atomInfo, mpiAtomStructType );
737  
# Line 748 | Line 750 | void DUFF::readParams( void ){
750    else{
751      
752      // listen for node 0 to send out the force params
753 <    
753 >
754      MPIcheckPoint();
755  
756      headAtomType = new LinkedAtomType;
757 <    recieveFrcStruct( &atomInfo, mpiAtomStructType );
757 >    receiveFrcStruct( &atomInfo, mpiAtomStructType );
758      
759      while( !atomInfo.last ){
760  
759
760
761        headAtomType->add( atomInfo );
762        
763        MPIcheckPoint();
764  
765 <      recieveFrcStruct( &atomInfo, mpiAtomStructType );
765 >      receiveFrcStruct( &atomInfo, mpiAtomStructType );
766      }
767    }
768  
# Line 779 | Line 779 | void DUFF::readParams( void ){
779    int isGB = 0;
780    int isLJ = 1;
781    int isEAM =0;
782 +  int isCharge = 0;
783 +  double charge=0.0;
784      
785    currentAtomType = headAtomType->next;;
786    while( currentAtomType != NULL ){
787      
788 <    if(currentAtomType->isDipole) entry_plug->useDipole = 1;
788 >    if(currentAtomType->isDipole) entry_plug->useDipoles = 1;
789      if(currentAtomType->isSSD) {
790        entry_plug->useSticky = 1;
791        set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0),
# Line 800 | Line 802 | void DUFF::readParams( void ){
802                   &(currentAtomType->isDipole),
803                   &isGB,
804                   &isEAM,
805 +                 &isCharge,
806                   &(currentAtomType->epslon),
807                   &(currentAtomType->sigma),
808 +                 &charge,
809                   &(currentAtomType->dipole),
810                   &isError );
811        if( isError ){
# Line 892 | Line 896 | void DUFF::readParams( void ){
896      MPIcheckPoint();
897  
898      headBondType = new LinkedBondType;
899 <    recieveFrcStruct( &bondInfo, mpiBondStructType );
899 >    receiveFrcStruct( &bondInfo, mpiBondStructType );
900      while( !bondInfo.last ){
901  
902        headBondType->add( bondInfo );
903 <      recieveFrcStruct( &bondInfo, mpiBondStructType );
903 >      receiveFrcStruct( &bondInfo, mpiBondStructType );
904      }
905    }
906  
# Line 920 | Line 924 | void DUFF::readParams( void ){
924      fastForward( "BendTypes", "initializeBends" );
925  
926      // we are now at the bendTypes section
927 <
927 >    
928      eof_test =  fgets( readLine, sizeof(readLine), frcFile );
929      lineNum++;
930          
# Line 975 | Line 979 | void DUFF::readParams( void ){
979      MPIcheckPoint();
980  
981      headBendType = new LinkedBendType;
982 <    recieveFrcStruct( &bendInfo, mpiBendStructType );
982 >    receiveFrcStruct( &bendInfo, mpiBendStructType );
983      while( !bendInfo.last ){
984  
985        headBendType->add( bendInfo );
986 <      recieveFrcStruct( &bendInfo, mpiBendStructType );
986 >      receiveFrcStruct( &bendInfo, mpiBendStructType );
987      }
988    }
989  
# Line 1060 | Line 1064 | void DUFF::readParams( void ){
1064      MPIcheckPoint();
1065  
1066      headTorsionType = new LinkedTorsionType;
1067 <    recieveFrcStruct( &torsionInfo, mpiTorsionStructType );
1067 >    receiveFrcStruct( &torsionInfo, mpiTorsionStructType );
1068      while( !torsionInfo.last ){
1069  
1070        headTorsionType->add( torsionInfo );
1071 <      recieveFrcStruct( &torsionInfo, mpiTorsionStructType );
1071 >      receiveFrcStruct( &torsionInfo, mpiTorsionStructType );
1072      }
1073    }
1074  
# Line 1118 | Line 1122 | void DUFF::initializeAtoms( int nAtoms, Atom** the_ato
1122    // initialize the atoms
1123    
1124    DirectionalAtom* dAtom;
1125 +  double ji[3];
1126  
1127    for(int i=0; i<nAtoms; i++ ){
1128  
# Line 1131 | Line 1136 | void DUFF::initializeAtoms( int nAtoms, Atom** the_ato
1136      }
1137      
1138      the_atoms[i]->setMass( currentAtomType->mass );
1134    the_atoms[i]->setEpslon( currentAtomType->epslon );
1135    the_atoms[i]->setSigma( currentAtomType->sigma );
1139      the_atoms[i]->setIdent( currentAtomType->ident );
1137    the_atoms[i]->setLJ();
1140  
1141      if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma;
1142  
# Line 1142 | Line 1144 | void DUFF::initializeAtoms( int nAtoms, Atom** the_ato
1144        if( the_atoms[i]->isDirectional() ){
1145          
1146          dAtom = (DirectionalAtom *) the_atoms[i];
1145        dAtom->setMu( currentAtomType->dipole );
1147          dAtom->setHasDipole( 1 );
1148 <        dAtom->setJx( 0.0 );
1149 <        dAtom->setJy( 0.0 );
1150 <        dAtom->setJz( 0.0 );
1148 >
1149 >        ji[0] = 0.0;
1150 >        ji[1] = 0.0;
1151 >        ji[2] = 0.0;
1152 >
1153 >        dAtom->setJ( ji );
1154          
1155          if(!strcmp("SSD",the_atoms[i]->getType())){
1156            dAtom->setI( waterI );
1153          dAtom->setSSD( 1 );
1157          }
1158          else if(!strcmp("HEAD",the_atoms[i]->getType())){
1159            dAtom->setI( headI );
1157          dAtom->setSSD( 0 );
1160          }
1161          else{
1162            sprintf(painCave.errMsg,
# Line 1178 | Line 1180 | void DUFF::initializeAtoms( int nAtoms, Atom** the_ato
1180      else{
1181        if( the_atoms[i]->isDirectional() ){
1182          sprintf( painCave.errMsg,
1183 <                 "DUFF error: Atom \"%s\" was given a standard"
1183 >                 "DUFF error: Atom \"%s\" was given a standard "
1184                   "orientation in the BASS file, yet it is not a dipole.\n",
1185                   currentAtomType->name);
1186          painCave.isFatal = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines