8 #include "TwoStepIntegrator.h" 9 #include <ddMd/simulation/Simulation.h> 10 #include <ddMd/storage/AtomStorage.h> 11 #include <ddMd/communicate/Exchanger.h> 13 #include <ddMd/modifiers/ModifierManager.h> 15 #include <ddMd/analyzers/AnalyzerManager.h> 16 #include <ddMd/potentials/pair/PairPotential.h> 17 #include <simp/ensembles/BoundaryEnsemble.h> 18 #include <util/misc/Log.h> 50 UTIL_THROW(
"Error: Atom coordinates are Cartesian");
71 modifierManager.
setup();
73 analyzerManager.
setup();
79 int endStep =
iStep_ + nStep;
85 UTIL_THROW(
"Error: Atomic coordinates are not Cartesian");
99 timer().
stamp(ANALYZER);
101 #ifdef DDMD_MODIFIERS 103 timer().
stamp(MODIFIER);
108 timer().
stamp(INTEGRATE1);
113 #ifdef DDMD_INTEGRATOR_DEBUG 116 timer().
stamp(DEBUG);
119 #ifdef DDMD_MODIFIERS 121 timer().
stamp(MODIFIER);
129 UTIL_THROW(
"Error: atomic coordinates are not Cartesian");
135 #ifdef DDMD_MODIFIERS 137 timer().
stamp(MODIFIER);
143 timer().
stamp(Integrator::TRANSFORM_F);
145 #ifdef DDMD_MODIFIERS 147 timer().
stamp(MODIFIER);
152 timer().
stamp(Integrator::EXCHANGE);
154 #ifdef DDMD_MODIFIERS 156 timer().
stamp(MODIFIER);
161 timer().
stamp(Integrator::CELLLIST);
165 timer().
stamp(Integrator::TRANSFORM_R);
170 timer().
stamp(Integrator::PAIRLIST);
172 #ifdef DDMD_MODIFIERS 174 timer().
stamp(MODIFIER);
179 #ifdef DDMD_MODIFIERS 181 timer().
stamp(MODIFIER);
186 timer().
stamp(UPDATE);
188 #ifdef DDMD_MODIFIERS 190 timer().
stamp(MODIFIER);
196 #ifdef DDMD_INTEGRATOR_DEBUG 199 timer().
stamp(DEBUG);
203 UTIL_THROW(
"Error: Atomic coordinates are not Cartesian");
206 #ifdef DDMD_MODIFIERS 208 timer().
stamp(MODIFIER);
222 #ifdef DDMD_MODIFIERS 224 timer().
stamp(MODIFIER);
230 timer().
stamp(INTEGRATE2);
232 #ifdef DDMD_INTEGRATOR_DEBUG 235 timer().
stamp(DEBUG);
238 #ifdef DDMD_MODIFIERS 240 timer().
stamp(MODIFIER);
258 if (
domain().isMaster()) {
Signal & modifySignal()
Signal to force unsetting of quantities that depend on x, v, or f.
void makeSnapshot()
Record current positions of all local atoms and lock storage.
PairPotential & pairPotential()
Get the PairPotential.
int iStep_
Current step number.
ModifierManager & modifierManager()
Return the ModifierManager by reference.
void computeForces()
Compute forces for all local atoms, with timing.
void update()
Update ghost atom coordinates.
void transformGenToCart(const Boundary &boundary)
Transform positions from generalized to Cartesian coordinates.
void postNeighbor(long iStep)
Call on exchange steps after re-building the neighbor list.
void preTransform(long iStep)
Call on exchange steps before transforming to scaled coordinates.
void postUpdate(long iStep)
Call on update steps after updating ghost positions.
TwoStepIntegrator(Simulation &simulation)
Constructor.
BoundaryEnsemble & boundaryEnsemble()
Get the BoundaryEnsemble.
Manager for a list of Analyzer objects.
void setup()
Call setup method of each Analyzer.
Boundary & boundary()
Get the Boundary.
void buildPairList()
Build the Verlet Pair list.
AnalyzerManager & analyzerManager()
Return the AnalyzerManager by reference.
void stop()
Stop total time accumulation.
void endOfStep(long iStep)
Call after 2nd integration step, at end of the time step.
bool isExchangeNeeded(double skin)
Determine whether an atom exchange and reneighboring is needed.
File containing preprocessor macros for error handling.
Parallel domain decomposition (DD) MD simulation.
Classes used by all simpatico molecular simulations.
Main object for a domain-decomposition MD simulation.
void buildCellList()
Build a cell list.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void computeForcesAndVirial()
Compute forces for all local atoms and virial, with timing.
void stamp(int id)
Mark end of interval id.
virtual void integrateStep1()=0
Execute first step of two-step integrator.
void preIntegrate1(long iStep)
Call just before the first step of velocity-Verlet algorithm.
void sample(long iStep)
Call sample method of each Analyzer, if scheduled.
An Integrator numerically integrates the equations of motion.
void notify(const T &t)
Notify all observers.
Utility classes for scientific computation.
virtual void integrateStep2()=0
Execute secodn step of two-step integrator.
void postExchange(long iStep)
Call on exchange steps after atom exchange, before reneighboring.
int saveInterval() const
Get interval for writing a restart file.
Domain & domain()
Get the Domain.
void preUpdate(long iStep)
Call on update steps before updating ghost positions.
~TwoStepIntegrator()
Destructor.
Exchanger & exchanger()
Get the Exchanger.
void clearSnapshot()
Clear previous snapshot.
AtomStorage & atomStorage()
Get the AtomStorage.
void computeNAtomTotal(MPI::Intracomm &communicator)
Compute the total number of local atoms on all processors.
Simulation & simulation()
Get the parent simulation.
static std::ostream & file()
Get log ostream by reference.
void run(int nStep)
Run a simulation.
Manager for a set of Modifier objects.
DdTimer & timer()
Return internal timer by reference.
void preForce(long iStep)
Call after updating but before calculating forces.
virtual void setup()=0
Setup integrator just before integration.
void postIntegrate1(long iStep)
Call just after the first step of velocity-Verlet algorithm.
void exchange()
Exchange local atoms and ghosts.
bool isValid()
Return true if this Simulation is valid, or throw an Exception.
Signal & exchangeSignal()
Signal to indicate exchange of atoms and groups.
void save(const std::string &filename)
Save state to a restart file.
void setup()
Setup before entering the main loop.
void preExchange(long iStep)
Call on exchange steps after transforming, before exchanging.
void start()
Clear statistics, mark a start time.
void postForce(long iStep)
Call after calculating forces.
void transformCartToGen(const Boundary &boundary)
Transform positions from Cartesian to generalized coordinates.
void unsetNAtomTotal()
Unset value of NAtomTotal (mark as unknown).
const std::string & saveFileName() const
Get restart file base name.