--- trunk/src/brains/SimInfo.cpp 2005/05/31 22:31:54 557 +++ trunk/src/brains/SimInfo.cpp 2005/09/07 20:46:46 586 @@ -52,6 +52,7 @@ #include "brains/SimInfo.hpp" #include "math/Vector3.hpp" #include "primitives/Molecule.hpp" +#include "UseTheForce/fCutoffPolicy.h" #include "UseTheForce/doForces_interface.h" #include "UseTheForce/notifyCutoffs_interface.h" #include "utils/MemoryUtils.hpp" @@ -462,7 +463,8 @@ namespace oopse { //setup fortran force field /** @deprecate */ int isError = 0; - initFortranFF( &fInfo_.SIM_uses_RF , &isError ); + initFortranFF( &fInfo_.SIM_uses_RF, &fInfo_.SIM_uses_UW, + &fInfo_.SIM_uses_DW, &isError ); if(isError){ sprintf( painCave.errMsg, "ForceField error: There was an error initializing the forceField in fortran.\n" ); @@ -519,6 +521,8 @@ namespace oopse { //usePBC and useRF are from simParams int usePBC = simParams_->getPBC(); int useRF = simParams_->getUseRF(); + int useUW = simParams_->getUseUndampedWolf(); + int useDW = simParams_->getUseDampedWolf(); //loop over all of the atom types for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { @@ -583,6 +587,12 @@ 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 @@ -599,6 +609,8 @@ namespace oopse { fInfo_.SIM_uses_Shapes = useShape; fInfo_.SIM_uses_FLARB = useFLARB; fInfo_.SIM_uses_RF = useRF; + fInfo_.SIM_uses_UW = useUW; + fInfo_.SIM_uses_DW = useDW; if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) { @@ -830,12 +842,34 @@ namespace oopse { } } - void SimInfo::setupCutoff() { + void SimInfo::setupCutoff() { getCutoff(rcut_, rsw_); double rnblist = rcut_ + 1; // skin of neighbor list //Pass these cutoff radius etc. to fortran. This function should be called once and only once - notifyFortranCutoffs(&rcut_, &rsw_, &rnblist); + + int cp = TRADITIONAL_CUTOFF_POLICY; + if (simParams_->haveCutoffPolicy()) { + std::string myPolicy = simParams_->getCutoffPolicy(); + if (myPolicy == "MIX") { + cp = MIX_CUTOFF_POLICY; + } else { + if (myPolicy == "MAX") { + cp = MAX_CUTOFF_POLICY; + } else { + if (myPolicy == "TRADITIONAL") { + cp = TRADITIONAL_CUTOFF_POLICY; + } else { + // throw error + sprintf( painCave.errMsg, + "SimInfo error: Unknown cutoffPolicy. (Input file specified %s .)\n\tcutoffPolicy must be one of: \"Mix\", \"Max\", or \"Traditional\".", myPolicy.c_str() ); + painCave.isFatal = 1; + simError(); + } + } + } + } + notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); } void SimInfo::addProperty(GenericData* genData) {