ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/src/brains/SimInfo.cpp (file contents):
Revision 1049 by chrisfen, Thu Sep 21 18:25:17 2006 UTC vs.
Revision 1050 by chrisfen, Fri Sep 22 22:19:59 2006 UTC

# Line 783 | Line 783 | namespace oopse {
783      fInfo_.SIM_uses_SF = useSF;
784      fInfo_.SIM_uses_SP = useSP;
785      fInfo_.SIM_uses_BoxDipole = useBoxDipole;
786
787    if( myMethod == "REACTION_FIELD") {
788      
789      if (simParams_->haveDielectric()) {
790        fInfo_.dielect = simParams_->getDielectric();
791      } else {
792        sprintf(painCave.errMsg,
793                "SimSetup Error: No Dielectric constant was set.\n"
794                "\tYou are trying to use Reaction Field without"
795                "\tsetting a dielectric constant!\n");
796        painCave.isFatal = 1;
797        simError();
798      }      
799    }
800
786    }
787  
788    void SimInfo::setupFortranSim() {
# Line 1075 | Line 1060 | namespace oopse {
1060      RealType dielectric;
1061      
1062      errorOut = isError;
1078    dielectric = simParams_->getDielectric();
1063  
1064      if (simParams_->haveElectrostaticSummationMethod()) {
1065        std::string myMethod = simParams_->getElectrostaticSummationMethod();
# Line 1092 | Line 1076 | namespace oopse {
1076              if (myMethod == "SHIFTED_FORCE") {            
1077                esm = SHIFTED_FORCE;
1078              } else {
1079 <              if (myMethod == "REACTION_FIELD") {            
1079 >              if (myMethod == "REACTION_FIELD") {
1080                  esm = REACTION_FIELD;
1081 +                dielectric = simParams_->getDielectric();
1082 +                if (!simParams_->haveDielectric()) {
1083 +                  // throw warning
1084 +                  sprintf( painCave.errMsg,
1085 +                           "SimInfo warning: dielectric was not specified in the input file\n\tfor the reaction field correction method.\n"
1086 +                           "\tA default value of %f will be used for the dielectric.\n", dielectric);
1087 +                  painCave.isFatal = 0;
1088 +                  simError();
1089 +                }
1090                } else {
1091                  // throw error        
1092                  sprintf( painCave.errMsg,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines