--- trunk/src/brains/SimInfo.cpp 2005/11/03 23:12:27 716 +++ trunk/src/brains/SimInfo.cpp 2005/11/11 15:22:11 726 @@ -55,9 +55,11 @@ #include "UseTheForce/fCutoffPolicy.h" #include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" #include "UseTheForce/DarkSide/fElectrostaticScreeningMethod.h" +#include "UseTheForce/DarkSide/fSwitchingFunctionType.h" #include "UseTheForce/doForces_interface.h" #include "UseTheForce/DarkSide/electrostatic_interface.h" #include "UseTheForce/notifyCutoffs_interface.h" +#include "UseTheForce/DarkSide/switcheroo_interface.h" #include "utils/MemoryUtils.hpp" #include "utils/simError.h" #include "selection/SelectionManager.hpp" @@ -472,6 +474,7 @@ namespace oopse { int isError = 0; setupElectrostaticSummationMethod( isError ); + setupSwitchingFunction(); if(isError){ sprintf( painCave.errMsg, @@ -529,12 +532,12 @@ namespace oopse { //usePBC and useRF are from simParams int usePBC = simParams_->getUsePeriodicBoundaryConditions(); int useRF; - int useDW; + int useSF; std::string myMethod; // set the useRF logical useRF = 0; - useDW = 0; + useSF = 0; if (simParams_->haveElectrostaticSummationMethod()) { @@ -543,8 +546,8 @@ namespace oopse { if (myMethod == "REACTION_FIELD") { useRF=1; } else { - if (myMethod == "SHIFTED_POTENTIAL") { - useDW = 1; + if (myMethod == "SHIFTED_FORCE") { + useSF = 1; } } } @@ -613,8 +616,8 @@ namespace oopse { temp = useRF; MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); - temp = useDW; - MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); + temp = useSF; + MPI_Allreduce(&temp, &useSF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); #endif @@ -631,7 +634,7 @@ namespace oopse { fInfo_.SIM_uses_Shapes = useShape; fInfo_.SIM_uses_FLARB = useFLARB; fInfo_.SIM_uses_RF = useRF; - fInfo_.SIM_uses_DampedWolf = useDW; + fInfo_.SIM_uses_SF = useSF; if( myMethod == "REACTION_FIELD") { @@ -977,7 +980,33 @@ namespace oopse { setReactionFieldDielectric( &dielectric ); initFortranFF( &esm, &errorOut ); } + + void SimInfo::setupSwitchingFunction() { + int ft = CUBIC; + if (simParams_->haveSwitchingFunctionType()) { + std::string funcType = simParams_->getSwitchingFunctionType(); + toUpper(funcType); + if (funcType == "CUBIC") { + ft = CUBIC; + } else { + if (funcType == "FIFTH_ORDER_POLYNOMIAL") { + ft = FIFTH_ORDER_POLY; + } else { + // throw error + sprintf( painCave.errMsg, + "SimInfo error: Unknown switchingFunctionType. (Input file specified %s .)\n\tswitchingFunctionType must be one of: \"cubic\" or \"fifth_order_polynomial\".", funcType.c_str() ); + painCave.isFatal = 1; + simError(); + } + } + } + + // send switching function notification to switcheroo + setFunctionType(&ft); + + } + void SimInfo::addProperty(GenericData* genData) { properties_.addProperty(genData); }