| 57 |
|
#include "primitives/Bend.hpp" |
| 58 |
|
#include "primitives/Torsion.hpp" |
| 59 |
|
#include "primitives/Inversion.hpp" |
| 60 |
– |
#include "nonbonded/LJ.hpp" |
| 60 |
|
|
| 61 |
|
namespace OpenMD { |
| 62 |
+ |
|
| 63 |
+ |
ForceManager::ForceManager(SimInfo * info) : info_(info), |
| 64 |
+ |
NBforcesInitialized_(false) { |
| 65 |
+ |
lj_ = LJ::Instance(); |
| 66 |
+ |
lj_->setForceField(info_->getForceField()); |
| 67 |
+ |
|
| 68 |
+ |
gb_ = GB::Instance(); |
| 69 |
+ |
gb_->setForceField(info_->getForceField()); |
| 70 |
+ |
|
| 71 |
+ |
sticky_ = Sticky::Instance(); |
| 72 |
+ |
sticky_->setForceField(info_->getForceField()); |
| 73 |
+ |
|
| 74 |
+ |
eam_ = EAM::Instance(); |
| 75 |
+ |
eam_->setForceField(info_->getForceField()); |
| 76 |
|
|
| 77 |
+ |
sc_ = SC::Instance(); |
| 78 |
+ |
sc_->setForceField(info_->getForceField()); |
| 79 |
+ |
} |
| 80 |
+ |
|
| 81 |
|
void ForceManager::calcForces() { |
| 82 |
|
|
| 83 |
|
if (!info_->isFortranInitialized()) { |
| 84 |
|
info_->update(); |
| 85 |
|
} |
| 86 |
|
|
| 70 |
– |
if (!NBforcesInitialized_) { |
| 71 |
– |
LJ* lj = new LJ(info_->getForceField()); |
| 72 |
– |
lj->initialize(); |
| 73 |
– |
} |
| 74 |
– |
|
| 87 |
|
preCalculation(); |
| 88 |
|
|
| 89 |
|
calcShortRangeInteraction(); |