| 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; | 
| 65 | 
  | 
      if( !strcmp( info.name, name ) ){ | 
| 66 | 
  | 
        sprintf( painCave.errMsg, | 
| 67 | 
  | 
                 "Duplicate LJ atom type \"%s\" found in " | 
| 68 | 
< | 
                 "the LJ_FF param file./n", | 
| 68 | 
> | 
                 "the LJFF param file./n", | 
| 69 | 
  | 
                 name ); | 
| 70 | 
  | 
        painCave.isFatal = 1; | 
| 71 | 
  | 
        simError(); | 
| 117 | 
  | 
//**************************************************************** | 
| 118 | 
  | 
 | 
| 119 | 
  | 
 | 
| 120 | 
< | 
LJ_FF::LJ_FF(){ | 
| 120 | 
> | 
LJFF::LJFF(){ | 
| 121 | 
  | 
 | 
| 122 | 
  | 
  char fileName[200]; | 
| 123 | 
  | 
  char* ffPath_env = "FORCE_PARAM_PATH"; | 
| 124 | 
  | 
  char* ffPath; | 
| 125 | 
  | 
  char temp[200]; | 
| 126 | 
– | 
  char errMsg[1000]; | 
| 126 | 
  | 
 | 
| 127 | 
  | 
  headAtomType = NULL; | 
| 128 | 
  | 
  currentAtomType = NULL; | 
| 161 | 
  | 
     | 
| 162 | 
  | 
    // generate the force file name | 
| 163 | 
  | 
     | 
| 164 | 
< | 
    strcpy( fileName, "LJ_FF.frc" );  | 
| 165 | 
< | 
    //    fprintf( stderr,"Trying to open %s\n", fileName ); | 
| 164 | 
> | 
    strcpy( fileName, "LJFF.frc" );  | 
| 165 | 
> | 
    fprintf( stderr,"Trying to open %s\n", fileName ); | 
| 166 | 
  | 
     | 
| 167 | 
  | 
    // attempt to open the file in the current directory first. | 
| 168 | 
  | 
     | 
| 200 | 
  | 
#ifdef IS_MPI | 
| 201 | 
  | 
  } | 
| 202 | 
  | 
   | 
| 203 | 
< | 
  sprintf( checkPointMsg, "LJ_FF file opened sucessfully." ); | 
| 203 | 
> | 
  sprintf( checkPointMsg, "LJFF file opened sucessfully." ); | 
| 204 | 
  | 
  MPIcheckPoint(); | 
| 205 | 
  | 
   | 
| 206 | 
  | 
#endif // is_mpi | 
| 207 | 
  | 
} | 
| 208 | 
  | 
 | 
| 209 | 
  | 
 | 
| 210 | 
< | 
LJ_FF::~LJ_FF(){ | 
| 210 | 
> | 
LJFF::~LJFF(){ | 
| 211 | 
  | 
 | 
| 212 | 
  | 
  if( headAtomType != NULL ) delete headAtomType; | 
| 213 | 
  | 
 | 
| 222 | 
  | 
#endif // is_mpi | 
| 223 | 
  | 
} | 
| 224 | 
  | 
 | 
| 225 | 
< | 
void LJ_FF::initForceField( int ljMixRule ){ | 
| 225 | 
> | 
void LJFF::initForceField( int ljMixRule ){ | 
| 226 | 
  | 
   | 
| 227 | 
  | 
  initFortran( ljMixRule, 0 ); | 
| 228 | 
  | 
} | 
| 229 | 
  | 
 | 
| 230 | 
< | 
void LJ_FF::cleanMe( void ){ | 
| 230 | 
> | 
void LJFF::cleanMe( void ){ | 
| 231 | 
  | 
 | 
| 232 | 
  | 
#ifdef IS_MPI | 
| 233 | 
  | 
   | 
| 242 | 
  | 
#endif // is_mpi | 
| 243 | 
  | 
} | 
| 244 | 
  | 
 | 
| 245 | 
< | 
void LJ_FF::readParams( void ){ | 
| 245 | 
> | 
void LJFF::readParams( void ){ | 
| 246 | 
  | 
 | 
| 247 | 
  | 
  atomStruct info; | 
| 248 | 
  | 
  info.last = 1; // initialize last to have the last set.  | 
| 249 | 
  | 
                 // if things go well, last will be set to 0 | 
| 250 | 
  | 
 | 
| 252 | 
– | 
  int i; | 
| 251 | 
  | 
  int identNum; | 
| 252 | 
  | 
   | 
| 253 | 
  | 
 | 
| 301 | 
  | 
    // send out the linked list to all the other processes | 
| 302 | 
  | 
 | 
| 303 | 
  | 
    sprintf( checkPointMsg, | 
| 304 | 
< | 
             "LJ_FF atom structures read successfully." ); | 
| 304 | 
> | 
             "LJFF atom structures read successfully." ); | 
| 305 | 
  | 
    MPIcheckPoint(); | 
| 306 | 
  | 
 | 
| 307 | 
  | 
    currentAtomType = headAtomType->next; //skip the first element who is a place holder. | 
| 355 | 
  | 
  int isDipole = 0; | 
| 356 | 
  | 
  int isSSD = 0; | 
| 357 | 
  | 
  int isGB = 0; | 
| 358 | 
+ | 
  int isEAM = 0; | 
| 359 | 
  | 
  double dipole = 0.0; | 
| 360 | 
  | 
   | 
| 361 | 
  | 
  currentAtomType = headAtomType; | 
| 368 | 
  | 
                 &isSSD, | 
| 369 | 
  | 
                 &isDipole, | 
| 370 | 
  | 
                 &isGB, | 
| 371 | 
+ | 
                 &isEAM, | 
| 372 | 
  | 
                 &(currentAtomType->epslon), | 
| 373 | 
  | 
                 &(currentAtomType->sigma), | 
| 374 | 
  | 
                 &dipole, | 
| 388 | 
  | 
 | 
| 389 | 
  | 
#ifdef IS_MPI | 
| 390 | 
  | 
  sprintf( checkPointMsg, | 
| 391 | 
< | 
           "LJ_FF atom structures successfully sent to fortran\n" ); | 
| 391 | 
> | 
           "LJFF atom structures successfully sent to fortran\n" ); | 
| 392 | 
  | 
  MPIcheckPoint(); | 
| 393 | 
  | 
#endif // is_mpi | 
| 394 | 
  | 
 | 
| 395 | 
  | 
} | 
| 396 | 
  | 
 | 
| 397 | 
  | 
 | 
| 398 | 
< | 
void LJ_FF::initializeAtoms( int nAtoms, Atom** the_atoms ){ | 
| 398 | 
> | 
void LJFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ | 
| 399 | 
  | 
   | 
| 400 | 
  | 
  int i; | 
| 401 | 
  | 
 | 
| 402 | 
  | 
  // initialize the atoms | 
| 403 | 
  | 
   | 
| 404 | 
  | 
 | 
| 405 | 
– | 
  Atom* thisAtom; | 
| 406 | 
– | 
 | 
| 405 | 
  | 
  for( i=0; i<nAtoms; i++ ){ | 
| 406 | 
  | 
     | 
| 407 | 
  | 
    currentAtomType = headAtomType->find( the_atoms[i]->getType() ); | 
| 423 | 
  | 
  } | 
| 424 | 
  | 
} | 
| 425 | 
  | 
 | 
| 426 | 
< | 
void LJ_FF::initializeBonds( int nBonds, Bond** BondArray, | 
| 426 | 
> | 
void LJFF::initializeBonds( int nBonds, Bond** BondArray, | 
| 427 | 
  | 
                             bond_pair* the_bonds ){ | 
| 428 | 
  | 
   | 
| 429 | 
  | 
    if( nBonds ){ | 
| 430 | 
  | 
      sprintf( painCave.errMsg, | 
| 431 | 
< | 
               "LJ_FF does not support bonds.\n" ); | 
| 431 | 
> | 
               "LJFF does not support bonds.\n" ); | 
| 432 | 
  | 
      painCave.isFatal = 1; | 
| 433 | 
  | 
      simError(); | 
| 434 | 
  | 
    } | 
| 435 | 
  | 
} | 
| 436 | 
  | 
 | 
| 437 | 
< | 
void LJ_FF::initializeBends( int nBends, Bend** bendArray, | 
| 437 | 
> | 
void LJFF::initializeBends( int nBends, Bend** bendArray, | 
| 438 | 
  | 
                             bend_set* the_bends ){ | 
| 439 | 
  | 
 | 
| 440 | 
  | 
    if( nBends ){ | 
| 441 | 
  | 
      sprintf( painCave.errMsg, | 
| 442 | 
< | 
               "LJ_FF does not support bends.\n" ); | 
| 442 | 
> | 
               "LJFF does not support bends.\n" ); | 
| 443 | 
  | 
      painCave.isFatal = 1; | 
| 444 | 
  | 
      simError(); | 
| 445 | 
  | 
    } | 
| 446 | 
  | 
} | 
| 447 | 
  | 
 | 
| 448 | 
< | 
void LJ_FF::initializeTorsions( int nTorsions, Torsion** torsionArray, | 
| 448 | 
> | 
void LJFF::initializeTorsions( int nTorsions, Torsion** torsionArray, | 
| 449 | 
  | 
                                torsion_set* the_torsions ){ | 
| 450 | 
  | 
 | 
| 451 | 
  | 
    if( nTorsions ){ | 
| 452 | 
  | 
      sprintf( painCave.errMsg, | 
| 453 | 
< | 
               "LJ_FF does not support torsions.\n" ); | 
| 453 | 
> | 
               "LJFF does not support torsions.\n" ); | 
| 454 | 
  | 
      painCave.isFatal = 1; | 
| 455 | 
  | 
      simError(); | 
| 456 | 
  | 
    } | 
| 457 | 
  | 
} | 
| 458 | 
  | 
 | 
| 459 | 
< | 
void LJ_FF::fastForward( char* stopText, char* searchOwner ){ | 
| 459 | 
> | 
void LJFF::fastForward( char* stopText, char* searchOwner ){ | 
| 460 | 
  | 
 | 
| 461 | 
  | 
  int foundText = 0; | 
| 462 | 
  | 
  char* the_token; |