chombo-discharge
Loading...
Searching...
No Matches
CD_ItoKMCFieldTagger.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_ITOKMCFIELDTAGGER_H
14#define CD_ITOKMCFIELDTAGGER_H
15
16// Our includes
17#include <CD_ItoKMCTagger.H>
18#include <CD_NamespaceHeader.H>
19
20namespace Physics {
21namespace ItoKMC {
22
29template <typename S>
31{
32public:
36 ItoKMCFieldTagger() noexcept;
37
41 virtual ~ItoKMCFieldTagger() noexcept;
42
46 virtual void
47 computeTagFields() const noexcept override;
48
52 virtual void
53 parseOptions() override = 0;
54
58 virtual void
59 parseRuntimeOptions() override = 0;
60
61protected:
65 mutable EBAMRCellData m_scratch;
66
70 mutable EBAMRCellData m_E;
71
75 mutable EBAMRCellData m_gradE;
76
80 virtual void
81 allocateStorage() const noexcept;
82
86 virtual void
87 deallocateStorage() const noexcept;
88
94 virtual void
95 computeElectricField(EBAMRCellData& a_E, EBAMRCellData& a_gradE) const noexcept;
96
110 virtual Vector<Real>
111 computeTagFields(const RealVect& a_pos,
112 const Real a_time,
113 const Real a_dx,
114 const RealVect& a_E,
115 const Real a_minE,
116 const Real a_maxE,
117 const RealVect& a_gradE,
118 const Real a_minGradE,
119 const Real a_maxGradE) const noexcept = 0;
120
131 virtual bool
132 coarsenCell(const RealVect& a_pos,
133 const Real a_time,
134 const Real a_dx,
135 const int a_lvl,
136 const Vector<Real>& a_tagFields,
137 const Vector<RealVect>& a_gradTagFields) const noexcept override = 0;
138
149 virtual bool
150 refineCell(const RealVect& a_pos,
151 const Real a_time,
152 const Real a_dx,
153 const int a_lvl,
154 const Vector<Real>& a_tagFields,
155 const Vector<RealVect>& a_gradTagFields) const noexcept override = 0;
156};
157} // namespace ItoKMC
158} // namespace Physics
159
160#include <CD_NamespaceFooter.H>
161
163
164#endif
Implementation of CD_ItoKMCFieldTagger.H.
Declaration of the Physics::ItoKMC::ItoKMCTagger abstract CellTagger.
Lightweight tagging class. Only tags cells based on the electric field.
Definition CD_ItoKMCFieldTagger.H:31
EBAMRCellData m_gradE
Storage for grad(|E|)
Definition CD_ItoKMCFieldTagger.H:75
ItoKMCFieldTagger() noexcept
Weak constructor. User MUST subsequently call define.
Definition CD_ItoKMCFieldTaggerImplem.H:25
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.
virtual void computeElectricField(EBAMRCellData &a_E, EBAMRCellData &a_gradE) const noexcept
Compute the electric field and its gradient magnitude.
Definition CD_ItoKMCFieldTaggerImplem.H:71
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:70
EBAMRCellData m_scratch
Scratch storage.
Definition CD_ItoKMCFieldTagger.H:65
virtual void allocateStorage() const noexcept
Allocate memory for scratch, electric field, and gradient of electric field.
Definition CD_ItoKMCFieldTaggerImplem.H:41
virtual ~ItoKMCFieldTagger() noexcept
Destructor.
Definition CD_ItoKMCFieldTaggerImplem.H:36
virtual void computeTagFields() const noexcept override
Compute tagging fields.
Definition CD_ItoKMCFieldTaggerImplem.H:99
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:57
Abstract CellTagger for the Ito-KMC-Poisson physics module.
Definition CD_ItoKMCTagger.H:33
Namespace containing physics models for use with chombo-discharge.
Definition CD_AdvectionDiffusion.H:16