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 428 by mmeineke, Thu Mar 27 21:07:14 2003 UTC vs.
Revision 976 by chrisfen, Thu Jan 22 17:34:20 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 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 721 | Line 728 | void TraPPE_ExFF::readParams( void ){
728      MPIcheckPoint();
729  
730      headAtomType = new LinkedAtomType;
731 <    recieveFrcStruct( &atomInfo, mpiAtomStructType );
731 >    receiveFrcStruct( &atomInfo, mpiAtomStructType );
732      
733      while( !atomInfo.last ){
734  
# Line 731 | Line 738 | void TraPPE_ExFF::readParams( void ){
738        
739        MPIcheckPoint();
740  
741 <      recieveFrcStruct( &atomInfo, mpiAtomStructType );
741 >      receiveFrcStruct( &atomInfo, mpiAtomStructType );
742      }
743    }
744 +
745   #endif // is_mpi
746  
747 +
748 +
749    // call new A_types in fortran
750    
751    int isError;
# 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 );
874 >    receiveFrcStruct( &bondInfo, mpiBondStructType );
875      while( !bondInfo.last ){
876  
877        headBondType->add( bondInfo );
878 <      recieveFrcStruct( &bondInfo, mpiBondStructType );
878 >      receiveFrcStruct( &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 938 | Line 954 | void TraPPE_ExFF::readParams( void ){
954      MPIcheckPoint();
955  
956      headBendType = new LinkedBendType;
957 <    recieveFrcStruct( &bendInfo, mpiBendStructType );
957 >    receiveFrcStruct( &bendInfo, mpiBendStructType );
958      while( !bendInfo.last ){
959  
960        headBendType->add( bendInfo );
961 <      recieveFrcStruct( &bendInfo, mpiBendStructType );
961 >      receiveFrcStruct( &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 1018 | Line 1039 | void TraPPE_ExFF::readParams( void ){
1039      MPIcheckPoint();
1040  
1041      headTorsionType = new LinkedTorsionType;
1042 <    recieveFrcStruct( &torsionInfo, mpiTorsionStructType );
1042 >    receiveFrcStruct( &torsionInfo, mpiTorsionStructType );
1043      while( !torsionInfo.last ){
1044  
1045        headTorsionType->add( torsionInfo );
1046 <      recieveFrcStruct( &torsionInfo, mpiTorsionStructType );
1046 >      receiveFrcStruct( &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 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