chombo-discharge
Loading...
Searching...
No Matches
CD_TimeStepper.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_TIMESTEPPER_H
14#define CD_TIMESTEPPER_H
15
16// Chombo includes
17#include <CH_HDF5.H>
18
19// Our includes
22#include <CD_AmrMesh.H>
23#include <CD_NamespaceHeader.H>
24
31{
32public:
37
41 virtual ~TimeStepper();
42
46 TimeStepper(const TimeStepper&) = delete;
47
52 operator=(const TimeStepper&) = delete;
53
58
64 operator=(TimeStepper&&) = default;
65
70 void
72
77 void
79
83 virtual void
85
89 virtual void
90 allocate() = 0;
91
95 virtual void
97
101 virtual void
103
107 virtual void
109
113 virtual void
115
119 virtual void
121
127 virtual void
129
130#ifdef CH_USE_HDF5
135 virtual void
137#endif
138
139#ifdef CH_USE_HDF5
144 virtual void
146#endif
147
148#ifdef CH_USE_HDF5
156 virtual void
158#endif
159
160#ifdef CH_USE_HDF5
167 virtual void
169#endif
170
176 virtual int
178
183 virtual Vector<std::string>
185
193 virtual void
195
200 virtual void
201 prePlot();
202
207 virtual void
208 postPlot();
209
224 virtual Vector<long int>
226
231 virtual Real
233
240 virtual Real
242
249 virtual void
251
256 virtual void
258
266 virtual void
268
275 virtual void
277
282 virtual void
284
291 virtual bool
292 needToRegrid();
293
300 bool
301 keepGoing() const;
302
308 virtual bool
310
324 virtual void
327 const std::string& a_realm,
329 int a_lmin,
330 int a_finestLevel);
331
332protected:
337
342
347
352
359
364
369};
370
371#include <CD_NamespaceFooter.H>
372
373#endif
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Declaration of base class for defining geometries.
Multi-fluid index space.
Base class for advancing equations.
Definition CD_TimeStepper.H:31
virtual void preRegrid(int a_lmin, int a_oldFinestLevel)=0
Perform pre-regrid operations.
virtual void regrid(int a_lmin, int a_oldFinestLevel, int a_newFinestLevel)=0
Time stepper regrid method.
virtual void setupSolvers()=0
Set up solvers.
virtual void prePlot()
An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY b...
Definition CD_TimeStepper.cpp:152
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, int a_level) const =0
Write plot data to output holder.
virtual ~TimeStepper()
Default destructor (does nothing)
void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set the computational geometry.
Definition CD_TimeStepper.cpp:37
Real m_time
TIme.
Definition CD_TimeStepper.H:346
int m_verbosity
Class verbosity.
Definition CD_TimeStepper.H:336
virtual Real computeDt()=0
Compute a time step to be used by Driver.
TimeStepper(TimeStepper &&)=default
Allow move construction.
TimeStepper(const TimeStepper &)=delete
Disallow copy construction.
TimeStepper & operator=(TimeStepper &&)=default
Allow move assignment.
virtual bool loadBalanceThisRealm(const std::string &a_realm) const
Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines...
Definition CD_TimeStepper.cpp:97
TimeStepper & operator=(const TimeStepper &)=delete
Disallow copy assignment.
bool keepGoing() const
Query whether the time stepper wants to continue stepping.
Definition CD_TimeStepper.cpp:50
virtual void printStepReport()=0
Print a step report.
virtual Vector< std::string > getPlotVariableNames() const =0
Get plot variable names.
virtual Real advance(Real a_dt)=0
Advancement method. The implementation of this method should advance all equations of motion.
virtual void registerOperators()=0
Register operators to be used for the simulation.
virtual void loadBalanceBoxes(Vector< Vector< int > > &a_procs, Vector< Vector< Box > > &a_boxes, const std::string &a_realm, const Vector< DisjointBoxLayout > &a_grids, int a_lmin, int a_finestLevel)
Load balance grid boxes for a specified realm.
Definition CD_TimeStepper.cpp:108
virtual void registerRealms()=0
Register realms to be used for the simulation.
virtual Vector< long int > getCheckpointLoads(const std::string &a_realm, int a_level) const
Get computational loads to be checkpointed.
Definition CD_TimeStepper.cpp:78
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Computational geometry.
Definition CD_TimeStepper.H:368
TimeStepper()
Default constructor (does nothing)
Definition CD_TimeStepper.cpp:18
virtual int getNumberOfPlotVariables() const =0
Get the number of plot variables for this time stepper.
virtual void postRegrid()=0
Perform post-regrid operations.
virtual void synchronizeSolverTimes(int a_step, Real a_time, Real a_dt)=0
Synchronzie solver times and time steps.
int m_timeStep
Time step.
Definition CD_TimeStepper.H:341
virtual void initialData()=0
Fill solvers with initial data.
virtual void postInitialize()=0
Post-initialize operations to be performed at end of setup stage.
Real m_dt
Previous time step size.
Definition CD_TimeStepper.H:351
virtual void allocate()=0
Allocate data for the time stepper and solvers.
bool m_keepGoing
If false, Driver will stop the time loop after the current step.
Definition CD_TimeStepper.H:358
virtual bool needToRegrid()
Function which can have Driver do regrids at arbitrary points in the simulation.
Definition CD_TimeStepper.cpp:58
RefCountedPtr< AmrMesh > m_amr
AmrMesh.
Definition CD_TimeStepper.H:363
virtual void postCheckpointSetup()=0
Post-initialize operations to be performed after filling solvers with data read from checkpoint files...
virtual void postPlot()
An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY a...
Definition CD_TimeStepper.cpp:156
void setAmr(const RefCountedPtr< AmrMesh > &a_amr)
Set AmrMesh.
Definition CD_TimeStepper.cpp:24
virtual void parseRuntimeOptions()
Parse runtime options.
Definition CD_TimeStepper.cpp:69
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26