ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/UseTheForce/WATER.cpp
(Generate patch)

Comparing:
trunk/OOPSE-4/src/UseTheForce/WATER.cpp (file contents), Revision 1650 by gezelter, Tue Oct 26 22:24:52 2004 UTC vs.
branches/new_design/OOPSE-4/src/UseTheForce/WATER.cpp (file contents), Revision 1683, Thu Oct 28 22:34:02 2004 UTC

# Line 12 | Line 12 | using namespace std;
12   #include "UseTheForce/ForceFields.hpp"
13   #include "primitives/SRI.hpp"
14   #include "utils/simError.h"
15 + #include "types/AtomType.hpp"
16   #include "types/DirectionalAtomType.hpp"
17   #include "UseTheForce/DarkSide/lj_interface.h"
18   #include "UseTheForce/DarkSide/charge_interface.h"
# Line 246 | Line 247 | WATER::WATER(){
247  
248   WATER::WATER(){
249  
250 <  char fileName[200];
251 <  char* ffPath_env = "FORCE_PARAM_PATH";
251 <  char* ffPath;
252 <  char temp[200];
250 >  string fileName;
251 >  string tempString;
252  
253    headAtomType = NULL;
254    currentAtomType = NULL;
# Line 309 | Line 308 | WATER::WATER(){
308    if( worldRank == 0 ){
309   #endif
310      
311 <    // generate the force file name
312 <    
313 <    strcpy( fileName, "WATER.frc" );
311 >    // generate the force file name  
312 >
313 >    fileName = "WATER.frc";
314 >
315      //    fprintf( stderr,"Trying to open %s\n", fileName );
316      
317      // attempt to open the file in the current directory first.
318      
319 <    frcFile = fopen( fileName, "r" );
319 >    frcFile = fopen( fileName.c_str(), "r" );
320      
321      if( frcFile == NULL ){
322        
323 <      // next see if the force path enviorment variable is set
324 <      
325 <      ffPath = getenv( ffPath_env );
326 <      if( ffPath == NULL ) {
327 <        STR_DEFINE(ffPath, FRC_PATH );
328 <      }
329 <      
323 >      tempString = ffPath + "/" + fileName;
324 >      fileName = tempString;
325        
326 <      strcpy( temp, ffPath );
332 <      strcat( temp, "/" );
333 <      strcat( temp, fileName );
334 <      strcpy( fileName, temp );
326 >      frcFile = fopen( fileName.c_str(), "r" );
327        
336      frcFile = fopen( fileName, "r" );
337      
328        if( frcFile == NULL ){
329          
330          sprintf( painCave.errMsg,
# Line 342 | Line 332 | WATER::WATER(){
332                   "\t%s\n"
333                   "\tHave you tried setting the FORCE_PARAM_PATH environment "
334                   "variable?\n",
335 <                 fileName );
335 >                 fileName.c_str() );
336          painCave.severity = OOPSE_ERROR;
337          painCave.isFatal = 1;
338          simError();
# Line 406 | Line 396 | void WATER::readParams( void ){
396    atomStruct atomInfo;
397    directionalStruct directionalInfo;
398    fpos_t *atomPos;
409
399    AtomType* at;
400  
401    atomInfo.last = 1;         // initialize last to have the last set.
# Line 555 | Line 544 | void WATER::readParams( void ){
544    while( currentAtomType != NULL ){
545      if( currentAtomType->name[0] != '\0' ){
546        if (currentAtomType->isDirectional)
547 <        DirectionalAtomType* at = new DirectionalAtomType();
547 >        at = new DirectionalAtomType();        
548        else
549 <        AtomType* at = new AtomType();
550 <
549 >        at = new AtomType();
550 >      
551        if (currentAtomType->isLJ) {
552          at->setLennardJones();
553        }
# Line 568 | Line 557 | void WATER::readParams( void ){
557        }
558  
559        if (currentAtomType->isDirectional) {
560 <        if (currentDirectionalType->isSticky) {
560 >        if (currentDirectionalType->isDipole) {
561            ((DirectionalAtomType*)at)->setDipole();
562            entry_plug->useDipoles = 1;
563          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines