chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Physics::RadiativeTransfer::RadiativeTransferStepper< T > Class Template Reference

TimeStepper for advancing a single radiative transfer species on an AMR mesh. More...

#include <CD_RadiativeTransferStepper.H>

Inheritance diagram for Physics::RadiativeTransfer::RadiativeTransferStepper< T >:
Inheritance graph
[legend]
Collaboration diagram for Physics::RadiativeTransfer::RadiativeTransferStepper< T >:
Collaboration graph
[legend]

Public Member Functions

 RadiativeTransferStepper ()
 Constructor. Reads a couple of input options.
 
virtual ~RadiativeTransferStepper ()
 Destructor (does nothing)
 
void setupSolvers () override
 Set up the solver.
 
void initialData () override
 Fill simulation with initial data.
 
void allocate () override
 Allocate necessary memory for solvers.
 
void postInitialize () override
 Post-initialization functionality – sets the source term.
 
void postCheckpointSetup () override
 Perform post-checkpoint setup routines (sets the source in the solver)
 
int getNumberOfPlotVariables () const override
 Get number of plot variables for this physics module.
 
Vector< std::stringgetPlotVariableNames () const override
 Get plot variable names.
 
void writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, const int a_level) const override
 Write plot data to output holder.
 
Real computeDt () override
 Compute a time step to be used by Driver.
 
Real advance (const Real a_dt) override
 Advancement method. Calls the solver function.
 
void synchronizeSolverTimes (const int a_step, const Real a_time, const Real a_dt) override
 Synchronize solver times and time steps.
 
void printStepReport () override
 Print a step report (does nothing)
 
void parseRuntimeOptions () override
 Parse runtime options.
 
void registerRealms () override
 Register realms.
 
void registerOperators () override
 Register operators – calls the solver registration routine.
 
void preRegrid (const int a_lmin, const int a_oldFinestLevel) override
 Perform pre-regrid operations — calls the solver function.
 
void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override
 Regrid function. Calls the solver function.
 
void postRegrid () override
 Post-regrid function. Sets a Gaussian source.
 
void forceDt (const Real a_dt)
 Force usage of a time step.
 
Real getDt () const
 Get the time step.
 
const EBAMRCellDatagetPhi () const
 Get the solver solution.
 
- Public Member Functions inherited from TimeStepper
 TimeStepper ()
 Default constructor (does nothing)
 
virtual ~TimeStepper ()
 Default destructor (does nothing)
 
 TimeStepper (const TimeStepper &)=delete
 Disallow copy construction.
 
TimeStepperoperator= (const TimeStepper &)=delete
 Disallow copy assignment.
 
 TimeStepper (TimeStepper &&)=default
 Allow move construction.
 
TimeStepperoperator= (TimeStepper &&)=default
 Allow move assignment.
 
void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set AmrMesh.
 
void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set the computational geometry.
 
virtual void prePlot ()
 An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY before writing the plot file.
 
virtual void postPlot ()
 An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY after writing the plot file.
 
virtual Vector< long intgetCheckpointLoads (const std::string &a_realm, int a_level) const
 Get computational loads to be checkpointed.
 
virtual bool needToRegrid ()
 Function which can have Driver do regrids at arbitrary points in the simulation.
 
bool keepGoing () const
 Query whether the time stepper wants to continue stepping.
 
virtual bool loadBalanceThisRealm (const std::string &a_realm) const
 Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines will be called during regrids.
 
virtual void loadBalanceBoxes (Vector< Vector< int > > &a_procs, Vector< Vector< Box > > &a_boxes, const std::string &a_realm, const Vector< DisjointBoxLayout > &a_grids, int a_lmin, int a_finestLevel)
 Load balance grid boxes for a specified realm.
 

Protected Member Functions

void setGaussianSource ()
 Set a Gaussian source term in the RtSolver.
 

Protected Attributes

std::string m_realm
 Realm where solver lives.
 
Real m_dt
 Time step to use.
 
Real m_forceDt
 Forced time step.
 
RefCountedPtr< RtSolverm_solver
 Reference to solver.
 
RefCountedPtr< RtSpeciesm_species
 Reference to species.
 
- Protected Attributes inherited from TimeStepper
int m_verbosity
 Class verbosity.
 
int m_timeStep
 Time step.
 
Real m_time
 TIme.
 
Real m_dt
 Previous time step size.
 
bool m_keepGoing
 If false, Driver will stop the time loop after the current step.
 
RefCountedPtr< AmrMeshm_amr
 AmrMesh.
 
RefCountedPtr< ComputationalGeometrym_computationalGeometry
 Computational geometry.
 

Detailed Description

template<class T>
class Physics::RadiativeTransfer::RadiativeTransferStepper< T >

TimeStepper for advancing a single radiative transfer species on an AMR mesh.

Supports both Monte Carlo photon transport and Eddington/Helmholtz continuum approximations through the common RtSolver interface. The template parameter T is the concrete RtSolver type. A source term modelled as a Gaussian blob is applied to the solver at initialization and after every regrid; the shape is set via the input script.

Member Function Documentation

◆ advance()

template<typename T >
Real RadiativeTransferStepper::advance ( const Real  a_dt)
overridevirtual

Advancement method. Calls the solver function.

Parameters
[in]a_dtTime step to be used for advancement
Returns
a_dt

Implements TimeStepper.

◆ allocate()

template<typename T >
void RadiativeTransferStepper::allocate ( )
overridevirtual

Allocate necessary memory for solvers.

Implements TimeStepper.

◆ computeDt()

template<typename T >
Real RadiativeTransferStepper::computeDt ( )
overridevirtual

Compute a time step to be used by Driver.

Returns
The fixed time step m_dt read from input options.

Implements TimeStepper.

◆ forceDt()

template<typename T >
void RadiativeTransferStepper::forceDt ( const Real  a_dt)

Force usage of a time step.

To remove the forced time step restriction, set a_dt to something negative

Parameters
[in]a_dtForced time step.

◆ getDt()

Get the time step.

Returns
The current time step m_dt.

◆ getNumberOfPlotVariables()

template<typename T >
int RadiativeTransferStepper::getNumberOfPlotVariables ( ) const
overridevirtual

Get number of plot variables for this physics module.

Returns
Number of plot variables contributed by the RtSolver.

Implements TimeStepper.

◆ getPhi()

template<typename T >
const EBAMRCellData & RadiativeTransferStepper::getPhi ( ) const

Get the solver solution.

Returns
Const reference to the RtSolver's photon density field on the AMR hierarchy.

◆ getPlotVariableNames()

template<typename T >
Vector< std::string > RadiativeTransferStepper::getPlotVariableNames ( ) const
overridevirtual

Get plot variable names.

Returns
Vector of variable name strings.

Implements TimeStepper.

◆ initialData()

template<typename T >
void RadiativeTransferStepper::initialData ( )
overridevirtual

Fill simulation with initial data.

Implements TimeStepper.

◆ parseRuntimeOptions()

template<typename T >
void RadiativeTransferStepper::parseRuntimeOptions ( )
overridevirtual

Parse runtime options.

Reimplemented from TimeStepper.

◆ postCheckpointSetup()

template<typename T >
void RadiativeTransferStepper::postCheckpointSetup ( )
overridevirtual

Perform post-checkpoint setup routines (sets the source in the solver)

Implements TimeStepper.

◆ postInitialize()

template<typename T >
void RadiativeTransferStepper::postInitialize ( )
overridevirtual

Post-initialization functionality – sets the source term.

Implements TimeStepper.

◆ postRegrid()

template<typename T >
void RadiativeTransferStepper::postRegrid ( )
overridevirtual

Post-regrid function. Sets a Gaussian source.

Implements TimeStepper.

◆ preRegrid()

template<typename T >
void RadiativeTransferStepper::preRegrid ( const int  a_lmin,
const int  a_oldFinestLevel 
)
overridevirtual

Perform pre-regrid operations — calls the solver function.

Parameters
[in]a_lminThe coarsest level that changes.
[in]a_oldFinestLevelThe finest level before the regrid.

Implements TimeStepper.

◆ printStepReport()

template<typename T >
void RadiativeTransferStepper::printStepReport ( )
overridevirtual

Print a step report (does nothing)

This is called by Driver after time step.

Implements TimeStepper.

◆ registerOperators()

template<typename T >
void RadiativeTransferStepper::registerOperators ( )
overridevirtual

Register operators – calls the solver registration routine.

Implements TimeStepper.

◆ registerRealms()

template<typename T >
void RadiativeTransferStepper::registerRealms ( )
overridevirtual

Register realms.

Implements TimeStepper.

◆ regrid()

template<typename T >
void RadiativeTransferStepper::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
overridevirtual

Regrid function. Calls the solver function.

Parameters
[in]a_lminThe coarsest level that changed.
[in]a_oldFinestLevelThe finest level before the regrid.
[in]a_newFinestLevelThe finest level after the regrid.

Implements TimeStepper.

◆ setGaussianSource()

template<typename T >
void RadiativeTransferStepper::setGaussianSource ( )
protected

Set a Gaussian source term in the RtSolver.

Reads the blob center, amplitude, and width from the input script and fills the solver's source field with a Gaussian distribution. Called after initialization and each regrid.

◆ setupSolvers()

template<typename T >
void RadiativeTransferStepper::setupSolvers ( )
overridevirtual

Set up the solver.

Implements TimeStepper.

◆ synchronizeSolverTimes()

template<typename T >
void RadiativeTransferStepper::synchronizeSolverTimes ( const int  a_step,
const Real  a_time,
const Real  a_dt 
)
overridevirtual

Synchronize solver times and time steps.

Parameters
[in]a_stepCurrent time step number.
[in]a_timeCurrent simulation time in seconds.
[in]a_dtTime step that was used.

Implements TimeStepper.

◆ writePlotData()

template<typename T >
void RadiativeTransferStepper::writePlotData ( LevelData< EBCellFAB > &  a_output,
int a_icomp,
const std::string a_outputRealm,
const int  a_level 
) const
overridevirtual

Write plot data to output holder.

Parameters
[in,out]a_outputOutput data holder.
[in,out]a_icompStarting component in a_output to begin at.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level

Implements TimeStepper.

Member Data Documentation

◆ m_forceDt

Forced time step.

This exists because the solver uses m_dt as a runtime input but there are cases when we want to force a time step.


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