| 54 |
|
#include "primitives/Molecule.hpp" |
| 55 |
|
#include "UseTheForce/fCutoffPolicy.h" |
| 56 |
|
#include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" |
| 57 |
< |
#include "UseTheForce/DarkSide/fScreeningMethod.h" |
| 57 |
> |
#include "UseTheForce/DarkSide/fElectrostaticScreeningMethod.h" |
| 58 |
> |
#include "UseTheForce/DarkSide/fSwitchingFunctionType.h" |
| 59 |
|
#include "UseTheForce/doForces_interface.h" |
| 60 |
|
#include "UseTheForce/DarkSide/electrostatic_interface.h" |
| 61 |
|
#include "UseTheForce/notifyCutoffs_interface.h" |
| 62 |
+ |
#include "UseTheForce/DarkSide/switcheroo_interface.h" |
| 63 |
|
#include "utils/MemoryUtils.hpp" |
| 64 |
|
#include "utils/simError.h" |
| 65 |
|
#include "selection/SelectionManager.hpp" |
| 474 |
|
int isError = 0; |
| 475 |
|
|
| 476 |
|
setupElectrostaticSummationMethod( isError ); |
| 477 |
+ |
setupSwitchingFunction(); |
| 478 |
|
|
| 479 |
|
if(isError){ |
| 480 |
|
sprintf( painCave.errMsg, |
| 532 |
|
//usePBC and useRF are from simParams |
| 533 |
|
int usePBC = simParams_->getUsePeriodicBoundaryConditions(); |
| 534 |
|
int useRF; |
| 535 |
< |
int useDW; |
| 535 |
> |
int useSF; |
| 536 |
|
std::string myMethod; |
| 537 |
|
|
| 538 |
|
// set the useRF logical |
| 539 |
|
useRF = 0; |
| 540 |
< |
useDW = 0; |
| 540 |
> |
useSF = 0; |
| 541 |
|
|
| 542 |
|
|
| 543 |
|
if (simParams_->haveElectrostaticSummationMethod()) { |
| 546 |
|
if (myMethod == "REACTION_FIELD") { |
| 547 |
|
useRF=1; |
| 548 |
|
} else { |
| 549 |
< |
if (myMethod == "SHIFTED_POTENTIAL") { |
| 550 |
< |
useDW = 1; |
| 549 |
> |
if (myMethod == "SHIFTED_FORCE") { |
| 550 |
> |
useSF = 1; |
| 551 |
|
} |
| 552 |
|
} |
| 553 |
|
} |
| 616 |
|
temp = useRF; |
| 617 |
|
MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
| 618 |
|
|
| 619 |
< |
temp = useDW; |
| 620 |
< |
MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
| 619 |
> |
temp = useSF; |
| 620 |
> |
MPI_Allreduce(&temp, &useSF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
| 621 |
|
|
| 622 |
|
#endif |
| 623 |
|
|
| 634 |
|
fInfo_.SIM_uses_Shapes = useShape; |
| 635 |
|
fInfo_.SIM_uses_FLARB = useFLARB; |
| 636 |
|
fInfo_.SIM_uses_RF = useRF; |
| 637 |
< |
fInfo_.SIM_uses_DampedWolf = useDW; |
| 637 |
> |
fInfo_.SIM_uses_SF = useSF; |
| 638 |
|
|
| 639 |
|
if( myMethod == "REACTION_FIELD") { |
| 640 |
|
|
| 948 |
|
} |
| 949 |
|
} |
| 950 |
|
|
| 951 |
< |
if (simParams_->haveScreeningMethod()) { |
| 952 |
< |
std::string myScreen = simParams_->getScreeningMethod(); |
| 951 |
> |
if (simParams_->haveElectrostaticScreeningMethod()) { |
| 952 |
> |
std::string myScreen = simParams_->getElectrostaticScreeningMethod(); |
| 953 |
|
toUpper(myScreen); |
| 954 |
|
if (myScreen == "UNDAMPED") { |
| 955 |
|
sm = UNDAMPED; |
| 962 |
|
"SimInfo warning: dampingAlpha was not specified in the input file. A default value of %f (1/ang) will be used.", alphaVal); |
| 963 |
|
painCave.isFatal = 0; |
| 964 |
|
simError(); |
| 962 |
– |
} else { |
| 963 |
– |
// throw error |
| 964 |
– |
sprintf( painCave.errMsg, |
| 965 |
– |
"SimInfo error: Unknown electrostaticSummationMethod. (Input file specified %s .)\n\telectrostaticSummationMethod must be one of: \"undamped\" or \"damped\".", myScreen.c_str() ); |
| 966 |
– |
painCave.isFatal = 1; |
| 967 |
– |
simError(); |
| 965 |
|
} |
| 966 |
+ |
} else { |
| 967 |
+ |
// throw error |
| 968 |
+ |
sprintf( painCave.errMsg, |
| 969 |
+ |
"SimInfo error: Unknown electrostaticScreeningMethod. (Input file specified %s .)\n\telectrostaticScreeningMethod must be one of: \"undamped\" or \"damped\".", myScreen.c_str() ); |
| 970 |
+ |
painCave.isFatal = 1; |
| 971 |
+ |
simError(); |
| 972 |
|
} |
| 973 |
|
} |
| 974 |
|
} |
| 975 |
+ |
|
| 976 |
|
// let's pass some summation method variables to fortran |
| 977 |
|
setElectrostaticSummationMethod( &esm ); |
| 978 |
|
setScreeningMethod( &sm ); |
| 979 |
|
setDampingAlpha( &alphaVal ); |
| 980 |
|
setReactionFieldDielectric( &dielectric ); |
| 981 |
|
initFortranFF( &esm, &errorOut ); |
| 982 |
+ |
} |
| 983 |
+ |
|
| 984 |
+ |
void SimInfo::setupSwitchingFunction() { |
| 985 |
+ |
int ft = CUBIC; |
| 986 |
+ |
|
| 987 |
+ |
if (simParams_->haveSwitchingFunctionType()) { |
| 988 |
+ |
std::string funcType = simParams_->getSwitchingFunctionType(); |
| 989 |
+ |
toUpper(funcType); |
| 990 |
+ |
if (funcType == "CUBIC") { |
| 991 |
+ |
ft = CUBIC; |
| 992 |
+ |
} else { |
| 993 |
+ |
if (funcType == "FIFTH_ORDER_POLYNOMIAL") { |
| 994 |
+ |
ft = FIFTH_ORDER_POLY; |
| 995 |
+ |
} else { |
| 996 |
+ |
// throw error |
| 997 |
+ |
sprintf( painCave.errMsg, |
| 998 |
+ |
"SimInfo error: Unknown switchingFunctionType. (Input file specified %s .)\n\tswitchingFunctionType must be one of: \"cubic\" or \"fifth_order_polynomial\".", funcType.c_str() ); |
| 999 |
+ |
painCave.isFatal = 1; |
| 1000 |
+ |
simError(); |
| 1001 |
+ |
} |
| 1002 |
+ |
} |
| 1003 |
+ |
} |
| 1004 |
+ |
|
| 1005 |
+ |
// send switching function notification to switcheroo |
| 1006 |
+ |
setFunctionType(&ft); |
| 1007 |
+ |
|
| 1008 |
|
} |
| 1009 |
|
|
| 1010 |
|
void SimInfo::addProperty(GenericData* genData) { |