Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Public Attributes | Protected Attributes | List of all members
updater Class Reference

A base class for implementing simple updaters. More...

#include <baseUpdater.h>

Inheritance diagram for updater:
Inheritance graph
[legend]

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< basicSimulationsim
 A pointer to the governing simulation. More...
 
shared_ptr< simpleModelmodel
 A pointer to a simpleModel that the updater acts on. More...
 
vector< scalarupdaterData
 
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ updater() [1/2]

updater::updater ( )
inline

by default, updaters are called every timestep with no offset

References Period, Phase, reproducible, and useGPU.

◆ updater() [2/2]

updater::updater ( int  _p)
inline

References Period, and Phase.

Member Function Documentation

◆ Update()

virtual void updater::Update ( int  timestep)
inlinevirtual

The fundamental function that a controlling Simulation can call.

References performUpdate(), Period, and Phase.

◆ performUpdate()

void updater::performUpdate ( )
virtual

The function which performs the update.

Reimplemented in energyMinimizerFIRE, energyMinimizerGradientDescent, energyMinimizerLoLBFGS, energyMinimizerNesterovAG, energyMinimizerAdam, and equationOfMotion.

References sim.

Referenced by Update().

◆ setSimulation()

void updater::setSimulation ( shared_ptr< basicSimulation _sim)
inline

set the simulation

References sim.

◆ setModel()

virtual void updater::setModel ( shared_ptr< simpleModel _model)
inlinevirtual

◆ initializeFromModel()

virtual void updater::initializeFromModel ( )
inlinevirtual

◆ setPeriod()

void updater::setPeriod ( int  _p)
inline

set the period

References Period.

◆ setPhase()

void updater::setPhase ( int  _p)
inline

set the phase

References Phase.

◆ spatialSorting()

virtual void updater::spatialSorting ( )
inlinevirtual

allow for spatial sorting to be called if necessary...

◆ setReproducible()

virtual void updater::setReproducible ( bool  rep)
inlinevirtual

Allow for a reproducibility call to be made.

References reproducible.

◆ setGPU()

virtual void updater::setGPU ( bool  _useGPU = true)
inlinevirtual

◆ getNdof()

int updater::getNdof ( )
inline

Get the number of degrees of freedom of the equation of motion.

References Ndof.

◆ setNdof()

void updater::setNdof ( int  _n)
inline

Set the number of degrees of freedom of the equation of motion.

References Ndof.

◆ setDeltaT()

virtual void updater::setDeltaT ( scalar  dt)
inlinevirtual

allow all updaters to potentially implement an internal time scale

Reimplemented in energyMinimizerFIRE.

References deltaT.

Referenced by energyMinimizerGradientDescent::initializeParameters(), and energyMinimizerGradientDescent::setGradientDescentParameters().

◆ setNThreads()

virtual void updater::setNThreads ( int  n)
inlinevirtual

allow for setting multiple threads

References n, and nThreads.

◆ getMaxForce()

virtual scalar updater::getMaxForce ( )
inlinevirtual

◆ setMaximumIterations()

void updater::setMaximumIterations ( int  maxIt)
inline

◆ getCurrentIterations()

int updater::getCurrentIterations ( )
inline

References iterations.

◆ getMaxIterations()

int updater::getMaxIterations ( )
inline

References maxIterations.

◆ setCurrentIterations()

void updater::setCurrentIterations ( int  newIterations)
inline

References iterations.

◆ getClassSize()

virtual scalar updater::getClassSize ( )
inlinevirtual

◆ getNTotal()

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.

Member Data Documentation

◆ sim

shared_ptr<basicSimulation> updater::sim

◆ model

shared_ptr<simpleModel> updater::model

◆ updaterData

vector<scalar> updater::updaterData

◆ iterations

int updater::iterations

◆ nThreads

int updater::nThreads =1
protected

number of threads to use

Referenced by setNThreads().

◆ Period

int updater::Period
protected

The period of the updater... the updater will work every Period timesteps.

Referenced by setPeriod(), Update(), and updater().

◆ Phase

int updater::Phase
protected

The phase of the updater... the updater will work every Period timesteps offset by a phase.

Referenced by setPhase(), Update(), and updater().

◆ useGPU

bool updater::useGPU
protected

◆ neverGPU

bool updater::neverGPU
protected

◆ Ndof

int updater::Ndof
protected

◆ nTotal

int updater::nTotal
protected

◆ reproducible

bool updater::reproducible
protected

whether the RNGs give reproducible results

Referenced by setReproducible(), and updater().

◆ deltaT

scalar updater::deltaT
protected

◆ maxIterations

int updater::maxIterations
protected

The documentation for this class was generated from the following files: