| 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; | 
| 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{ | 
| 32 | 
  | 
    double mass; | 
| 33 | 
  | 
    double epslon; | 
| 34 | 
  | 
    double sigma; | 
| 35 | 
+ | 
    double charge; | 
| 36 | 
  | 
    double dipole; | 
| 37 | 
  | 
    double w0; | 
| 38 | 
  | 
    double v0; | 
| 39 | 
+ | 
    double v0p; | 
| 40 | 
+ | 
    double rl; | 
| 41 | 
+ | 
    double ru; | 
| 42 | 
+ | 
    double rlp; | 
| 43 | 
+ | 
    double rup; | 
| 44 | 
  | 
    int isSSD; | 
| 45 | 
+ | 
    int isCharge; | 
| 46 | 
  | 
    int isDipole; | 
| 47 | 
  | 
    int ident; | 
| 48 | 
  | 
    int last;      //  0  -> default | 
| 53 | 
  | 
  typedef struct{ | 
| 54 | 
  | 
    char nameA[15]; | 
| 55 | 
  | 
    char nameB[15]; | 
| 42 | 
– | 
    char type[30]; | 
| 56 | 
  | 
    double d0; | 
| 57 | 
+ | 
    double k0; | 
| 58 | 
  | 
    int last;      //  0  -> default | 
| 59 | 
  | 
                   //  1  -> tells nodes to stop listening | 
| 60 | 
+ | 
    int type; | 
| 61 | 
  | 
  } bondStruct; | 
| 62 | 
  | 
   | 
| 63 | 
  | 
   | 
| 126 | 
  | 
       | 
| 127 | 
  | 
      if( !strcmp( info.name, name ) ){ | 
| 128 | 
  | 
        sprintf( painCave.errMsg, | 
| 129 | 
< | 
                 "Duplicate TraPPE_Ex atom type \"%s\" found in " | 
| 130 | 
< | 
                 "the TraPPE_ExFF param file./n", | 
| 129 | 
> | 
                 "Duplicate DUFF atom type \"%s\" found in " | 
| 130 | 
> | 
                 "the DUFF param file./n", | 
| 131 | 
  | 
                 name ); | 
| 132 | 
  | 
        painCave.isFatal = 1; | 
| 133 | 
  | 
        simError(); | 
| 145 | 
  | 
        next->dipole   = info.dipole; | 
| 146 | 
  | 
        next->w0       = info.w0; | 
| 147 | 
  | 
        next->v0       = info.v0; | 
| 148 | 
+ | 
        next->v0p      = info.v0p; | 
| 149 | 
+ | 
        next->rl       = info.rl; | 
| 150 | 
+ | 
        next->ru       = info.ru; | 
| 151 | 
+ | 
        next->rlp      = info.rlp; | 
| 152 | 
+ | 
        next->rup      = info.rup; | 
| 153 | 
  | 
        next->ident    = info.ident; | 
| 154 | 
  | 
      } | 
| 155 | 
  | 
    } | 
| 166 | 
  | 
      info.dipole   = dipole; | 
| 167 | 
  | 
      info.w0       = w0; | 
| 168 | 
  | 
      info.v0       = v0; | 
| 169 | 
+ | 
      info.v0p      = v0p; | 
| 170 | 
+ | 
      info.rl       = rl; | 
| 171 | 
+ | 
      info.ru       = ru; | 
| 172 | 
+ | 
      info.rlp      = rlp; | 
| 173 | 
+ | 
      info.rup      = rup; | 
| 174 | 
  | 
      info.ident    = ident; | 
| 175 | 
  | 
      info.last     = 0; | 
| 176 | 
  | 
    } | 
| 187 | 
  | 
    double dipole; | 
| 188 | 
  | 
    double w0; | 
| 189 | 
  | 
    double v0; | 
| 190 | 
+ | 
    double v0p; | 
| 191 | 
+ | 
    double rl; | 
| 192 | 
+ | 
    double ru; | 
| 193 | 
+ | 
    double rlp; | 
| 194 | 
+ | 
    double rup; | 
| 195 | 
  | 
    int ident; | 
| 196 | 
  | 
    LinkedAtomType* next; | 
| 197 | 
  | 
  }; | 
| 202 | 
  | 
      next = NULL; | 
| 203 | 
  | 
      nameA[0] = '\0'; | 
| 204 | 
  | 
      nameB[0] = '\0'; | 
| 175 | 
– | 
      type[0] = '\0'; | 
| 205 | 
  | 
    } | 
| 206 | 
  | 
    ~LinkedBondType(){ if( next != NULL ) delete next; } | 
| 207 | 
  | 
 | 
| 223 | 
  | 
       | 
| 224 | 
  | 
      if(dup){ | 
| 225 | 
  | 
        sprintf( painCave.errMsg, | 
| 226 | 
< | 
                 "Duplicate TraPPE_Ex bond type \"%s - %s\" found in " | 
| 227 | 
< | 
                 "the TraPPE_ExFF param file./n", | 
| 226 | 
> | 
                 "Duplicate DUFF bond type \"%s - %s\" found in " | 
| 227 | 
> | 
                 "the DUFF param file./n", | 
| 228 | 
  | 
                 nameA, nameB ); | 
| 229 | 
  | 
        painCave.isFatal = 1; | 
| 230 | 
  | 
        simError(); | 
| 236 | 
  | 
        next = new LinkedBondType(); | 
| 237 | 
  | 
        strcpy(next->nameA, info.nameA); | 
| 238 | 
  | 
        strcpy(next->nameB, info.nameB); | 
| 239 | 
< | 
        strcpy(next->type,  info.type); | 
| 239 | 
> | 
        next->type = info.type; | 
| 240 | 
  | 
        next->d0 = info.d0; | 
| 241 | 
+ | 
        next->k0 = info.k0; | 
| 242 | 
  | 
      } | 
| 243 | 
  | 
    } | 
| 244 | 
  | 
     | 
| 246 | 
  | 
    void duplicate( bondStruct &info ){ | 
| 247 | 
  | 
      strcpy(info.nameA, nameA); | 
| 248 | 
  | 
      strcpy(info.nameB, nameB); | 
| 249 | 
< | 
      strcpy(info.type,  type); | 
| 249 | 
> | 
      info.type = type; | 
| 250 | 
  | 
      info.d0   = d0; | 
| 251 | 
+ | 
      info.k0   = k0; | 
| 252 | 
  | 
      info.last = 0; | 
| 253 | 
  | 
    } | 
| 254 | 
  | 
 | 
| 257 | 
  | 
 | 
| 258 | 
  | 
    char nameA[15]; | 
| 259 | 
  | 
    char nameB[15]; | 
| 260 | 
< | 
    char type[30]; | 
| 260 | 
> | 
    int type; | 
| 261 | 
  | 
    double d0; | 
| 262 | 
+ | 
    double k0; | 
| 263 | 
  | 
 | 
| 264 | 
  | 
    LinkedBondType* next; | 
| 265 | 
  | 
  }; | 
| 296 | 
  | 
 | 
| 297 | 
  | 
      if(dup){ | 
| 298 | 
  | 
        sprintf( painCave.errMsg, | 
| 299 | 
< | 
                 "Duplicate TraPPE_Ex bend type \"%s - %s - %s\" found in " | 
| 300 | 
< | 
                 "the TraPPE_ExFF param file./n", | 
| 299 | 
> | 
                 "Duplicate DUFF bend type \"%s - %s - %s\" found in " | 
| 300 | 
> | 
                 "the DUFF param file./n", | 
| 301 | 
  | 
                 nameA, nameB, nameC ); | 
| 302 | 
  | 
        painCave.isFatal = 1; | 
| 303 | 
  | 
        simError(); | 
| 381 | 
  | 
       | 
| 382 | 
  | 
      if(dup){ | 
| 383 | 
  | 
        sprintf( painCave.errMsg, | 
| 384 | 
< | 
                 "Duplicate TraPPE_Ex torsion type \"%s - %s - %s - %s\" found in " | 
| 385 | 
< | 
                 "the TraPPE_ExFF param file./n", nameA, nameB, nameC, nameD ); | 
| 384 | 
> | 
                 "Duplicate DUFF torsion type \"%s - %s - %s - %s\" found in " | 
| 385 | 
> | 
                 "the DUFF param file./n", nameA, nameB, nameC, nameD ); | 
| 386 | 
  | 
        painCave.isFatal = 1; | 
| 387 | 
  | 
        simError(); | 
| 388 | 
  | 
      } | 
| 442 | 
  | 
 | 
| 443 | 
  | 
} // namespace | 
| 444 | 
  | 
 | 
| 445 | 
< | 
using namespace TPE; | 
| 445 | 
> | 
using namespace DUFF_NS; | 
| 446 | 
  | 
 | 
| 447 | 
  | 
 | 
| 448 | 
  | 
//**************************************************************** | 
| 450 | 
  | 
//**************************************************************** | 
| 451 | 
  | 
 | 
| 452 | 
  | 
 | 
| 453 | 
< | 
TraPPE_ExFF::TraPPE_ExFF(){ | 
| 453 | 
> | 
DUFF::DUFF(){ | 
| 454 | 
  | 
 | 
| 455 | 
  | 
  char fileName[200]; | 
| 456 | 
  | 
  char* ffPath_env = "FORCE_PARAM_PATH"; | 
| 457 | 
  | 
  char* ffPath; | 
| 458 | 
  | 
  char temp[200]; | 
| 427 | 
– | 
  char errMsg[1000]; | 
| 459 | 
  | 
 | 
| 460 | 
  | 
  headAtomType       = NULL;  | 
| 461 | 
  | 
  currentAtomType    = NULL; | 
| 477 | 
  | 
  // Init the atomStruct mpi type | 
| 478 | 
  | 
 | 
| 479 | 
  | 
  atomStruct atomProto; // mpiPrototype | 
| 480 | 
< | 
  int atomBC[3] = {15,6,4};  // block counts | 
| 480 | 
> | 
  int atomBC[3] = {15,11,4};  // block counts | 
| 481 | 
  | 
  MPI_Aint atomDspls[3];           // displacements | 
| 482 | 
  | 
  MPI_Datatype atomMbrTypes[3];    // member mpi types | 
| 483 | 
  | 
 | 
| 499 | 
  | 
  // Init the bondStruct mpi type | 
| 500 | 
  | 
   | 
| 501 | 
  | 
  bondStruct bondProto; // mpiPrototype | 
| 502 | 
< | 
  int bondBC[3] = {60,1,1};  // block counts | 
| 502 | 
> | 
  int bondBC[3] = {30,2,2};  // block counts | 
| 503 | 
  | 
  MPI_Aint bondDspls[3];           // displacements | 
| 504 | 
  | 
  MPI_Datatype bondMbrTypes[3];    // member mpi types | 
| 505 | 
  | 
   | 
| 568 | 
  | 
     | 
| 569 | 
  | 
    // generate the force file name | 
| 570 | 
  | 
     | 
| 571 | 
< | 
    strcpy( fileName, "TraPPE_Ex.frc" );  | 
| 571 | 
> | 
    strcpy( fileName, "DUFF.frc" );  | 
| 572 | 
  | 
    //    fprintf( stderr,"Trying to open %s\n", fileName ); | 
| 573 | 
  | 
     | 
| 574 | 
  | 
    // attempt to open the file in the current directory first. | 
| 607 | 
  | 
#ifdef IS_MPI | 
| 608 | 
  | 
  } | 
| 609 | 
  | 
   | 
| 610 | 
< | 
  sprintf( checkPointMsg, "TraPPE_ExFF file opened sucessfully." ); | 
| 610 | 
> | 
  sprintf( checkPointMsg, "DUFF file opened sucessfully." ); | 
| 611 | 
  | 
  MPIcheckPoint(); | 
| 612 | 
  | 
   | 
| 613 | 
  | 
#endif // is_mpi | 
| 614 | 
  | 
} | 
| 615 | 
  | 
 | 
| 616 | 
  | 
 | 
| 617 | 
< | 
TraPPE_ExFF::~TraPPE_ExFF(){ | 
| 617 | 
> | 
DUFF::~DUFF(){ | 
| 618 | 
  | 
 | 
| 619 | 
  | 
  if( headAtomType != NULL ) delete headAtomType; | 
| 620 | 
  | 
  if( headBondType != NULL ) delete headBondType; | 
| 632 | 
  | 
#endif // is_mpi | 
| 633 | 
  | 
} | 
| 634 | 
  | 
 | 
| 635 | 
< | 
void TraPPE_ExFF::cleanMe( void ){ | 
| 635 | 
> | 
void DUFF::cleanMe( void ){ | 
| 636 | 
  | 
 | 
| 637 | 
  | 
#ifdef IS_MPI | 
| 638 | 
  | 
   | 
| 651 | 
  | 
} | 
| 652 | 
  | 
 | 
| 653 | 
  | 
 | 
| 654 | 
< | 
void TraPPE_ExFF::initForceField( int ljMixRule ){ | 
| 654 | 
> | 
void DUFF::initForceField( int ljMixRule ){ | 
| 655 | 
  | 
   | 
| 656 | 
  | 
  initFortran( ljMixRule, entry_plug->useReactionField ); | 
| 657 | 
  | 
} | 
| 658 | 
  | 
 | 
| 659 | 
  | 
 | 
| 660 | 
< | 
void TraPPE_ExFF::readParams( void ){ | 
| 660 | 
> | 
void DUFF::readParams( void ){ | 
| 661 | 
  | 
 | 
| 631 | 
– | 
  int i, a, b, c, d; | 
| 662 | 
  | 
  int identNum; | 
| 633 | 
– | 
  char* atomA; | 
| 634 | 
– | 
  char* atomB; | 
| 635 | 
– | 
  char* atomC; | 
| 636 | 
– | 
  char* atomD; | 
| 663 | 
  | 
   | 
| 664 | 
  | 
  atomStruct atomInfo; | 
| 665 | 
  | 
  bondStruct bondInfo; | 
| 724 | 
  | 
    // send out the linked list to all the other processes | 
| 725 | 
  | 
 | 
| 726 | 
  | 
    sprintf( checkPointMsg, | 
| 727 | 
< | 
             "TraPPE_ExFF atom structures read successfully." ); | 
| 727 | 
> | 
             "DUFF atom structures read successfully." ); | 
| 728 | 
  | 
    MPIcheckPoint(); | 
| 729 | 
  | 
 | 
| 730 | 
  | 
    currentAtomType = headAtomType->next; //skip the first element who is a place holder. | 
| 736 | 
  | 
      sendFrcStruct( &atomInfo, mpiAtomStructType ); | 
| 737 | 
  | 
 | 
| 738 | 
  | 
      sprintf( checkPointMsg, | 
| 739 | 
< | 
               "successfully sent TraPPE_Ex force type: \"%s\"\n", | 
| 739 | 
> | 
               "successfully sent DUFF force type: \"%s\"\n", | 
| 740 | 
  | 
               atomInfo.name ); | 
| 741 | 
  | 
      MPIcheckPoint(); | 
| 742 | 
  | 
 | 
| 780 | 
  | 
   | 
| 781 | 
  | 
  int isGB = 0; | 
| 782 | 
  | 
  int isLJ = 1; | 
| 783 | 
< | 
  double GB_dummy = 0.0; | 
| 784 | 
< | 
   | 
| 785 | 
< | 
   | 
| 783 | 
> | 
  int isEAM =0; | 
| 784 | 
> | 
  int isCharge = 0; | 
| 785 | 
> | 
  double charge=0.0; | 
| 786 | 
> | 
     | 
| 787 | 
  | 
  currentAtomType = headAtomType->next;; | 
| 788 | 
  | 
  while( currentAtomType != NULL ){ | 
| 789 | 
  | 
     | 
| 790 | 
< | 
    if(currentAtomType->isDipole) entry_plug->useDipole = 1; | 
| 790 | 
> | 
    if(currentAtomType->isDipole) entry_plug->useDipoles = 1; | 
| 791 | 
  | 
    if(currentAtomType->isSSD) { | 
| 792 | 
  | 
      entry_plug->useSticky = 1; | 
| 793 | 
< | 
      set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0)); | 
| 793 | 
> | 
      set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0),  | 
| 794 | 
> | 
                         &(currentAtomType->v0p),  | 
| 795 | 
> | 
                         &(currentAtomType->rl), &(currentAtomType->ru),  | 
| 796 | 
> | 
                         &(currentAtomType->rlp), &(currentAtomType->rup)); | 
| 797 | 
  | 
    } | 
| 798 | 
  | 
 | 
| 799 | 
  | 
    if( currentAtomType->name[0] != '\0' ){ | 
| 803 | 
  | 
                 &(currentAtomType->isSSD), | 
| 804 | 
  | 
                 &(currentAtomType->isDipole), | 
| 805 | 
  | 
                 &isGB, | 
| 806 | 
+ | 
                 &isEAM, | 
| 807 | 
+ | 
                 &isCharge, | 
| 808 | 
  | 
                 &(currentAtomType->epslon), | 
| 809 | 
  | 
                 &(currentAtomType->sigma), | 
| 810 | 
+ | 
                 &charge, | 
| 811 | 
  | 
                 &(currentAtomType->dipole), | 
| 812 | 
  | 
                 &isError ); | 
| 813 | 
  | 
      if( isError ){ | 
| 823 | 
  | 
       | 
| 824 | 
  | 
#ifdef IS_MPI | 
| 825 | 
  | 
  sprintf( checkPointMsg, | 
| 826 | 
< | 
           "TraPPE_ExFF atom structures successfully sent to fortran\n" ); | 
| 826 | 
> | 
           "DUFF atom structures successfully sent to fortran\n" ); | 
| 827 | 
  | 
  MPIcheckPoint(); | 
| 828 | 
  | 
#endif // is_mpi | 
| 829 | 
  | 
 | 
| 877 | 
  | 
    // send out the linked list to all the other processes | 
| 878 | 
  | 
     | 
| 879 | 
  | 
    sprintf( checkPointMsg, | 
| 880 | 
< | 
             "TraPPE_Ex bond structures read successfully." ); | 
| 880 | 
> | 
             "DUFF bond structures read successfully." ); | 
| 881 | 
  | 
    MPIcheckPoint(); | 
| 882 | 
  | 
     | 
| 883 | 
  | 
    currentBondType = headBondType->next; | 
| 907 | 
  | 
  } | 
| 908 | 
  | 
 | 
| 909 | 
  | 
  sprintf( checkPointMsg, | 
| 910 | 
< | 
           "TraPPE_ExFF bond structures broadcast successfully." ); | 
| 910 | 
> | 
           "DUFF bond structures broadcast successfully." ); | 
| 911 | 
  | 
  MPIcheckPoint(); | 
| 912 | 
  | 
 | 
| 913 | 
  | 
#endif // is_mpi | 
| 960 | 
  | 
    // send out the linked list to all the other processes | 
| 961 | 
  | 
 | 
| 962 | 
  | 
    sprintf( checkPointMsg, | 
| 963 | 
< | 
             "TraPPE_Ex bend structures read successfully." ); | 
| 963 | 
> | 
             "DUFF bend structures read successfully." ); | 
| 964 | 
  | 
    MPIcheckPoint(); | 
| 965 | 
  | 
 | 
| 966 | 
  | 
    currentBendType = headBendType->next; | 
| 990 | 
  | 
  } | 
| 991 | 
  | 
 | 
| 992 | 
  | 
  sprintf( checkPointMsg, | 
| 993 | 
< | 
           "TraPPE_ExFF bend structures broadcast successfully." ); | 
| 993 | 
> | 
           "DUFF bend structures broadcast successfully." ); | 
| 994 | 
  | 
  MPIcheckPoint(); | 
| 995 | 
  | 
 | 
| 996 | 
  | 
#endif // is_mpi | 
| 1045 | 
  | 
    // send out the linked list to all the other processes | 
| 1046 | 
  | 
     | 
| 1047 | 
  | 
    sprintf( checkPointMsg, | 
| 1048 | 
< | 
             "TraPPE_Ex torsion structures read successfully." ); | 
| 1048 | 
> | 
             "DUFF torsion structures read successfully." ); | 
| 1049 | 
  | 
    MPIcheckPoint(); | 
| 1050 | 
  | 
     | 
| 1051 | 
  | 
    currentTorsionType = headTorsionType->next; | 
| 1075 | 
  | 
  } | 
| 1076 | 
  | 
 | 
| 1077 | 
  | 
  sprintf( checkPointMsg, | 
| 1078 | 
< | 
           "TraPPE_ExFF torsion structures broadcast successfully." ); | 
| 1078 | 
> | 
           "DUFF torsion structures broadcast successfully." ); | 
| 1079 | 
  | 
  MPIcheckPoint(); | 
| 1080 | 
  | 
 | 
| 1081 | 
  | 
#endif // is_mpi | 
| 1085 | 
  | 
 | 
| 1086 | 
  | 
 | 
| 1087 | 
  | 
 | 
| 1088 | 
< | 
void TraPPE_ExFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ | 
| 1088 | 
> | 
void DUFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ | 
| 1089 | 
  | 
   | 
| 1090 | 
  | 
   | 
| 1091 | 
  | 
  ////////////////////////////////////////////////// | 
| 1174 | 
  | 
      else{ | 
| 1175 | 
  | 
         | 
| 1176 | 
  | 
        sprintf( painCave.errMsg, | 
| 1177 | 
< | 
                "TraPPE_ExFF error: Atom \"%s\" is a dipole, yet no standard" | 
| 1177 | 
> | 
                "DUFF error: Atom \"%s\" is a dipole, yet no standard" | 
| 1178 | 
  | 
                 " orientation was specifed in the BASS file.\n", | 
| 1179 | 
  | 
                 currentAtomType->name ); | 
| 1180 | 
  | 
        painCave.isFatal = 1; | 
| 1184 | 
  | 
    else{ | 
| 1185 | 
  | 
      if( the_atoms[i]->isDirectional() ){ | 
| 1186 | 
  | 
        sprintf( painCave.errMsg, | 
| 1187 | 
< | 
                 "TraPPE_ExFF error: Atom \"%s\" was given a standard" | 
| 1187 | 
> | 
                 "DUFF error: Atom \"%s\" was given a standard" | 
| 1188 | 
  | 
                 "orientation in the BASS file, yet it is not a dipole.\n", | 
| 1189 | 
  | 
                 currentAtomType->name); | 
| 1190 | 
  | 
        painCave.isFatal = 1; | 
| 1194 | 
  | 
  } | 
| 1195 | 
  | 
} | 
| 1196 | 
  | 
 | 
| 1197 | 
< | 
void TraPPE_ExFF::initializeBonds( int nBonds, Bond** bondArray, | 
| 1197 | 
> | 
void DUFF::initializeBonds( int nBonds, Bond** bondArray, | 
| 1198 | 
  | 
                                   bond_pair* the_bonds ){ | 
| 1199 | 
  | 
  int i,a,b; | 
| 1200 | 
  | 
  char* atomA; | 
| 1222 | 
  | 
      simError(); | 
| 1223 | 
  | 
    } | 
| 1224 | 
  | 
     | 
| 1225 | 
< | 
    if( !strcmp( currentBondType->type, "fixed" ) ){ | 
| 1226 | 
< | 
       | 
| 1225 | 
> | 
    switch( currentBondType->type ){ | 
| 1226 | 
> | 
 | 
| 1227 | 
> | 
    case FIXED_BOND: | 
| 1228 | 
> | 
             | 
| 1229 | 
  | 
      bondArray[i] = new ConstrainedBond( *the_atoms[a],  | 
| 1230 | 
  | 
                                          *the_atoms[b], | 
| 1231 | 
  | 
                                          currentBondType->d0 ); | 
| 1232 | 
  | 
      entry_plug->n_constraints++; | 
| 1233 | 
+ | 
      break; | 
| 1234 | 
+ | 
 | 
| 1235 | 
+ | 
    case HARMONIC_BOND: | 
| 1236 | 
+ | 
       | 
| 1237 | 
+ | 
      bondArray[i] = new HarmonicBond( *the_atoms[a], | 
| 1238 | 
+ | 
                                       *the_atoms[b], | 
| 1239 | 
+ | 
                                       currentBondType->d0, | 
| 1240 | 
+ | 
                                       currentBondType->k0 ); | 
| 1241 | 
+ | 
      break; | 
| 1242 | 
+ | 
       | 
| 1243 | 
+ | 
    default: | 
| 1244 | 
+ | 
 | 
| 1245 | 
+ | 
      break; | 
| 1246 | 
+ | 
      // do nothing | 
| 1247 | 
  | 
    } | 
| 1248 | 
  | 
  } | 
| 1249 | 
  | 
} | 
| 1250 | 
  | 
 | 
| 1251 | 
< | 
void TraPPE_ExFF::initializeBends( int nBends, Bend** bendArray, | 
| 1251 | 
> | 
void DUFF::initializeBends( int nBends, Bend** bendArray, | 
| 1252 | 
  | 
                                   bend_set* the_bends ){ | 
| 1253 | 
  | 
   | 
| 1254 | 
  | 
  QuadraticBend* qBend; | 
| 1308 | 
  | 
        } | 
| 1309 | 
  | 
         | 
| 1310 | 
  | 
        gBend = new GhostBend( *the_atoms[a],  | 
| 1311 | 
< | 
                               *the_atoms[b] );                         | 
| 1311 | 
> | 
                               *the_atoms[b]); | 
| 1312 | 
> | 
                                                                        | 
| 1313 | 
  | 
        gBend->setConstants( currentBendType->k1, | 
| 1314 | 
  | 
                             currentBendType->k2, | 
| 1315 | 
  | 
                             currentBendType->k3, | 
| 1325 | 
  | 
                             currentBendType->k3, | 
| 1326 | 
  | 
                             currentBendType->t0 ); | 
| 1327 | 
  | 
        bendArray[i] = qBend; | 
| 1328 | 
< | 
      } | 
| 1328 | 
> | 
      }       | 
| 1329 | 
  | 
    } | 
| 1330 | 
  | 
  } | 
| 1331 | 
  | 
} | 
| 1332 | 
  | 
 | 
| 1333 | 
< | 
void TraPPE_ExFF::initializeTorsions( int nTorsions, Torsion** torsionArray, | 
| 1333 | 
> | 
void DUFF::initializeTorsions( int nTorsions, Torsion** torsionArray, | 
| 1334 | 
  | 
                                      torsion_set* the_torsions ){ | 
| 1335 | 
  | 
 | 
| 1336 | 
  | 
  int i, a, b, c, d; | 
| 1377 | 
  | 
  } | 
| 1378 | 
  | 
} | 
| 1379 | 
  | 
 | 
