chombo-discharge
|
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. | |
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.
ItoLayout< T >::ItoLayout | ( | const Vector< RefCountedPtr< ItoSpecies >> & | a_species | ) |
Full constructor. Calls the define function (but does not generate solvers).
[in] | a_species | List of ItoSpecies. |
|
virtual |
Add solver to the list of solvers.
[in] | a_solver | New solver. |
|
virtual |
Allocate internals for all solvers.
This will call allocate for each ItoSolver.
|
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)
|
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.
|
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)
|
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.
[in] | a_maxCellsToMove | Maximum number of cells to move. |
|
virtual |
Define function.
[in] | a_species | List of species (for which we generate solvers). |
|
virtual |
All solvers deposit their particles.
Calls depositParticles for each solver.
|
virtual |
Deposit particles for each solver. Input argument determines which container is deposited.
Calls depositParticles(ItoSolver::WhichContainer) for each solver.
[in] | a_whichContainer | Container type (e.g., ItoSolver::WhichContainer::bulk) |
|
virtual |
Get all densities.
This accumulates a pointer to the density mesh data for each solver.
|
virtual |
Get all diffusion coefficients.
This accumulates a pointer to diffusion coefficient mesh data for each solver.
|
virtual |
Get all mobility mesh functions.
This accumulates a pointer to mobility coefficient mesh data for each solver.
|
virtual |
Get total number of particles.
This returns the total number of particles in a specified container. The result is accumulated over all solvers.
[in] | a_whichContainer | Container type in ItoSolver |
[in] | a_localOnly | If true, only count particles locally. If false, compute globally. |
|
virtual |
Get particle containers of a particular container type.
[in] | a_whichContainer | Which ItoSolver container |
|
virtual |
Get solvers all solvers.
|
virtual |
Get species.
|
virtual |
Get all velocity functions.
This accumulates a pointer to the velocity mesh data for each solver.
|
virtual |
Fill all solvers with initial data.
Calls initialData() for each solver.
|
virtual |
Interpolate velocities.
Calls interpolateVelocities() for each solver.
|
virtual |
Rearrange the input container particle into new superparticles – this is done for all solvers.
[in] | a_whichContainer | Which ItoSolver container to sort by cell. |
[in] | a_ppc | Target particle-per-cell (ppc) |
|
virtual |
Rearrange the input container particle into new superparticles – this is done for all solvers.
[in] | a_whichContainer | Which ItoSolver container to sort by cell. |
[in] | a_ppc | Target particle-per-cell (ppc) per level |
|
virtual |
|
virtual |
|
virtual |
Utility function which caches states before regrid step.
Calls the preRegrid function for each solver.
[in] | a_lbase | Coarsest level that changed during regrid. |
[in] | a_oldFinestLevel | Finest grid level before the regrid operation. |
|
virtual |
Regrid method – calls the regrid method for each 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. |
|
virtual |
Remap function – all solves remap the input container.
[in] | a_whichContainer | Container type (e.g., ItoSolver::WhichContainer::bulk) |
|
virtual |
Set the computational geometry. This sets the computational geometry for each solver.
[in] | a_computationalGeometry | Computational geometry. |
|
virtual |
Set phase for each solver.
[in] | a_phase | Phase |
|
virtual |
Set the realm where the solvers are defined.
[in] | a_realm | Realm name. |
|
virtual |
Set time for each solver.
[in] | a_step | Time step number |
[in] | a_time | Time (in seconds) |
[in] | a_dt | Time step increment |
|
virtual |
Set verbosity for each solver.
[in] | a_verbosity | Verbosity level. |