chombo-discharge
CD_ItoKMCFieldTagger.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_ItoKMCFieldTagger_H
13 #define CD_ItoKMCFieldTagger_H
14 
15 // Our includes
16 #include <CD_ItoKMCTagger.H>
17 #include <CD_NamespaceHeader.H>
18 
19 namespace Physics {
20  namespace ItoKMC {
21 
28  template <typename S>
29  class ItoKMCFieldTagger : public ItoKMCTagger<S>
30  {
31  public:
35  ItoKMCFieldTagger() noexcept;
36 
40  virtual ~ItoKMCFieldTagger() noexcept;
41 
45  virtual void
46  computeTagFields() const noexcept override;
47 
51  virtual void
52  parseOptions() override = 0;
53 
57  virtual void
58  parseRuntimeOptions() override = 0;
59 
60  protected:
65 
69  mutable EBAMRCellData m_E;
70 
75 
79  virtual void
80  allocateStorage() const noexcept;
81 
85  virtual void
86  deallocateStorage() const noexcept;
87 
93  virtual void
94  computeElectricField(EBAMRCellData& a_E, EBAMRCellData& a_gradE) const noexcept;
95 
108  virtual Vector<Real>
109  computeTagFields(const RealVect a_pos,
110  const Real a_time,
111  const Real a_dx,
112  const RealVect a_E,
113  const Real a_minE,
114  const Real a_maxE,
115  const RealVect a_gradE,
116  const Real a_minGradE,
117  const Real a_maxGradE) const noexcept = 0;
118 
128  virtual bool
129  coarsenCell(const RealVect a_pos,
130  const Real a_time,
131  const Real a_dx,
132  const int a_lvl,
133  const Vector<Real> a_tagFields,
134  const Vector<RealVect> a_gradTagFields) const noexcept override = 0;
135 
145  virtual bool
146  refineCell(const RealVect a_pos,
147  const Real a_time,
148  const Real a_dx,
149  const int a_lvl,
150  const Vector<Real> a_tagFields,
151  const Vector<RealVect> a_gradTagFields) const noexcept override = 0;
152  };
153  } // namespace ItoKMC
154 } // namespace Physics
155 
156 #include <CD_NamespaceFooter.H>
157 
159 
160 #endif
Implementation of CD_ItoKMCFieldTagger.H.
Parent tagger class for ItoKMC.
Lightweight tagging class. Only tags cells based on the electric field.
Definition: CD_ItoKMCFieldTagger.H:30
EBAMRCellData m_gradE
Storage for grad(|E|)
Definition: CD_ItoKMCFieldTagger.H:74
ItoKMCFieldTagger() noexcept
Weak constructor. User MUST subsequently call define.
Definition: CD_ItoKMCFieldTaggerImplem.H:24
virtual void computeElectricField(EBAMRCellData &a_E, EBAMRCellData &a_gradE) const noexcept
Compute electric field.
Definition: CD_ItoKMCFieldTaggerImplem.H:70
virtual bool coarsenCell(const RealVect a_pos, const Real a_time, const Real a_dx, const int a_lvl, const Vector< Real > a_tagFields, const Vector< RealVect > a_gradTagFields) const noexcept override=0
Determine if a particular cell should be coarsened or not.
EBAMRCellData m_E
Storage for the electric field E.
Definition: CD_ItoKMCFieldTagger.H:69
virtual bool refineCell(const RealVect a_pos, const Real a_time, const Real a_dx, const int a_lvl, const Vector< Real > a_tagFields, const Vector< RealVect > a_gradTagFields) const noexcept override=0
Determine if a particular cell should be refined or not.
EBAMRCellData m_scratch
Scratch storage.
Definition: CD_ItoKMCFieldTagger.H:64
virtual void allocateStorage() const noexcept
Allocate memory for scratch, electric field, and gradient of electric field.
Definition: CD_ItoKMCFieldTaggerImplem.H:40
virtual ~ItoKMCFieldTagger() noexcept
Destructor.
Definition: CD_ItoKMCFieldTaggerImplem.H:35
virtual void computeTagFields() const noexcept override
Compute tagging fields.
Definition: CD_ItoKMCFieldTaggerImplem.H:95
virtual void parseRuntimeOptions() override=0
Parse run-time configurable options.
virtual void parseOptions() override=0
Parse options.
virtual void deallocateStorage() const noexcept
Deallocate memory.
Definition: CD_ItoKMCFieldTaggerImplem.H:56
Class for tagging grid cells using the Ito-KMC-Poisson module. Note that S is the time integrator typ...
Definition: CD_ItoKMCTagger.H:30
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15