| 53 |  | #include "brains/SimInfo.hpp" | 
| 54 |  | #include "math/Vector3.hpp" | 
| 55 |  | #include "primitives/Molecule.hpp" | 
| 56 | + | #include "primitives/StuntDouble.hpp" | 
| 57 |  | #include "UseTheForce/fCutoffPolicy.h" | 
| 58 |  | #include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" | 
| 59 |  | #include "UseTheForce/DarkSide/fElectrostaticScreeningMethod.h" | 
| 90 |  | nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0), | 
| 91 |  | nAtoms_(0), nBonds_(0),  nBends_(0), nTorsions_(0), nRigidBodies_(0), | 
| 92 |  | nIntegrableObjects_(0),  nCutoffGroups_(0), nConstraints_(0), | 
| 93 | < | sman_(NULL), fortranInitialized_(false) { | 
| 93 | > | sman_(NULL), fortranInitialized_(false), calcBoxDipole_(false) { | 
| 94 |  |  | 
| 95 |  | MoleculeStamp* molStamp; | 
| 96 |  | int nMolWithSameStamp; | 
| 603 |  |  | 
| 604 |  | setupElectrostaticSummationMethod( isError ); | 
| 605 |  | setupSwitchingFunction(); | 
| 606 | + | setupAccumulateBoxDipole(); | 
| 607 |  |  | 
| 608 |  | if(isError){ | 
| 609 |  | sprintf( painCave.errMsg, | 
| 663 |  | int usePBC = simParams_->getUsePeriodicBoundaryConditions(); | 
| 664 |  | int useRF; | 
| 665 |  | int useSF; | 
| 666 | + | int useSP; | 
| 667 | + | int useBoxDipole; | 
| 668 |  | std::string myMethod; | 
| 669 |  |  | 
| 670 |  | // set the useRF logical | 
| 675 |  | if (simParams_->haveElectrostaticSummationMethod()) { | 
| 676 |  | std::string myMethod = simParams_->getElectrostaticSummationMethod(); | 
| 677 |  | toUpper(myMethod); | 
| 678 | < | if (myMethod == "REACTION_FIELD") { | 
| 678 | > | if (myMethod == "REACTION_FIELD"){ | 
| 679 |  | useRF=1; | 
| 680 | < | } else { | 
| 681 | < | if (myMethod == "SHIFTED_FORCE") { | 
| 682 | < | useSF = 1; | 
| 683 | < | } | 
| 680 | > | } else if (myMethod == "SHIFTED_FORCE"){ | 
| 681 | > | useSF = 1; | 
| 682 | > | } else if (myMethod == "SHIFTED_POTENTIAL"){ | 
| 683 | > | useSP = 1; | 
| 684 |  | } | 
| 685 |  | } | 
| 686 | + |  | 
| 687 | + | if (simParams_->haveAccumulateBoxDipole()) | 
| 688 | + | if (simParams_->getAccumulateBoxDipole()) | 
| 689 | + | useBoxDipole = 1; | 
| 690 |  |  | 
| 691 |  | //loop over all of the atom types | 
| 692 |  | for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { | 
| 757 |  | MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 758 |  |  | 
| 759 |  | temp = useSF; | 
| 760 | < | MPI_Allreduce(&temp, &useSF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 760 | > | MPI_Allreduce(&temp, &useSF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 761 | > |  | 
| 762 | > | temp = useSP; | 
| 763 | > | MPI_Allreduce(&temp, &useSP, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 764 | > |  | 
| 765 | > | temp = useBoxDipole; | 
| 766 | > | MPI_Allreduce(&temp, &useBoxDipole, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); | 
| 767 |  |  | 
| 768 |  | #endif | 
| 769 |  |  | 
| 782 |  | fInfo_.SIM_uses_FLARB = useFLARB; | 
| 783 |  | fInfo_.SIM_uses_RF = useRF; | 
| 784 |  | fInfo_.SIM_uses_SF = useSF; | 
| 785 | + | fInfo_.SIM_uses_SP = useSP; | 
| 786 | + | fInfo_.SIM_uses_BoxDipole = useBoxDipole; | 
| 787 |  |  | 
| 788 |  | if( myMethod == "REACTION_FIELD") { | 
| 789 |  |  | 
| 1177 |  |  | 
| 1178 |  | } | 
| 1179 |  |  | 
| 1180 | + | void SimInfo::setupAccumulateBoxDipole() { | 
| 1181 | + |  | 
| 1182 | + | // we only call setAccumulateBoxDipole if the accumulateBoxDipole parameter is true | 
| 1183 | + | if ( simParams_->haveAccumulateBoxDipole() ) | 
| 1184 | + | if ( simParams_->getAccumulateBoxDipole() ) { | 
| 1185 | + | setAccumulateBoxDipole(); | 
| 1186 | + | calcBoxDipole_ = true; | 
| 1187 | + | } | 
| 1188 | + |  | 
| 1189 | + | } | 
| 1190 | + |  | 
| 1191 |  | void SimInfo::addProperty(GenericData* genData) { | 
| 1192 |  | properties_.addProperty(genData); | 
| 1193 |  | } | 
| 1437 |  | return angularMomentum; | 
| 1438 |  | } | 
| 1439 |  |  | 
| 1440 | < |  | 
| 1440 | > | StuntDouble* SimInfo::getIOIndexToIntegrableObject(int index) { | 
| 1441 | > | return IOIndexToIntegrableObject.at(index); | 
| 1442 | > | } | 
| 1443 | > |  | 
| 1444 | > | void SimInfo::setIOIndexToIntegrableObject(const std::vector<StuntDouble*>& v) { | 
| 1445 | > | IOIndexToIntegrableObject= v; | 
| 1446 | > | } | 
| 1447 | > |  | 
| 1448 | > | /* | 
| 1449 | > | void SimInfo::setStuntDoubleFromGlobalIndex(std::vector<StuntDouble*> v) { | 
| 1450 | > | assert( v.size() == nAtoms_ + nRigidBodies_); | 
| 1451 | > | sdByGlobalIndex_ = v; | 
| 1452 | > | } | 
| 1453 | > |  | 
| 1454 | > | StuntDouble* SimInfo::getStuntDoubleFromGlobalIndex(int index) { | 
| 1455 | > | //assert(index < nAtoms_ + nRigidBodies_); | 
| 1456 | > | return sdByGlobalIndex_.at(index); | 
| 1457 | > | } | 
| 1458 | > | */ | 
| 1459 |  | }//end namespace oopse | 
| 1460 |  |  |