# | 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 15 | Line 15 | using namespace std; | |
15 | #include "mpiForceField.h" | |
16 | #endif // is_mpi | |
17 | ||
18 | – | namespace TPE { // restrict the access of the folowing to this file only. |
18 | ||
19 | + | // define some bond Types |
20 | ||
21 | + | #define FIXED_BOND 0 |
22 | + | #define HARMONIC_BOND 1 |
23 | + | |
24 | + | |
25 | + | namespace DUFF_NS { // restrict the access of the folowing to this file only. |
26 | + | |
27 | + | |
28 | // Declare the structures that will be passed by MPI | |
29 | ||
30 | typedef struct{ | |
# | Line 28 | Line 35 | namespace TPE { // restrict the access of the folowin | |
35 | double dipole; | |
36 | double w0; | |
37 | double v0; | |
38 | + | double v0p; |
39 | + | double rl; |
40 | + | double ru; |
41 | + | double rlp; |
42 | + | double rup; |
43 | int isSSD; | |
44 | int isDipole; | |
45 | int ident; | |
# | Line 39 | Line 51 | namespace TPE { // restrict the access of the folowin | |
51 | typedef struct{ | |
52 | char nameA[15]; | |
53 | char nameB[15]; | |
42 | – | char type[30]; |
54 | double d0; | |
55 | + | double k0; |
56 | int last; // 0 -> default | |
57 | // 1 -> tells nodes to stop listening | |
58 | + | int type; |
59 | } bondStruct; | |
60 | ||
61 | ||
# | Line 111 | Line 124 | namespace TPE { // restrict the access of the folowin | |
124 | ||
125 | if( !strcmp( info.name, name ) ){ | |
126 | sprintf( painCave.errMsg, | |
127 | < | "Duplicate TraPPE_Ex atom type \"%s\" found in " |
128 | < | "the TraPPE_ExFF param file./n", |
127 | > | "Duplicate DUFF atom type \"%s\" found in " |
128 | > | "the DUFF param file./n", |
129 | name ); | |
130 | painCave.isFatal = 1; | |
131 | simError(); | |
# | Line 130 | Line 143 | namespace TPE { // restrict the access of the folowin | |
143 | next->dipole = info.dipole; | |
144 | next->w0 = info.w0; | |
145 | next->v0 = info.v0; | |
146 | + | next->v0p = info.v0p; |
147 | + | next->rl = info.rl; |
148 | + | next->ru = info.ru; |
149 | + | next->rlp = info.rlp; |
150 | + | next->rup = info.rup; |
151 | next->ident = info.ident; | |
152 | } | |
153 | } | |
# | Line 146 | Line 164 | namespace TPE { // restrict the access of the folowin | |
164 | info.dipole = dipole; | |
165 | info.w0 = w0; | |
166 | info.v0 = v0; | |
167 | + | info.v0p = v0p; |
168 | + | info.rl = rl; |
169 | + | info.ru = ru; |
170 | + | info.rlp = rlp; |
171 | + | info.rup = rup; |
172 | info.ident = ident; | |
173 | info.last = 0; | |
174 | } | |
# | Line 162 | Line 185 | namespace TPE { // restrict the access of the folowin | |
185 | double dipole; | |
186 | double w0; | |
187 | double v0; | |
188 | + | double v0p; |
189 | + | double rl; |
190 | + | double ru; |
191 | + | double rlp; |
192 | + | double rup; |
193 | int ident; | |
194 | LinkedAtomType* next; | |
195 | }; | |
# | Line 172 | Line 200 | namespace TPE { // restrict the access of the folowin | |
200 | next = NULL; | |
201 | nameA[0] = '\0'; | |
202 | nameB[0] = '\0'; | |
175 | – | type[0] = '\0'; |
203 | } | |
204 | ~LinkedBondType(){ if( next != NULL ) delete next; } | |
205 | ||
# | Line 194 | Line 221 | namespace TPE { // restrict the access of the folowin | |
221 | ||
222 | if(dup){ | |
223 | sprintf( painCave.errMsg, | |
224 | < | "Duplicate TraPPE_Ex bond type \"%s - %s\" found in " |
225 | < | "the TraPPE_ExFF param file./n", |
224 | > | "Duplicate DUFF bond type \"%s - %s\" found in " |
225 | > | "the DUFF param file./n", |
226 | nameA, nameB ); | |
227 | painCave.isFatal = 1; | |
228 | simError(); | |
# | Line 207 | Line 234 | namespace TPE { // restrict the access of the folowin | |
234 | next = new LinkedBondType(); | |
235 | strcpy(next->nameA, info.nameA); | |
236 | strcpy(next->nameB, info.nameB); | |
237 | < | strcpy(next->type, info.type); |
237 | > | next->type = info.type; |
238 | next->d0 = info.d0; | |
239 | + | next->k0 = info.k0; |
240 | } | |
241 | } | |
242 | ||
# | Line 216 | Line 244 | namespace TPE { // restrict the access of the folowin | |
244 | void duplicate( bondStruct &info ){ | |
245 | strcpy(info.nameA, nameA); | |
246 | strcpy(info.nameB, nameB); | |
247 | < | strcpy(info.type, type); |
247 | > | info.type = type; |
248 | info.d0 = d0; | |
249 | + | info.k0 = k0; |
250 | info.last = 0; | |
251 | } | |
252 | ||
# | Line 226 | Line 255 | namespace TPE { // restrict the access of the folowin | |
255 | ||
256 | char nameA[15]; | |
257 | char nameB[15]; | |
258 | < | char type[30]; |
258 | > | int type; |
259 | double d0; | |
260 | + | double k0; |
261 | ||
262 | LinkedBondType* next; | |
263 | }; | |
# | Line 264 | Line 294 | namespace TPE { // restrict the access of the folowin | |
294 | ||
295 | if(dup){ | |
296 | sprintf( painCave.errMsg, | |
297 | < | "Duplicate TraPPE_Ex bend type \"%s - %s - %s\" found in " |
298 | < | "the TraPPE_ExFF param file./n", |
297 | > | "Duplicate DUFF bend type \"%s - %s - %s\" found in " |
298 | > | "the DUFF param file./n", |
299 | nameA, nameB, nameC ); | |
300 | painCave.isFatal = 1; | |
301 | simError(); | |
# | Line 349 | Line 379 | namespace TPE { // restrict the access of the folowin | |
379 | ||
380 | if(dup){ | |
381 | sprintf( painCave.errMsg, | |
382 | < | "Duplicate TraPPE_Ex torsion type \"%s - %s - %s - %s\" found in " |
383 | < | "the TraPPE_ExFF param file./n", nameA, nameB, nameC, nameD ); |
382 | > | "Duplicate DUFF torsion type \"%s - %s - %s - %s\" found in " |
383 | > | "the DUFF param file./n", nameA, nameB, nameC, nameD ); |
384 | painCave.isFatal = 1; | |
385 | simError(); | |
386 | } | |
# | Line 410 | Line 440 | namespace TPE { // restrict the access of the folowin | |
440 | ||
441 | } // namespace | |
442 | ||
443 | < | using namespace TPE; |
443 | > | using namespace DUFF_NS; |
444 | ||
445 | ||
446 | //**************************************************************** | |
# | Line 418 | Line 448 | using namespace TPE; | |
448 | //**************************************************************** | |
449 | ||
450 | ||
451 | < | TraPPE_ExFF::TraPPE_ExFF(){ |
451 | > | DUFF::DUFF(){ |
452 | ||
453 | char fileName[200]; | |
454 | char* ffPath_env = "FORCE_PARAM_PATH"; | |
455 | char* ffPath; | |
456 | char temp[200]; | |
427 | – | char errMsg[1000]; |
457 | ||
458 | headAtomType = NULL; | |
459 | currentAtomType = NULL; | |
# | Line 446 | Line 475 | TraPPE_ExFF::TraPPE_ExFF(){ | |
475 | // Init the atomStruct mpi type | |
476 | ||
477 | atomStruct atomProto; // mpiPrototype | |
478 | < | int atomBC[3] = {15,6,4}; // block counts |
478 | > | int atomBC[3] = {15,11,4}; // block counts |
479 | MPI_Aint atomDspls[3]; // displacements | |
480 | MPI_Datatype atomMbrTypes[3]; // member mpi types | |
481 | ||
# | Line 468 | Line 497 | TraPPE_ExFF::TraPPE_ExFF(){ | |
497 | // Init the bondStruct mpi type | |
498 | ||
499 | bondStruct bondProto; // mpiPrototype | |
500 | < | int bondBC[3] = {60,1,1}; // block counts |
500 | > | int bondBC[3] = {30,2,2}; // block counts |
501 | MPI_Aint bondDspls[3]; // displacements | |
502 | MPI_Datatype bondMbrTypes[3]; // member mpi types | |
503 | ||
# | Line 537 | Line 566 | TraPPE_ExFF::TraPPE_ExFF(){ | |
566 | ||
567 | // generate the force file name | |
568 | ||
569 | < | strcpy( fileName, "TraPPE_Ex.frc" ); |
569 | > | strcpy( fileName, "DUFF.frc" ); |
570 | // fprintf( stderr,"Trying to open %s\n", fileName ); | |
571 | ||
572 | // attempt to open the file in the current directory first. | |
# | Line 576 | Line 605 | TraPPE_ExFF::TraPPE_ExFF(){ | |
605 | #ifdef IS_MPI | |
606 | } | |
607 | ||
608 | < | sprintf( checkPointMsg, "TraPPE_ExFF file opened sucessfully." ); |
608 | > | sprintf( checkPointMsg, "DUFF file opened sucessfully." ); |
609 | MPIcheckPoint(); | |
610 | ||
611 | #endif // is_mpi | |
612 | } | |
613 | ||
614 | ||
615 | < | TraPPE_ExFF::~TraPPE_ExFF(){ |
615 | > | DUFF::~DUFF(){ |
616 | ||
617 | if( headAtomType != NULL ) delete headAtomType; | |
618 | if( headBondType != NULL ) delete headBondType; | |
# | Line 601 | Line 630 | TraPPE_ExFF::~TraPPE_ExFF(){ | |
630 | #endif // is_mpi | |
631 | } | |
632 | ||
633 | < | void TraPPE_ExFF::cleanMe( void ){ |
633 | > | void DUFF::cleanMe( void ){ |
634 | ||
635 | #ifdef IS_MPI | |
636 | ||
# | Line 620 | Line 649 | void TraPPE_ExFF::cleanMe( void ){ | |
649 | } | |
650 | ||
651 | ||
652 | < | void TraPPE_ExFF::initForceField( int ljMixRule ){ |
652 | > | void DUFF::initForceField( int ljMixRule ){ |
653 | ||
654 | initFortran( ljMixRule, entry_plug->useReactionField ); | |
655 | } | |
656 | ||
657 | ||
658 | < | void TraPPE_ExFF::readParams( void ){ |
658 | > | void DUFF::readParams( void ){ |
659 | ||
631 | – | int i, a, b, c, d; |
660 | int identNum; | |
633 | – | char* atomA; |
634 | – | char* atomB; |
635 | – | char* atomC; |
636 | – | char* atomD; |
661 | ||
662 | atomStruct atomInfo; | |
663 | bondStruct bondInfo; | |
# | Line 698 | Line 722 | void TraPPE_ExFF::readParams( void ){ | |
722 | // send out the linked list to all the other processes | |
723 | ||
724 | sprintf( checkPointMsg, | |
725 | < | "TraPPE_ExFF atom structures read successfully." ); |
725 | > | "DUFF atom structures read successfully." ); |
726 | MPIcheckPoint(); | |
727 | ||
728 | currentAtomType = headAtomType->next; //skip the first element who is a place holder. | |
# | Line 710 | Line 734 | void TraPPE_ExFF::readParams( void ){ | |
734 | sendFrcStruct( &atomInfo, mpiAtomStructType ); | |
735 | ||
736 | sprintf( checkPointMsg, | |
737 | < | "successfully sent TraPPE_Ex force type: \"%s\"\n", |
737 | > | "successfully sent DUFF force type: \"%s\"\n", |
738 | atomInfo.name ); | |
739 | MPIcheckPoint(); | |
740 | ||
# | Line 754 | Line 778 | void TraPPE_ExFF::readParams( void ){ | |
778 | ||
779 | int isGB = 0; | |
780 | int isLJ = 1; | |
781 | < | double GB_dummy = 0.0; |
782 | < | |
759 | < | |
781 | > | int isEAM =0; |
782 | > | |
783 | currentAtomType = headAtomType->next;; | |
784 | while( currentAtomType != NULL ){ | |
785 | ||
786 | if(currentAtomType->isDipole) entry_plug->useDipole = 1; | |
787 | if(currentAtomType->isSSD) { | |
788 | entry_plug->useSticky = 1; | |
789 | < | set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0)); |
789 | > | set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0), |
790 | > | &(currentAtomType->v0p), |
791 | > | &(currentAtomType->rl), &(currentAtomType->ru), |
792 | > | &(currentAtomType->rlp), &(currentAtomType->rup)); |
793 | } | |
794 | ||
795 | if( currentAtomType->name[0] != '\0' ){ | |
# | Line 773 | Line 799 | void TraPPE_ExFF::readParams( void ){ | |
799 | &(currentAtomType->isSSD), | |
800 | &(currentAtomType->isDipole), | |
801 | &isGB, | |
802 | + | &isEAM, |
803 | &(currentAtomType->epslon), | |
804 | &(currentAtomType->sigma), | |
805 | &(currentAtomType->dipole), | |
# | Line 790 | Line 817 | void TraPPE_ExFF::readParams( void ){ | |
817 | ||
818 | #ifdef IS_MPI | |
819 | sprintf( checkPointMsg, | |
820 | < | "TraPPE_ExFF atom structures successfully sent to fortran\n" ); |
820 | > | "DUFF atom structures successfully sent to fortran\n" ); |
821 | MPIcheckPoint(); | |
822 | #endif // is_mpi | |
823 | ||
# | Line 844 | Line 871 | void TraPPE_ExFF::readParams( void ){ | |
871 | // send out the linked list to all the other processes | |
872 | ||
873 | sprintf( checkPointMsg, | |
874 | < | "TraPPE_Ex bond structures read successfully." ); |
874 | > | "DUFF bond structures read successfully." ); |
875 | MPIcheckPoint(); | |
876 | ||
877 | currentBondType = headBondType->next; | |
# | Line 874 | Line 901 | void TraPPE_ExFF::readParams( void ){ | |
901 | } | |
902 | ||
903 | sprintf( checkPointMsg, | |
904 | < | "TraPPE_ExFF bond structures broadcast successfully." ); |
904 | > | "DUFF bond structures broadcast successfully." ); |
905 | MPIcheckPoint(); | |
906 | ||
907 | #endif // is_mpi | |
# | Line 927 | Line 954 | void TraPPE_ExFF::readParams( void ){ | |
954 | // send out the linked list to all the other processes | |
955 | ||
956 | sprintf( checkPointMsg, | |
957 | < | "TraPPE_Ex bend structures read successfully." ); |
957 | > | "DUFF bend structures read successfully." ); |
958 | MPIcheckPoint(); | |
959 | ||
960 | currentBendType = headBendType->next; | |
# | Line 957 | Line 984 | void TraPPE_ExFF::readParams( void ){ | |
984 | } | |
985 | ||
986 | sprintf( checkPointMsg, | |
987 | < | "TraPPE_ExFF bend structures broadcast successfully." ); |
987 | > | "DUFF bend structures broadcast successfully." ); |
988 | MPIcheckPoint(); | |
989 | ||
990 | #endif // is_mpi | |
# | Line 1012 | Line 1039 | void TraPPE_ExFF::readParams( void ){ | |
1039 | // send out the linked list to all the other processes | |
1040 | ||
1041 | sprintf( checkPointMsg, | |
1042 | < | "TraPPE_Ex torsion structures read successfully." ); |
1042 | > | "DUFF torsion structures read successfully." ); |
1043 | MPIcheckPoint(); | |
1044 | ||
1045 | currentTorsionType = headTorsionType->next; | |
# | Line 1042 | Line 1069 | void TraPPE_ExFF::readParams( void ){ | |
1069 | } | |
1070 | ||
1071 | sprintf( checkPointMsg, | |
1072 | < | "TraPPE_ExFF torsion structures broadcast successfully." ); |
1072 | > | "DUFF torsion structures broadcast successfully." ); |
1073 | MPIcheckPoint(); | |
1074 | ||
1075 | #endif // is_mpi | |
# | Line 1052 | Line 1079 | void TraPPE_ExFF::readParams( void ){ | |
1079 | ||
1080 | ||
1081 | ||
1082 | < | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ |
1082 | > | void DUFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ |
1083 | ||
1084 | ||
1085 | ////////////////////////////////////////////////// | |
# | Line 1141 | Line 1168 | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom** | |
1168 | else{ | |
1169 | ||
1170 | sprintf( painCave.errMsg, | |
1171 | < | "TraPPE_ExFF error: Atom \"%s\" is a dipole, yet no standard" |
1171 | > | "DUFF error: Atom \"%s\" is a dipole, yet no standard" |
1172 | " orientation was specifed in the BASS file.\n", | |
1173 | currentAtomType->name ); | |
1174 | painCave.isFatal = 1; | |
# | Line 1151 | Line 1178 | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom** | |
1178 | else{ | |
1179 | if( the_atoms[i]->isDirectional() ){ | |
1180 | sprintf( painCave.errMsg, | |
1181 | < | "TraPPE_ExFF error: Atom \"%s\" was given a standard" |
1181 | > | "DUFF error: Atom \"%s\" was given a standard" |
1182 | "orientation in the BASS file, yet it is not a dipole.\n", | |
1183 | currentAtomType->name); | |
1184 | painCave.isFatal = 1; | |
# | Line 1161 | Line 1188 | void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom** | |
1188 | } | |
1189 | } | |
1190 | ||
1191 | < | void TraPPE_ExFF::initializeBonds( int nBonds, Bond** bondArray, |
1191 | > | void DUFF::initializeBonds( int nBonds, Bond** bondArray, |
1192 | bond_pair* the_bonds ){ | |
1193 | int i,a,b; | |
1194 | char* atomA; | |
# | Line 1189 | Line 1216 | void TraPPE_ExFF::initializeBonds( int nBonds, Bond** | |
1216 | simError(); | |
1217 | } | |
1218 | ||
1219 | < | if( !strcmp( currentBondType->type, "fixed" ) ){ |
1220 | < | |
1219 | > | switch( currentBondType->type ){ |
1220 | > | |
1221 | > | case FIXED_BOND: |
1222 | > | |
1223 | bondArray[i] = new ConstrainedBond( *the_atoms[a], | |
1224 | *the_atoms[b], | |
1225 | currentBondType->d0 ); | |
1226 | entry_plug->n_constraints++; | |
1227 | + | break; |
1228 | + | |
1229 | + | case HARMONIC_BOND: |
1230 | + | |
1231 | + | bondArray[i] = new HarmonicBond( *the_atoms[a], |
1232 | + | *the_atoms[b], |
1233 | + | currentBondType->d0, |
1234 | + | currentBondType->k0 ); |
1235 | + | break; |
1236 | + | |
1237 | + | default: |
1238 | + | |
1239 | + | break; |
1240 | + | // do nothing |
1241 | } | |
1242 | } | |
1243 | } | |
1244 | ||
1245 | < | void TraPPE_ExFF::initializeBends( int nBends, Bend** bendArray, |
1245 | > | void DUFF::initializeBends( int nBends, Bend** bendArray, |
1246 | bend_set* the_bends ){ | |
1247 | ||
1248 | QuadraticBend* qBend; | |
# | Line 1259 | Line 1302 | void TraPPE_ExFF::initializeBends( int nBends, Bend** | |
1302 | } | |
1303 | ||
1304 | gBend = new GhostBend( *the_atoms[a], | |
1305 | < | *the_atoms[b] ); |
1305 | > | *the_atoms[b]); |
1306 | > | |
1307 | gBend->setConstants( currentBendType->k1, | |
1308 | currentBendType->k2, | |
1309 | currentBendType->k3, | |
# | Line 1275 | Line 1319 | void TraPPE_ExFF::initializeBends( int nBends, Bend** | |
1319 | currentBendType->k3, | |
1320 | currentBendType->t0 ); | |
1321 | bendArray[i] = qBend; | |
1322 | < | } |
1322 | > | } |
1323 | } | |
1324 | } | |
1325 | } | |
1326 | ||
1327 | < | void TraPPE_ExFF::initializeTorsions( int nTorsions, Torsion** torsionArray, |
1327 | > | void DUFF::initializeTorsions( int nTorsions, Torsion** torsionArray, |
1328 | torsion_set* the_torsions ){ | |
1329 | ||
1330 | int i, a, b, c, d; | |
# | Line 1327 | Line 1371 | void TraPPE_ExFF::initializeTorsions( int nTorsions, T | |
1371 | } | |
1372 | } | |
1373 | ||
1374 | < | void TraPPE_ExFF::fastForward( char* stopText, char* searchOwner ){ |
1374 | > | void DUFF::fastForward( char* stopText, char* searchOwner ){ |
1375 | ||
1376 | int foundText = 0; | |
1377 | char* the_token; | |
# | Line 1382 | Line 1426 | void TraPPE_ExFF::fastForward( char* stopText, char* s | |
1426 | } | |
1427 | ||
1428 | ||
1429 | < | int TPE::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ |
1429 | > | int DUFF_NS::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ |
1430 | ||
1431 | char* the_token; | |
1432 | ||
# | Line 1468 | Line 1512 | int TPE::parseAtom( char *lineBuffer, int lineNum, ato | |
1512 | } | |
1513 | ||
1514 | info.v0 = atof( the_token ); | |
1515 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1516 | + | sprintf( painCave.errMsg, |
1517 | + | "Error parseing AtomTypes: line %d\n", lineNum ); |
1518 | + | painCave.isFatal = 1; |
1519 | + | simError(); |
1520 | + | } |
1521 | + | |
1522 | + | info.v0p = atof( the_token ); |
1523 | + | |
1524 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1525 | + | sprintf( painCave.errMsg, |
1526 | + | "Error parseing AtomTypes: line %d\n", lineNum ); |
1527 | + | painCave.isFatal = 1; |
1528 | + | simError(); |
1529 | + | } |
1530 | + | |
1531 | + | info.rl = atof( the_token ); |
1532 | + | |
1533 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1534 | + | sprintf( painCave.errMsg, |
1535 | + | "Error parseing AtomTypes: line %d\n", lineNum ); |
1536 | + | painCave.isFatal = 1; |
1537 | + | simError(); |
1538 | + | } |
1539 | + | |
1540 | + | info.ru = atof( the_token ); |
1541 | + | |
1542 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1543 | + | sprintf( painCave.errMsg, |
1544 | + | "Error parseing AtomTypes: line %d\n", lineNum ); |
1545 | + | painCave.isFatal = 1; |
1546 | + | simError(); |
1547 | + | } |
1548 | + | |
1549 | + | info.rlp = atof( the_token ); |
1550 | + | |
1551 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1552 | + | sprintf( painCave.errMsg, |
1553 | + | "Error parseing AtomTypes: line %d\n", lineNum ); |
1554 | + | painCave.isFatal = 1; |
1555 | + | simError(); |
1556 | + | } |
1557 | + | |
1558 | + | info.rup = atof( the_token ); |
1559 | } | |
1560 | < | else info.v0 = info.w0 = 0.0; |
1560 | > | else info.v0 = info.w0 = info.v0p = info.rl = info.ru = info.rlp = info.rup = 0.0; |
1561 | ||
1562 | return 1; | |
1563 | } | |
1564 | else return 0; | |
1565 | } | |
1566 | ||
1567 | < | int TPE::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ |
1567 | > | int DUFF_NS::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ |
1568 | ||
1569 | char* the_token; | |
1570 | + | char bondType[30]; |
1571 | ||
1572 | the_token = strtok( lineBuffer, " \n\t,;" ); | |
1573 | if( the_token != NULL ){ | |
# | Line 1501 | Line 1590 | int TPE::parseBond( char *lineBuffer, int lineNum, bon | |
1590 | simError(); | |
1591 | } | |
1592 | ||
1593 | < | strcpy( info.type, the_token ); |
1593 | > | strcpy( bondType, the_token ); |
1594 | ||
1595 | < | if( !strcmp( info.type, "fixed" ) ){ |
1595 | > | if( !strcmp( bondType, "fixed" ) ){ |
1596 | > | info.type = FIXED_BOND; |
1597 | > | |
1598 | > | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1599 | > | sprintf( painCave.errMsg, |
1600 | > | "Error parseing BondTypes: line %d\n", lineNum ); |
1601 | > | painCave.isFatal = 1; |
1602 | > | simError(); |
1603 | > | } |
1604 | > | |
1605 | > | info.d0 = atof( the_token ); |
1606 | > | |
1607 | > | info.k0=0.0; |
1608 | > | } |
1609 | > | else if( !strcmp( bondType, "harmonic" ) ){ |
1610 | > | info.type = HARMONIC_BOND; |
1611 | > | |
1612 | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | |
1613 | sprintf( painCave.errMsg, | |
1614 | "Error parseing BondTypes: line %d\n", lineNum ); | |
# | Line 1512 | Line 1617 | int TPE::parseBond( char *lineBuffer, int lineNum, bon | |
1617 | } | |
1618 | ||
1619 | info.d0 = atof( the_token ); | |
1620 | + | |
1621 | + | if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
1622 | + | sprintf( painCave.errMsg, |
1623 | + | "Error parseing BondTypes: line %d\n", lineNum ); |
1624 | + | painCave.isFatal = 1; |
1625 | + | simError(); |
1626 | + | } |
1627 | + | |
1628 | + | info.k0 = atof( the_token ); |
1629 | } | |
1630 | + | |
1631 | else{ | |
1632 | sprintf( painCave.errMsg, | |
1633 | < | "Unknown TraPPE_Ex bond type \"%s\" at line %d\n", |
1634 | < | info.type, |
1633 | > | "Unknown DUFF bond type \"%s\" at line %d\n", |
1634 | > | bondType, |
1635 | lineNum ); | |
1636 | painCave.isFatal = 1; | |
1637 | simError(); | |
# | Line 1528 | Line 1643 | int TPE::parseBond( char *lineBuffer, int lineNum, bon | |
1643 | } | |
1644 | ||
1645 | ||
1646 | < | int TPE::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ |
1646 | > | int DUFF_NS::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ |
1647 | ||
1648 | char* the_token; | |
1649 | ||
# | Line 1604 | Line 1719 | int TPE::parseBend( char *lineBuffer, int lineNum, ben | |
1719 | ||
1720 | else{ | |
1721 | sprintf( painCave.errMsg, | |
1722 | < | "Unknown TraPPE_Ex bend type \"%s\" at line %d\n", |
1722 | > | "Unknown DUFF bend type \"%s\" at line %d\n", |
1723 | info.type, | |
1724 | lineNum ); | |
1725 | painCave.isFatal = 1; | |
# | Line 1616 | Line 1731 | int TPE::parseBend( char *lineBuffer, int lineNum, ben | |
1731 | else return 0; | |
1732 | } | |
1733 | ||
1734 | < | int TPE::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ |
1734 | > | int DUFF_NS::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ |
1735 | ||
1736 | char* the_token; | |
1737 | ||
# | Line 1702 | Line 1817 | int TPE::parseTorsion( char *lineBuffer, int lineNum, | |
1817 | ||
1818 | else{ | |
1819 | sprintf( painCave.errMsg, | |
1820 | < | "Unknown TraPPE_Ex torsion type \"%s\" at line %d\n", |
1820 | > | "Unknown DUFF torsion type \"%s\" at line %d\n", |
1821 | info.type, | |
1822 | lineNum ); | |
1823 | painCave.isFatal = 1; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |