chombo-discharge
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Physics::CdrPlasma::CdrPlasmaTagger Class Referenceabstract

Abstract Class which implements CellTagger for the CDR plasma physics module. More...

#include <CD_CdrPlasmaTagger.H>

Inheritance diagram for Physics::CdrPlasma::CdrPlasmaTagger:
Inheritance graph
[legend]
Collaboration diagram for Physics::CdrPlasma::CdrPlasmaTagger:
Collaboration graph
[legend]

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< CdrPlasmaPhysicsm_physics
 Plasma physics.
 
RefCountedPtr< CdrPlasmaStepperm_timeStepper
 Time stepper.
 
RefCountedPtr< AmrMeshm_amr
 AmrMesh. Needed for computing tracer stuff.
 
RefCountedPtr< ComputationalGeometrym_computationalGeometry
 Computational geometry. Not needed but useful to have.
 
int m_numTracers
 Number of tracer fields.
 
Vector< EBAMRCellDatam_tracers
 Tracer fields.
 
Vector< EBAMRCellDatam_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< 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

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

Constructor & Destructor Documentation

◆ CdrPlasmaTagger()

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.

Parameters
[in]a_physicsReference to CdrPlasmaPhysics.
[in]a_timeStepperReference to the TimeStepper being used.
[in]a_amrReference to AmrMesh.
[in]a_computationalGeometryComputational geometry

Member Function Documentation

◆ 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

Coarsen a cell based on a tracer field.

Parameters
[in]a_posPhysical position
[in]a_timeCurrent time
[in]a_dxGrid resolution
[in]a_lvlGrid level
[in]a_tracersTracer fields
[in]a_gradTracersGradient of tracer fields
Returns
Return true if the cell should be coarsened and false otherwise.

Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger, and Physics::CdrPlasma::CdrPlasmaStreamerTagger.

◆ 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

Per-box coarsening method.

Iterates through all cells and check if they need coarsening.

Parameters
[out]a_coarsenedCellsCells flagged for coarsening.
[in]a_tracersTracer fields on this grid patch.
[in]a_gradTracersGradient of tracer fields on this grid patch.
[in]a_lvlGrid level
[in]a_ditGrid index
[in]a_boxCell centered box
[in]a_ebisboxEBIS box
[in]a_timeCurrent time
[in]a_dxGrid resolution
[in]a_probLoLower-left corner of simulation domain.

◆ computeTracers()

virtual void Physics::CdrPlasma::CdrPlasmaTagger::computeTracers ( ) const
pure virtual

Compute tracer fields.

This should fill m_tracers – user must implement it.

Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger.

◆ define()

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.

Parameters
[in]a_physicsReference to CdrPlasmaPhysics.
[in]a_timeStepperReference to the TimeStepper being used.
[in]a_amrReference to AmrMesh.
[in]a_computationalGeometryComputational geometry

◆ 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

Refine a cell based on a tracer field.

Parameters
[in]a_posPhysical position
[in]a_timeCurrent time
[in]a_dxGrid resolution
[in]a_lvlGrid level
[in]a_tracersTracer fields
[in]a_gradTracersGradient of tracer fields
Returns
True if the cell should be refined and false otherwise.

Implemented in Physics::CdrPlasma::CdrPlasmaFieldTagger, and Physics::CdrPlasma::CdrPlasmaStreamerTagger.

◆ 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

Per-box refinement method.

Iterates through all cells and check if they need refinement.

Parameters
[out]a_refinedCellsCells flagged for refinement
[in]a_tracersTracer fields on this grid patch.
[in]a_gradTracersGradient of tracer fields on this grid patch.
[in]a_lvlGrid level
[in]a_ditGrid index
[in]a_boxCell centered box
[in]a_ebisboxEBIS box
[in]a_timeCurrent time
[in]a_dxGrid resolution
[in]a_probLoLower-left corner of simulation domain.

◆ tagCells()

bool CdrPlasmaTagger::tagCells ( EBAMRTags a_tags)
finaloverridevirtual

Tag cells for refinement.

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.

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 plot data.

Parameters
[in,out]a_outputOutput data holder
[in,out]a_icompStarting variable in a_output where we begin appending data. πaram[in] a_outputRealm Realm where a_output lives
[in]a_levelGrid level

Reimplemented from CellTagger.


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