52 |
|
|
53 |
|
#include "brains/SimInfo.hpp" |
54 |
|
#include "primitives/Molecule.hpp" |
55 |
< |
#include "nonbonded/LJ.hpp" |
56 |
< |
#include "nonbonded/GB.hpp" |
57 |
< |
#include "nonbonded/Sticky.hpp" |
58 |
< |
#include "nonbonded/EAM.hpp" |
55 |
> |
#include "nonbonded/InteractionManager.hpp" |
56 |
> |
#include "parallel/ForceDecomposition.hpp" |
57 |
|
|
58 |
+ |
#define PREPAIR_LOOP 0 |
59 |
+ |
#define PAIR_LOOP 1 |
60 |
+ |
|
61 |
+ |
using namespace std; |
62 |
|
namespace OpenMD { |
63 |
|
/** |
64 |
|
* @class ForceManager ForceManager.hpp "brains/ForceManager.hpp" |
65 |
|
* ForceManager is responsible for calculating the short range |
66 |
< |
* interactions (C++) and long range interactions (Fortran). If the |
65 |
< |
* Fortran side is not set up before the force calculation, call |
66 |
< |
* SimInfo's update function to settle it down. |
66 |
> |
* interactions and long range interactions. |
67 |
|
* |
68 |
< |
* @note the reason we delay fortran side's setup is that some |
69 |
< |
* applications (Dump2XYZ etc.) may not need force calculation, so why |
70 |
< |
* bother? |
68 |
> |
* @note the reason we delay some of the setup is that some |
69 |
> |
* applications (Dump2XYZ etc.) may not need force calculation, so |
70 |
> |
* why bother? |
71 |
|
*/ |
72 |
|
class ForceManager { |
73 |
|
|
75 |
|
|
76 |
|
ForceManager(SimInfo * info); |
77 |
|
virtual ~ForceManager() {} |
78 |
– |
|
79 |
– |
// public virtual functions should be avoided |
80 |
– |
/**@todo needs refactoring */ |
78 |
|
virtual void calcForces(); |
79 |
|
virtual void init() {}; |
80 |
|
|
81 |
|
protected: |
82 |
|
|
83 |
|
virtual void preCalculation(); |
84 |
< |
virtual void calcShortRangeInteraction(); |
85 |
< |
virtual void calcLongRangeInteraction(); |
84 |
> |
virtual void shortRangeInteractions(); |
85 |
> |
virtual void longRangeInteractions(); |
86 |
|
virtual void postCalculation(); |
87 |
|
|
88 |
|
SimInfo * info_; |
89 |
< |
std::map<Bend*, BendDataSet> bendDataSets; |
90 |
< |
std::map<Torsion*, TorsionDataSet> torsionDataSets; |
91 |
< |
std::map<Inversion*, InversionDataSet> inversionDataSets; |
89 |
> |
map<Bend*, BendDataSet> bendDataSets; |
90 |
> |
map<Torsion*, TorsionDataSet> torsionDataSets; |
91 |
> |
map<Inversion*, InversionDataSet> inversionDataSets; |
92 |
|
Mat3x3d tau; |
93 |
|
|
94 |
< |
bool NBforcesInitialized_; |
95 |
< |
LJ* lj_; |
96 |
< |
GB* gb_; |
97 |
< |
Sticky* sticky_; |
98 |
< |
EAM* eam_; |
102 |
< |
|
94 |
> |
InteractionManager* interactionMan_; |
95 |
> |
ForceDecomposition* fDecomp_; |
96 |
> |
SwitchingFunction* swfun_; |
97 |
> |
vector<pair<int, int> > neighborList; |
98 |
> |
map< pair<int, int>, pair<RealType, RealType> > groupCutoffMap; |
99 |
|
}; |
100 |
< |
|
101 |
< |
} //end namespace OpenMD |
100 |
> |
|
101 |
> |
} |
102 |
|
#endif //BRAINS_FORCEMANAGER_HPP |