chombo-discharge
CD_CdrPlasmaFieldTagger.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_CdrPlasmaFieldTagger_H
13 #define CD_CdrPlasmaFieldTagger_H
14 
15 // Our includes
16 #include <CD_CdrPlasmaTagger.H>
17 #include <CD_NamespaceHeader.H>
18 
19 namespace Physics {
20  namespace CdrPlasma {
21 
28  {
29  public:
34 
38  virtual ~CdrPlasmaFieldTagger();
39 
44  void
45  computeTracers() const override final;
46 
50  virtual void
51  parseOptions() override = 0;
52 
53  protected:
58 
63 
68 
72  virtual void
73  allocateStorage() const;
74 
78  virtual void
79  deallocateStorage() const;
80 
86  virtual void
87  computeElectricField(EBAMRCellData& a_electricField, EBAMRCellData& a_gradientElectricField) const;
88 
101  virtual Vector<Real>
102  tracer(const RealVect a_pos,
103  const Real a_time,
104  const Real a_dx,
105  const RealVect a_electricField,
106  const Real a_minElectricField,
107  const Real a_maxElectricField,
108  const RealVect a_gradElectricField,
109  const Real a_minGradElectricField,
110  const Real a_maxGradElectricField) const = 0;
111 
122  virtual bool
123  coarsenCell(const RealVect a_pos,
124  const Real a_time,
125  const Real a_dx,
126  const int a_lvl,
127  const Vector<Real> a_tracers,
128  const Vector<RealVect> a_gradTracers) const override = 0;
129 
140  virtual bool
141  refineCell(const RealVect a_pos,
142  const Real a_time,
143  const Real a_dx,
144  const int a_lvl,
145  const Vector<Real> a_tracers,
146  const Vector<RealVect> a_gradTracers) const override = 0;
147  };
148  } // namespace CdrPlasma
149 } // namespace Physics
150 
151 #include <CD_NamespaceFooter.H>
152 
153 #endif
Declearation of an abstract class for tagging cells in a Physics/CdrPlasma context.
Lightweight tagging class which flags cells for refinement/coarsening using the electric field only.
Definition: CD_CdrPlasmaFieldTagger.H:28
virtual ~CdrPlasmaFieldTagger()
Destructor.
Definition: CD_CdrPlasmaFieldTagger.cpp:32
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.
virtual void allocateStorage() const
Allocate memory for electric field and scratch.
Definition: CD_CdrPlasmaFieldTagger.cpp:36
void computeTracers() const override final
Compute tracer fields.
Definition: CD_CdrPlasmaFieldTagger.cpp:87
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.
EBAMRCellData m_electricField
Storage for electric field.
Definition: CD_CdrPlasmaFieldTagger.H:62
CdrPlasmaFieldTagger()
Weak constructor, must subsequently call define.
Definition: CD_CdrPlasmaFieldTagger.cpp:22
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.
EBAMRCellData m_gradElectricField
Storage for electric field.
Definition: CD_CdrPlasmaFieldTagger.H:67
virtual void computeElectricField(EBAMRCellData &a_electricField, EBAMRCellData &a_gradientElectricField) const
Compute electric field onto the input data holders.
Definition: CD_CdrPlasmaFieldTagger.cpp:62
virtual void parseOptions() override=0
Parse options. Must be implemented by users.
virtual void deallocateStorage() const
Deallocate memory for electric field and scratch.
Definition: CD_CdrPlasmaFieldTagger.cpp:49
EBAMRCellData m_scratch
Scratch storage.
Definition: CD_CdrPlasmaFieldTagger.H:57
Abstract Class which implements CellTagger for the CDR plasma physics module.
Definition: CD_CdrPlasmaTagger.H:35
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15