Chombo + EB  3.2
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AMRLevel Class Referenceabstract

Abstract base class for time-dependent data at a level of refinement. More...

#include <AMRLevel.H>

Inheritance diagram for AMRLevel:
Inheritance graph
[legend]

Public Member Functions

 AMRLevel ()
 
virtual ~AMRLevel ()
 
virtual void define (AMRLevel *a_coarser_level_ptr, const Box &a_problem_domain, int a_level, int a_ref_ratio)
 
virtual void define (AMRLevel *a_coarser_level_ptr, const ProblemDomain &a_problem_domain, int a_level, int a_ref_ratio)
 
virtual Real advance ()=0
 
virtual bool convergedToSteadyState ()
 
virtual void postTimeStep ()=0
 
virtual void tagCells (IntVectSet &a_tags)=0
 
virtual void tagCellsInit (IntVectSet &a_tags)=0
 
virtual void preRegrid (int a_base_level, const Vector< Vector< Box > > &a_new_grids)
 
virtual void regrid (const Vector< Box > &a_new_grids)=0
 
virtual void postRegrid (int a_base_level)
 
virtual void initialGrid (const Vector< Box > &a_new_grids)=0
 
virtual void postInitialGrid (const bool a_restart)
 
virtual void initialData ()=0
 
virtual void postInitialize ()=0
 
virtual void conclude (int a_step) const
 
I/O functions
virtual void writeCheckpointHeader (HDF5Handle &a_handle) const =0
 
virtual void writeCheckpointLevel (HDF5Handle &a_handle) const =0
 
virtual void readCheckpointHeader (HDF5Handle &a_handle)=0
 
virtual void readCheckpointLevel (HDF5Handle &a_handle)=0
 
virtual void writePlotHeader (HDF5Handle &a_handle) const =0
 
virtual void writePlotLevel (HDF5Handle &a_handle) const =0
 
virtual void writeCustomPlotFile (const std::string &a_prefix, int a_step) const
 
Parameter-setting functions
virtual void finerLevelPtr (AMRLevel *a_finer_level_ptr)
 
virtual void dt (Real a_dt)
 
virtual void time (Real a_time)
 
virtual void initialDtMultiplier (Real a_initial_dt_multiplier)
 
Access functions
virtual Real dt () const
 
virtual Real time () const
 
virtual Real initialDtMultiplier () const
 
virtual const ProblemDomainproblemDomain () const
 
virtual Vector< Boxboxes () const
 
bool isDefined () const
 
bool hasCoarserLevel () const
 
bool hasFinerLevel () const
 
virtual int level () const
 
virtual int refRatio () const
 
virtual Real computeDt ()=0
 
virtual Real computeInitialDt ()=0
 
Vector< AMRLevel * > getAMRLevelHierarchy ()
 Retrieve an array of all of the AMRLevel objects in the entire hierarchy. More...
 

Static Public Member Functions

static int verbosity ()
 
static void verbosity (int a_verbosity)
 

Protected Attributes

ProblemDomain m_problem_domain
 
Vector< Boxm_level_grids
 
int m_level
 
int m_ref_ratio
 
Real m_initial_dt_multiplier
 
Real m_dt
 
Real m_time
 
AMRLevelm_coarser_level_ptr
 
AMRLevelm_finer_level_ptr
 
bool m_isDefined
 

Static Protected Attributes

static int s_verbosity
 

Detailed Description

Abstract base class for time-dependent data at a level of refinement.

This is an abstract base class for data at the same level of refinement within a hierarchy of levels. The concrete class derived from AMRLevel is called a physics class. The domain of a level is a disjoint union of rectangles in a logically rectangular index space. Data is defined within this domain. There is also a problem domain, which may be larger, within which data can, in theory, be interpolated from some coarser level.

AMRLevel is intimately entangled with the AMR class. The AMR contains a collection of AMRLevel objects which represent a hierarchy of levels of refinement. The class AMR is responsible for calling the correct member functions of AMRLevel. The user is responsible for implementing the physics class, and might never call any AMRLevel functions described here.

Constructor & Destructor Documentation

◆ AMRLevel()

AMRLevel::AMRLevel ( )

Default constructor.

◆ ~AMRLevel()

virtual AMRLevel::~AMRLevel ( )
virtual

Destructor.

Member Function Documentation

◆ define() [1/2]

virtual void AMRLevel::define ( AMRLevel a_coarser_level_ptr,
const Box a_problem_domain,
int  a_level,
int  a_ref_ratio 
)
virtual

Defines this AMRLevel.

  • a_coarser_level_ptr (not modified): pointer to next coarser level object.
  • a_problem_domain (not modified): problem domain of this level.
  • a_level (not modified): index of this level. The base level is zero.
  • a_ref_ratio (not modified): the refinement ratio between this level and the next finer level.

Reimplemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

◆ define() [2/2]

virtual void AMRLevel::define ( AMRLevel a_coarser_level_ptr,
const ProblemDomain a_problem_domain,
int  a_level,
int  a_ref_ratio 
)
virtual

Defines this AMRLevel.

  • a_coarser_level_ptr (not modified): pointer to next coarser level object.
  • a_problem_domain (not modified): problem domain of this level.
  • a_level (not modified): index of this level. The base level is zero.
  • a_ref_ratio (not modified): the refinement ratio between this level and the next finer level.

Reimplemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

◆ advance()

virtual Real AMRLevel::advance ( )
pure virtual

Advances this level by one time step. Returns an estimate of the new time step.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

◆ convergedToSteadyState()

virtual bool AMRLevel::convergedToSteadyState ( )
inlinevirtual

◆ postTimeStep()

virtual void AMRLevel::postTimeStep ( )
pure virtual

Things to do after advancing this level by one time step.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ tagCells()

virtual void AMRLevel::tagCells ( IntVectSet a_tags)
pure virtual

Creates tagged cells for dynamic mesh refinement.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ tagCellsInit()

virtual void AMRLevel::tagCellsInit ( IntVectSet a_tags)
pure virtual

Creates tagged cells for mesh refinement at initialization.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ preRegrid()

virtual void AMRLevel::preRegrid ( int  a_base_level,
const Vector< Vector< Box > > &  a_new_grids 
)
virtual

Performs any pre-regridding operations which are necessary.

This is not a pure virtual function to preserve compatibility with earlier versions of AMRLevel. The AMRLevel::preRegrid() instantiation is a no-op.

Referenced by convergedToSteadyState().

◆ regrid()

virtual void AMRLevel::regrid ( const Vector< Box > &  a_new_grids)
pure virtual

Redefines this level to have the specified domain a_new_grids.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ postRegrid()

virtual void AMRLevel::postRegrid ( int  a_base_level)
virtual

Performs any post-regridding operations which are necessary.

This is not a pure virtual function to preserve compatibility with earlier versions of AMRLevel. The AMRLevel::postRegrid() instantiation is a no-op.

Referenced by convergedToSteadyState().

◆ initialGrid()

virtual void AMRLevel::initialGrid ( const Vector< Box > &  a_new_grids)
pure virtual

Initializes this level to have the specified domain a_new_grids.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelAdvectDiffuse, AMRLevelPolytropicGas, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ postInitialGrid()

virtual void AMRLevel::postInitialGrid ( const bool  a_restart)
virtual

Performs operations required after the grid has been defined but before data initialization. This will also be called after readCheckpointLevel during a restart procedure with argument a_restart set to true.

Levels are accessed from finest to coarsest. The AMRLevel::postInitialGrid() instantiation is a no-op.

Referenced by convergedToSteadyState().

◆ initialData()

virtual void AMRLevel::initialData ( )
pure virtual

Initializes data.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ postInitialize()

virtual void AMRLevel::postInitialize ( )
pure virtual

Things to do after initialization.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ conclude()

virtual void AMRLevel::conclude ( int  a_step) const
virtual

Override this method to have an AMRLevel subclass perform some operation upon the conclusion of a simulation. This is called when AMR::conclude() is called. The final step is passed to the method.

Parameters
a_stepThe last step in the simulation.

Referenced by convergedToSteadyState().

◆ writeCheckpointHeader()

virtual void AMRLevel::writeCheckpointHeader ( HDF5Handle a_handle) const
pure virtual

Writes checkpoint header.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ writeCheckpointLevel()

virtual void AMRLevel::writeCheckpointLevel ( HDF5Handle a_handle) const
pure virtual

Write checkpoint data for this level.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ readCheckpointHeader()

virtual void AMRLevel::readCheckpointHeader ( HDF5Handle a_handle)
pure virtual

Reads checkpoint header.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ readCheckpointLevel()

virtual void AMRLevel::readCheckpointLevel ( HDF5Handle a_handle)
pure virtual

Reads checkpoint data for this level.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ writePlotHeader()

virtual void AMRLevel::writePlotHeader ( HDF5Handle a_handle) const
pure virtual

Writes plot header.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ writePlotLevel()

virtual void AMRLevel::writePlotLevel ( HDF5Handle a_handle) const
pure virtual

Write plot file for this level.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ writeCustomPlotFile()

virtual void AMRLevel::writeCustomPlotFile ( const std::string &  a_prefix,
int  a_step 
) const
virtual

This allows one to write a plot file in a non-HDF5 format. It is called only at refinement level 0, so AMR data will have to be handled by the implementer.

Parameters
a_prefixA prefix for the custom plot file name.
a_stepThe current time step.

Referenced by convergedToSteadyState().

◆ finerLevelPtr()

virtual void AMRLevel::finerLevelPtr ( AMRLevel a_finer_level_ptr)
virtual

Sets the pointer-to-finer-level member to a_finer_level_ptr.

Referenced by convergedToSteadyState().

◆ dt() [1/2]

virtual void AMRLevel::dt ( Real  a_dt)
virtual

Sets the time step to a_dt.

◆ time() [1/2]

virtual void AMRLevel::time ( Real  a_time)
virtual

Sets the time to a_time.

◆ initialDtMultiplier() [1/2]

virtual void AMRLevel::initialDtMultiplier ( Real  a_initial_dt_multiplier)
virtual

Sets the initial dt multiplier to a_initial_dt_multiplier.

◆ dt() [2/2]

virtual Real AMRLevel::dt ( ) const
virtual

Returns the current value of the time step.

Referenced by convergedToSteadyState().

◆ time() [2/2]

virtual Real AMRLevel::time ( ) const
virtual

Returns the current value of the time on this level.

Referenced by convergedToSteadyState().

◆ initialDtMultiplier() [2/2]

virtual Real AMRLevel::initialDtMultiplier ( ) const
virtual

Returns the initial dt multiplier.

Referenced by convergedToSteadyState().

◆ problemDomain()

virtual const ProblemDomain& AMRLevel::problemDomain ( ) const
virtual

Returns the problem domain of this level.

Referenced by convergedToSteadyState().

◆ boxes()

virtual Vector<Box> AMRLevel::boxes ( ) const
virtual

Returns the domain of this level.

Referenced by convergedToSteadyState().

◆ isDefined()

bool AMRLevel::isDefined ( ) const

Returns true if any AMRLevel::define function has been called, false otherwise.

Referenced by convergedToSteadyState().

◆ hasCoarserLevel()

bool AMRLevel::hasCoarserLevel ( ) const

Returns true if a coarser level exists, is defined, and has a grid.

Referenced by convergedToSteadyState().

◆ hasFinerLevel()

bool AMRLevel::hasFinerLevel ( ) const

Returns true if a finer level exists, is defined, and has a grid.

Referenced by convergedToSteadyState().

◆ level()

virtual int AMRLevel::level ( ) const
virtual

Returns the index of this level

Referenced by convergedToSteadyState().

◆ refRatio()

virtual int AMRLevel::refRatio ( ) const
virtual

Returns the refinement ratio between this level and the next finer level.

Referenced by convergedToSteadyState().

◆ computeDt()

virtual Real AMRLevel::computeDt ( )
pure virtual

Returns maximum stable time step for this level.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ computeInitialDt()

virtual Real AMRLevel::computeInitialDt ( )
pure virtual

Returns maximum stable time step for this level with initial data.

This is a pure virtual function and MUST be defined in the derived class.

Implemented in AMRLevelPolytropicGas, AMRLevelAdvectDiffuse, and EBAMRGodunov.

Referenced by convergedToSteadyState().

◆ getAMRLevelHierarchy()

Vector<AMRLevel*> AMRLevel::getAMRLevelHierarchy ( )

Retrieve an array of all of the AMRLevel objects in the entire hierarchy.

Referenced by convergedToSteadyState().

◆ verbosity() [1/2]

static int AMRLevel::verbosity ( )
static

Returns current verbosity level. Minimum verbosity is 0, for which nothing is printed.

Referenced by convergedToSteadyState().

◆ verbosity() [2/2]

static void AMRLevel::verbosity ( int  a_verbosity)
static

Sets verbosity level to a_verbosity. Minimum verbosity is 0, for which nothing is printed.

Member Data Documentation

◆ s_verbosity

int AMRLevel::s_verbosity
staticprotected

◆ m_problem_domain

ProblemDomain AMRLevel::m_problem_domain
protected

◆ m_level_grids

Vector<Box> AMRLevel::m_level_grids
protected

◆ m_level

int AMRLevel::m_level
protected

◆ m_ref_ratio

int AMRLevel::m_ref_ratio
protected

◆ m_initial_dt_multiplier

Real AMRLevel::m_initial_dt_multiplier
protected

◆ m_dt

Real AMRLevel::m_dt
protected

◆ m_time

Real AMRLevel::m_time
protected

◆ m_coarser_level_ptr

AMRLevel* AMRLevel::m_coarser_level_ptr
protected

◆ m_finer_level_ptr

AMRLevel* AMRLevel::m_finer_level_ptr
protected

◆ m_isDefined

bool AMRLevel::m_isDefined
protected

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