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

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

#include <CD_ItoLayout.H>

Public Member Functions

 ItoLayout ()=delete
 Disallowed weak construction.
 
 ItoLayout (const Vector< RefCountedPtr< ItoSpecies >> &a_species)
 Full constructor. Calls the define function (but does not generate solvers). More...
 
virtual ~ItoLayout ()
 Destructor (does nothing).
 
virtual phase::which_phase getPhase () const
 Return phase where the solvers are defined.
 
virtual ItoIterator< T > iterator ()
 Return a fresh iterator. The iterator is a simple random access object that can iterate through the solvers.
 
virtual const std::string getRealm () const
 Get the realm name where the solvers are defined.
 
virtual void setRealm (const std::string a_realm)
 Set the realm where the solvers are defined. More...
 
virtual void define (const Vector< RefCountedPtr< ItoSpecies >> &a_species)
 Define function. More...
 
virtual void parseOptions ()
 Utility function – parse options for all solvers.
 
virtual void parseRuntimeOptions ()
 Utility function – parse runtime options for all solvers.
 
virtual void allocate ()
 Allocate internals for all solvers. More...
 
virtual void addSolver (RefCountedPtr< T > &a_solver)
 Add solver to the list of solvers. More...
 
virtual void preRegrid (const int a_lbase, const int a_finestLevel)
 Utility function which caches states before regrid step. More...
 
virtual void initialData ()
 Fill all solvers with initial data. More...
 
virtual void depositParticles ()
 All solvers deposit their particles. More...
 
virtual void depositParticles (const ItoSolver::WhichContainer a_whichContainer)
 Deposit particles for each solver. Input argument determines which container is deposited. More...
 
virtual void remap ()
 Remap function – calls remap(ItoSolver::WhichContainer::bulk) for each solver.
 
virtual void remap (const ItoSolver::WhichContainer a_whichContainer)
 Remap function – all solves remap the input container. More...
 
virtual void interpolateVelocities ()
 Interpolate velocities. More...
 
virtual void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
 Regrid method – calls the regrid method for each solver. More...
 
virtual void registerOperators ()
 Register operators. Calls registerOperators for each solver.
 
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set AmrMesh object for each solver. More...
 
virtual void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set the computational geometry. This sets the computational geometry for each solver. More...
 
virtual void setPhase (phase::which_phase a_phase)
 Set phase for each solver. More...
 
virtual void setVerbosity (const int a_verbosity)
 Set verbosity for each solver. More...
 
virtual void setTime (const int a_step, const Real a_time, const Real a_dt)
 Set time for each solver. More...
 
virtual void organizeParticlesByCell (const ItoSolver::WhichContainer a_whichContainer)
 Sort ItoSolver particles by cell – this is done for all solvers. More...
 
virtual void organizeParticlesByPatch (const ItoSolver::WhichContainer a_whichContainer)
 Sort ItoSolver particles by patch – this is done for all solvers. More...
 
virtual void makeSuperparticles (const ItoSolver::WhichContainer a_whichContainer, const int a_ppc)
 Rearrange the input container particle into new superparticles – this is done for all solvers. More...
 
virtual void makeSuperparticles (const ItoSolver::WhichContainer a_whichContainer, const Vector< int > a_ppc)
 Rearrange the input container particle into new superparticles – this is done for all solvers. More...
 
virtual Real computeDt ()
 Compute smallest possible time step. More...
 
virtual Real computeAdvectiveDt ()
 Compute the classical advection time step for all solvers. This returns dt = dx/max(v) where max(v) takes the largest component. More...
 
virtual Real computeHopDt (const Real a_maxCellsToMove)
 Compute the largest dt which restricts all particles to move less than a_maxCellsToMove. More...
 
virtual Real computeDiffusiveDt ()
 Compute the classical diffusive time step dt = dx*dx/(2*D) where D is the diffusion coefficient (not dimensional dependence here) More...
 
virtual size_t getNumParticles (const ItoSolver::WhichContainer a_ptype, const bool a_localOnly)
 Get total number of particles. More...
 
virtual Vector< RefCountedPtr< T > > & getSolvers ()
 Get solvers all solvers. More...
 
virtual Vector< RefCountedPtr< ItoSpecies > > & getSpecies ()
 Get species. More...
 
virtual Vector< EBAMRCellData * > getVelocityFunctions ()
 Get all velocity functions. More...
 
virtual Vector< EBAMRCellData * > getDensities ()
 Get all densities. More...
 
virtual Vector< EBAMRCellData * > getDiffusionFunctions ()
 Get all diffusion coefficients. More...
 
virtual Vector< EBAMRCellData * > getMobilityFunctions ()
 Get all mobility mesh functions. More...
 
virtual Vector< ParticleContainer< ItoParticle > * > getParticles (const ItoSolver::WhichContainer a_whichContainer)
 Get particle containers of a particular container type. More...
 

Protected Attributes

std::string m_realm
 Realm where all the solvers are registered.
 
Vector< RefCountedPtr< T > > m_solvers
 ItoSolver solvers.
 
Vector< RefCountedPtr< ItoSpecies > > m_species
 ItoSolver species.
 
int m_verbosity
 Verbosity level.
 
phase::which_phase m_phase
 Phase where solvers live.
 
bool m_isDefined
 Layout is defined or not.
 

Detailed Description

template<class T>
class ItoLayout< T >

Class for holding a set of ItoSolvers.

This is primarily a utility class just cuts down on typing when there are multiple species being advected/diffused. This class just stores a set of such solvers and contains an "iterator" for going through them. Fundamentally, there is no difference between this class and a vector of ItoSolvers. This class can be constructed through a factory method.

Constructor & Destructor Documentation

◆ ItoLayout()

template<class T >
ItoLayout< T >::ItoLayout ( const Vector< RefCountedPtr< ItoSpecies >> &  a_species)

Full constructor. Calls the define function (but does not generate solvers).

Parameters
[in]a_speciesList of ItoSpecies.

Member Function Documentation

◆ addSolver()

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

Add solver to the list of solvers.

Parameters
[in]a_solverNew solver.

◆ allocate()

template<class T >
void ItoLayout< T >::allocate
virtual

Allocate internals for all solvers.

This will call allocate for each ItoSolver.

◆ computeAdvectiveDt()

template<class T >
Real ItoLayout< T >::computeAdvectiveDt
virtual

Compute the classical advection time step for all solvers. This returns dt = dx/max(v) where max(v) takes the largest component.

This calls computeAdvectionDt() for each ItoSolver and minimizes the result over the solvers (i.e. it returns the smallest time step)

Note
See ItoSolver::computeAdvectionDt() to see how the time step is computed.

◆ computeDiffusiveDt()

template<class T >
Real ItoLayout< T >::computeDiffusiveDt
virtual

Compute the classical diffusive time step dt = dx*dx/(2*D) where D is the diffusion coefficient (not dimensional dependence here)

This calls computeDiffusiveDt for all solvers and minimizes the result over all solvers.

◆ computeDt()

template<class T >
Real ItoLayout< T >::computeDt
virtual

Compute smallest possible time step.

This calls computeDt() for each ItoSolver and minimizes the result over the solvers (i.e. it returns the smallest time step)

◆ computeHopDt()

template<class T >
Real ItoLayout< T >::computeHopDt ( const Real  a_maxCellsToMove)
virtual

Compute the largest dt which restricts all particles to move less than a_maxCellsToMove.

This calls computeHopDt for all solvers – that function uses the maximum permitted diffusion hop to restrict the time step (the user will have restricted the normal distribution to some value). So, the result of this value will depend strongly on the user input for the ItoSolvers.

Parameters
[in]a_maxCellsToMoveMaximum number of cells to move.

◆ define()

template<class T >
void ItoLayout< T >::define ( const Vector< RefCountedPtr< ItoSpecies >> &  a_species)
virtual

Define function.

Parameters
[in]a_speciesList of species (for which we generate solvers).

◆ depositParticles() [1/2]

template<class T >
void ItoLayout< T >::depositParticles
virtual

All solvers deposit their particles.

Calls depositParticles for each solver.

◆ depositParticles() [2/2]

template<class T >
void ItoLayout< T >::depositParticles ( const ItoSolver::WhichContainer  a_whichContainer)
virtual

Deposit particles for each solver. Input argument determines which container is deposited.

Calls depositParticles(ItoSolver::WhichContainer) for each solver.

Parameters
[in]a_whichContainerContainer type (e.g., ItoSolver::WhichContainer::bulk)

◆ getDensities()

template<class T >
Vector< EBAMRCellData * > ItoLayout< T >::getDensities
virtual

Get all densities.

This accumulates a pointer to the density mesh data for each solver.

◆ getDiffusionFunctions()

template<class T >
Vector< EBAMRCellData * > ItoLayout< T >::getDiffusionFunctions
virtual

Get all diffusion coefficients.

This accumulates a pointer to diffusion coefficient mesh data for each solver.

◆ getMobilityFunctions()

template<class T >
Vector< EBAMRCellData * > ItoLayout< T >::getMobilityFunctions
virtual

Get all mobility mesh functions.

This accumulates a pointer to mobility coefficient mesh data for each solver.

◆ getNumParticles()

template<class T >
size_t ItoLayout< T >::getNumParticles ( const ItoSolver::WhichContainer  a_ptype,
const bool  a_localOnly 
)
virtual

Get total number of particles.

This returns the total number of particles in a specified container. The result is accumulated over all solvers.

Parameters
[in]a_whichContainerContainer type in ItoSolver
[in]a_localOnlyIf true, only count particles locally. If false, compute globally.

◆ getParticles()

template<class T >
Vector< ParticleContainer< ItoParticle > * > ItoLayout< T >::getParticles ( const ItoSolver::WhichContainer  a_whichContainer)
virtual

Get particle containers of a particular container type.

Parameters
[in]a_whichContainerWhich ItoSolver container

◆ getSolvers()

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

Get solvers all solvers.

Returns
Returns m_solvers

◆ getSpecies()

template<class T >
Vector< RefCountedPtr< ItoSpecies > > & ItoLayout< T >::getSpecies
virtual

Get species.

Returns
Returns m_species

◆ getVelocityFunctions()

template<class T >
Vector< EBAMRCellData * > ItoLayout< T >::getVelocityFunctions
virtual

Get all velocity functions.

This accumulates a pointer to the velocity mesh data for each solver.

◆ initialData()

template<class T >
void ItoLayout< T >::initialData
virtual

Fill all solvers with initial data.

Calls initialData() for each solver.

◆ interpolateVelocities()

template<class T >
void ItoLayout< T >::interpolateVelocities
virtual

Interpolate velocities.

Calls interpolateVelocities() for each solver.

◆ makeSuperparticles() [1/2]

template<class T >
void ItoLayout< T >::makeSuperparticles ( const ItoSolver::WhichContainer  a_whichContainer,
const int  a_ppc 
)
virtual

Rearrange the input container particle into new superparticles – this is done for all solvers.

Parameters
[in]a_whichContainerWhich ItoSolver container to sort by cell.
[in]a_ppcTarget particle-per-cell (ppc)

◆ makeSuperparticles() [2/2]

template<class T >
void ItoLayout< T >::makeSuperparticles ( const ItoSolver::WhichContainer  a_whichContainer,
const Vector< int >  a_ppc 
)
virtual

Rearrange the input container particle into new superparticles – this is done for all solvers.

Parameters
[in]a_whichContainerWhich ItoSolver container to sort by cell.
[in]a_ppcTarget particle-per-cell (ppc) per level

◆ organizeParticlesByCell()

template<class T >
void ItoLayout< T >::organizeParticlesByCell ( const ItoSolver::WhichContainer  a_whichContainer)
virtual

Sort ItoSolver particles by cell – this is done for all solvers.

Parameters
[in]a_whichContainerWhich ItoSolver container to sort by cell.

◆ organizeParticlesByPatch()

template<class T >
void ItoLayout< T >::organizeParticlesByPatch ( const ItoSolver::WhichContainer  a_whichContainer)
virtual

Sort ItoSolver particles by patch – this is done for all solvers.

Parameters
[in]a_whichContainerWhich ItoSolver container to sort by cell.

◆ preRegrid()

template<class T >
void ItoLayout< T >::preRegrid ( const int  a_lbase,
const int  a_finestLevel 
)
virtual

Utility function which caches states before regrid step.

Calls the preRegrid function for each solver.

Parameters
[in]a_lbaseCoarsest level that changed during regrid.
[in]a_oldFinestLevelFinest grid level before the regrid operation.

◆ regrid()

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

Regrid method – calls the regrid method for each solver.

Parameters
[in]a_lminCoarsest level where grids did not change.
[in]a_oldFinestLevelFinest AMR level before the regrid.
[in]a_newFinestLevelFinest AMR level after the regrid.

◆ remap()

template<class T >
void ItoLayout< T >::remap ( const ItoSolver::WhichContainer  a_whichContainer)
virtual

Remap function – all solves remap the input container.

Parameters
[in]a_whichContainerContainer type (e.g., ItoSolver::WhichContainer::bulk)

◆ setAmr()

template<class T >
void ItoLayout< T >::setAmr ( const RefCountedPtr< AmrMesh > &  a_amr)
virtual

Set AmrMesh object for each solver.

Parameters
[in]a_amrMeshAmrMesh object

◆ setComputationalGeometry()

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

Set the computational geometry. This sets the computational geometry for each solver.

Parameters
[in]a_computationalGeometryComputational geometry.

◆ setPhase()

template<class T >
void ItoLayout< T >::setPhase ( phase::which_phase  a_phase)
virtual

Set phase for each solver.

Parameters
[in]a_phasePhase

◆ setRealm()

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

Set the realm where the solvers are defined.

Parameters
[in]a_realmRealm name.

◆ setTime()

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

Set time for each solver.

Parameters
[in]a_stepTime step number
[in]a_timeTime (in seconds)
[in]a_dtTime step increment
Note
This sets m_step=a_step, m_time=a_time, m_dt=a_dt

◆ setVerbosity()

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

Set verbosity for each solver.

Parameters
[in]a_verbosityVerbosity level.

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