45#include "flucq/FluctuatingChargePropagator.hpp"
51#include "flucq/FluctuatingChargeObjectiveFunction.hpp"
54#include "optimization/OptimizationFactory.hpp"
56#include "optimization/StatusFunction.hpp"
58using namespace QuantLib;
61 FluctuatingChargePropagator::FluctuatingChargePropagator(
SimInfo* info) :
62 info_(info), forceMan_(NULL), hasFlucQ_(false), initialized_(false) {
63 Globals* simParams = info_->getSimParams();
64 fqParams_ = simParams->getFluctuatingChargeParameters();
67 FluctuatingChargePropagator::~FluctuatingChargePropagator() {
69 delete fqConstraints_;
72 void FluctuatingChargePropagator::setForceManager(
ForceManager* forceMan) {
76 void FluctuatingChargePropagator::initialize() {
77 if (info_->usesFluctuatingCharges()) {
81 fqConstraints_->setConstrainRegions(fqParams_->getConstrainRegions());
107 if (fqParams_->getDoInitialOptimization()) {
116 Problem problem(flucQobjf, noConstraint, noStatus, initCoords);
118 int maxIter = fqParams_->getMaxIterations();
119 RealType tolerance = fqParams_->getTolerance();
120 RealType initialStepSize = fqParams_->getInitialStepSize();
122 EndCriteria endCriteria(maxIter, maxIter, tolerance, tolerance,
124 std::string chargeOptMethod = fqParams_->getChargeOptimizationMethod();
129 minim->
minimize(problem, endCriteria, initialStepSize);
137 void FluctuatingChargePropagator::applyConstraints() {
138 if (!initialized_) initialize();
139 if (!hasFlucQ_)
return;
141 fqConstraints_->applyConstraints();
Abstract constraint class.
Optimization criteria class.
Abstract optimization problem class.
Dynamically-sized vector class.
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
static OptimizationFactory & getInstance()
Returns an instance of Optimization factory.
QuantLib::OptimizationMethod * createOptimization(const std::string &id, SimInfo *info)
Looks up the type identifier in the internal map.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
int getNFluctuatingCharges()
Returns the total number of fluctuating charges that are present.
Criteria to end optimization process:
Abstract class for constrained optimization method.
virtual EndCriteria::Type minimize(Problem &P, const EndCriteria &endCriteria, RealType initialStepSize)=0
minimize the optimization problem P
Constrained optimization problem.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.