Abstract CellTagger base class for the CDR plasma physics module.
More...
#include <CD_CdrPlasmaTagger.H>
|
|
| CdrPlasmaTagger () |
| | Default constructor. Sets default realm and phase.
|
| |
| | CdrPlasmaTagger (const RefCountedPtr< CdrPlasmaPhysics > &a_physics, const RefCountedPtr< CdrPlasmaStepper > &a_timeStepper, const RefCountedPtr< AmrMesh > &a_amr, const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
| | Full constructor. Leaves the object in a usable state.
|
| |
|
virtual | ~CdrPlasmaTagger () |
| | Destructor.
|
| |
| void | define (const RefCountedPtr< CdrPlasmaPhysics > &a_physics, const RefCountedPtr< CdrPlasmaStepper > &a_timeStepper, const RefCountedPtr< AmrMesh > &a_amr, const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
| | Define function. Leaves the object in a usable state.
|
| |
| virtual void | computeTracers () const =0 |
| | Compute tracer fields on the AMR hierarchy. Must be implemented by subclasses.
|
| |
| virtual void | parseOptions () override=0 |
| | Parse class options from ParmParse. Must be implemented by subclasses.
|
| |
| virtual void | prePlot () const noexcept override |
| | Pre-plot hook. Computes tracer fields so they appear in plot output.
|
| |
| virtual void | preRegrid () noexcept override |
| | Pre-regrid hook. Clears tracer field storage before the grid changes.
|
| |
| virtual void | regrid () override final |
| | Regrid hook. Reallocates tracer field and gradient storage on the new mesh.
|
| |
| virtual bool | tagCells (EBAMRTags &a_tags) override final |
| | Flag cells for refinement and coarsening using the tracer-field approach.
|
| |
| virtual int | getNumberOfPlotVariables () const override final |
| | Return the number of plot variables (one per tracer field).
|
| |
| virtual Vector< std::string > | getPlotVariableNames () const override final |
| | Return the names of the tracer field plot variables.
|
| |
| virtual void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, const int a_level) const override final |
| | Write tracer field data into the output holder.
|
| |
|
| CellTagger () |
| | Weak constructor (does nothing)
|
| |
|
virtual | ~CellTagger () |
| | Destructor (does nothing).
|
| |
| virtual void | parseRuntimeOptions () |
| | Parse runtime class options.
|
| |
| virtual int | getBuffer () const |
| | Get tag buffer.
|
| |
|
| virtual void | refineCellsBox (DenseIntVectSet &a_refinedCells, const Vector< EBCellFAB * > &a_tracers, const Vector< EBCellFAB * > &a_gradTracers, const int a_lvl, const DataIndex &a_dit, const Box &a_box, const EBISBox &a_ebisbox, const Real a_time, const Real a_dx, const RealVect &a_probLo) |
| | Flag cells for refinement within a single grid patch.
|
| |
| virtual void | coarsenCellsBox (DenseIntVectSet &a_coarsenedCells, const Vector< EBCellFAB * > &a_tracers, const Vector< EBCellFAB * > &a_gradTracers, const int a_lvl, const DataIndex &a_dit, const Box &a_box, const EBISBox &a_ebisbox, const Real a_time, const Real a_dx, const RealVect &a_probLo) |
| | Flag cells for coarsening within a single grid patch.
|
| |
| virtual bool | coarsenCell (const RealVect &a_pos, const Real a_time, const Real a_dx, const int a_lvl, const Vector< Real > &a_tracers, const Vector< RealVect > &a_gradTracers) const =0 |
| | Decide whether a single cell should be coarsened. Must be implemented by subclasses.
|
| |
| virtual bool | refineCell (const RealVect &a_pos, const Real a_time, const Real a_dx, const int a_lvl, const Vector< Real > &a_tracers, const Vector< RealVect > &a_gradTracers) const =0 |
| | Decide whether a single cell should be refined. Must be implemented by subclasses.
|
| |
| bool | insideTagBox (const RealVect &a_pos) const |
| | Check if a point is inside a tagging box.
|
| |
| int | getManualRefinementLevel (const RealVect &a_pos) const |
| | Get the specified level for this position when doing manual refinement.
|
| |
| virtual void | parseTagBoxes () |
| | Parse boxes.
|
| |
|
virtual void | parseRefinementBoxes () |
| | Parse refinement boxes.
|
| |
| virtual void | parseBuffer () |
| | Parse refinement buffer.
|
| |
| virtual void | parseVerbosity () |
| | Parse the verbosity from the input file or command line.
|
| |
|
|
std::string | m_realm |
| | Realm on which tracer field storage is allocated.
|
| |
|
phase::which_phase | m_phase |
| | Phase on which tracer field storage is allocated.
|
| |
|
RefCountedPtr< CdrPlasmaPhysics > | m_physics |
| | Plasma kinetics interface.
|
| |
|
RefCountedPtr< CdrPlasmaStepper > | m_timeStepper |
| | Time stepper providing access to solver data and electric field.
|
| |
|
RefCountedPtr< AmrMesh > | m_amr |
| | AMR mesh for grid iteration, gradient computation, and interpolation.
|
| |
|
RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
| | Computational geometry providing electrode and dielectric information.
|
| |
|
int | m_numTracers |
| | Number of scalar tracer fields used for tagging decisions.
|
| |
|
Vector< EBAMRCellData > | m_tracers |
| | Tracer fields on the AMR hierarchy. Allocated and filled by computeTracers().
|
| |
|
Vector< EBAMRCellData > | m_gradTracers |
| | Gradients of the tracer fields on the AMR hierarchy.
|
| |
|
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.
|
| |
Abstract CellTagger base class for the CDR plasma physics module.
This class provides subclasses with access to solver data and plasma physics through references to CdrPlasmaStepper, AmrMesh, CdrPlasmaPhysics, and ComputationalGeometry. It implements the CellTagger interface using a tracer-field approach: subclasses compute one or more scalar tracer fields via computeTracers(), and the base class then calls the per-cell refineCell() and coarsenCell() methods to determine which cells should be flagged.
Subclasses must implement computeTracers(), parseOptions(), refineCell(), and coarsenCell(). The number of tracer fields is controlled by setting m_numTracers in the subclass constructor.
◆ CdrPlasmaTagger()
Full constructor. Leaves the object in a usable state.
- Parameters
-
| [in] | a_physics | Plasma kinetics interface. |
| [in] | a_timeStepper | Time stepper providing solver data. |
| [in] | a_amr | AMR mesh for grid iteration and operators. |
| [in] | a_computationalGeometry | Computational geometry (electrodes and dielectrics). |
◆ coarsenCell()
| virtual bool Physics::CdrPlasma::CdrPlasmaTagger::coarsenCell |
( |
const RealVect & |
a_pos, |
|
|
const Real |
a_time, |
|
|
const Real |
a_dx, |
|
|
const int |
a_lvl, |
|
|
const Vector< Real > & |
a_tracers, |
|
|
const Vector< RealVect > & |
a_gradTracers |
|
) |
| const |
|
protectedpure virtual |
Decide whether a single cell should be coarsened. Must be implemented by subclasses.
- Parameters
-
| [in] | a_pos | Cell centroid position. |
| [in] | a_time | Current simulation time. |
| [in] | a_dx | Grid cell spacing. |
| [in] | a_lvl | AMR level of this cell. |
| [in] | a_tracers | Tracer field values at this cell. |
| [in] | a_gradTracers | Gradient of tracer fields at this cell. |
- Returns
- True if the cell should be coarsened.
Implemented in Physics::CdrPlasma::CdrPlasmaStreamerTagger, and Physics::CdrPlasma::CdrPlasmaFieldTagger.
◆ coarsenCellsBox()
| void CdrPlasmaTagger::coarsenCellsBox |
( |
DenseIntVectSet & |
a_coarsenedCells, |
|
|
const Vector< EBCellFAB * > & |
a_tracers, |
|
|
const Vector< EBCellFAB * > & |
a_gradTracers, |
|
|
const int |
a_lvl, |
|
|
const DataIndex & |
a_dit, |
|
|
const Box & |
a_box, |
|
|
const EBISBox & |
a_ebisbox, |
|
|
const Real |
a_time, |
|
|
const Real |
a_dx, |
|
|
const RealVect & |
a_probLo |
|
) |
| |
|
protectedvirtual |
Flag cells for coarsening within a single grid patch.
- Parameters
-
| [out] | a_coarsenedCells | Cells flagged for coarsening on this patch. |
| [in] | a_tracers | Tracer field data on this patch. |
| [in] | a_gradTracers | Gradient of tracer fields on this patch. |
| [in] | a_lvl | AMR level. |
| [in] | a_dit | Grid patch index. |
| [in] | a_box | Cell-centered box for this patch. |
| [in] | a_ebisbox | EB geometry information for this patch. |
| [in] | a_time | Current simulation time. |
| [in] | a_dx | Grid cell spacing. |
| [in] | a_probLo | Lower-left corner of the simulation domain. |
◆ computeTracers()
| virtual void Physics::CdrPlasma::CdrPlasmaTagger::computeTracers |
( |
| ) |
const |
|
pure virtual |
Compute tracer fields on the AMR hierarchy. Must be implemented by subclasses.
Results are stored in m_tracers. The number of tracer fields must equal m_numTracers.
Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger.
◆ define()
Define function. Leaves the object in a usable state.
- Parameters
-
| [in] | a_physics | Plasma kinetics interface. |
| [in] | a_timeStepper | Time stepper providing solver data. |
| [in] | a_amr | AMR mesh for grid iteration and operators. |
| [in] | a_computationalGeometry | Computational geometry. |
◆ getNumberOfPlotVariables()
| int CdrPlasmaTagger::getNumberOfPlotVariables |
( |
| ) |
const |
|
finaloverridevirtual |
Return the number of plot variables (one per tracer field).
- Returns
- Number of tracer fields (m_numTracers).
Reimplemented from CellTagger.
◆ getPlotVariableNames()
| Vector< std::string > CdrPlasmaTagger::getPlotVariableNames |
( |
| ) |
const |
|
finaloverridevirtual |
Return the names of the tracer field plot variables.
- Returns
- Vector of names of the form "Tracer field-i".
Reimplemented from CellTagger.
◆ parseOptions()
| virtual void Physics::CdrPlasma::CdrPlasmaTagger::parseOptions |
( |
| ) |
|
|
overridepure virtual |
◆ prePlot()
| void CdrPlasmaTagger::prePlot |
( |
| ) |
const |
|
overridevirtualnoexcept |
Pre-plot hook. Computes tracer fields so they appear in plot output.
Reimplemented from CellTagger.
◆ preRegrid()
| void CdrPlasmaTagger::preRegrid |
( |
| ) |
|
|
overridevirtualnoexcept |
Pre-regrid hook. Clears tracer field storage before the grid changes.
Reimplemented from CellTagger.
◆ refineCell()
| virtual bool Physics::CdrPlasma::CdrPlasmaTagger::refineCell |
( |
const RealVect & |
a_pos, |
|
|
const Real |
a_time, |
|
|
const Real |
a_dx, |
|
|
const int |
a_lvl, |
|
|
const Vector< Real > & |
a_tracers, |
|
|
const Vector< RealVect > & |
a_gradTracers |
|
) |
| const |
|
protectedpure virtual |
Decide whether a single cell should be refined. Must be implemented by subclasses.
- Parameters
-
| [in] | a_pos | Cell centroid position. |
| [in] | a_time | Current simulation time. |
| [in] | a_dx | Grid cell spacing. |
| [in] | a_lvl | AMR level of this cell. |
| [in] | a_tracers | Tracer field values at this cell. |
| [in] | a_gradTracers | Gradient of tracer fields at this cell. |
- Returns
- True if the cell should be refined.
Implemented in Physics::CdrPlasma::CdrPlasmaStreamerTagger, and Physics::CdrPlasma::CdrPlasmaFieldTagger.
◆ refineCellsBox()
| void CdrPlasmaTagger::refineCellsBox |
( |
DenseIntVectSet & |
a_refinedCells, |
|
|
const Vector< EBCellFAB * > & |
a_tracers, |
|
|
const Vector< EBCellFAB * > & |
a_gradTracers, |
|
|
const int |
a_lvl, |
|
|
const DataIndex & |
a_dit, |
|
|
const Box & |
a_box, |
|
|
const EBISBox & |
a_ebisbox, |
|
|
const Real |
a_time, |
|
|
const Real |
a_dx, |
|
|
const RealVect & |
a_probLo |
|
) |
| |
|
protectedvirtual |
Flag cells for refinement within a single grid patch.
- Parameters
-
| [out] | a_refinedCells | Cells flagged for refinement on this patch. |
| [in] | a_tracers | Tracer field data on this patch. |
| [in] | a_gradTracers | Gradient of tracer fields on this patch. |
| [in] | a_lvl | AMR level. |
| [in] | a_dit | Grid patch index. |
| [in] | a_box | Cell-centered box for this patch. |
| [in] | a_ebisbox | EB geometry information for this patch. |
| [in] | a_time | Current simulation time. |
| [in] | a_dx | Grid cell spacing. |
| [in] | a_probLo | Lower-left corner of the simulation domain. |
◆ regrid()
| void CdrPlasmaTagger::regrid |
( |
| ) |
|
|
finaloverridevirtual |
Regrid hook. Reallocates tracer field and gradient storage on the new mesh.
Implements CellTagger.
◆ tagCells()
| bool CdrPlasmaTagger::tagCells |
( |
EBAMRTags & |
a_tags | ) |
|
|
finaloverridevirtual |
Flag cells for refinement and coarsening using the tracer-field approach.
Calls computeTracers(), then iterates over grid cells calling refineCell() and coarsenCell() on each. Returns true if the tag set changed on any MPI rank.
- Parameters
-
| [in,out] | a_tags | Cell tags across the AMR hierarchy. |
- Returns
- True if any new tags were added or removed.
Implements CellTagger.
◆ writePlotData()
| void CdrPlasmaTagger::writePlotData |
( |
LevelData< EBCellFAB > & |
a_output, |
|
|
int & |
a_icomp, |
|
|
const std::string & |
a_outputRealm, |
|
|
const int |
a_level |
|
) |
| const |
|
finaloverridevirtual |
Write tracer field data into the output holder.
- Parameters
-
| [in,out] | a_output | Output data holder. |
| [in,out] | a_icomp | Starting component index; incremented on return. |
| [in] | a_outputRealm | Realm that owns a_output. |
| [in] | a_level | AMR level to write. |
Reimplemented from CellTagger.
The documentation for this class was generated from the following files: