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

Surface ODE solver. More...

#include <CD_SurfaceODESolver.H>

Collaboration diagram for SurfaceODESolver< N >:
Collaboration graph
[legend]

Public Member Functions

 SurfaceODESolver ()
 Default constructor. Must subsequently set AmrMesh. More...
 
 SurfaceODESolver (const RefCountedPtr< AmrMesh > &a_amr)
 Full constructor. More...
 
 SurfaceODESolver (const SurfaceODESolver &)=delete
 Disallowed copy constructor.
 
 SurfaceODESolver (const SurfaceODESolver &&)=delete
 Disallowed move constructor.
 
virtual ~SurfaceODESolver ()
 Destructor (does nothing).
 
SurfaceODESolveroperator= (const SurfaceODESolver &)=delete
 Disallowed assignment operator.
 
SurfaceODESolveroperator= (const SurfaceODESolver &&)=delete
 Disallowed assignment operator.
 
virtual void parseOptions () noexcept
 Parse solver options.
 
virtual void parseRuntimeOptions () noexcept
 Parse runtime solver options.
 
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amrMesh) noexcept
 Set the amr object. More...
 
virtual void setRealm (const std::string a_realm) noexcept
 Set the realm. More...
 
virtual void setName (const std::string a_name) noexcept
 Set the solver name. More...
 
std::string getRealm () const noexcept
 Get the realm where the solver is registered. More...
 
virtual void setPhase (const phase::which_phase a_phase) noexcept
 Set phase. More...
 
virtual phase::which_phase getPhase () const noexcept
 Get phase. More...
 
virtual void setVerbosity (const int a_verbosity) noexcept
 Set verbosity. More...
 
virtual int getVerbosity () const noexcept
 Get verbosity. More...
 
virtual void setTime (const int a_step, const Real a_time, const Real a_dt) noexcept
 Set the time. More...
 
virtual Real computeMass (const int a_comp=0) const noexcept
 Compute the total mass for component a_comp in m_phi. More...
 
virtual Real computeMass (const EBAMRIVData &a_data, const int a_comp=0) const noexcept
 Compute the total mass in a_phi. More...
 
virtual int getStep () const noexcept
 Get current time step. More...
 
virtual Real getTime () const noexcept
 Get current time. More...
 
virtual Real getDt () const noexcept
 Get last time step. More...
 
virtual void setPhi (const Real a_phi)
 Convenience function for setting m_phi. More...
 
virtual void setPhi (const std::array< Real, N > &a_phi)
 Convenience function for setting m_phi. More...
 
virtual void setPhi (const EBAMRIVData &a_phi)
 Convenience function for setting m_phi. More...
 
virtual EBAMRIVDatagetPhi () noexcept
 Get internal state. More...
 
virtual const EBAMRIVDatagetPhi () const noexcept
 Get internal state. More...
 
virtual void setRHS (const Real a_rhs)
 Convenience function for setting m_rhs. More...
 
virtual void setRHS (const std::array< Real, N > &a_rhs)
 Convenience function for setting m_rhs. More...
 
virtual void setRHS (const EBAMRIVData &a_rhs)
 Convenience function for setting m_rhs. More...
 
virtual EBAMRIVDatagetRHS ()
 Get internal state. More...
 
virtual const EBAMRIVDatagetRHS () const noexcept
 Get internal state. More...
 
virtual void allocate () noexcept
 Allocate internal storage for this class. More...
 
virtual void deallocate () noexcept
 Deallocate internal storage.
 
virtual void registerOperators () noexcept
 Register operators.
 
virtual void preRegrid (const int a_lbase, const int a_oldFinestLevel) noexcept
 Pre-regrid function. More...
 
virtual void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) noexcept
 Regrid function. More...
 
virtual void resetElectrodes (const Real a_value) noexcept
 Reset m_phi on electrode cells. More...
 
virtual void resetElectrodes (EBAMRIVData &a_phi, const Real a_value) const noexcept
 Reset the input data holder on electrode cells. More...
 
virtual void resetDielectrics (const Real a_value) noexcept
 Reset m_phi on dielectric cells. More...
 
virtual void resetDielectrics (EBAMRIVData &a_phi, const Real a_value) const noexcept
 Reset the input data holder on dielectric cells. More...
 
virtual void writePlotFile () const noexcept
 Write a plot file. More...
 
virtual int getNumberOfPlotVariables () const noexcept
 Get number of variables to be plotted.
 
virtual Vector< std::string > getPlotVariableNames () const noexcept
 Get output plot names. More...
 
virtual void writePlotData (LevelData< EBCellFAB > &a_output, int &a_comp, const std::string a_outputRealm, const int a_level) const noexcept
 Write output data to a_output. More...
 

Protected Member Functions

void parseVerbosity () noexcept
 Parse verbosity.
 
void parseRegrid () noexcept
 Parse regrid method.
 
void parsePlotVariables () noexcept
 Parse plot variables.
 
void defineVoFIterators () noexcept
 Define iterators for iterating over cell subsets.
 

Protected Attributes

std::string m_realm
 Realm where this solver is registered.
 
std::string m_className
 Class name.
 
std::string m_name
 Solver name.
 
phase::which_phase m_phase
 Phase where the data lives.
 
bool m_conservativeRegrid
 Conservative regrid or not.
 
bool m_plotPhi
 Plot phi or not.
 
bool m_plotRHS
 Plot rhs or not.
 
RefCountedPtr< MultiFluidIndexSpacem_mfis
 Index spaces.
 
RefCountedPtr< AmrMeshm_amr
 AMR; needed for grid stuff.
 
Vector< RefCountedPtr< LayoutData< VoFIterator > > > m_electrodeVoFs
 Cut-cells that are electrode cells. This does not include ghost cells.
 
Vector< RefCountedPtr< LayoutData< VoFIterator > > > m_dielectricVoFs
 Cut-cells that are also dielectric cells. This does not include ghost cells.
 
EBAMRIVData m_phi
 State. Stored on cut-cells.
 
EBAMRIVData m_cache
 Cached state used during regridding.
 
EBAMRIVData m_rhs
 Right-hand side.
 
int m_verbosity
 Solver verbosity.
 
int m_step
 Time step.
 
Real m_time
 Current time.
 
Real m_dt
 Time increment.
 

Detailed Description

template<int N = 1>
class SurfaceODESolver< N >

Surface ODE solver.

This is a basic solver that acts as an ODE solver on cut-cells.

Constructor & Destructor Documentation

◆ SurfaceODESolver() [1/2]

template<int N>
SurfaceODESolver< N >::SurfaceODESolver

Default constructor. Must subsequently set AmrMesh.

Sets realm to primal and phase to phase::gas.

◆ SurfaceODESolver() [2/2]

template<int N>
SurfaceODESolver< N >::SurfaceODESolver ( const RefCountedPtr< AmrMesh > &  a_amr)

Full constructor.

Sets AmrMesh to input and sets realm to primal and phase to phase::gas.

Parameters
[in]a_amrAmrMesh reference

Member Function Documentation

◆ allocate()

template<int N>
void SurfaceODESolver< N >::allocate
virtualnoexcept

Allocate internal storage for this class.

Allocates m_phi and m_rhs

◆ computeMass() [1/2]

template<int N>
Real SurfaceODESolver< N >::computeMass ( const EBAMRIVData a_data,
const int  a_comp = 0 
) const
virtualnoexcept

Compute the total mass in a_phi.

Parameters
[in]a_phiInput data
[in]a_compComponent
Note
Computation runs only over the valid cells.

◆ computeMass() [2/2]

template<int N>
Real SurfaceODESolver< N >::computeMass ( const int  a_comp = 0) const
virtualnoexcept

Compute the total mass for component a_comp in m_phi.

Parameters
[in]a_compComponent
Note
Computation runs only over the valid cells.

◆ getDt()

template<int N>
Real SurfaceODESolver< N >::getDt
virtualnoexcept

Get last time step.

Returns
m_dt

◆ getPhase()

template<int N>
phase::which_phase SurfaceODESolver< N >::getPhase
virtualnoexcept

Get phase.

Returns
m_phase

◆ getPhi() [1/2]

template<int N>
const EBAMRIVData & SurfaceODESolver< N >::getPhi
virtualnoexcept

Get internal state.

Returns
Returns m_phi

◆ getPhi() [2/2]

template<int N>
EBAMRIVData & SurfaceODESolver< N >::getPhi
virtualnoexcept

Get internal state.

Returns
Returns m_phi

◆ getPlotVariableNames()

template<int N>
Vector< std::string > SurfaceODESolver< N >::getPlotVariableNames
virtualnoexcept

Get output plot names.

Returns
Return a list of plot variable names.

◆ getRealm()

template<int N>
std::string SurfaceODESolver< N >::getRealm
noexcept

Get the realm where the solver is registered.

Returns
Returns m_realm

◆ getRHS() [1/2]

template<int N>
EBAMRIVData & SurfaceODESolver< N >::getRHS
virtual

Get internal state.

Returns
Returns m_rhs

◆ getRHS() [2/2]

template<int N>
const EBAMRIVData & SurfaceODESolver< N >::getRHS
virtualnoexcept

Get internal state.

Returns
Returns m_rhs

◆ getStep()

template<int N>
int SurfaceODESolver< N >::getStep
virtualnoexcept

Get current time step.

Returns
m_step

◆ getTime()

template<int N>
Real SurfaceODESolver< N >::getTime
virtualnoexcept

Get current time.

Returns
m_time

◆ getVerbosity()

template<int N>
int SurfaceODESolver< N >::getVerbosity
virtualnoexcept

Get verbosity.

Returns
m_verbosity

◆ preRegrid()

template<int N>
void SurfaceODESolver< N >::preRegrid ( const int  a_lbase,
const int  a_oldFinestLevel 
)
virtualnoexcept

Pre-regrid function.

This stores the data on the old mesh so it can be regridded later.

Parameters
[in]a_lbaseCoarsest level which will change during regrids.
[in]a_oldFinestLevelFinest level before the regrid operation.

◆ regrid()

template<int N>
void SurfaceODESolver< N >::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
virtualnoexcept

Regrid function.

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.

This interpolates or coarsens conservatively, e.g. sigma_c = sum(A_f * sigma_f)/A_c if we coarsen.

◆ resetDielectrics() [1/2]

template<int N>
void SurfaceODESolver< N >::resetDielectrics ( const Real  a_value)
virtualnoexcept

Reset m_phi on dielectric cells.

This will set a_data to the specified value (in dielectric cells)

Parameters
[in]a_valValue
Note
Does not include ghost cells.

◆ resetDielectrics() [2/2]

template<int N>
void SurfaceODESolver< N >::resetDielectrics ( EBAMRIVData a_phi,
const Real  a_value 
) const
virtualnoexcept

Reset the input data holder on dielectric cells.

This will set a_data to the specified value (in dielectric cells)

Parameters
[in]a_dataInput data to be set.
[in]a_valValue
Note
Does not include ghost cells.

◆ resetElectrodes() [1/2]

template<int N>
void SurfaceODESolver< N >::resetElectrodes ( const Real  a_value)
virtualnoexcept

Reset m_phi on electrode cells.

This will set a_data to the specified value (in electrode cells)

Parameters
[in]a_valValue
Note
Does not include ghost cells.

◆ resetElectrodes() [2/2]

template<int N>
void SurfaceODESolver< N >::resetElectrodes ( EBAMRIVData a_phi,
const Real  a_value 
) const
virtualnoexcept

Reset the input data holder on electrode cells.

This will set a_data to the specified value (in electrode cells)

Parameters
[in]a_dataInput data to be set.
[in]a_valValue
Note
Does not include ghost cells.

◆ setAmr()

template<int N>
void SurfaceODESolver< N >::setAmr ( const RefCountedPtr< AmrMesh > &  a_amrMesh)
virtualnoexcept

Set the amr object.

Parameters
[in]a_amrMeshAmrMesh object.

◆ setName()

template<int N>
void SurfaceODESolver< N >::setName ( const std::string  a_name)
virtualnoexcept

Set the solver name.

Parameters
[in]a_nameSolver name

◆ setPhase()

template<int N>
void SurfaceODESolver< N >::setPhase ( const phase::which_phase  a_phase)
virtualnoexcept

Set phase.

Parameters
[in]a_phasePhase.

◆ setPhi() [1/3]

template<int N>
void SurfaceODESolver< N >::setPhi ( const EBAMRIVData a_phi)
virtual

Convenience function for setting m_phi.

Parameters
[in]a_phiValues
Note
a_phi must have N components.

◆ setPhi() [2/3]

template<int N>
void SurfaceODESolver< N >::setPhi ( const Real  a_phi)
virtual

Convenience function for setting m_phi.

Parameters
[in]a_phiValues for all components

◆ setPhi() [3/3]

template<int N>
void SurfaceODESolver< N >::setPhi ( const std::array< Real, N > &  a_phi)
virtual

Convenience function for setting m_phi.

Parameters
[in]a_phiComponent-wise values.

◆ setRealm()

template<int N>
void SurfaceODESolver< N >::setRealm ( const std::string  a_realm)
virtualnoexcept

Set the realm.

Parameters
[in]a_realmRealm name.

◆ setRHS() [1/3]

template<int N>
void SurfaceODESolver< N >::setRHS ( const EBAMRIVData a_rhs)
virtual

Convenience function for setting m_rhs.

Parameters
[in]a_rhsValues per cell and component.
Note
a_rhs must have N components.

◆ setRHS() [2/3]

template<int N>
void SurfaceODESolver< N >::setRHS ( const Real  a_rhs)
virtual

Convenience function for setting m_rhs.

Parameters
[in]a_rhsValues for all components

◆ setRHS() [3/3]

template<int N>
void SurfaceODESolver< N >::setRHS ( const std::array< Real, N > &  a_rhs)
virtual

Convenience function for setting m_rhs.

Parameters
[in]a_rhsComponent-wise values.

◆ setTime()

template<int N>
void SurfaceODESolver< N >::setTime ( const int  a_step,
const Real  a_time,
const Real  a_dt 
)
virtualnoexcept

Set the time.

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<int N>
void SurfaceODESolver< N >::setVerbosity ( const int  a_verbosity)
virtualnoexcept

Set verbosity.

Parameters
[in]a_verbosityVerbosity level.

◆ writePlotData()

template<int N>
void SurfaceODESolver< N >::writePlotData ( LevelData< EBCellFAB > &  a_output,
int &  a_comp,
const std::string  a_outputRealm,
const int  a_level 
) const
virtualnoexcept

Write output data to a_output.

Parameters
[in,out]a_outputOutput data holder.
[in,out]a_icompStarting component where this solver begins writing the output.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level
Note
This will write the plot data in this solver to a_output, starting on a_comp
This routine writes m_phi and m_rhs into a_ouput.

◆ writePlotFile()

template<int N>
void SurfaceODESolver< N >::writePlotFile
virtualnoexcept

Write a plot file.

The name of the plot file is m_name.stepXXXXXXX.DIM.hdf5


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