chombo-discharge
|
Abstract Class which implements CellTagger for the CDR plasma physics module. More...
#include <CD_CdrPlasmaTagger.H>
Public Member Functions | |
CdrPlasmaTagger () | |
Weak constructor. Must subsequently call define. | |
CdrPlasmaTagger (const RefCountedPtr< CdrPlasmaPhysics > &a_physics, const RefCountedPtr< CdrPlasmaStepper > &a_timeStepper, const RefCountedPtr< AmrMesh > &a_amr, const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) | |
Full constructor. Leaves object in usable state. More... | |
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 constructor. Leaves object in usable state. More... | |
virtual void | computeTracers () const =0 |
Compute tracer fields. More... | |
virtual void | parseOptions () override=0 |
Parse class options – must be implemented by user. | |
virtual void | prePlot () const noexcept override |
Pre-plot magic for Driver. | |
virtual void | preRegrid () noexcept override |
Perform pre-regrid operations. | |
virtual void | regrid () override final |
Regrid method – used for reallocating storage for the tracer fields. | |
virtual bool | tagCells (EBAMRTags &a_tags) override final |
Tag cells for refinement. More... | |
virtual int | getNumberOfPlotVariables () const override final |
Get number of plot variables. This is fetched by Driver and can be used. | |
virtual Vector< std::string > | getPlotVariableNames () const override final |
Get plot variable names. | |
virtual void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const override final |
Write plot data. More... | |
Public Member Functions inherited from CellTagger | |
CellTagger () | |
Weak constructor (does nothing) | |
virtual | ~CellTagger () |
Destructor (does nothing). | |
virtual void | parseRuntimeOptions () |
Parse runtime class options. More... | |
virtual int | getBuffer () const |
Get tag buffer. More... | |
Protected Member Functions | |
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) |
Per-box refinement method. More... | |
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) |
Per-box coarsening method. More... | |
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 |
Coarsen a cell based on a tracer field. More... | |
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 |
Refine a cell based on a tracer field. More... | |
Protected Member Functions inherited from CellTagger | |
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_realm |
Realm where this cell tagger allocates its data. | |
phase::which_phase | m_phase |
Phase where this cell tagger allocates its data. | |
RefCountedPtr< CdrPlasmaPhysics > | m_physics |
Plasma physics. | |
RefCountedPtr< CdrPlasmaStepper > | m_timeStepper |
Time stepper. | |
RefCountedPtr< AmrMesh > | m_amr |
AmrMesh. Needed for computing tracer stuff. | |
RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
Computational geometry. Not needed but useful to have. | |
int | m_numTracers |
Number of tracer fields. | |
Vector< EBAMRCellData > | m_tracers |
Tracer fields. | |
Vector< EBAMRCellData > | m_gradTracers |
Gradient of tracer fields. | |
Protected Attributes inherited from CellTagger | |
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 Class which implements CellTagger for the CDR plasma physics module.
This class exposes a number of mesh data holders which can be used for flagging cells for refinement. It is only meant to be used as an interface, providing the user access to solver data and physics through the constructor. From that, users can fetch the necessary data from the solvers (or the physics class) and more easily use the data to flag cells for refinement and coarsening.
This class uses 'tracer fields' for flagging cells for refinement and coarsening. It is up to the user to compute these fields by implementing the routine CdrPlasmaTagger::computeTracerFields. These fields can then be used in the other routines CdrPlasmaTagger::refineCell and CdrPlasmaTagger::coarsenCell
CdrPlasmaTagger::CdrPlasmaTagger | ( | const RefCountedPtr< CdrPlasmaPhysics > & | a_physics, |
const RefCountedPtr< CdrPlasmaStepper > & | a_timeStepper, | ||
const RefCountedPtr< AmrMesh > & | a_amr, | ||
const RefCountedPtr< ComputationalGeometry > & | a_computationalGeometry | ||
) |
Full constructor. Leaves object in usable state.
[in] | a_physics | Reference to CdrPlasmaPhysics. |
[in] | a_timeStepper | Reference to the TimeStepper being used. |
[in] | a_amr | Reference to AmrMesh. |
[in] | a_computationalGeometry | Computational geometry |
|
protectedpure virtual |
Coarsen a cell based on a tracer field.
[in] | a_pos | Physical position |
[in] | a_time | Current time |
[in] | a_dx | Grid resolution |
[in] | a_lvl | Grid level |
[in] | a_tracers | Tracer fields |
[in] | a_gradTracers | Gradient of tracer fields |
Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger, and Physics::CdrPlasma::CdrPlasmaStreamerTagger.
|
protectedvirtual |
Per-box coarsening method.
Iterates through all cells and check if they need coarsening.
[out] | a_coarsenedCells | Cells flagged for coarsening. |
[in] | a_tracers | Tracer fields on this grid patch. |
[in] | a_gradTracers | Gradient of tracer fields on this grid patch. |
[in] | a_lvl | Grid level |
[in] | a_dit | Grid index |
[in] | a_box | Cell centered box |
[in] | a_ebisbox | EBIS box |
[in] | a_time | Current time |
[in] | a_dx | Grid resolution |
[in] | a_probLo | Lower-left corner of simulation domain. |
|
pure virtual |
Compute tracer fields.
This should fill m_tracers – user must implement it.
Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger.
void CdrPlasmaTagger::define | ( | const RefCountedPtr< CdrPlasmaPhysics > & | a_physics, |
const RefCountedPtr< CdrPlasmaStepper > & | a_timeStepper, | ||
const RefCountedPtr< AmrMesh > & | a_amr, | ||
const RefCountedPtr< ComputationalGeometry > & | a_computationalGeometry | ||
) |
Define function constructor. Leaves object in usable state.
[in] | a_physics | Reference to CdrPlasmaPhysics. |
[in] | a_timeStepper | Reference to the TimeStepper being used. |
[in] | a_amr | Reference to AmrMesh. |
[in] | a_computationalGeometry | Computational geometry |
|
protectedpure virtual |
Refine a cell based on a tracer field.
[in] | a_pos | Physical position |
[in] | a_time | Current time |
[in] | a_dx | Grid resolution |
[in] | a_lvl | Grid level |
[in] | a_tracers | Tracer fields |
[in] | a_gradTracers | Gradient of tracer fields |
Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger, and Physics::CdrPlasma::CdrPlasmaStreamerTagger.
|
protectedvirtual |
Per-box refinement method.
Iterates through all cells and check if they need refinement.
[out] | a_refinedCells | Cells flagged for refinement |
[in] | a_tracers | Tracer fields on this grid patch. |
[in] | a_gradTracers | Gradient of tracer fields on this grid patch. |
[in] | a_lvl | Grid level |
[in] | a_dit | Grid index |
[in] | a_box | Cell centered box |
[in] | a_ebisbox | EBIS box |
[in] | a_time | Current time |
[in] | a_dx | Grid resolution |
[in] | a_probLo | Lower-left corner of simulation domain. |
|
finaloverridevirtual |
Tag cells for refinement.
[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.
Implements CellTagger.
|
finaloverridevirtual |
Write plot data.
[in,out] | a_output | Output data holder |
[in,out] | a_icomp | Starting variable in a_output where we begin appending data. πaram[in] a_outputRealm Realm where a_output lives |
[in] | a_level | Grid level |
Reimplemented from CellTagger.