--- trunk/src/brains/SimInfo.cpp 2005/09/16 21:07:45 608 +++ trunk/src/brains/SimInfo.cpp 2005/09/19 23:21:46 611 @@ -55,6 +55,7 @@ #include "UseTheForce/fCutoffPolicy.h" #include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" #include "UseTheForce/doForces_interface.h" +#include "UseTheForce/DarkSide/electrostatic_interface.h" #include "UseTheForce/notifyCutoffs_interface.h" #include "utils/MemoryUtils.hpp" #include "utils/simError.h" @@ -522,7 +523,15 @@ namespace oopse { int useElectrostatics = 0; //usePBC and useRF are from simParams int usePBC = simParams_->getPBC(); + int useRF; + // set the useRF logical + std::string myMethod = simParams_->getElectrostaticSummationMethod(); + if (myMethod == "REACTION_FIELD") + useRF = 1; + else + useRF = 0; + //loop over all of the atom types for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { useLennardJones |= (*i)->isLennardJones(); @@ -584,6 +593,9 @@ namespace oopse { temp = useFLARB; MPI_Allreduce(&temp, &useFLARB, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); + temp = useRF; + MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); + #endif fInfo_.SIM_uses_PBC = usePBC; @@ -598,8 +610,9 @@ namespace oopse { fInfo_.SIM_uses_EAM = useEAM; fInfo_.SIM_uses_Shapes = useShape; fInfo_.SIM_uses_FLARB = useFLARB; + fInfo_.SIM_uses_RF = useRF; - if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) { + if( fInfo_.SIM_uses_Dipoles && myMethod == "REACTION_FIELD") { if (simParams_->haveDielectric()) { fInfo_.dielect = simParams_->getDielectric(); @@ -857,6 +870,8 @@ namespace oopse { } } notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); + // also send cutoff notification to electrostatics + setElectrostaticCutoffRadius(&rcut_); } void SimInfo::setupElectrostaticSummationMethod( int isError ) { @@ -864,8 +879,11 @@ namespace oopse { int errorOut; int esm = NONE; double alphaVal; + double dielectric; errorOut = isError; + alphaVal = simParams_->getDampingAlpha(); + dielectric = simParams_->getDielectric(); if (simParams_->haveElectrostaticSummationMethod()) { std::string myMethod = simParams_->getElectrostaticSummationMethod(); @@ -880,11 +898,10 @@ namespace oopse { if (!simParams_->haveDampingAlpha()) { //throw error sprintf( painCave.errMsg, - "SimInfo warning: dampingAlpha was not specified in the input file. A default value of %f (1/ang) will be used for the Damped Wolf Method.", simParams_->getDampingAlpha()); + "SimInfo warning: dampingAlpha was not specified in the input file. A default value of %f (1/ang) will be used for the Damped Wolf Method.", alphaVal); painCave.isFatal = 0; simError(); } - alphaVal = simParams_->getDampingAlpha(); } else { if (myMethod == "REACTION_FIELD") { esm = REACTION_FIELD; @@ -899,7 +916,11 @@ namespace oopse { } } } - initFortranFF( &esm, &alphaVal, &errorOut ); + // let's pass some summation method variables to fortran + setElectrostaticSummationMethod( &esm ); + setDampedWolfAlpha( &alphaVal ); + setReactionFieldDielectric( &dielectric ); + initFortranFF( &esm, &errorOut ); } void SimInfo::addProperty(GenericData* genData) {