| 22 | 
  | 
#define HARMONIC_BOND 1 | 
| 23 | 
  | 
 | 
| 24 | 
  | 
 | 
| 25 | 
< | 
namespace TPE {  // restrict the access of the folowing to this file only. | 
| 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 | 
| 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; | 
| 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 | 
  | 
    } | 
| 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 | 
  | 
    } | 
| 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 | 
  | 
  }; | 
| 440 | 
  | 
 | 
| 441 | 
  | 
} // namespace | 
| 442 | 
  | 
 | 
| 443 | 
< | 
using namespace TPE; | 
| 443 | 
> | 
using namespace DUFF_NS; | 
| 444 | 
  | 
 | 
| 445 | 
  | 
 | 
| 446 | 
  | 
//**************************************************************** | 
| 454 | 
  | 
  char* ffPath_env = "FORCE_PARAM_PATH"; | 
| 455 | 
  | 
  char* ffPath; | 
| 456 | 
  | 
  char temp[200]; | 
| 437 | 
– | 
  char errMsg[1000]; | 
| 457 | 
  | 
 | 
| 458 | 
  | 
  headAtomType       = NULL;  | 
| 459 | 
  | 
  currentAtomType    = NULL; | 
| 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 | 
  | 
 | 
| 657 | 
  | 
 | 
| 658 | 
  | 
void DUFF::readParams( void ){ | 
| 659 | 
  | 
 | 
| 641 | 
– | 
  int i, a, b, c, d; | 
| 660 | 
  | 
  int identNum; | 
| 643 | 
– | 
  char* atomA; | 
| 644 | 
– | 
  char* atomB; | 
| 645 | 
– | 
  char* atomC; | 
| 646 | 
– | 
  char* atomD; | 
| 661 | 
  | 
   | 
| 662 | 
  | 
  atomStruct atomInfo; | 
| 663 | 
  | 
  bondStruct bondInfo; | 
| 778 | 
  | 
   | 
| 779 | 
  | 
  int isGB = 0; | 
| 780 | 
  | 
  int isLJ = 1; | 
| 781 | 
< | 
  double GB_dummy = 0.0; | 
| 782 | 
< | 
   | 
| 769 | 
< | 
   | 
| 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' ){ | 
| 799 | 
  | 
                 &(currentAtomType->isSSD), | 
| 800 | 
  | 
                 &(currentAtomType->isDipole), | 
| 801 | 
  | 
                 &isGB, | 
| 802 | 
+ | 
                 &isEAM, | 
| 803 | 
  | 
                 &(currentAtomType->epslon), | 
| 804 | 
  | 
                 &(currentAtomType->sigma), | 
| 805 | 
  | 
                 &(currentAtomType->dipole), | 
| 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, | 
| 1319 | 
  | 
                             currentBendType->k3, | 
| 1320 | 
  | 
                             currentBendType->t0 ); | 
| 1321 | 
  | 
        bendArray[i] = qBend; | 
| 1322 | 
< | 
      } | 
| 1322 | 
> | 
      }       | 
| 1323 | 
  | 
    } | 
| 1324 | 
  | 
  } | 
| 1325 | 
  | 
} | 
| 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 | 
  | 
   | 
| 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]; | 
| 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; | 
| 1631 | 
  | 
    else{ | 
| 1632 | 
  | 
      sprintf( painCave.errMsg,  | 
| 1633 | 
  | 
               "Unknown DUFF bond type \"%s\" at line %d\n", | 
| 1634 | 
< | 
               info.type, | 
| 1634 | 
> | 
               bondType, | 
| 1635 | 
  | 
               lineNum ); | 
| 1636 | 
  | 
      painCave.isFatal = 1; | 
| 1637 | 
  | 
      simError(); | 
| 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 | 
  | 
   | 
| 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 | 
  | 
 |