Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
A class that ties together all the parts of a simulation. More...
#include <simulation.h>
Public Member Functions | |
void | setConfiguration (ConfigPtr _config) |
Pass in a reference to the configuration. More... | |
virtual void | computeForces () |
Call the force computer to compute the forces. More... | |
virtual void | moveParticles (GPUArray< dVec > &displacements, scalar scale=1.0) |
Call the configuration to move particles around. More... | |
void | performTimestep () |
Call every updater to advance one time step. More... | |
shared_ptr< Simulation > | getPointer () |
return a shared pointer to this Simulation More... | |
void | addUpdater (UpdaterPtr _upd) |
Add an updater. More... | |
void | addUpdater (UpdaterPtr _upd, ConfigPtr _config) |
Add an updater with a reference to a configuration. More... | |
void | addForce (ForcePtr _force) |
Add a force computer configuration. More... | |
void | addForce (ForcePtr _force, ConfigPtr _config) |
Add a force computer configuration. More... | |
void | clearForceComputers () |
Clear out the vector of forceComputes. More... | |
void | clearUpdaters () |
Clear out the vector of updaters. More... | |
scalar | getMaxForce () |
A utility function that just checks the first updater for a max force. More... | |
virtual scalar | computePotentialEnergy (bool verbose=false) |
compute the potential energy associated with all of the forces More... | |
virtual scalar | computeKineticEnergy (bool verbose=false) |
compute the kinetic energy More... | |
virtual scalar | computeEnergy (bool verbose=false) |
compute the total energy More... | |
virtual void | computePressureTensor (MatrixDxD &P) |
compute the pressure tensor More... | |
void | setIntegrationTimestep (scalar dt) |
Set the simulation timestep. More... | |
void | setCPUOperation (bool setcpu) |
turn on CPU-only mode for all components More... | |
void | setReproducible (bool reproducible) |
Enforce reproducible dynamics. More... | |
void | setNThreads (int n) |
work with openMP threads More... | |
void | setBox (BoxPtr _box) |
This changes the contents of the Box pointed to by Box to match that of _box. More... | |
void | setSortPeriod (int sp) |
Set the time between spatial sorting operations. More... | |
virtual void | setCurrentTime (scalar _cTime) |
reset the simulation clock More... | |
virtual void | setCurrentTimestep (int _cTime) |
reset the simulation clock counter More... | |
virtual void | sumUpdaterData (vector< scalar > &data) |
manipulate data from updaters More... | |
Public Attributes | |
vector< WeakUpdaterPtr > | updaters |
A vector of updaters that the simulation will loop through. More... | |
vector< WeakForcePtr > | forceComputers |
A vector of force computes the simulation will loop through. More... | |
WeakConfigPtr | configuration |
The configuration of particles. More... | |
BoxPtr | Box |
The domain of the simulation. More... | |
int | integerTimestep |
An integer that keeps track of how often performTimestep has been called. More... | |
scalar | Time |
The current simulation time. More... | |
scalar | integrationTimestep |
The dt of a time step. More... | |
bool | useGPU |
A flag controlling whether to use the GPU. More... | |
int | myRank |
integer for this rank More... | |
int | nRanks |
total number of ranks More... | |
int | NActive = 0 |
some measure of the number of active degrees of freedom More... | |
Protected Attributes | |
int | sortPeriod |
Determines how frequently the spatial sorter be called...once per sortPeriod Timesteps. When sortPeriod < 0 no sorting occurs. More... | |
bool | spatialSortThisStep |
A flag that determins if a spatial sorting is due to occur this Timestep. More... | |
A class that ties together all the parts of a simulation.
Simulation objects should have a configuration set, and then at least one updater (such as an equation of motion). In addition to being a centralized object controlling the progression of a simulation of cell models, the Simulation class provides some interfaces to cell configuration and updater parameter setters.
void Simulation::setConfiguration | ( | ConfigPtr | _config | ) |
Pass in a reference to the configuration.
Set a pointer to the configuration
References basicSimulation::Box, and basicSimulation::configuration.
|
virtual |
Call the force computer to compute the forces.
Calls all force computers, and evaluate the self force calculation if the model demands it
Implements basicSimulation.
References basicSimulation::configuration, and forceComputers.
Call the configuration to move particles around.
Calls the configuration to displace the degrees of freedom
Implements basicSimulation.
References basicSimulation::configuration.
void Simulation::performTimestep | ( | ) |
Call every updater to advance one time step.
Call all relevant functions to advance the system one time step; every sortPeriod also call the spatial sorting routine.
References basicSimulation::integerTimestep, basicSimulation::integrationTimestep, basicSimulation::Time, and updaters.
|
inline |
return a shared pointer to this Simulation
Referenced by addUpdater().
|
inline |
Add an updater.
References updaters.
void Simulation::addUpdater | ( | UpdaterPtr | _upd, |
ConfigPtr | _config | ||
) |
Add an updater with a reference to a configuration.
Add a pointer to the list of updaters, and give that updater a reference to the model...
References getPointer(), and updaters.
|
inline |
Add a force computer configuration.
References forceComputers.
Add a force computer configuration.
Add a pointer to the list of force computers, and give that FC a reference to the model...
References forceComputers.
|
inline |
Clear out the vector of forceComputes.
References forceComputers.
|
inline |
Clear out the vector of updaters.
References updaters.
|
inline |
A utility function that just checks the first updater for a max force.
References updaters.
|
virtual |
compute the potential energy associated with all of the forces
Reimplemented from basicSimulation.
References forceComputers, and scalar.
Referenced by computeEnergy().
|
virtual |
compute the kinetic energy
Reimplemented from basicSimulation.
References basicSimulation::configuration.
Referenced by computeEnergy().
|
inlinevirtual |
compute the total energy
References computeKineticEnergy(), and computePotentialEnergy().
|
virtual |
compute the pressure tensor
References for(), forceComputers, make_dVec(), and MatrixDxD::mat.
void Simulation::setIntegrationTimestep | ( | scalar | dt | ) |
Set the simulation timestep.
References basicSimulation::integrationTimestep, and updaters.
void Simulation::setCPUOperation | ( | bool | setcpu | ) |
turn on CPU-only mode for all components
References basicSimulation::configuration, forceComputers, updaters, and basicSimulation::useGPU.
void Simulation::setReproducible | ( | bool | reproducible | ) |
Enforce reproducible dynamics.
References updaters.
void Simulation::setNThreads | ( | int | n | ) |
work with openMP threads
References basicSimulation::configuration, forceComputers, n, and updaters.
|
inherited |
This changes the contents of the Box pointed to by Box to match that of _box.
Set a new Box for the simulation...This is the function that should be called to propagate a change in the box dimensions throughout the simulation...
References basicSimulation::Box, and basicSimulation::configuration.
|
inlineinherited |
Set the time between spatial sorting operations.
References basicSimulation::sortPeriod.
|
virtualinherited |
reset the simulation clock
References basicSimulation::Time.
|
inlinevirtualinherited |
reset the simulation clock counter
References basicSimulation::integerTimestep.
|
inlinevirtualinherited |
manipulate data from updaters
Reimplemented in multirankSimulation.
vector<WeakUpdaterPtr> Simulation::updaters |
A vector of updaters that the simulation will loop through.
Referenced by addUpdater(), clearUpdaters(), getMaxForce(), performTimestep(), setCPUOperation(), setIntegrationTimestep(), setNThreads(), and setReproducible().
vector<WeakForcePtr> Simulation::forceComputers |
A vector of force computes the simulation will loop through.
Referenced by addForce(), clearForceComputers(), computeForces(), computePotentialEnergy(), computePressureTensor(), setCPUOperation(), and setNThreads().
|
inherited |
The configuration of particles.
Referenced by computeForces(), computeKineticEnergy(), moveParticles(), basicSimulation::setBox(), setConfiguration(), setCPUOperation(), and setNThreads().
|
inherited |
The domain of the simulation.
Referenced by basicSimulation::basicSimulation(), basicSimulation::setBox(), setConfiguration(), and multirankSimulation::setConfiguration().
|
inherited |
An integer that keeps track of how often performTimestep has been called.
Referenced by performTimestep(), multirankSimulation::performTimestep(), and basicSimulation::setCurrentTimestep().
|
inherited |
The current simulation time.
Referenced by performTimestep(), multirankSimulation::performTimestep(), and basicSimulation::setCurrentTime().
|
inherited |
The dt of a time step.
Referenced by performTimestep(), multirankSimulation::performTimestep(), setIntegrationTimestep(), and multirankSimulation::setIntegrationTimestep().
|
inherited |
A flag controlling whether to use the GPU.
Referenced by multirankSimulation::communicateHaloSitesRoutine(), multirankSimulation::computeForces(), setCPUOperation(), multirankSimulation::setCPUOperation(), and multirankSimulation::synchronizeAndTransferBuffers().
|
inherited |
integer for this rank
Referenced by multirankSimulation::multirankSimulation(), and multirankSimulation::setRankTopology().
|
inherited |
total number of ranks
Referenced by multirankSimulation::communicateHaloSitesRoutine(), multirankSimulation::setRankTopology(), multirankSimulation::sumUpdaterData(), and multirankSimulation::synchronizeAndTransferBuffers().
|
inherited |
some measure of the number of active degrees of freedom
Referenced by multirankSimulation::computePotentialEnergy(), and multirankSimulation::finalizeObjects().
|
protectedinherited |
Determines how frequently the spatial sorter be called...once per sortPeriod Timesteps. When sortPeriod < 0 no sorting occurs.
Referenced by basicSimulation::setSortPeriod().
|
protectedinherited |
A flag that determins if a spatial sorting is due to occur this Timestep.