| 1380 | 
< | 
void TraPPE_ExFF::fastForward( char* stopText, char* searchOwner ){ | 
| 1380 | 
> | 
void DUFF::fastForward( char* stopText, char* searchOwner ){ | 
| 1381 | 
  | 
 | 
| 1382 | 
  | 
  int foundText = 0; | 
| 1383 | 
  | 
  char* the_token; | 
| 1432 | 
  | 
} | 
| 1433 | 
  | 
 | 
| 1434 | 
  | 
 | 
| 1435 | 
< | 
int TPE::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ | 
| 1435 | 
> | 
int DUFF_NS::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ | 
| 1436 | 
  | 
  | 
| 1437 | 
  | 
  char* the_token; | 
| 1438 | 
  | 
   | 
| 1518 | 
  | 
      } | 
| 1519 | 
  | 
       | 
| 1520 | 
  | 
      info.v0 = atof( the_token ); | 
| 1521 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1522 | 
+ | 
        sprintf( painCave.errMsg,  | 
| 1523 | 
+ | 
                 "Error parseing AtomTypes: line %d\n", lineNum ); | 
| 1524 | 
+ | 
        painCave.isFatal = 1; | 
| 1525 | 
+ | 
        simError(); | 
| 1526 | 
+ | 
      } | 
| 1527 | 
+ | 
       | 
| 1528 | 
+ | 
      info.v0p = atof( the_token ); | 
| 1529 | 
+ | 
 | 
| 1530 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1531 | 
+ | 
        sprintf( painCave.errMsg,  | 
| 1532 | 
+ | 
                 "Error parseing AtomTypes: line %d\n", lineNum ); | 
| 1533 | 
+ | 
        painCave.isFatal = 1; | 
| 1534 | 
+ | 
        simError(); | 
| 1535 | 
+ | 
      } | 
| 1536 | 
+ | 
       | 
| 1537 | 
+ | 
      info.rl = atof( the_token ); | 
| 1538 | 
+ | 
 | 
| 1539 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1540 | 
+ | 
        sprintf( painCave.errMsg,  | 
| 1541 | 
+ | 
                 "Error parseing AtomTypes: line %d\n", lineNum ); | 
| 1542 | 
+ | 
        painCave.isFatal = 1; | 
| 1543 | 
+ | 
        simError(); | 
| 1544 | 
+ | 
      } | 
| 1545 | 
+ | 
       | 
| 1546 | 
+ | 
      info.ru = atof( the_token ); | 
| 1547 | 
+ | 
 | 
| 1548 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1549 | 
+ | 
        sprintf( painCave.errMsg,  | 
| 1550 | 
+ | 
                 "Error parseing AtomTypes: line %d\n", lineNum ); | 
| 1551 | 
+ | 
        painCave.isFatal = 1; | 
| 1552 | 
+ | 
        simError(); | 
| 1553 | 
+ | 
      } | 
| 1554 | 
+ | 
       | 
| 1555 | 
+ | 
      info.rlp = atof( the_token ); | 
| 1556 | 
+ | 
 | 
| 1557 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1558 | 
+ | 
        sprintf( painCave.errMsg,  | 
| 1559 | 
+ | 
                 "Error parseing AtomTypes: line %d\n", lineNum ); | 
| 1560 | 
+ | 
        painCave.isFatal = 1; | 
| 1561 | 
+ | 
        simError(); | 
| 1562 | 
+ | 
      } | 
| 1563 | 
+ | 
       | 
| 1564 | 
+ | 
      info.rup = atof( the_token ); | 
| 1565 | 
  | 
    } | 
| 1566 | 
< | 
    else info.v0 = info.w0 = 0.0; | 
| 1566 | 
> | 
    else info.v0 = info.w0 = info.v0p = info.rl = info.ru = info.rlp = info.rup = 0.0; | 
| 1567 | 
  | 
 | 
| 1568 | 
  | 
    return 1; | 
| 1569 | 
  | 
  } | 
| 1570 | 
  | 
  else return 0; | 
| 1571 | 
  | 
} | 
| 1572 | 
  | 
 | 
| 1573 | 
< | 
int TPE::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ | 
| 1573 | 
> | 
int DUFF_NS::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ | 
| 1574 | 
  | 
  | 
| 1575 | 
  | 
  char* the_token; | 
| 1576 | 
+ | 
  char bondType[30]; | 
| 1577 | 
  | 
   | 
| 1578 | 
  | 
  the_token = strtok( lineBuffer, " \n\t,;" ); | 
| 1579 | 
  | 
  if( the_token != NULL ){ | 
| 1596 | 
  | 
      simError(); | 
| 1597 | 
  | 
    } | 
| 1598 | 
  | 
     | 
| 1599 | 
< | 
    strcpy( info.type, the_token ); | 
| 1599 | 
> | 
    strcpy( bondType, the_token ); | 
| 1600 | 
  | 
     | 
