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

Lightweight tagging class which flags cells for refinement/coarsening using the electric field only. More...

#include <CD_CdrPlasmaFieldTagger.H>

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

Public Member Functions

 CdrPlasmaFieldTagger ()
 Weak constructor, must subsequently call define.
 
virtual ~CdrPlasmaFieldTagger ()
 Destructor.
 
void computeTracers () const override final
 Compute tracer fields. More...
 
virtual void parseOptions () override=0
 Parse options. Must be implemented by users.
 
- Public Member Functions inherited from Physics::CdrPlasma::CdrPlasmaTagger
 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 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 allocateStorage () const
 Allocate memory for electric field and scratch.
 
virtual void deallocateStorage () const
 Deallocate memory for electric field and scratch.
 
virtual void computeElectricField (EBAMRCellData &a_electricField, EBAMRCellData &a_gradientElectricField) const
 Compute electric field onto the input data holders. More...
 
virtual Vector< Real > tracer (const RealVect a_pos, const Real a_time, const Real a_dx, const RealVect a_electricField, const Real a_minElectricField, const Real a_maxElectricField, const RealVect a_gradElectricField, const Real a_minGradElectricField, const Real a_maxGradElectricField) const =0
 Compute tracer field. 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 override=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 override=0
 Refine a cell based on a tracer field. More...
 
- Protected Member Functions inherited from Physics::CdrPlasma::CdrPlasmaTagger
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...
 
- 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

EBAMRCellData m_scratch
 Scratch storage.
 
EBAMRCellData m_electricField
 Storage for electric field.
 
EBAMRCellData m_gradElectricField
 Storage for electric field.
 
- Protected Attributes inherited from Physics::CdrPlasma::CdrPlasmaTagger
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

Lightweight tagging class which flags cells for refinement/coarsening using the electric field only.

This class fetches the point-wise electric field. The class is pure, so users must implement the actual tagging criterion themselves.

Member Function Documentation

◆ coarsenCell()

virtual bool Physics::CdrPlasma::CdrPlasmaFieldTagger::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
overrideprotectedpure 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.

Implements Physics::CdrPlasma::CdrPlasmaTagger.

Implemented in Physics::CdrPlasma::CdrPlasmaStreamerTagger.

◆ computeElectricField()

void CdrPlasmaFieldTagger::computeElectricField ( EBAMRCellData a_electricField,
EBAMRCellData a_gradientElectricField 
) const
protectedvirtual

Compute electric field onto the input data holders.

Parameters
[out]a_electricFieldCell-centered electric field
[out]a_gradientElectricFieldGradient of |E| where E is the electric field.

◆ computeTracers()

void CdrPlasmaFieldTagger::computeTracers ( ) const
finaloverridevirtual

Compute tracer fields.

Implements parent class method but introduces a cell-wise method CdrPlasmaFieldTagger::tracer which is used on per-cell basis.

Implements Physics::CdrPlasma::CdrPlasmaTagger.

◆ refineCell()

virtual bool Physics::CdrPlasma::CdrPlasmaFieldTagger::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
overrideprotectedpure 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.

Implements Physics::CdrPlasma::CdrPlasmaTagger.

Implemented in Physics::CdrPlasma::CdrPlasmaStreamerTagger.

◆ tracer()

virtual Vector<Real> Physics::CdrPlasma::CdrPlasmaFieldTagger::tracer ( const RealVect  a_pos,
const Real  a_time,
const Real  a_dx,
const RealVect  a_electricField,
const Real  a_minElectricField,
const Real  a_maxElectricField,
const RealVect  a_gradElectricField,
const Real  a_minGradElectricField,
const Real  a_maxGradElectricField 
) const
protectedpure virtual

Compute tracer field.

Parameters
[in]a_posPhysical coordinates
[in]a_timeTime
[in]a_electricFieldElectric field (in SI units)
[in]a_minElectricFieldMinimum value of electric field
[in]a_maxElectricFieldMaximum value of electric field
[in]a_gradElectricFieldGradient of |E|, i.e. grad(|E|)
[in]a_minGradElectricFieldMaximum value of |grad(|E|)|
[in]a_maxGradElectricFieldMaximum value of |grad(|E|)|
Returns
This should return a Vector of values whose length is equal to the number of tracer fields the subclasses uses.

Implemented in Physics::CdrPlasma::CdrPlasmaStreamerTagger.


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