--- trunk/mdtools/interface_implementation/TraPPE_ExFF.cpp 2002/10/16 22:24:44 141 +++ trunk/mdtools/interface_implementation/TraPPE_ExFF.cpp 2002/10/18 16:15:05 146 @@ -28,6 +28,42 @@ MPI_Datatype mpiAtomStructType; } atomStruct; MPI_Datatype mpiAtomStructType; +typedef struct{ + char nameA[15]; + char nameB[15]; + char type[30]; + double d0; + int last; // 0 -> default + // 1 -> tells nodes to stop listening + // -1 -> an error has occured. (handled in mpiForceField) +} bondStruct; +MPI_Datatype mpiBondStructType; + +typedef struct{ + char nameA[15]; + char nameB[15]; + char nameC[15]; + char type[30]; + double k1, k2, k3, t0; + int last; // 0 -> default + // 1 -> tells nodes to stop listening + // -1 -> an error has occured. (handled in mpiForceField) +} bendStruct; +MPI_Datatype mpiBendStructType; + +typedef struct{ + char nameA[15]; + char nameB[15]; + char nameC[15]; + char nameD[15]; + char type[30]; + double k1, k2, k3, k4; + int last; // 0 -> default + // 1 -> tells nodes to stop listening + // -1 -> an error has occured. (handled in mpiForceField) +} TorsionStruct; +MPI_Datatype mpiTorsionStructType; + #endif @@ -422,8 +458,31 @@ void TraPPE_ExFF::initializeBonds( bond_pair* the_bond if( !strcmp(nameA, key2 ) && !strcmp( nameB, key1 ) ) return this; if( next != NULL ) return next->find(key1, key2); return NULL; + } + +#ifdef IS_MPI + void add( bondStruct &info ){ + if( next != NULL ) next->add(info); + else{ + next = new LinkedType(); + strcpy(next->nameA, info.nameA); + strcpy(next->nameB, info.nameB); + strcpy(next->type, info.type); + next->d0 = info.d0; + } } + void duplicate( bondStruct &info ){ + strcpy(info.nameA, nameA); + strcpy(info.nameB, nameB); + strcpy(info.type, type); + info.d0 = d0; + info.last = 0; + } + + +#endif + char nameA[15]; char nameB[15]; char type[30]; @@ -612,8 +671,39 @@ void TraPPE_ExFF::initializeBends( bend_set* the_bends && !strcmp( nameC, key1 ) ) return this; if( next != NULL ) return next->find(key1, key2, key3); return NULL; + } + +#ifdef IS_MPI + + void add( bendStruct &info ){ + if( next != NULL ) next->add(info); + else{ + next = new LinkedType(); + strcpy(next->nameA, info.nameA); + strcpy(next->nameB, info.nameB); + strcpy(next->nameC, info.nameC); + strcpy(next->type, info.type); + next->k1 = info.k1; + next->k2 = info.k2; + next->k3 = info.k3; + next->t0 = info.t0; + } } + void duplicate( bendStruct &info ){ + strcpy(info.nameA, nameA); + strcpy(info.nameB, nameB); + strcpy(info.nameC, nameC); + strcpy(info.type, type); + info.k1 = k1; + info.k2 = k2; + info.k3 = k3; + info.t0 = t0; + info.last = 0; + } + +#endif + char nameA[15]; char nameB[15]; char nameC[15]; @@ -840,8 +930,40 @@ void TraPPE_ExFF::initializeTorsions( torsion_set* the if( next != NULL ) return next->find(key1, key2, key3, key4); return NULL; + } + +#ifdef IS_MPI + + void add( torsionStruct &info ){ + if( next != NULL ) next->add(info); + else{ + next = new LinkedType(); + strcpy(next->nameA, info.nameA); + strcpy(next->nameB, info.nameB); + strcpy(next->nameC, info.nameC); + strcpy(next->type, info.type); + next->k1 = info.k1; + next->k2 = info.k2; + next->k3 = info.k3; + next->k4 = info.k4; + } } + void duplicate( torsionStruct &info ){ + strcpy(info.nameA, nameA); + strcpy(info.nameB, nameB); + strcpy(info.nameC, nameC); + strcpy(info.nameD, nameD); + strcpy(info.type, type); + info.k1 = k1; + info.k2 = k2; + info.k3 = k3; + info.k4 = k4; + info.last = 0; + } + +#endif + char nameA[15]; char nameB[15]; char nameC[15];