Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
A base class for implementing simple updaters. More...
#include <baseUpdater.h>
Public Member Functions | |
updater () | |
by default, updaters are called every timestep with no offset More... | |
updater (int _p) | |
virtual void | Update (int timestep) |
The fundamental function that a controlling Simulation can call. More... | |
virtual void | performUpdate () |
The function which performs the update. 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... | |
virtual void | initializeFromModel () |
by default, set Ndof 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... | |
virtual scalar | getMaxForce () |
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) |
virtual scalar | getClassSize () |
int | getNTotal () |
communicate the number of non-object sites across ranks More... | |
Public Attributes | |
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 Attributes | |
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... | |
A base class for implementing simple updaters.
In dDimensionalSimulation an updater is some class object that can update something about the underlying state of the system. An example might be an equation of motion, or an updater that periodically subtracts off any center-of-mass motion of a system as it evolves, etc.. A simulation will call all updaters in a loop, e.g. for(each updater i in list) updater[i].Update(Timestep) To facilitate this structure, but acknowledge that any given updater might only need to be called occasionally, the Update function is passed a timestep, and each updaters has a period that should be set.
|
inline |
by default, updaters are called every timestep with no offset
References Period, Phase, reproducible, and useGPU.
|
inlinevirtual |
The fundamental function that a controlling Simulation can call.
References performUpdate(), Period, and Phase.
|
virtual |
The function which performs the update.
Reimplemented in energyMinimizerFIRE, energyMinimizerGradientDescent, energyMinimizerLoLBFGS, energyMinimizerNesterovAG, energyMinimizerAdam, and equationOfMotion.
References sim.
Referenced by Update().
|
inline |
set the simulation
References sim.
|
inlinevirtual |
virtual function to allow the model to be a derived class
References initializeFromModel(), and model.
Referenced by energyMinimizerFIRE::energyMinimizerFIRE(), energyMinimizerGradientDescent::energyMinimizerGradientDescent(), energyMinimizerLoLBFGS::energyMinimizerLoLBFGS(), and energyMinimizerNesterovAG::energyMinimizerNesterovAG().
|
inlinevirtual |
by default, set Ndof
Reimplemented in energyMinimizerFIRE, energyMinimizerGradientDescent, equationOfMotion, energyMinimizerLoLBFGS, energyMinimizerNesterovAG, and energyMinimizerAdam.
Referenced by setModel().
|
inline |
set the period
References Period.
|
inline |
set the phase
References Phase.
|
inlinevirtual |
allow for spatial sorting to be called if necessary...
|
inlinevirtual |
Allow for a reproducibility call to be made.
References reproducible.
|
inlinevirtual |
Enforce GPU operation.
References useGPU.
Referenced by energyMinimizerNesterovAG::initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
|
inline |
Get the number of degrees of freedom of the equation of motion.
References Ndof.
|
inline |
Set the number of degrees of freedom of the equation of motion.
References Ndof.
|
inlinevirtual |
allow all updaters to potentially implement an internal time scale
Reimplemented in energyMinimizerFIRE.
References deltaT.
Referenced by energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerGradientDescent::setGradientDescentParameters().
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in energyMinimizerFIRE, energyMinimizerGradientDescent, energyMinimizerLoLBFGS, energyMinimizerNesterovAG, and energyMinimizerAdam.
|
inline |
Set the maximum number of iterations before terminating (or set to -1 to ignore)
References maxIterations.
Referenced by energyMinimizerNesterovAG::initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
|
inline |
References iterations.
|
inline |
References maxIterations.
|
inline |
References iterations.
|
inlinevirtual |
Reimplemented in energyMinimizerFIRE, energyMinimizerLoLBFGS, energyMinimizerGradientDescent, and equationOfMotion.
References scalar.
Referenced by equationOfMotion::getClassSize().
int updater::getNTotal | ( | ) |
communicate the number of non-object sites across ranks
References access_location::host, model, Ndof, nTotal, access_mode::read, sim, and updaterData.
shared_ptr<basicSimulation> updater::sim |
A pointer to the governing simulation.
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), performUpdate(), and setSimulation().
shared_ptr<simpleModel> updater::model |
A pointer to a simpleModel that the updater acts on.
Referenced by energyMinimizerAdam::adamStepCPU(), energyMinimizerAdam::adamStepGPU(), energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerAdam::initializeFromModel(), energyMinimizerNesterovAG::initializeFromModel(), energyMinimizerLoLBFGS::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), initializeFromModel(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), and setModel().
vector<scalar> updater::updaterData |
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerFIRE::initializeParameters().
int updater::iterations |
The number of iterations performed.
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), getCurrentIterations(), energyMinimizerAdam::initializeFromModel(), energyMinimizerNesterovAG::initializeParameters(), energyMinimizerLoLBFGS::initializeParameters(), energyMinimizerGradientDescent::initializeParameters(), energyMinimizerFIRE::initializeParameters(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), and setCurrentIterations().
|
protected |
number of threads to use
Referenced by setNThreads().
|
protected |
The period of the updater... the updater will work every Period timesteps.
Referenced by setPeriod(), Update(), and updater().
|
protected |
The phase of the updater... the updater will work every Period timesteps offset by a phase.
Referenced by setPhase(), Update(), and updater().
|
protected |
whether the updater does its work on the GPU or not
Referenced by energyMinimizerFIRE::fireStep(), energyMinimizerGradientDescent::gradientDescentStep(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), setGPU(), and updater().
|
protected |
whether the updater never does work on the GPU
Referenced by equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), and energyMinimizerFIRE::initializeFromModel().
|
protected |
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(), getNdof(), getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), energyMinimizerAdam::initializeFromModel(), energyMinimizerNesterovAG::initializeFromModel(), energyMinimizerLoLBFGS::initializeFromModel(), equationOfMotion::initializeFromModel(), energyMinimizerGradientDescent::initializeFromModel(), energyMinimizerFIRE::initializeFromModel(), initializeFromModel(), energyMinimizerFIRE::initializeParameters(), velocityVerlet::integrateEOMCPU(), velocityVerlet::integrateEOMGPU(), equationOfMotion::integrateEquationOfMotion(), energyMinimizerLoLBFGS::lineSearchCPU(), energyMinimizerLoLBFGS::LoLBFGSStepCPU(), energyMinimizerLoLBFGS::LoLBFGSStepGPU(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), energyMinimizerGradientDescent::minimize(), energyMinimizerFIRE::minimize(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), and setNdof().
|
protected |
the total number of non-object sites across all ranks
Referenced by energyMinimizerFIRE::fireStepCPU(), energyMinimizerFIRE::fireStepGPU(), getNTotal(), energyMinimizerGradientDescent::gradientDescentCPU(), energyMinimizerGradientDescent::gradientDescentGPU(), and energyMinimizerFIRE::initializeParameters().
|
protected |
whether the RNGs give reproducible results
Referenced by setReproducible(), and updater().
|
protected |
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(), energyMinimizerNesterovAG::nesterovStepCPU(), energyMinimizerNesterovAG::nesterovStepGPU(), energyMinimizerAdam::setAdamParameters(), energyMinimizerFIRE::setDeltaT(), setDeltaT(), energyMinimizerFIRE::setFIREParameters(), energyMinimizerGradientDescent::setGradientDescentParameters(), energyMinimizerLoLBFGS::setLoLBFGSParameters(), and energyMinimizerNesterovAG::setNesterovAGParameters().
|
protected |
The maximum number of iterations allowed.
Referenced by getMaxIterations(), energyMinimizerAdam::minimize(), energyMinimizerNesterovAG::minimize(), energyMinimizerLoLBFGS::minimize(), and setMaximumIterations().