Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
#include <energyMinimizerAdam.h>
Public Member Functions | |
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 | setAdamParameters (scalar b1=0.9, scalar b2=0.99, scalar eps=0.00000001, scalar _dt=0.0001, 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 | |
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 | adamStepCPU () |
void | adamStepGPU () |
Protected Attributes | |
scalar | beta1 |
scalar | beta2 |
scalar | beta1t |
scalar | beta2t |
scalar | epsilon |
scalar | forceMax |
scalar | forceCutoff |
The cutoff value of the maximum force. More... | |
scalar | alpha |
GPUArray< dVec > | biasedMomentumEstimate |
GPUArray< dVec > | biasedMomentumSquaredEstimate |
GPUArray< dVec > | correctedMomentumEstimate |
GPUArray< dVec > | correctedMomentumSquaredEstimate |
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... | |
|
virtual |
by default, set Ndof
Reimplemented from equationOfMotion.
References biasedMomentumEstimate, biasedMomentumSquaredEstimate, correctedMomentumEstimate, correctedMomentumSquaredEstimate, equationOfMotion::displacement, updater::iterations, make_dVec(), updater::model, updater::Ndof, and GPUArray< T >::resize().
Referenced by minimize().
void energyMinimizerAdam::minimize | ( | ) |
Minimize to either the force tolerance or the maximum number of iterations.
References adamStepCPU(), adamStepGPU(), forceCutoff, forceMax, initializeFromModel(), updater::iterations, updater::maxIterations, updater::model, updater::Ndof, updater::sim, and updater::useGPU.
Referenced by performUpdate().
|
inlinevirtual |
The "intergate equatios of motion just calls minimize.
Reimplemented from equationOfMotion.
References minimize().
|
inline |
References beta1, beta1t, beta2, beta2t, updater::deltaT, epsilon, and setForceCutoff().
|
inlinevirtual |
|
inline |
|
protected |
References beta1, beta1t, beta2, beta2t, biasedMomentumEstimate, biasedMomentumSquaredEstimate, correctedMomentumEstimate, correctedMomentumSquaredEstimate, ArrayHandle< T >::data, updater::deltaT, equationOfMotion::displacement, dot(), epsilon, forceMax, updater::model, multiply(), updater::Ndof, scalar, and updater::sim.
Referenced by minimize().
|
protected |
References beta1, beta1t, beta2, beta2t, biasedMomentumEstimate, biasedMomentumSquaredEstimate, correctedMomentumEstimate, correctedMomentumSquaredEstimate, ArrayHandle< T >::data, updater::deltaT, access_location::device, equationOfMotion::displacement, gpu_adam_step(), updater::model, updater::Ndof, access_mode::readwrite, and updater::sim.
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::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 energyMinimizerNesterovAG::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 energyMinimizerNesterovAG::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.
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and setAdamParameters().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and setAdamParameters().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and setAdamParameters().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and setAdamParameters().
|
protected |
Referenced by adamStepCPU(), and setAdamParameters().
|
protected |
Referenced by adamStepCPU(), getMaxForce(), and minimize().
|
protected |
The cutoff value of the maximum force.
Referenced by minimize(), and setForceCutoff().
|
protected |
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and initializeFromModel().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and initializeFromModel().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and initializeFromModel().
|
protected |
Referenced by adamStepCPU(), adamStepGPU(), and initializeFromModel().
|
inherited |
an array of displacements
Referenced by adamStepCPU(), adamStepGPU(), equationOfMotion::getClassSize(), initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), velocityVerlet::integrateEOMCPU(), and velocityVerlet::integrateEOMGPU().
|
inherited |
A pointer to the governing simulation.
Referenced by adamStepCPU(), adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), updater::performUpdate(), and updater::setSimulation().
|
inherited |
A pointer to a simpleModel that the updater acts on.
Referenced by adamStepCPU(), adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), initializeFromModel(), energyMinimizerNesterovAG::initializeFromModel(), energyMinimizerLoLBFGS::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), updater::initializeFromModel(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::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(), initializeFromModel(), energyMinimizerNesterovAG::initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), energyMinimizerFIRE::initializeParameters(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), minimize(), energyMinimizerNesterovAG::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(), minimize(), energyMinimizerNesterovAG::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 adamStepCPU(), adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), updater::getNdof(), updater::getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), initializeFromModel(), energyMinimizerNesterovAG::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(), minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::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 adamStepCPU(), adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), energyMinimizerLoLBFGS::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), setAdamParameters(), energyMinimizerFIRE::setDeltaT(), updater::setDeltaT(), energyMinimizerFIRE::setFIREParameters(), energyMinimizerGradientDescent::setGradientDescentParameters(), energyMinimizerLoLBFGS::setLoLBFGSParameters(), and energyMinimizerNesterovAG::setNesterovAGParameters().
|
protectedinherited |
The maximum number of iterations allowed.
Referenced by updater::getMaxIterations(), minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), and updater::setMaximumIterations().