chombo-discharge
|
Base class for advancing equations. More...
#include <CD_TimeStepper.H>
Public Member Functions | |
TimeStepper () | |
Default constructor (does nothing) | |
virtual | ~TimeStepper () |
Default destructor (does nothing) | |
void | setAmr (const RefCountedPtr< AmrMesh > &a_amr) |
Set AmrMesh. More... | |
void | setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
Set the computational geometry. More... | |
virtual void | setupSolvers ()=0 |
Set up solvers. | |
virtual void | allocate ()=0 |
Allocate data for the time stepper and solvers. | |
virtual void | initialData ()=0 |
Fill solvers with initial data. | |
virtual void | postInitialize ()=0 |
Post-initialize operations to be performed at end of setup stage. | |
virtual void | postCheckpointSetup ()=0 |
Post-initialize operations to be performed after filling solvers with data read from checkpoint files. | |
virtual void | registerRealms ()=0 |
Register realms to be used for the simulation. | |
virtual void | registerOperators ()=0 |
Register operators to be used for the simulation. | |
virtual void | parseRuntimeOptions () |
Parse runtime options. More... | |
virtual int | getNumberOfPlotVariables () const =0 |
Get the number of plot variables for this time stepper. More... | |
virtual Vector< std::string > | getPlotVariableNames () const =0 |
Get plot variable names. | |
virtual void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const =0 |
Write plot data to output holder. More... | |
virtual void | prePlot () |
An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY before writing the plot file. | |
virtual void | postPlot () |
An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY after writing the plot file. | |
virtual Vector< long int > | getCheckpointLoads (const std::string a_realm, const int a_level) const |
Get computational loads to be checkpointed. More... | |
virtual Real | computeDt ()=0 |
Compute a time step to be used by Driver. | |
virtual Real | advance (const Real a_dt)=0 |
Advancement method. The implementation of this method should advance all equations of motion. More... | |
virtual void | synchronizeSolverTimes (const int a_step, const Real a_time, const Real a_dt)=0 |
Synchronzie solver times and time steps. More... | |
virtual void | printStepReport ()=0 |
Print a step report. More... | |
virtual void | preRegrid (const int a_lmin, const int a_oldFinestLevel)=0 |
Perform pre-regrid operations. More... | |
virtual void | regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)=0 |
Time stepper regrid method. More... | |
virtual void | postRegrid ()=0 |
Perform post-regrid operations. More... | |
virtual bool | needToRegrid () |
Fuction which can have Driver do regrids at arbitrary points in the simulation. More... | |
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 will be called during regrids. More... | |
virtual void | loadBalanceBoxes (Vector< Vector< int >> &a_procs, Vector< Vector< Box >> &a_boxes, const std::string a_realm, const Vector< DisjointBoxLayout > &a_grids, const int a_lmin, const int a_finestLevel) |
Load balance grid boxes for a specified realm. More... | |
Protected Attributes | |
int | m_verbosity |
Class verbosity. | |
int | m_timeStep |
Time step. | |
Real | m_time |
TIme. | |
Real | m_dt |
Previous time step size. | |
RefCountedPtr< AmrMesh > | m_amr |
AmrMesh. | |
RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
Computational geometry. | |
Base class for advancing equations.
This class is used by Driver for advancing sets of equations. In short, this class should implement a time-stepping routine for a set of solvers. One should also implement routines for setting up the solvers, allocating necessary memory, regridding etc.
|
pure virtual |
Advancement method. The implementation of this method should advance all equations of motion.
[in] | a_dt | Time step to be used for advancement |
Implemented in Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::ItoKMC::ItoKMCGodunovStepper< I, C, R, F >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaImExSdcStepper, Physics::CdrPlasma::CdrPlasmaGodunovStepper, Physics::BrownianWalker::BrownianWalkerStepper, and Physics::AdvectionDiffusion::AdvectionDiffusionStepper.
|
virtual |
Get computational loads to be checkpointed.
This is used by Driver both for setting up load-balanced restarts AND for plotting the computational loads to a file. This routine is disjoint from loadBalanceBoxes because this routine is not part of a regrid. This means that we are not operating with temporarily load balanced grids where the but the final ones.
Also note that the return vector has the same ordering as the DisjointBoxLayout's boxes on the input grid level. See the implementation for further details.
[in] | a_realm | Realm |
[in] | a_level | Grid level |
Reimplemented in Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >, and Physics::BrownianWalker::BrownianWalkerStepper.
|
pure virtual |
Get the number of plot variables for this time stepper.
This is necessary because Driver, not TimeStepper, is responsible for allocating the necessary memory.
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
|
virtual |
Load balance grid boxes for a specified realm.
[out] | a_procs | MPI ranks owning the various grid boxes. |
[out] | a_boxes | Grid boxes on every level (obtain them with a_grids[lvl].boxArray()) |
[in] | a_realm | Realm identifier |
[in] | a_grids | Original grids |
[in] | a_lmin | Coarsest grid level that changed |
[in] | a_finestLevel | New finest grid level |
This is only called by Driver if TimeStepper::loadBalanceThisRealm(a_realm) returned true. The default implementation uses volume-based loads for the grid patches. If the user wants to load balance boxes on a realm, this routine must be overwritten and he should compute loads for the various patches in a_grids and call LoadBalancing::makeBalance on each level. It is up to the user/programmer to decide if load balancing should be done independently on each level, or if loads per MPI rank are accumulated across levels.
Reimplemented in Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >, Physics::Electrostatics::FieldStepper< T >, and Physics::BrownianWalker::BrownianWalkerStepper.
|
virtual |
Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines will be called during regrids.
[in] | a_realm | Realm name |
Reimplemented in Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >, Physics::Electrostatics::FieldStepper< T >, and Physics::BrownianWalker::BrownianWalkerStepper.
|
virtual |
Fuction which can have Driver do regrids at arbitrary points in the simulation.
This is called by Driver at every time step and if it returns true, Driver will regrid, regardless of whether or not it is on the regular "regrid intervals".
Reimplemented in Physics::BrownianWalker::BrownianWalkerStepper.
|
virtual |
Parse runtime options.
Override this routine if your time stepper can use run-time configuration of the solvers that it advances. This can e.g. be the CFL condition.
Reimplemented in Physics::CdrPlasma::CdrPlasmaStepper, Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaImExSdcStepper, Physics::CdrPlasma::CdrPlasmaGodunovStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCGodunovStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
|
pure virtual |
Perform post-regrid operations.
This includes all operations to be done AFTER interpolating data to new grids.
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaGodunovStepper, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
|
pure virtual |
Perform pre-regrid operations.
This should include all copying all data which should be interpolated to the new grids. It can also include deallocating memory in case the regrid operation takes a lot of memory.
[in] | a_lmin | The coarsest level that changes |
[in] | a_oldFinestLevel | The finest level before the regrid. |
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::ItoKMC::ItoKMCGodunovStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >, Physics::CdrPlasma::CdrPlasmaGodunovStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::Electrostatics::FieldStepper< T >, and Physics::AdvectionDiffusion::AdvectionDiffusionStepper.
|
pure virtual |
Print a step report.
This is called by Driver after time step. The routine can be used to display use information about the simulation progress.
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
|
pure virtual |
Time stepper regrid method.
[in] | a_lmin | The coarsest level that changed. |
[in] | a_oldFinestLevel | The finest level before the regrid. |
[in] | a_newFinestLevel | The finest level after the regrid. |
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaGodunovStepper, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCGodunovStepper< I, C, R, F >, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
void TimeStepper::setAmr | ( | const RefCountedPtr< AmrMesh > & | a_amr | ) |
void TimeStepper::setComputationalGeometry | ( | const RefCountedPtr< ComputationalGeometry > & | a_computationalGeometry | ) |
Set the computational geometry.
[in] | a_computationalGeometry | The computational geometry. |
|
pure virtual |
Synchronzie solver times and time steps.
[in] | a_step | Time step |
[in] | a_time | Time (in seconds) |
[in] | a_dt | Time step that was used. |
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Geometry::GeometryStepper, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.
|
pure virtual |
Write plot data to output holder.
[in,out] | a_output | Output data holder. |
[in,out] | a_icomp | Starting component in a_output to begin at. |
[in] | a_outputRealm | Realm where a_output belongs |
[in] | a_level | Grid level |
Implemented in Physics::TracerParticle::TracerParticleStepper< P >, Physics::Geometry::GeometryStepper, Physics::RadiativeTransfer::RadiativeTransferStepper< T >, Physics::MeshODE::MeshODEStepper< N >, Physics::Electrostatics::FieldStepper< T >, Physics::DischargeInception::DischargeInceptionStepper< P, F, C >, Physics::CdrPlasma::CdrPlasmaStepper, Physics::BrownianWalker::BrownianWalkerStepper, Physics::AdvectionDiffusion::AdvectionDiffusionStepper, Physics::ItoKMC::ItoKMCStepper< I, C, R, F >, and Physics::ItoKMC::ItoKMCStepper< ItoSolver, CdrCTU, McPhoto, FieldSolverMultigrid >.