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

Comparing trunk/OOPSE/libmdtools/TraPPE_ExFF.cpp (file contents):
Revision 421 by mmeineke, Thu Mar 27 17:55:20 2003 UTC vs.
Revision 941 by gezelter, Tue Jan 13 23:01:43 2004 UTC

# Line 1 | Line 1
1 < #include <cstdlib>
2 < #include <cstdio>
3 < #include <cstring>
1 > #include <stdlib.h>
2 > #include <stdio.h>
3 > #include <string.h>
4  
5   #include <iostream>
6   using namespace std;
# Line 12 | Line 12 | using namespace std;
12   #include "fortranWrappers.hpp"
13  
14   #ifdef IS_MPI
15 #include <mpi++.h>
15   #include "mpiForceField.h"
16   #endif // is_mpi
17  
# Line 99 | Line 98 | namespace TPE {  // restrict the access of the folowin
98        return NULL;
99      }
100      
101 +    void printMe( void ){
102 +      
103 +      std::cerr << "LinkedAtype " << name << ": ident = " << ident << "\n";
104 +      if( next != NULL ) next->printMe();
105 +
106 +    }
107 +
108      void add( atomStruct &info ){
109  
110        // check for duplicates
# Line 114 | Line 120 | namespace TPE {  // restrict the access of the folowin
120  
121        if( next != NULL ) next->add(info);
122        else{
123 <        next = new LinkedType();
123 >        next = new LinkedAtomType();
124          strcpy(next->name, info.name);
125          next->isDipole = info.isDipole;
126          next->isSSD    = info.isSSD;
# Line 140 | Line 146 | namespace TPE {  // restrict the access of the folowin
146        info.dipole   = dipole;
147        info.w0       = w0;
148        info.v0       = v0;
149 +      info.ident    = ident;
150        info.last     = 0;
151      }
152  
# Line 197 | Line 204 | namespace TPE {  // restrict the access of the folowin
204          
205        if( next != NULL ) next->add(info);
206        else{
207 <        next = new LinkedType();
207 >        next = new LinkedBondType();
208          strcpy(next->nameA, info.nameA);
209          strcpy(next->nameB, info.nameB);
210          strcpy(next->type,  info.type);
# Line 266 | Line 273 | namespace TPE {  // restrict the access of the folowin
273  
274        if( next != NULL ) next->add(info);
275        else{
276 <        next = new LinkedType();
276 >        next = new LinkedBendType();
277          strcpy(next->nameA, info.nameA);
278          strcpy(next->nameB, info.nameB);
279          strcpy(next->nameC, info.nameC);
# Line 350 | Line 357 | namespace TPE {  // restrict the access of the folowin
357  
358        if( next != NULL ) next->add(info);
359        else{
360 <        next = new LinkedType();
360 >        next = new LinkedTorsionType();
361          strcpy(next->nameA, info.nameA);
362          strcpy(next->nameB, info.nameB);
363          strcpy(next->nameC, info.nameC);
# Line 734 | Line 741 | void TraPPE_ExFF::readParams( void ){
741        recieveFrcStruct( &atomInfo, mpiAtomStructType );
742      }
743    }
744 +
745   #endif // is_mpi
746 +
747 +
748  
749    // call new A_types in fortran
750    
# Line 744 | Line 754 | void TraPPE_ExFF::readParams( void ){
754    
755    int isGB = 0;
756    int isLJ = 1;
757 +  int isEAM = 0;
758 +  int isCharge = 0;
759    double GB_dummy = 0.0;
760 +  double charge = 0.0;
761    
762    
763 <  currentAtomType = headAtomType;
763 >  currentAtomType = headAtomType->next;;
764    while( currentAtomType != NULL ){
765      
766      if(currentAtomType->isDipole) entry_plug->useDipole = 1;
767 <    if(currentAtomType->isSSD)    entry_plug->useSticky = 1;
767 >    if(currentAtomType->isSSD) {
768 >      entry_plug->useSticky = 1;
769 >      set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0));
770 >    }
771  
772      if( currentAtomType->name[0] != '\0' ){
773        isError = 0;
# Line 760 | Line 776 | void TraPPE_ExFF::readParams( void ){
776                   &(currentAtomType->isSSD),
777                   &(currentAtomType->isDipole),
778                   &isGB,
779 +                 &isEAM,
780 +                 &isCharge,
781                   &(currentAtomType->epslon),
782                   &(currentAtomType->sigma),
783 +                 &charge,
784                   &(currentAtomType->dipole),
766                 &(currentAtomType->w0),
767                 &(currentAtomType->v0),
768                 &GB_dummy,
769                 &GB_dummy,
770                 &GB_dummy,
771                 &GB_dummy,
772                 &GB_dummy,
773                 &GB_dummy,
785                   &isError );
786        if( isError ){
787          sprintf( painCave.errMsg,
# Line 842 | Line 853 | void TraPPE_ExFF::readParams( void ){
853               "TraPPE_Ex bond structures read successfully." );
854      MPIcheckPoint();
855      
856 <    currentBondType = headBondType;
856 >    currentBondType = headBondType->next;
857      while( currentBondType != NULL ){
858        currentBondType->duplicate( bondInfo );
859        sendFrcStruct( &bondInfo, mpiBondStructType );
# Line 857 | Line 868 | void TraPPE_ExFF::readParams( void ){
868      
869      // listen for node 0 to send out the force params
870      
871 <    MPIcheckPoint();
871 >    MPIcheckPoint();
872  
873      headBondType = new LinkedBondType;
874      recieveFrcStruct( &bondInfo, mpiBondStructType );
# Line 867 | Line 878 | void TraPPE_ExFF::readParams( void ){
878        recieveFrcStruct( &bondInfo, mpiBondStructType );
879      }
880    }
881 +
882 +  sprintf( checkPointMsg,
883 +           "TraPPE_ExFF bond structures broadcast successfully." );
884 +  MPIcheckPoint();
885 +
886   #endif // is_mpi
887    
888  
# Line 920 | Line 936 | void TraPPE_ExFF::readParams( void ){
936               "TraPPE_Ex bend structures read successfully." );
937      MPIcheckPoint();
938  
939 <    currentBendType = headBendType;
939 >    currentBendType = headBendType->next;
940      while( currentBendType != NULL ){
941        currentBendType->duplicate( bendInfo );
942        sendFrcStruct( &bendInfo, mpiBendStructType );
# Line 945 | Line 961 | void TraPPE_ExFF::readParams( void ){
961        recieveFrcStruct( &bendInfo, mpiBendStructType );
962      }
963    }
964 +
965 +  sprintf( checkPointMsg,
966 +           "TraPPE_ExFF bend structures broadcast successfully." );
967 +  MPIcheckPoint();
968 +
969   #endif // is_mpi
970  
971  
# Line 1000 | Line 1021 | void TraPPE_ExFF::readParams( void ){
1021               "TraPPE_Ex torsion structures read successfully." );
1022      MPIcheckPoint();
1023      
1024 <    currentTorsionType = headTorsionType;
1024 >    currentTorsionType = headTorsionType->next;
1025      while( currentTorsionType != NULL ){
1026        currentTorsionType->duplicate( torsionInfo );
1027        sendFrcStruct( &torsionInfo, mpiTorsionStructType );
# Line 1025 | Line 1046 | void TraPPE_ExFF::readParams( void ){
1046        recieveFrcStruct( &torsionInfo, mpiTorsionStructType );
1047      }
1048    }
1049 +
1050 +  sprintf( checkPointMsg,
1051 +           "TraPPE_ExFF torsion structures broadcast successfully." );
1052 +  MPIcheckPoint();
1053 +
1054   #endif // is_mpi
1055  
1056 +  entry_plug->useLJ = 1;
1057   }
1058  
1059  
# Line 1071 | Line 1098 | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom**
1098    
1099    DirectionalAtom* dAtom;
1100  
1101 <  for( i=0; i<nAtoms; i++ ){
1101 >  for(int i=0; i<nAtoms; i++ ){
1102  
1103      currentAtomType = headAtomType->find( the_atoms[i]->getType() );
1104      if( currentAtomType == NULL ){
# Line 1138 | Line 1165 | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom**
1165        }
1166      }
1167    }
1141
1142
1143 #ifdef IS_MPI
1144  sprintf( checkPointMsg, "TraPPE_Ex atoms initialized succesfully" );
1145  MPIcheckPoint();
1146 #endif // is_mpi
1147
1168   }
1169  
1170   void TraPPE_ExFF::initializeBonds( int nBonds, Bond** bondArray,
# Line 1183 | Line 1203 | void TraPPE_ExFF::initializeBonds( int nBonds, Bond**
1203        entry_plug->n_constraints++;
1204      }
1205    }
1186  
1187 #ifdef IS_MPI
1188  sprintf( checkPointMsg, "TraPPE_Ex bonds initialized succesfully" );
1189  MPIcheckPoint();
1190 #endif // is_mpi
1191
1206   }
1207  
1208   void TraPPE_ExFF::initializeBends( int nBends, Bend** bendArray,
# Line 1237 | Line 1251 | void TraPPE_ExFF::initializeBends( int nBends, Bend**
1251          else if( the_bends[i].ghost == a ){
1252            c = a;
1253            a = b;
1254 <          b = a;
1254 >          b = c;
1255          }
1256          else{
1257            sprintf( painCave.errMsg,
# Line 1270 | Line 1284 | void TraPPE_ExFF::initializeBends( int nBends, Bend**
1284        }
1285      }
1286    }
1273
1274 #ifdef IS_MPI
1275  sprintf( checkPointMsg, "TraPPE_Ex bends initialized succesfully" );
1276  MPIcheckPoint();
1277 #endif // is_mpi
1278
1287   }
1288  
1289   void TraPPE_ExFF::initializeTorsions( int nTorsions, Torsion** torsionArray,
# Line 1323 | Line 1331 | void TraPPE_ExFF::initializeTorsions( int nTorsions, T
1331        torsionArray[i] = cTors;
1332      }
1333    }
1326
1327 #ifdef IS_MPI
1328  sprintf( checkPointMsg, "TraPPE_Ex torsions initialized succesfully" );
1329  MPIcheckPoint();
1330 #endif // is_mpi
1331
1334   }
1335  
1336   void TraPPE_ExFF::fastForward( char* stopText, char* searchOwner ){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines