chombo-discharge
Public Member Functions | Protected Attributes | List of all members
CdrLayout< T > Class Template Reference

Class for holding a set of CdrSolvers. More...

#include <CD_CdrLayout.H>

Public Member Functions

 CdrLayout ()=delete
 Disallowed weak constructor. Use the full constructor.
 
 CdrLayout (const Vector< RefCountedPtr< CdrSpecies >> &a_species)
 Full constructor, setting the number of solvers to be instantiated. More...
 
virtual ~CdrLayout ()
 Destructor.
 
virtual phase::which_phase getPhase () const
 Get phase. More...
 
virtual CdrIterator< T > iterator ()
 Get an iterator which can iterate through the various Cdr solvers.
 
virtual std::string getRealm () const
 Get the realm where the Cdr solvers live. More...
 
virtual void setRealm (const std::string a_realm)
 Set realm for all CdrSolvers. More...
 
virtual void parseOptions ()
 Parse class options.
 
virtual void parseRuntimeOptions ()
 Parse runtime options.
 
virtual void addSolver (RefCountedPtr< T > &a_solver)
 Add solver. This appends a_solver to m_solvers. More...
 
virtual void allocate ()
 Allocate internal storage for solvers.
 
virtual void deallocate ()
 Deallocate solver internals.
 
virtual void preRegrid (const int a_lbase, const int a_oldFinestLevel)
 Call preRegrid(...) method for all the CdrSolvers. More...
 
virtual void initialData ()
 Initial data. Fill all solvers with initial data.
 
virtual void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
 Regrid method. Calls regrid(...) for every CdrSolver. More...
 
virtual void registerOperators ()
 Register operators.
 
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amrMesh)
 Set AmrMesh for all CdrSolvers. More...
 
virtual void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set the computational geometry for all CdrSolvers. More...
 
virtual void setPhase (const phase::which_phase a_phase=phase::gas)
 Set phase. More...
 
virtual void setVerbosity (const int a_verbosity)
 Set verbosity for all CdrSolvers. More...
 
virtual void setTime (const int a_step, const Real a_time, const Real a_dt)
 Set time. More...
 
virtual void writePlotFile ()
 Convenience function. All solvers write plot files (for debugging purposes)
 
virtual Real computeAdvectionDt ()
 Get CFL time for advection. More...
 
virtual Real computeDiffusionDt ()
 Get time step for explicit diffusion. More...
 
virtual Real computeAdvectionDiffusionDt ()
 Get the time step for explicit advection-diffusion. More...
 
virtual Vector< RefCountedPtr< T > > & getSolvers ()
 Get solvers. More...
 
virtual Vector< RefCountedPtr< CdrSpecies > > & getSpecies ()
 Get species.
 
virtual Vector< EBAMRCellData * > getSources ()
 Get all source terms.
 
virtual Vector< EBAMRCellData * > getPhis ()
 Get all cell-centered states.
 
virtual Vector< EBAMRCellData * > getVelocities ()
 Get all cell-centered velocities.
 
virtual Vector< EBAMRCellData * > getCellCenteredDiffusionCoefficients ()
 Get all cell-centered diffusion coefficients.
 
virtual Vector< EBAMRFluxData * > getFaceCenteredDiffusionCoefficient ()
 Get all face-centered diffusion coefficients.
 
virtual Vector< EBAMRIVData * > getEbCenteredDiffusionCoefficient ()
 Get all EB-centered diffusion coefficients.
 
virtual Vector< EBAMRIVData * > getEbFlux ()
 Get all EB flux data holders.
 
virtual Vector< EBAMRIFData * > getDomainFlux ()
 Get domain flux data holders.
 

Protected Attributes

std::string m_realm
 Realm where solvers live.
 
phase::which_phase m_phase
 Phase where solvers live.
 
int m_verbosity
 Verbosity.
 
Vector< RefCountedPtr< CdrSolver > > m_solvers
 Solver instantiations.
 
Vector< RefCountedPtr< CdrSpecies > > m_species
 Cdr species.
 

Detailed Description

template<class T>
class CdrLayout< T >

Class for holding a set of CdrSolvers.

This is primarily a utility class that just cuts down on typing when there are multiple species are being advected/diffused. This class simply stores a set of CdrSolvers, and it contains an "iterator" for iterating through them. This is simply meant to cut down on typing. Note that a TimeStepper can keep an instance this class rather than e.g. a Vector<RefCountedPtr<CdrSolver> >, but fundamentally there is no difference between the two. The CdrLayout can be constructed through a factory method, i.e. the user can do a quick-generation of a set of CdrSolvers by using the factory method for instantiating an arbitrary number of CdrSolvers.

Note
A separate use case for this is class is that it allows segregation between groups of CdrSolvers that live on different realms and phases.

Constructor & Destructor Documentation

◆ CdrLayout()

template<class T >
CdrLayout< T >::CdrLayout ( const Vector< RefCountedPtr< CdrSpecies >> &  a_species)

Full constructor, setting the number of solvers to be instantiated.

Parameters
[in]a_speciesList of species that defines this solver.

Member Function Documentation

◆ addSolver()

template<class T >
void CdrLayout< T >::addSolver ( RefCountedPtr< T > &  a_solver)
virtual

Add solver. This appends a_solver to m_solvers.

Parameters
[in]a_solverSolver to add to the layout.

◆ computeAdvectionDiffusionDt()

template<class T >
Real CdrLayout< T >::computeAdvectionDiffusionDt
virtual

Get the time step for explicit advection-diffusion.

Returns
Returns the smallest explicit advection-diffusion time step (minimized over solvers)

◆ computeAdvectionDt()

template<class T >
Real CdrLayout< T >::computeAdvectionDt
virtual

Get CFL time for advection.

Returns
Returns the smallest explicit advective time step (minimized over solvers)

◆ computeDiffusionDt()

template<class T >
Real CdrLayout< T >::computeDiffusionDt
virtual

Get time step for explicit diffusion.

Returns
Returns the smallest explicit diffusion time step (minimized over solvers)

◆ getPhase()

template<class T >
phase::which_phase CdrLayout< T >::getPhase
virtual

Get phase.

Returns
Return the phase on which all CdrSolvers are allocated.

◆ getRealm()

template<class T >
std::string CdrLayout< T >::getRealm
virtual

Get the realm where the Cdr solvers live.

Returns
Return realm name.

◆ getSolvers()

template<class T >
Vector< RefCountedPtr< T > > & CdrLayout< T >::getSolvers
virtual

Get solvers.

Returns
Returns all CdrSolvers in this layout.

◆ preRegrid()

template<class T >
void CdrLayout< T >::preRegrid ( const int  a_lbase,
const int  a_oldFinestLevel 
)
virtual

Call preRegrid(...) method for all the CdrSolvers.

Parameters
[in]a_lbaseCoarsest level which changes during regrid
[in]a_oldFinestLevelFinest level before the regrid (i.e., the current finest level)

◆ regrid()

template<class T >
void CdrLayout< T >::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
virtual

Regrid method. Calls regrid(...) for every CdrSolver.

Parameters
[in]a_lminCoarsest level that changed during the regrid.
[in]a_oldFinestLevelFinest level before the regrid
[in]a_newFinestLevelFinest level after the regrid

◆ setAmr()

template<class T >
void CdrLayout< T >::setAmr ( const RefCountedPtr< AmrMesh > &  a_amrMesh)
virtual

Set AmrMesh for all CdrSolvers.

Parameters
[in]a_amrMeshAmrMesh

◆ setComputationalGeometry()

template<class T >
void CdrLayout< T >::setComputationalGeometry ( const RefCountedPtr< ComputationalGeometry > &  a_computationalGeometry)
virtual

Set the computational geometry for all CdrSolvers.

Parameters
[in]a_computationalGeometryComputational geometry

◆ setPhase()

template<class T >
void CdrLayout< T >::setPhase ( const phase::which_phase  a_phase = phase::gas)
virtual

Set phase.

Parameters
[i]a_phase Phase

◆ setRealm()

template<class T >
void CdrLayout< T >::setRealm ( const std::string  a_realm)
virtual

Set realm for all CdrSolvers.

Parameters
[in]a_realmRealm name

◆ setTime()

template<class T >
void CdrLayout< T >::setTime ( const int  a_step,
const Real  a_time,
const Real  a_dt 
)
virtual

Set time.

Parameters
[in]a_stepTime step
[in]a_timeTime
[in]a_dtTime increment

◆ setVerbosity()

template<class T >
void CdrLayout< T >::setVerbosity ( const int  a_verbosity)
virtual

Set verbosity for all CdrSolvers.

Parameters
[in]a_verbosityVerbosity

The documentation for this class was generated from the following files: