53 |
|
#include "math/Vector3.hpp" |
54 |
|
#include "primitives/Molecule.hpp" |
55 |
|
#include "UseTheForce/fCutoffPolicy.h" |
56 |
< |
#include "UseTheForce/fCoulombicCorrection.h" |
56 |
> |
#include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" |
57 |
|
#include "UseTheForce/doForces_interface.h" |
58 |
+ |
#include "UseTheForce/DarkSide/electrostatic_interface.h" |
59 |
|
#include "UseTheForce/notifyCutoffs_interface.h" |
60 |
|
#include "utils/MemoryUtils.hpp" |
61 |
|
#include "utils/simError.h" |
466 |
|
/** @deprecate */ |
467 |
|
int isError = 0; |
468 |
|
|
469 |
< |
setupCoulombicCorrection( isError ); |
469 |
> |
setupElectrostaticSummationMethod( isError ); |
470 |
|
|
471 |
|
if(isError){ |
472 |
|
sprintf( painCave.errMsg, |
523 |
|
int useElectrostatics = 0; |
524 |
|
//usePBC and useRF are from simParams |
525 |
|
int usePBC = simParams_->getPBC(); |
525 |
– |
int useRF = simParams_->getUseRF(); |
526 |
|
|
527 |
|
//loop over all of the atom types |
528 |
|
for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { |
584 |
|
|
585 |
|
temp = useFLARB; |
586 |
|
MPI_Allreduce(&temp, &useFLARB, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
587 |
– |
|
588 |
– |
temp = useRF; |
589 |
– |
MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
587 |
|
|
591 |
– |
temp = useUW; |
592 |
– |
MPI_Allreduce(&temp, &useUW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
593 |
– |
|
594 |
– |
temp = useDW; |
595 |
– |
MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
596 |
– |
|
588 |
|
#endif |
589 |
|
|
590 |
|
fInfo_.SIM_uses_PBC = usePBC; |
599 |
|
fInfo_.SIM_uses_EAM = useEAM; |
600 |
|
fInfo_.SIM_uses_Shapes = useShape; |
601 |
|
fInfo_.SIM_uses_FLARB = useFLARB; |
611 |
– |
fInfo_.SIM_uses_RF = useRF; |
602 |
|
|
603 |
|
if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) { |
604 |
|
|
858 |
|
} |
859 |
|
} |
860 |
|
notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); |
861 |
+ |
// also send cutoff notification to electrostatics |
862 |
+ |
setElectrostaticCutoffRadius(&rcut_); |
863 |
|
} |
864 |
|
|
865 |
< |
void SimInfo::setupCoulombicCorrection( int isError ) { |
865 |
> |
void SimInfo::setupElectrostaticSummationMethod( int isError ) { |
866 |
|
|
867 |
|
int errorOut; |
868 |
< |
int cc = NONE; |
868 |
> |
int esm = NONE; |
869 |
|
double alphaVal; |
870 |
+ |
double dielectric; |
871 |
|
|
872 |
|
errorOut = isError; |
873 |
+ |
alphaVal = simParams_->getDampingAlpha(); |
874 |
+ |
dielectric = simParams_->getDielectric(); |
875 |
|
|
876 |
< |
if (simParams_->haveCoulombicCorrection()) { |
877 |
< |
std::string myCorrection = simParams_->getCoulombicCorrection(); |
878 |
< |
if (myCorrection == "NONE") { |
879 |
< |
cc = NONE; |
876 |
> |
if (simParams_->haveElectrostaticSummationMethod()) { |
877 |
> |
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
878 |
> |
if (myMethod == "NONE") { |
879 |
> |
esm = NONE; |
880 |
|
} else { |
881 |
< |
if (myCorrection == "UNDAMPED_WOLF") { |
882 |
< |
cc = UNDAMPED_WOLF; |
881 |
> |
if (myMethod == "UNDAMPED_WOLF") { |
882 |
> |
esm = UNDAMPED_WOLF; |
883 |
|
} else { |
884 |
< |
if (myCorrection == "WOLF") { |
885 |
< |
cc = WOLF; |
884 |
> |
if (myMethod == "DAMPED_WOLF") { |
885 |
> |
esm = DAMPED_WOLF; |
886 |
|
if (!simParams_->haveDampingAlpha()) { |
887 |
|
//throw error |
888 |
|
sprintf( painCave.errMsg, |
889 |
< |
"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()); |
889 |
> |
"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); |
890 |
|
painCave.isFatal = 0; |
891 |
|
simError(); |
892 |
|
} |
898 |
– |
alphaVal = simParams_->getDampingAlpha(); |
893 |
|
} else { |
894 |
< |
if (myCorrection == "REACTION_FIELD") { |
895 |
< |
cc = REACTION_FIELD; |
894 |
> |
if (myMethod == "REACTION_FIELD") { |
895 |
> |
esm = REACTION_FIELD; |
896 |
|
} else { |
897 |
|
// throw error |
898 |
|
sprintf( painCave.errMsg, |
899 |
< |
"SimInfo error: Unknown coulombicCorrection. (Input file specified %s .)\n\tcoulombicCorrection must be one of: \"none\", \"undamped_wolf\", \"wolf\", or \"reaction_field\".", myCorrection.c_str() ); |
899 |
> |
"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() ); |
900 |
|
painCave.isFatal = 1; |
901 |
|
simError(); |
902 |
|
} |
904 |
|
} |
905 |
|
} |
906 |
|
} |
907 |
< |
initFortranFF( &fInfo_.SIM_uses_RF, &cc, &alphaVal, &errorOut ); |
907 |
> |
// let's pass some summation method variables to fortran |
908 |
> |
setElectrostaticSummationMethod( &esm ); |
909 |
> |
setDampedWolfAlpha( &alphaVal ); |
910 |
> |
setReactionFieldDielectric( &dielectric ); |
911 |
> |
initFortranFF( &esm, &errorOut ); |
912 |
|
} |
913 |
|
|
914 |
|
void SimInfo::addProperty(GenericData* genData) { |