ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DUFF.cpp (file contents):
Revision 631 by chuckv, Thu Jul 17 19:25:51 2003 UTC vs.
Revision 941 by gezelter, Tue Jan 13 23:01:43 2004 UTC

# 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 32 | Line 32 | namespace DUFF_NS {  // restrict the access of the fol
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
# Line 138 | Line 145 | namespace DUFF_NS {  // restrict the access of the fol
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      }
# Line 154 | Line 166 | namespace DUFF_NS {  // restrict the access of the fol
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      }
# Line 170 | Line 187 | namespace DUFF_NS {  // restrict the access of the fol
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    };
# Line 434 | Line 456 | DUFF::DUFF(){
456    char* ffPath_env = "FORCE_PARAM_PATH";
457    char* ffPath;
458    char temp[200];
437  char errMsg[1000];
459  
460    headAtomType       = NULL;
461    currentAtomType    = NULL;
# Line 456 | Line 477 | DUFF::DUFF(){
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  
# Line 638 | Line 659 | void DUFF::readParams( void ){
659  
660   void DUFF::readParams( void ){
661  
641  int i, a, b, c, d;
662    int identNum;
643  char* atomA;
644  char* atomB;
645  char* atomC;
646  char* atomD;
663    
664    atomStruct atomInfo;
665    bondStruct bondInfo;
# Line 765 | Line 781 | void DUFF::readParams( void ){
781    int isGB = 0;
782    int isLJ = 1;
783    int isEAM =0;
784 <  double GB_dummy = 0.0;
785 <  
786 <  
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' ){
# Line 785 | Line 804 | void DUFF::readParams( void ){
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 ){
# Line 1287 | Line 1308 | void DUFF::initializeBends( int nBends, Bend** bendArr
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,
# Line 1303 | Line 1325 | void DUFF::initializeBends( int nBends, Bend** bendArr
1325                               currentBendType->k3,
1326                               currentBendType->t0 );
1327          bendArray[i] = qBend;
1328 <      }
1328 >      }      
1329      }
1330    }
1331   }
# Line 1496 | Line 1518 | int DUFF_NS::parseAtom( char *lineBuffer, int lineNum,
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    }
# Line 1543 | Line 1609 | int DUFF_NS::parseBond( char *lineBuffer, int lineNum,
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;
# Line 1569 | Line 1637 | int DUFF_NS::parseBond( char *lineBuffer, int lineNum,
1637      else{
1638        sprintf( painCave.errMsg,
1639                 "Unknown DUFF bond type \"%s\" at line %d\n",
1640 <               info.type,
1640 >               bondType,
1641                 lineNum );
1642        painCave.isFatal = 1;
1643        simError();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines