# | Line 454 | Line 454 | DUFF::DUFF(){ | |
---|---|---|
454 | ||
455 | DUFF::DUFF(){ | |
456 | ||
457 | < | char fileName[200]; |
458 | < | char* ffPath_env = "FORCE_PARAM_PATH"; |
459 | < | char* ffPath; |
460 | < | char temp[200]; |
457 | > | string fileName; |
458 | > | string tempString; |
459 | ||
460 | headAtomType = NULL; | |
461 | currentAtomType = NULL; | |
# | Line 567 | Line 565 | DUFF::DUFF(){ | |
565 | ||
566 | // generate the force file name | |
567 | ||
568 | < | strcpy( fileName, "DUFF.frc" ); |
568 | > | fileName = "DUFF.frc"; |
569 | // fprintf( stderr,"Trying to open %s\n", fileName ); | |
570 | ||
571 | // attempt to open the file in the current directory first. | |
572 | ||
573 | < | frcFile = fopen( fileName, "r" ); |
573 | > | frcFile = fopen( fileName.c_str(), "r" ); |
574 | ||
575 | if( frcFile == NULL ){ | |
576 | ||
577 | // next see if the force path enviorment variable is set | |
578 | < | |
579 | < | ffPath = getenv( ffPath_env ); |
580 | < | if( ffPath == NULL ) { |
581 | < | STR_DEFINE(ffPath, FRC_PATH ); |
582 | < | } |
578 | > | |
579 | > | tempString = ffPath + "/" + fileName; |
580 | > | fileName = tempString; |
581 | > | |
582 | > | frcFile = fopen( fileName.c_str(), "r" ); |
583 | ||
586 | – | |
587 | – | strcpy( temp, ffPath ); |
588 | – | strcat( temp, "/" ); |
589 | – | strcat( temp, fileName ); |
590 | – | strcpy( fileName, temp ); |
591 | – | |
592 | – | frcFile = fopen( fileName, "r" ); |
593 | – | |
584 | if( frcFile == NULL ){ | |
585 | ||
586 | sprintf( painCave.errMsg, | |
# | Line 598 | Line 588 | DUFF::DUFF(){ | |
588 | "\t%s\n" | |
589 | "\tHave you tried setting the FORCE_PARAM_PATH environment " | |
590 | "variable?\n", | |
591 | < | fileName ); |
591 | > | fileName.c_str() ); |
592 | painCave.severity = OOPSE_ERROR; | |
593 | painCave.isFatal = 1; | |
594 | simError(); | |
# | Line 657 | Line 647 | void DUFF::initForceField(){ | |
647 | initFortran( entry_plug->useReactionField ); | |
648 | } | |
649 | ||
660 | – | double DUFF::getAtomTypeMass (char* atomType) { |
650 | ||
662 | – | currentAtomType = headAtomType->find( atomType ); |
663 | – | if( currentAtomType == NULL ){ |
664 | – | sprintf( painCave.errMsg, |
665 | – | "AtomType error, %s not found in force file.\n", |
666 | – | atomType ); |
667 | – | painCave.isFatal = 1; |
668 | – | simError(); |
669 | – | } |
670 | – | |
671 | – | return currentAtomType->mass; |
672 | – | } |
673 | – | |
651 | void DUFF::readParams( void ){ | |
652 | ||
653 | int identNum, isError; | |
# | Line 790 | Line 767 | void DUFF::readParams( void ){ | |
767 | if( currentAtomType->name[0] != '\0' ){ | |
768 | ||
769 | if (currentAtomType->isSSD || currentAtomType->isDipole) | |
770 | < | DirectionalAtomType* at = new DirectionalAtomType(); |
770 | > | at = new DirectionalAtomType(); |
771 | else | |
772 | < | AtomType* at = new AtomType(); |
772 | > | at = new AtomType(); |
773 | ||
774 | if (currentAtomType->isSSD) { | |
775 | ((DirectionalAtomType*)at)->setSticky(); | |
799 | – | entry_plug->useSticky = 1; |
776 | } | |
777 | ||
778 | if (currentAtomType->isDipole) { | |
779 | ((DirectionalAtomType*)at)->setDipole(); | |
804 | – | entry_plug->useDipoles = 1; |
780 | } | |
781 | ||
782 | at->setIdent(currentAtomType->ident); | |
# | Line 1108 | Line 1083 | void DUFF::readParams( void ){ | |
1083 | MPIcheckPoint(); | |
1084 | ||
1085 | #endif // is_mpi | |
1111 | – | |
1112 | – | entry_plug->useLennardJones = 1; |
1086 | } | |
1087 | ||
1088 | ||
# | Line 1169 | Line 1142 | void DUFF::initializeAtoms( int nAtoms, Atom** the_ato | |
1142 | the_atoms[i]->setMass( currentAtomType->mass ); | |
1143 | the_atoms[i]->setIdent( currentAtomType->ident ); | |
1144 | ||
1145 | + | if (currentAtomType->isSSD) entry_plug->useSticky = 1; |
1146 | + | if (currentAtomType->isDipole) entry_plug->useDipoles = 1; |
1147 | + | // Fix this later. We'll set it a bunch of times. |
1148 | + | entry_plug->useLennardJones = 1; |
1149 | + | |
1150 | + | |
1151 | if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma; | |
1152 | ||
1153 | if( currentAtomType->isDipole ){ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |