Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
#include <energyMinimizerNesterovAG.h>
Public Member Functions | |
energyMinimizerNesterovAG () | |
The basic constructor. More... | |
energyMinimizerNesterovAG (shared_ptr< simpleModel > system) | |
The basic constructor that feeds in a target system to minimize. More... | |
virtual void | initializeParameters () |
Sets a bunch of default parameters that do not depend on the number of degrees of freedom. More... | |
virtual void | initializeFromModel () |
by default, set Ndof More... | |
void | minimize () |
Minimize to either the force tolerance or the maximum number of iterations. More... | |
virtual void | performUpdate () |
The "intergate equatios of motion just calls minimize. More... | |
void | setNesterovAGParameters (scalar _dt=0.0001, scalar _mu=0.01, scalar fc=1e-12) |
scalar | getMaxForce () |
Return the maximum force. More... | |
void | setForceCutoff (scalar fc) |
Set the force cutoff. More... | |
virtual void | integrateEquationOfMotion () |
virtual void | integrateEOMGPU () |
virtual void | integrateEOMCPU () |
virtual scalar | getClassSize () |
virtual void | Update (int timestep) |
The fundamental function that a controlling Simulation can call. More... | |
void | setSimulation (shared_ptr< basicSimulation > _sim) |
set the simulation More... | |
virtual void | setModel (shared_ptr< simpleModel > _model) |
virtual function to allow the model to be a derived class More... | |
void | setPeriod (int _p) |
set the period More... | |
void | setPhase (int _p) |
set the phase More... | |
virtual void | spatialSorting () |
allow for spatial sorting to be called if necessary... More... | |
virtual void | setReproducible (bool rep) |
Allow for a reproducibility call to be made. More... | |
virtual void | setGPU (bool _useGPU=true) |
Enforce GPU operation. More... | |
int | getNdof () |
Get the number of degrees of freedom of the equation of motion. More... | |
void | setNdof (int _n) |
Set the number of degrees of freedom of the equation of motion. More... | |
virtual void | setDeltaT (scalar dt) |
allow all updaters to potentially implement an internal time scale More... | |
virtual void | setNThreads (int n) |
allow for setting multiple threads More... | |
void | setMaximumIterations (int maxIt) |
Set the maximum number of iterations before terminating (or set to -1 to ignore) More... | |
int | getCurrentIterations () |
int | getMaxIterations () |
void | setCurrentIterations (int newIterations) |
int | getNTotal () |
communicate the number of non-object sites across ranks More... | |
Public Attributes | |
bool | scheduledMomentum |
GPUArray< dVec > | displacement |
an array of displacements More... | |
shared_ptr< basicSimulation > | sim |
A pointer to the governing simulation. More... | |
shared_ptr< simpleModel > | model |
A pointer to a simpleModel that the updater acts on. More... | |
vector< scalar > | updaterData |
int | iterations |
The number of iterations performed. More... | |
Protected Member Functions | |
void | nesterovStepCPU () |
void | nesterovStepGPU () |
Protected Attributes | |
scalar | mu |
scalar | forceMax |
scalar | forceCutoff |
The cutoff value of the maximum force. More... | |
scalar | lambda |
scalar | gamma |
GPUArray< dVec > | alternateSequence |
GPUArray< scalar > | sumReductionIntermediate |
Utility array for simple reductions. More... | |
GPUArray< scalar > | sumReductionIntermediate2 |
GPUArray< scalar > | sumReductions |
Utility array for simple reductions. More... | |
shared_ptr< kernelTuner > | dotProductTuner |
kernel tuner for performance More... | |
shared_ptr< kernelTuner > | minimizationTuner |
int | nThreads =1 |
number of threads to use More... | |
int | Period |
The period of the updater... the updater will work every Period timesteps. More... | |
int | Phase |
The phase of the updater... the updater will work every Period timesteps offset by a phase. More... | |
bool | useGPU |
whether the updater does its work on the GPU or not More... | |
bool | neverGPU |
whether the updater never does work on the GPU More... | |
int | Ndof |
some measure of the number of degrees of freedom the equations of motion might need to know about locally More... | |
int | nTotal |
the total number of non-object sites across all ranks More... | |
bool | reproducible |
whether the RNGs give reproducible results More... | |
scalar | deltaT |
The internal time step size. More... | |
int | maxIterations |
The maximum number of iterations allowed. More... | |
|
inline |
The basic constructor.
References initializeParameters().
energyMinimizerNesterovAG::energyMinimizerNesterovAG | ( | shared_ptr< simpleModel > | system | ) |
The basic constructor that feeds in a target system to minimize.
References initializeFromModel(), initializeParameters(), and updater::setModel().
|
virtual |
Sets a bunch of default parameters that do not depend on the number of degrees of freedom.
Initialize the minimizer with some default parameters. that do not depend on Ndof
References dotProductTuner, forceMax, updater::iterations, lambda, minimizationTuner, GPUArray< T >::resize(), scheduledMomentum, updater::setGPU(), updater::setMaximumIterations(), setNesterovAGParameters(), and sumReductions.
Referenced by energyMinimizerNesterovAG().
|
virtual |
by default, set Ndof
Reimplemented from equationOfMotion.
References alternateSequence, updater::model, updater::Ndof, GPUArray< T >::resize(), sumReductionIntermediate, and sumReductionIntermediate2.
Referenced by energyMinimizerNesterovAG(), and minimize().
void energyMinimizerNesterovAG::minimize | ( | ) |
Minimize to either the force tolerance or the maximum number of iterations.
References forceCutoff, forceMax, gamma, initializeFromModel(), updater::iterations, lambda, updater::maxIterations, updater::model, mu, updater::Ndof, nesterovStepCPU(), nesterovStepGPU(), scalar, scheduledMomentum, updater::sim, and updater::useGPU.
Referenced by performUpdate().
|
inlinevirtual |
The "intergate equatios of motion just calls minimize.
Reimplemented from equationOfMotion.
References minimize().
|
inline |
References updater::deltaT, mu, and setForceCutoff().
Referenced by initializeParameters().
|
inlinevirtual |
|
inline |
|
protected |
References alternateSequence, ArrayHandle< T >::data, updater::deltaT, dot(), forceMax, updater::model, mu, updater::Ndof, scalar, and updater::sim.
Referenced by minimize().
|
protected |
References alternateSequence, ArrayHandle< T >::data, updater::deltaT, access_location::device, dotProductTuner, forceMax, gpu_dVec_dot_products(), gpu_nesterovAG_step(), access_location::host, minimizationTuner, updater::model, mu, updater::Ndof, access_mode::overwrite, access_mode::read, access_mode::readwrite, scalar, updater::sim, sumReductionIntermediate, sumReductionIntermediate2, and sumReductions.
Referenced by minimize().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Reimplemented in velocityVerlet.
Referenced by equationOfMotion::integrateEquationOfMotion().
|
inlinevirtualinherited |
Reimplemented in velocityVerlet.
Referenced by equationOfMotion::integrateEquationOfMotion().
|
inlinevirtualinherited |
Reimplemented from updater.
Reimplemented in energyMinimizerFIRE, energyMinimizerLoLBFGS, and energyMinimizerGradientDescent.
References equationOfMotion::displacement, updater::getClassSize(), GPUArray< T >::getNumElements(), and scalar.
Referenced by energyMinimizerGradientDescent::getClassSize(), energyMinimizerLoLBFGS::getClassSize(), and energyMinimizerFIRE::getClassSize().
|
inlinevirtualinherited |
The fundamental function that a controlling Simulation can call.
References updater::performUpdate(), updater::Period, and updater::Phase.
|
inlineinherited |
set the simulation
References updater::sim.
|
inlinevirtualinherited |
virtual function to allow the model to be a derived class
References updater::initializeFromModel(), and updater::model.
Referenced by energyMinimizerFIRE::energyMinimizerFIRE(), energyMinimizerGradientDescent::energyMinimizerGradientDescent(), energyMinimizerLoLBFGS::energyMinimizerLoLBFGS(), and energyMinimizerNesterovAG().
|
inlineinherited |
set the period
References updater::Period.
|
inlineinherited |
set the phase
References updater::Phase.
|
inlinevirtualinherited |
allow for spatial sorting to be called if necessary...
|
inlinevirtualinherited |
Allow for a reproducibility call to be made.
References updater::reproducible.
|
inlinevirtualinherited |
Enforce GPU operation.
References updater::useGPU.
Referenced by initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
|
inlineinherited |
Get the number of degrees of freedom of the equation of motion.
References updater::Ndof.
|
inlineinherited |
Set the number of degrees of freedom of the equation of motion.
References updater::Ndof.
|
inlinevirtualinherited |
allow all updaters to potentially implement an internal time scale
Reimplemented in energyMinimizerFIRE.
References updater::deltaT.
Referenced by energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerGradientDescent::setGradientDescentParameters().
|
inlinevirtualinherited |
allow for setting multiple threads
References n, and updater::nThreads.
|
inlineinherited |
Set the maximum number of iterations before terminating (or set to -1 to ignore)
References updater::maxIterations.
Referenced by initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
|
inlineinherited |
References updater::iterations.
|
inlineinherited |
References updater::maxIterations.
|
inlineinherited |
References updater::iterations.
|
inherited |
communicate the number of non-object sites across ranks
References access_location::host, updater::model, updater::Ndof, updater::nTotal, access_mode::read, updater::sim, and updater::updaterData.
bool energyMinimizerNesterovAG::scheduledMomentum |
Referenced by initializeParameters(), and minimize().
|
protected |
Referenced by minimize(), nesterovStepCPU(), nesterovStepGPU(), and setNesterovAGParameters().
|
protected |
Referenced by getMaxForce(), initializeParameters(), minimize(), nesterovStepCPU(), and nesterovStepGPU().
|
protected |
The cutoff value of the maximum force.
Referenced by minimize(), and setForceCutoff().
|
protected |
Referenced by initializeParameters(), and minimize().
|
protected |
Referenced by minimize().
|
protected |
Referenced by initializeFromModel(), nesterovStepCPU(), and nesterovStepGPU().
Utility array for simple reductions.
Referenced by initializeFromModel(), and nesterovStepGPU().
Referenced by initializeFromModel(), and nesterovStepGPU().
Utility array for simple reductions.
Referenced by initializeParameters(), and nesterovStepGPU().
|
protected |
kernel tuner for performance
Referenced by initializeParameters(), and nesterovStepGPU().
|
protected |
Referenced by initializeParameters(), and nesterovStepGPU().
|
inherited |
an array of displacements
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), equationOfMotion::getClassSize(), energyMinimizerAdam::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), velocityVerlet::integrateEOMCPU(), and velocityVerlet::integrateEOMGPU().
|
inherited |
A pointer to the governing simulation.
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), nesterovStepCPU(), nesterovStepGPU(), updater::performUpdate(), and updater::setSimulation().
|
inherited |
A pointer to a simpleModel that the updater acts on.
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerAdam::initializeFromModel(), initializeFromModel(), energyMinimizerLoLBFGS::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), updater::initializeFromModel(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), nesterovStepCPU(), nesterovStepGPU(), and updater::setModel().
|
inherited |
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
|
inherited |
The number of iterations performed.
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getCurrentIterations(), energyMinimizerAdam::initializeFromModel(), initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), energyMinimizerFIRE::initializeParameters(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), and updater::setCurrentIterations().
|
protectedinherited |
number of threads to use
Referenced by updater::setNThreads().
|
protectedinherited |
The period of the updater... the updater will work every Period timesteps.
Referenced by updater::setPeriod(), updater::Update(), and updater::updater().
|
protectedinherited |
The phase of the updater... the updater will work every Period timesteps offset by a phase.
Referenced by updater::setPhase(), updater::Update(), and updater::updater().
|
protectedinherited |
whether the updater does its work on the GPU or not
Referenced by energyMinimizerFIRE::fireStep(), energyMinimizerGradientDescent::gradientDescentStep(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerLoLBFGS::minimize(), updater::setGPU(), and updater::updater().
|
protectedinherited |
whether the updater never does work on the GPU
Referenced by equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), and energyMinimizerFIRE::initializeFromModel().
|
protectedinherited |
some measure of the number of degrees of freedom the equations of motion might need to know about locally
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNdof(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerAdam::initializeFromModel(), initializeFromModel(), energyMinimizerLoLBFGS::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), updater::initializeFromModel(), energyMinimizerFIRE::initializeParameters(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), nesterovStepCPU(), nesterovStepGPU(), and updater::setNdof().
|
protectedinherited |
the total number of non-object sites across all ranks
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), and energyMinimizerFIRE::initializeParameters().
|
protectedinherited |
whether the RNGs give reproducible results
Referenced by updater::setReproducible(), and updater::updater().
|
protectedinherited |
The internal time step size.
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), energyMinimizerLoLBFGS::minimize(), energyMinimizerFIRE::minimize(), nesterovStepCPU(), nesterovStepGPU(), energyMinimizerAdam::setAdamParameters(), energyMinimizerFIRE::setDeltaT(), updater::setDeltaT(), energyMinimizerFIRE::setFIREParameters(), energyMinimizerGradientDescent::setGradientDescentParameters(), energyMinimizerLoLBFGS::setLoLBFGSParameters(), and setNesterovAGParameters().
|
protectedinherited |
The maximum number of iterations allowed.
Referenced by updater::getMaxIterations(), energyMinimizerAdam::minimize(), minimize(), energyMinimizerLoLBFGS::minimize(), and updater::setMaximumIterations().