chombo-discharge
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CellTagger Class Referenceabstract

Base class for tagging cells across an AMR hierarchy. More...

#include <CD_CellTagger.H>

Inheritance diagram for CellTagger:
Inheritance graph
[legend]

Public Member Functions

 CellTagger ()
 Weak constructor (does nothing)
 
virtual ~CellTagger ()
 Destructor (does nothing).
 
virtual void preRegrid () noexcept
 Pre-regrid function for cell-tagger.
 
virtual void regrid ()=0
 Regrid function for cell tagger (in case it uses transient storage to do things) More...
 
virtual void parseOptions ()=0
 Parse class options. More...
 
virtual void parseRuntimeOptions ()
 Parse runtime class options. More...
 
virtual bool tagCells (EBAMRTags &a_tags)=0
 Tag cells. More...
 
virtual void prePlot () const noexcept
 Perform pre-plotting operations (if necessary)
 
virtual int getNumberOfPlotVariables () const
 Get number of plot variables that will be written to file (by Driver). More...
 
virtual Vector< std::string > getPlotVariableNames () const
 Get plot variable names.
 
virtual void writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const
 Write plot data. More...
 
virtual int getBuffer () const
 Get tag buffer. More...
 

Protected Member Functions

bool insideTagBox (const RealVect a_pos) const
 Check if a point is inside a tagging box. More...
 
int getManualRefinementLevel (const RealVect a_pos) const
 Get the specified level for this position when doing manual refinement.
 
virtual void parseTagBoxes ()
 Parse boxes. More...
 
virtual void parseRefinementBoxes ()
 Parse refinement boxes.
 
virtual void parseBuffer ()
 Parse refinement buffer. More...
 
virtual void parseVerbosity ()
 Parse the verbosity from the input file or command line. More...
 

Protected Attributes

std::string m_name
 Cell tagger class name (default is CellTagger).
 
int m_verbosity
 Class verbosity.
 
int m_buffer
 Tag buffer. Grow tags by this amount (finest level only)
 
Vector< RealBoxm_tagBoxes
 Boxes that can be used to restrict tagging.
 
std::vector< std::pair< RealBox, int > > m_refBoxes
 Refinement boxes for adding manual refinement.
 

Detailed Description

Base class for tagging cells across an AMR hierarchy.

This is a pure class that users must implemented in order to enable refinement/coarsening of grid cells. This class will require implementing at least three functions, one for parsing options, one for regridding, and one which flags/removes cell for refinement. This class can also provide data to plot files, in which case the user must overwrite getNumberOfPlotVariables() and writePlotData(). A supporting utility for CellTagger is that the parent class provides functionality for restricting cell refinement to specified regions in space. This can be used to prune tags where it is (heuristically) known that cell refinement is unnecessary.

Member Function Documentation

◆ getBuffer()

int CellTagger::getBuffer ( ) const
virtual

Get tag buffer.

This returns an integer > 0 which adds additional tags around the cells that were refined. This is used by Driver to grow the refined region.

Returns
Returns m_buffer
Note
This will look for a string in the form "m_name.buffer = <integer>".

◆ getNumberOfPlotVariables()

int CellTagger::getNumberOfPlotVariables ( ) const
virtual

Get number of plot variables that will be written to file (by Driver).

Returns
Returns number of plot variables that Driver will write to plot files.

Reimplemented in Physics::CdrPlasma::CdrPlasmaTagger, Physics::DischargeInception::DischargeInceptionTagger, and Physics::ItoKMC::ItoKMCTagger< S >.

◆ insideTagBox()

bool CellTagger::insideTagBox ( const RealVect  a_pos) const
protected

Check if a point is inside a tagging box.

Parameters
[in]a_posPhysical coordinates.
Returns
Returns true if a_pos is inside any of the boxes in m_tagBoxes. Otherwise it returns false.

◆ parseBuffer()

void CellTagger::parseBuffer ( )
protectedvirtual

Parse refinement buffer.

This will look for an input parameter in the form "m_name.buffer = <integer>". If this is called but the string does not exist, it will cause a run-time error.

◆ parseOptions()

virtual void CellTagger::parseOptions ( )
pure virtual

◆ parseRuntimeOptions()

void CellTagger::parseRuntimeOptions ( )
virtual

Parse runtime class options.

This function is called by Driver at every time step; the user can use this for run-time updates of e.g. refinement criteria.

Reimplemented in Physics::ItoKMC::ItoKMCTagger< S >, Physics::ItoKMC::ItoKMCFieldTagger< S >, Physics::CdrPlasma::CdrPlasmaStreamerTagger, and Physics::ItoKMC::ItoKMCStreamerTagger< S >.

◆ parseTagBoxes()

void CellTagger::parseTagBoxes ( )
protectedvirtual

Parse boxes.

This will look for input parameters in the form m_name.num_boxes = <integer>. If <integer> = 0 then the function will process additional lines in the form "m_name.box1_lo = <float> <float> <float>" which indicates the lower corner of the "tag box".

◆ parseVerbosity()

void CellTagger::parseVerbosity ( )
protectedvirtual

Parse the verbosity from the input file or command line.

This will look for an input parameter in the form "m_name.verbosity = <integer>". This is used to control "verbosity" for the cell tagger class. Turning on verbosity for this class is mostly for debugging purposes.

◆ regrid()

virtual void CellTagger::regrid ( )
pure virtual

Regrid function for cell tagger (in case it uses transient storage to do things)

This function exists because implementations may require data to be allocated on a mesh. This function is called by Driver to make sure data is reallocated when it needs to.

Implemented in Physics::DischargeInception::DischargeInceptionTagger, Physics::CdrPlasma::CdrPlasmaTagger, Physics::BrownianWalker::BrownianWalkerTagger, Physics::AdvectionDiffusion::AdvectionDiffusionTagger, and Physics::ItoKMC::ItoKMCTagger< S >.

◆ tagCells()

virtual bool CellTagger::tagCells ( EBAMRTags a_tags)
pure virtual

Tag cells.

Parameters
[in,out]a_tagsTags on grid levels

EBAMRTags is a data-type Vector<RefCountedPtr<LayoutData<DenseIntVectSet> > >. The vector indicates the grid level, the LayoutData indicates data ownership (in much the same way as LevelData. The DenseIntVectSet is essentially an IntVectSet restricted to the patch (i.e. one cannot add IntVects that are outside the patch). This function cells for refinement or coarsening. The user's responsibility is to add (or remove) tags from a_tags.

Implemented in Physics::DischargeInception::DischargeInceptionTagger, Physics::CdrPlasma::CdrPlasmaTagger, Physics::BrownianWalker::BrownianWalkerTagger, Physics::AdvectionDiffusion::AdvectionDiffusionTagger, and Physics::ItoKMC::ItoKMCTagger< S >.

◆ writePlotData()

void CellTagger::writePlotData ( LevelData< EBCellFAB > &  a_output,
int &  a_icomp,
const std::string  a_outputRealm,
const int  a_level 
) const
virtual

Write plot data.

Parameters
[in,out]a_outputOutput data holder
[in,out]a_icompStarting variable in a_output where we begin appending data.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level

Reimplemented in Physics::CdrPlasma::CdrPlasmaTagger, and Physics::ItoKMC::ItoKMCTagger< S >.


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