| 52 |
|
#include "brains/SimInfo.hpp" |
| 53 |
|
#include "math/Vector3.hpp" |
| 54 |
|
#include "primitives/Molecule.hpp" |
| 55 |
+ |
#include "UseTheForce/fCutoffPolicy.h" |
| 56 |
|
#include "UseTheForce/doForces_interface.h" |
| 57 |
|
#include "UseTheForce/notifyCutoffs_interface.h" |
| 58 |
|
#include "utils/MemoryUtils.hpp" |
| 463 |
|
//setup fortran force field |
| 464 |
|
/** @deprecate */ |
| 465 |
|
int isError = 0; |
| 466 |
< |
initFortranFF( &fInfo_.SIM_uses_RF , &isError ); |
| 466 |
> |
initFortranFF( &fInfo_.SIM_uses_RF, &fInfo_.SIM_uses_UW, |
| 467 |
> |
&fInfo_.SIM_uses_DW, &isError ); |
| 468 |
|
if(isError){ |
| 469 |
|
sprintf( painCave.errMsg, |
| 470 |
|
"ForceField error: There was an error initializing the forceField in fortran.\n" ); |
| 521 |
|
//usePBC and useRF are from simParams |
| 522 |
|
int usePBC = simParams_->getPBC(); |
| 523 |
|
int useRF = simParams_->getUseRF(); |
| 524 |
+ |
int useUW = simParams_->getUseUndampedWolf(); |
| 525 |
+ |
int useDW = simParams_->getUseDampedWolf(); |
| 526 |
|
|
| 527 |
|
//loop over all of the atom types |
| 528 |
|
for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { |
| 587 |
|
|
| 588 |
|
temp = useRF; |
| 589 |
|
MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
| 590 |
+ |
|
| 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 |
|
|
| 597 |
|
#endif |
| 598 |
|
|
| 609 |
|
fInfo_.SIM_uses_Shapes = useShape; |
| 610 |
|
fInfo_.SIM_uses_FLARB = useFLARB; |
| 611 |
|
fInfo_.SIM_uses_RF = useRF; |
| 612 |
+ |
fInfo_.SIM_uses_UW = useUW; |
| 613 |
+ |
fInfo_.SIM_uses_DW = useDW; |
| 614 |
|
|
| 615 |
|
if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) { |
| 616 |
|
|
| 842 |
|
} |
| 843 |
|
} |
| 844 |
|
|
| 845 |
< |
void SimInfo::setupCutoff() { |
| 845 |
> |
void SimInfo::setupCutoff() { |
| 846 |
|
getCutoff(rcut_, rsw_); |
| 847 |
|
double rnblist = rcut_ + 1; // skin of neighbor list |
| 848 |
|
|
| 849 |
|
//Pass these cutoff radius etc. to fortran. This function should be called once and only once |
| 850 |
< |
notifyFortranCutoffs(&rcut_, &rsw_, &rnblist); |
| 850 |
> |
|
| 851 |
> |
int cp = TRADITIONAL_CUTOFF_POLICY; |
| 852 |
> |
if (simParams_->haveCutoffPolicy()) { |
| 853 |
> |
std::string myPolicy = simParams_->getCutoffPolicy(); |
| 854 |
> |
if (myPolicy == "MIX") { |
| 855 |
> |
cp = MIX_CUTOFF_POLICY; |
| 856 |
> |
} else { |
| 857 |
> |
if (myPolicy == "MAX") { |
| 858 |
> |
cp = MAX_CUTOFF_POLICY; |
| 859 |
> |
} else { |
| 860 |
> |
if (myPolicy == "TRADITIONAL") { |
| 861 |
> |
cp = TRADITIONAL_CUTOFF_POLICY; |
| 862 |
> |
} else { |
| 863 |
> |
// throw error |
| 864 |
> |
sprintf( painCave.errMsg, |
| 865 |
> |
"SimInfo error: Unknown cutoffPolicy. (Input file specified %s .)\n\tcutoffPolicy must be one of: \"Mix\", \"Max\", or \"Traditional\".", myPolicy.c_str() ); |
| 866 |
> |
painCave.isFatal = 1; |
| 867 |
> |
simError(); |
| 868 |
> |
} |
| 869 |
> |
} |
| 870 |
> |
} |
| 871 |
> |
} |
| 872 |
> |
notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); |
| 873 |
|
} |
| 874 |
|
|
| 875 |
|
void SimInfo::addProperty(GenericData* genData) { |