--- trunk/src/brains/SimInfo.cpp 2005/09/15 00:14:35 598 +++ trunk/src/brains/SimInfo.cpp 2005/09/26 15:58:17 629 @@ -53,8 +53,9 @@ #include "math/Vector3.hpp" #include "primitives/Molecule.hpp" #include "UseTheForce/fCutoffPolicy.h" -#include "UseTheForce/fCoulombicCorrection.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" @@ -465,7 +466,7 @@ namespace oopse { /** @deprecate */ int isError = 0; - setupCoulombicCorrection( isError ); + setupElectrostaticSummationMethod( isError ); if(isError){ sprintf( painCave.errMsg, @@ -522,7 +523,14 @@ namespace oopse { int useElectrostatics = 0; //usePBC and useRF are from simParams int usePBC = simParams_->getPBC(); - int useRF = simParams_->getUseRF(); + 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) { @@ -588,12 +596,6 @@ namespace oopse { temp = useRF; MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); - temp = useUW; - MPI_Allreduce(&temp, &useUW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); - - temp = useDW; - MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); - #endif fInfo_.SIM_uses_PBC = usePBC; @@ -610,7 +612,7 @@ namespace oopse { 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(); @@ -866,43 +868,53 @@ namespace oopse { } } } + } + + + if (simParams_->haveSkinThickness()) { + double skinThickness = simParams_->getSkinThickness(); } + notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); + // also send cutoff notification to electrostatics + setElectrostaticCutoffRadius(&rcut_); } - void SimInfo::setupCoulombicCorrection( int isError ) { + void SimInfo::setupElectrostaticSummationMethod( int isError ) { int errorOut; - int cc = NONE; + int esm = NONE; double alphaVal; + double dielectric; errorOut = isError; + alphaVal = simParams_->getDampingAlpha(); + dielectric = simParams_->getDielectric(); - if (simParams_->haveCoulombicCorrection()) { - std::string myCorrection = simParams_->getCoulombicCorrection(); - if (myCorrection == "NONE") { - cc = NONE; + if (simParams_->haveElectrostaticSummationMethod()) { + std::string myMethod = simParams_->getElectrostaticSummationMethod(); + if (myMethod == "NONE") { + esm = NONE; } else { - if (myCorrection == "UNDAMPED_WOLF") { - cc = UNDAMPED_WOLF; + if (myMethod == "UNDAMPED_WOLF") { + esm = UNDAMPED_WOLF; } else { - if (myCorrection == "WOLF") { - cc = WOLF; + if (myMethod == "DAMPED_WOLF") { + esm = DAMPED_WOLF; 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 Wolf Coulombic Correction.", 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 (myCorrection == "REACTION_FIELD") { - cc = REACTION_FIELD; + if (myMethod == "REACTION_FIELD") { + esm = REACTION_FIELD; } else { // throw error sprintf( painCave.errMsg, - "SimInfo error: Unknown coulombicCorrection. (Input file specified %s .)\n\tcoulombicCorrection must be one of: \"none\", \"undamped_wolf\", \"wolf\", or \"reaction_field\".", myCorrection.c_str() ); + "SimInfo error: Unknown electrostaticSummationMethod. (Input file specified %s .)\n\telectrostaticSummationMethod must be one of: \"none\", \"undamped_wolf\", \"damped_wolf\", or \"reaction_field\".", myMethod.c_str() ); painCave.isFatal = 1; simError(); } @@ -910,7 +922,11 @@ namespace oopse { } } } - initFortranFF( &fInfo_.SIM_uses_RF, &cc, &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) {