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; |
12 |
|
#include "fortranWrappers.hpp" |
13 |
|
|
14 |
|
#ifdef IS_MPI |
15 |
– |
#include <mpi++.h> |
15 |
|
#include "mpiForceField.h" |
16 |
|
#endif // is_mpi |
17 |
|
|
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 |
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; |
146 |
|
info.dipole = dipole; |
147 |
|
info.w0 = w0; |
148 |
|
info.v0 = v0; |
149 |
+ |
info.ident = ident; |
150 |
|
info.last = 0; |
151 |
|
} |
152 |
|
|
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); |
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); |
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); |
741 |
|
recieveFrcStruct( &atomInfo, mpiAtomStructType ); |
742 |
|
} |
743 |
|
} |
744 |
+ |
|
745 |
|
#endif // is_mpi |
746 |
+ |
|
747 |
+ |
|
748 |
|
|
749 |
|
// call new A_types in fortran |
750 |
|
|
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; |
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, |
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 ); |
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 ); |
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 |
|
|
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 ); |
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 |
|
|
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 ); |
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 |
|
|
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 ){ |
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, |
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, |
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, |
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, |
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 ){ |