chombo-discharge
|
Base class for tagging cells across an AMR hierarchy. More...
#include <CD_CellTagger.H>
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< RealBox > | m_tagBoxes |
Boxes that can be used to restrict tagging. | |
std::vector< std::pair< RealBox, int > > | m_refBoxes |
Refinement boxes for adding manual refinement. | |
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.
|
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.
|
virtual |
Get number of plot variables that will be written to file (by Driver).
Reimplemented in Physics::CdrPlasma::CdrPlasmaTagger, Physics::DischargeInception::DischargeInceptionTagger, and Physics::ItoKMC::ItoKMCTagger< S >.
|
protected |
Check if a point is inside a tagging box.
[in] | a_pos | Physical coordinates. |
|
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.
|
pure virtual |
Parse class options.
Implemented in Physics::ItoKMC::ItoKMCTagger< S >, Physics::ItoKMC::ItoKMCFieldTagger< S >, Physics::CdrPlasma::CdrPlasmaTagger, Physics::CdrPlasma::CdrPlasmaFieldTagger, Physics::DischargeInception::DischargeInceptionTagger, Physics::CdrPlasma::CdrPlasmaStreamerTagger, Physics::BrownianWalker::BrownianWalkerTagger, Physics::AdvectionDiffusion::AdvectionDiffusionTagger, and Physics::ItoKMC::ItoKMCStreamerTagger< S >.
|
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 >.
|
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".
|
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.
|
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 >.
|
pure virtual |
Tag cells.
[in,out] | a_tags | Tags 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 >.
|
virtual |
Write plot data.
[in,out] | a_output | Output data holder |
[in,out] | a_icomp | Starting variable in a_output where we begin appending data. |
[in] | a_outputRealm | Realm where a_output belongs |
[in] | a_level | Grid level |
Reimplemented in Physics::CdrPlasma::CdrPlasmaTagger, and Physics::ItoKMC::ItoKMCTagger< S >.