| 1601 | 
< | 
    if( !strcmp( info.type, "fixed" ) ){ | 
| 1601 | 
> | 
    if( !strcmp( bondType, "fixed" ) ){ | 
| 1602 | 
> | 
      info.type = FIXED_BOND; | 
| 1603 | 
> | 
       | 
| 1604 | 
> | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1605 | 
> | 
        sprintf( painCave.errMsg, | 
| 1606 | 
> | 
                 "Error parseing BondTypes: line %d\n", lineNum ); | 
| 1607 | 
> | 
        painCave.isFatal = 1; | 
| 1608 | 
> | 
        simError(); | 
| 1609 | 
> | 
      } | 
| 1610 | 
> | 
       | 
| 1611 | 
> | 
      info.d0 = atof( the_token ); | 
| 1612 | 
> | 
       | 
| 1613 | 
> | 
      info.k0=0.0; | 
| 1614 | 
> | 
    } | 
| 1615 | 
> | 
    else if( !strcmp( bondType, "harmonic" ) ){ | 
| 1616 | 
> | 
      info.type = HARMONIC_BOND; | 
| 1617 | 
> | 
       | 
| 1618 | 
  | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1619 | 
  | 
        sprintf( painCave.errMsg, | 
| 1620 | 
  | 
                 "Error parseing BondTypes: line %d\n", lineNum ); | 
| 1623 | 
  | 
      } | 
| 1624 | 
  | 
       | 
| 1625 | 
  | 
      info.d0 = atof( the_token ); | 
| 1626 | 
+ | 
 | 
| 1627 | 
+ | 
      if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ | 
| 1628 | 
+ | 
        sprintf( painCave.errMsg, | 
| 1629 | 
+ | 
                 "Error parseing BondTypes: line %d\n", lineNum ); | 
| 1630 | 
+ | 
        painCave.isFatal = 1; | 
| 1631 | 
+ | 
        simError(); | 
| 1632 | 
+ | 
      } | 
| 1633 | 
+ | 
       | 
| 1634 | 
+ | 
      info.k0 = atof( the_token ); | 
| 1635 | 
  | 
    } | 
| 1636 | 
+ | 
 | 
| 1637 | 
  | 
    else{ | 
| 1638 | 
  | 
      sprintf( painCave.errMsg,  | 
| 1639 | 
< | 
               "Unknown TraPPE_Ex bond type \"%s\" at line %d\n", | 
| 1640 | 
< | 
               info.type, | 
| 1639 | 
> | 
               "Unknown DUFF bond type \"%s\" at line %d\n", | 
| 1640 | 
> | 
               bondType, | 
| 1641 | 
  | 
               lineNum ); | 
| 1642 | 
  | 
      painCave.isFatal = 1; | 
| 1643 | 
  | 
      simError(); | 
| 1649 | 
  | 
} | 
| 1650 | 
  | 
 | 
| 1651 | 
  | 
 | 
| 1652 | 
< | 
int TPE::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ | 
| 1652 | 
> | 
int DUFF_NS::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ | 
| 1653 | 
  | 
 | 
| 1654 | 
  | 
  char* the_token; | 
| 1655 | 
  | 
   | 
| 1725 | 
  | 
     | 
| 1726 | 
  | 
    else{ | 
| 1727 | 
  | 
      sprintf( painCave.errMsg,  | 
| 1728 | 
< | 
               "Unknown TraPPE_Ex bend type \"%s\" at line %d\n", | 
| 1728 | 
> | 
               "Unknown DUFF bend type \"%s\" at line %d\n", | 
| 1729 | 
  | 
               info.type, | 
| 1730 | 
  | 
               lineNum ); | 
| 1731 | 
  | 
      painCave.isFatal = 1; | 
| 1737 | 
  | 
  else return 0; | 
| 1738 | 
  | 
} | 
| 1739 | 
  | 
 | 
| 1740 | 
< | 
int TPE::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ | 
| 1740 | 
> | 
int DUFF_NS::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ | 
| 1741 | 
  | 
   | 
| 1742 | 
  | 
  char*  the_token; | 
| 1743 | 
  | 
 | 
| 1823 | 
  | 
     | 
| 1824 | 
  | 
    else{ | 
| 1825 | 
  | 
      sprintf( painCave.errMsg,  | 
| 1826 | 
< | 
               "Unknown TraPPE_Ex torsion type \"%s\" at line %d\n", | 
| 1826 | 
> | 
               "Unknown DUFF torsion type \"%s\" at line %d\n", | 
| 1827 | 
  | 
               info.type, | 
| 1828 | 
  | 
               lineNum ); | 
| 1829 | 
  | 
      painCave.isFatal = 1; |