chombo-discharge
|
Class for solving dy/dt = f on an AMR hierarchy. More...
#include <CD_MeshODESolver.H>
Public Types | |
using | RHSFunction = std::function< std::array< Real, N >(const std::array< Real, N > &, const Real)> |
Alias for right-hand side. | |
Public Member Functions | |
MeshODESolver () | |
Default constructor. Must subsequently set everything through public member functions. | |
MeshODESolver (const RefCountedPtr< AmrMesh > &a_amr) noexcept | |
Full constructor. More... | |
MeshODESolver (const MeshODESolver &)=delete | |
Disallowed copy constructor. | |
MeshODESolver (const MeshODESolver &&)=delete | |
Disallowed move constructor. | |
virtual | ~MeshODESolver () |
Destructor. | |
MeshODESolver & | operator= (const MeshODESolver &)=delete |
Disallowed assignment operator. | |
MeshODESolver & | operator= (const MeshODESolver &&)=delete |
Disallowed move assignement operator. | |
virtual void | setAmr (const RefCountedPtr< AmrMesh > &a_amrMesh) noexcept |
Set AmrMesh. More... | |
virtual void | parseOptions () noexcept |
Parse class options. | |
virtual void | parseRuntimeOptions () noexcept |
Parse run-time configurable class options. | |
virtual void | allocate () noexcept |
Allocate internal storage. | |
virtual void | setPhi (const std::function< Real(const RealVect &a_pos)> &a_phiFunc, const size_t a_comp) noexcept |
Set phi for a specific component. More... | |
virtual void | setPhi (const std::function< std::array< Real, N >(const RealVect &a_pos)> &a_phiFunc) noexcept |
Set phi everywhere. More... | |
virtual void | setRHS (const std::function< Real(const RealVect &a_pos)> &a_srcFunc, const size_t a_comp) noexcept |
Set right-hand side for specified component. More... | |
virtual void | computeRHS (const RHSFunction &a_rhsFunction) noexcept |
Compute right-hand side from left-hand side. I.e. compute f = f(y,t). More... | |
virtual void | computeRHS (EBAMRCellData &rhs, const RHSFunction &a_rhsFunction) const noexcept |
Compute right-hand side from left-hand side. I.e. compute f = f(y,t). More... | |
EBAMRCellData & | getPhi () noexcept |
Get the solution vector (left-hand side of equation). | |
const EBAMRCellData & | getPhi () const noexcept |
Get the solution vector (left-hand side of equation). | |
EBAMRCellData & | getRHS () noexcept |
Get the solution vector (left-hand side of equation). | |
const EBAMRCellData & | getRHS () const noexcept |
Get the solution vector (left-hand side of equation). | |
virtual void | preRegrid (const int a_lbase, const int a_oldFinestLevel) noexcept |
Perform pre-regrid operations. More... | |
virtual void | regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) noexcept |
Regrid this solver. More... | |
virtual std::string | getRealm () const noexcept |
Get the realm where this solver is registered. More... | |
virtual std::string | getName () const noexcept |
Get solver name. More... | |
virtual void | setName (const std::string &a_name) noexcept |
Set solver name. More... | |
virtual void | registerOperators () const noexcept |
Register operators for AMR operations. More... | |
virtual void | setRealm (const std::string a_realm) noexcept |
Set the realm for this solver. More... | |
virtual void | setPhase (phase::which_phase a_phase) noexcept |
Set phase. More... | |
virtual void | setVerbosity (const int a_verbosity) noexcept |
Set verbosity. More... | |
virtual void | setTime (const int a_step, const Real a_time, const Real a_dt) noexcept |
Set the time for this solver. More... | |
virtual void | writePlotFile () const noexcept |
Write plot file. More... | |
virtual int | getNumberOfPlotVariables () const noexcept |
Get number of output fields. More... | |
virtual Vector< std::string > | getPlotVariableNames () const noexcept |
Get output plot names. More... | |
virtual void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const noexcept |
Write plot data to output holder. More... | |
Protected Member Functions | |
virtual void | writeData (LevelData< EBCellFAB > &a_output, int &a_comp, const EBAMRCellData &a_data, const std::string a_outputRealm, const int a_level, const bool a_interpToCentroids, const bool a_interpGhost) const noexcept |
Write data to output. Convenience function. More... | |
virtual void | parsePlotVariables () noexcept |
Parse plot variables. | |
Protected Attributes | |
RefCountedPtr< AmrMesh > | m_amr |
Write checkpoint data into HDF5 file. @paramo[out] a_handle HDF5 file. More... | |
int | m_verbosity |
Chattiness. | |
int | m_timeStep |
Time step. | |
Real | m_time |
Current time. | |
Real | m_dt |
Last time step increment. | |
bool | m_plotPhi |
Plot solution vector or not. | |
bool | m_plotRHS |
Plot source term or not. | |
bool | m_regridSlopes |
Use slopes when regridding. | |
std::string | m_name |
Solver name. | |
std::string | m_className |
Class name. More... | |
std::string | m_realm |
Realm where solver is registered. | |
phase::which_phase | m_phase |
Phase where solver data lives. | |
EBAMRCellData | m_phi |
Solution vector (left hand side of equation). | |
EBAMRCellData | m_rhs |
Source term (right-hand side of equation). | |
EBAMRCellData | m_cache |
Cache storage when doing regrids. | |
Class for solving dy/dt = f on an AMR hierarchy.
The template parameter is the number of variables in y and f.
|
noexcept |
Full constructor.
[in] | a_amr | AMR core. |
|
virtualnoexcept |
Compute right-hand side from left-hand side. I.e. compute f = f(y,t).
[in] | a_rhsFunction | Function for computing the right-hand side. |
|
virtualnoexcept |
Compute right-hand side from left-hand side. I.e. compute f = f(y,t).
[out] | a_rhs | Right-hand side on the mesh. |
[in] | a_rhsFunction | Function for computing the right-hand side. |
|
virtualnoexcept |
Get solver name.
|
virtualnoexcept |
Get number of output fields.
|
virtualnoexcept |
Get output plot names.
|
virtualnoexcept |
Get the realm where this solver is registered.
|
virtualnoexcept |
Perform pre-regrid operations.
[in] | a_lbase | Coarsest level that changed during regrid. |
[in] | a_oldFinestLevel | Finest grid level before the regrid operation. |
|
virtualnoexcept |
Register operators for AMR operations.
|
virtualnoexcept |
Regrid this solver.
[in] | a_lmin | Coarsest level where grids did not change. |
[in] | a_oldFinestLevel | Finest AMR level before the regrid. |
[in] | a_newFinestLevel | Finest AMR level after the regrid. |
This linearly interpolates (potentially with limiters) m_phi to the new grids.
|
virtualnoexcept |
|
virtualnoexcept |
Set solver name.
[in] | a_name | Solver name |
|
virtualnoexcept |
Set phase.
[in] | a_phase | Phase. |
|
virtualnoexcept |
Set phi for a specific component.
[in] | a_phiFunc | Phi function |
[in] | a_comp | Component |
|
virtualnoexcept |
Set phi everywhere.
[in] | a_phiFunc | Phi function. |
|
virtualnoexcept |
Set the realm for this solver.
[in] | a_realm | Realm identifier |
|
virtualnoexcept |
Set right-hand side for specified component.
[in] | a_srcFunc | Source term function. |
[in] | a_comp | Component |
|
virtualnoexcept |
Set the time for this solver.
[in] | a_step | Time step number |
[in] | a_time | Time (in seconds) |
[in] | a_dt | Time step increment |
|
virtualnoexcept |
Set verbosity.
[in] | a_verbosity | Verbosity level. |
|
protectedvirtualnoexcept |
Write data to output. Convenience function.
[in,out] | a_output | Output data holder. |
[in,out] | a_icomp | Starting component where this solver begins writing the output. |
[in] | a_data | Data to write. |
[in] | a_outputRealm | Realm where a_output belongs |
[in] | a_level | Grid level |
[in] | a_interpToCentroids | If true, a_data will be interpolated to cell centroids before writing to a_output. |
[in] | a_interpGhost | If true, interpolate ghost cells |
|
virtualnoexcept |
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 |
|
virtualnoexcept |
Write plot file.
The name of the plot file is m_name.stepXXXXX.DIM.hdf5
|
protected |
Write checkpoint data into HDF5 file. @paramo[out] a_handle HDF5 file.
[in] | a_level | Grid level |
Read checkpoint data from HDF5 file.
[in] | a_handle | HDF5 handle. |
[in] | const | int a_level Grid level |
AMR mesh reference
|
protected |
Class name.
This will be different for different implementations of CdrSolver