--- branches/development/src/nonbonded/InteractionManager.hpp 2011/11/22 20:38:56 1665 +++ trunk/src/nonbonded/InteractionManager.hpp 2013/08/07 15:24:16 1925 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -61,26 +61,27 @@ namespace OpenMD { namespace OpenMD { /** - * @class InteractionManager InteractionManager is responsible for + * @class InteractionManager + * InteractionManager is responsible for * keeping track of the non-bonded interactions (C++) */ class InteractionManager { public: InteractionManager(); - ~InteractionManager(); + virtual ~InteractionManager(); void setSimInfo(SimInfo* info) {info_ = info;} void initialize(); // Fortran support routines - void doPrePair(InteractionData idat); - void doPreForce(SelfData sdat); - void doPair(InteractionData idat); - void doSkipCorrection(InteractionData idat); - void doSelfCorrection(SelfData sdat); + void doPrePair(InteractionData &idat); + void doPreForce(SelfData &sdat); + void doPair(InteractionData &idat); + void doSkipCorrection(InteractionData &idat); + void doSelfCorrection(SelfData &sdat); + void doReciprocalSpaceSum(RealType &recipPot); void setCutoffRadius(RealType rCut); - void setSwitchingRadius(RealType rSwitch); RealType getSuggestedCutoffRadius(int *atid1); RealType getSuggestedCutoffRadius(AtomType *atype); @@ -102,11 +103,21 @@ namespace OpenMD { map typeMap_; /** - * Each pair of atom types can have multiple interactions, so the + * Each pair of atom types can have multiple interactions, so the * natural data structures are a map between the pair, and a set - * of non-bonded interactions. + * of non-bonded interactions: + * + * map, set > interactions_; + * + * Pair creation turns out to be inefficient, and map searching + * isn't necessary. Instead of AtomType* sort keys, we now use + * the AtomType idents (atids) which are ints to access the vector + * locations. iHash_ contains largely the same information as + * interactions_, but in a way that doesn't require a set iterator + * inside the main pair loop. */ - map, set > interactions_; + vector > > interactions_; + vector > iHash_; }; } #endif