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 |
146 |
|
info.dipole = dipole; |
147 |
|
info.w0 = w0; |
148 |
|
info.v0 = v0; |
149 |
+ |
info.ident = ident; |
150 |
|
info.last = 0; |
151 |
|
} |
152 |
|
|
741 |
|
recieveFrcStruct( &atomInfo, mpiAtomStructType ); |
742 |
|
} |
743 |
|
} |
744 |
+ |
|
745 |
|
#endif // is_mpi |
746 |
|
|
747 |
+ |
|
748 |
+ |
|
749 |
|
// call new A_types in fortran |
750 |
|
|
751 |
|
int isError; |
757 |
|
double GB_dummy = 0.0; |
758 |
|
|
759 |
|
|
760 |
< |
currentAtomType = headAtomType; |
760 |
> |
currentAtomType = headAtomType->next;; |
761 |
|
while( currentAtomType != NULL ){ |
762 |
|
|
763 |
|
if(currentAtomType->isDipole) entry_plug->useDipole = 1; |
764 |
< |
if(currentAtomType->isSSD) entry_plug->useSticky = 1; |
764 |
> |
if(currentAtomType->isSSD) { |
765 |
> |
entry_plug->useSticky = 1; |
766 |
> |
set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0)); |
767 |
> |
} |
768 |
|
|
769 |
|
if( currentAtomType->name[0] != '\0' ){ |
770 |
|
isError = 0; |
776 |
|
&(currentAtomType->epslon), |
777 |
|
&(currentAtomType->sigma), |
778 |
|
&(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, |
779 |
|
&isError ); |
780 |
|
if( isError ){ |
781 |
|
sprintf( painCave.errMsg, |
847 |
|
"TraPPE_Ex bond structures read successfully." ); |
848 |
|
MPIcheckPoint(); |
849 |
|
|
850 |
< |
currentBondType = headBondType; |
850 |
> |
currentBondType = headBondType->next; |
851 |
|
while( currentBondType != NULL ){ |
852 |
|
currentBondType->duplicate( bondInfo ); |
853 |
|
sendFrcStruct( &bondInfo, mpiBondStructType ); |
862 |
|
|
863 |
|
// listen for node 0 to send out the force params |
864 |
|
|
865 |
< |
MPIcheckPoint(); |
865 |
> |
MPIcheckPoint(); |
866 |
|
|
867 |
|
headBondType = new LinkedBondType; |
868 |
|
recieveFrcStruct( &bondInfo, mpiBondStructType ); |
872 |
|
recieveFrcStruct( &bondInfo, mpiBondStructType ); |
873 |
|
} |
874 |
|
} |
875 |
+ |
|
876 |
+ |
sprintf( checkPointMsg, |
877 |
+ |
"TraPPE_ExFF bond structures broadcast successfully." ); |
878 |
+ |
MPIcheckPoint(); |
879 |
+ |
|
880 |
|
#endif // is_mpi |
881 |
|
|
882 |
|
|
930 |
|
"TraPPE_Ex bend structures read successfully." ); |
931 |
|
MPIcheckPoint(); |
932 |
|
|
933 |
< |
currentBendType = headBendType; |
933 |
> |
currentBendType = headBendType->next; |
934 |
|
while( currentBendType != NULL ){ |
935 |
|
currentBendType->duplicate( bendInfo ); |
936 |
|
sendFrcStruct( &bendInfo, mpiBendStructType ); |
955 |
|
recieveFrcStruct( &bendInfo, mpiBendStructType ); |
956 |
|
} |
957 |
|
} |
958 |
+ |
|
959 |
+ |
sprintf( checkPointMsg, |
960 |
+ |
"TraPPE_ExFF bend structures broadcast successfully." ); |
961 |
+ |
MPIcheckPoint(); |
962 |
+ |
|
963 |
|
#endif // is_mpi |
964 |
|
|
965 |
|
|
1015 |
|
"TraPPE_Ex torsion structures read successfully." ); |
1016 |
|
MPIcheckPoint(); |
1017 |
|
|
1018 |
< |
currentTorsionType = headTorsionType; |
1018 |
> |
currentTorsionType = headTorsionType->next; |
1019 |
|
while( currentTorsionType != NULL ){ |
1020 |
|
currentTorsionType->duplicate( torsionInfo ); |
1021 |
|
sendFrcStruct( &torsionInfo, mpiTorsionStructType ); |
1040 |
|
recieveFrcStruct( &torsionInfo, mpiTorsionStructType ); |
1041 |
|
} |
1042 |
|
} |
1043 |
+ |
|
1044 |
+ |
sprintf( checkPointMsg, |
1045 |
+ |
"TraPPE_ExFF torsion structures broadcast successfully." ); |
1046 |
+ |
MPIcheckPoint(); |
1047 |
+ |
|
1048 |
|
#endif // is_mpi |
1049 |
|
|
1050 |
+ |
entry_plug->useLJ = 1; |
1051 |
|
} |
1052 |
|
|
1053 |
|
|
1159 |
|
} |
1160 |
|
} |
1161 |
|
} |
1141 |
– |
|
1142 |
– |
|
1143 |
– |
#ifdef IS_MPI |
1144 |
– |
sprintf( checkPointMsg, "TraPPE_Ex atoms initialized succesfully" ); |
1145 |
– |
MPIcheckPoint(); |
1146 |
– |
#endif // is_mpi |
1147 |
– |
|
1162 |
|
} |
1163 |
|
|
1164 |
|
void TraPPE_ExFF::initializeBonds( int nBonds, Bond** bondArray, |
1197 |
|
entry_plug->n_constraints++; |
1198 |
|
} |
1199 |
|
} |
1186 |
– |
|
1187 |
– |
#ifdef IS_MPI |
1188 |
– |
sprintf( checkPointMsg, "TraPPE_Ex bonds initialized succesfully" ); |
1189 |
– |
MPIcheckPoint(); |
1190 |
– |
#endif // is_mpi |
1191 |
– |
|
1200 |
|
} |
1201 |
|
|
1202 |
|
void TraPPE_ExFF::initializeBends( int nBends, Bend** bendArray, |
1245 |
|
else if( the_bends[i].ghost == a ){ |
1246 |
|
c = a; |
1247 |
|
a = b; |
1248 |
< |
b = a; |
1248 |
> |
b = c; |
1249 |
|
} |
1250 |
|
else{ |
1251 |
|
sprintf( painCave.errMsg, |
1278 |
|
} |
1279 |
|
} |
1280 |
|
} |
1273 |
– |
|
1274 |
– |
#ifdef IS_MPI |
1275 |
– |
sprintf( checkPointMsg, "TraPPE_Ex bends initialized succesfully" ); |
1276 |
– |
MPIcheckPoint(); |
1277 |
– |
#endif // is_mpi |
1278 |
– |
|
1281 |
|
} |
1282 |
|
|
1283 |
|
void TraPPE_ExFF::initializeTorsions( int nTorsions, Torsion** torsionArray, |
1325 |
|
torsionArray[i] = cTors; |
1326 |
|
} |
1327 |
|
} |
1326 |
– |
|
1327 |
– |
#ifdef IS_MPI |
1328 |
– |
sprintf( checkPointMsg, "TraPPE_Ex torsions initialized succesfully" ); |
1329 |
– |
MPIcheckPoint(); |
1330 |
– |
#endif // is_mpi |
1331 |
– |
|
1328 |
|
} |
1329 |
|
|
1330 |
|
void TraPPE_ExFF::fastForward( char* stopText, char* searchOwner ){ |