chombo-discharge
Loading...
Searching...
No Matches
CD_CdrPlasmaFieldTagger.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_CDRPLASMAFIELDTAGGER_H
14#define CD_CDRPLASMAFIELDTAGGER_H
15
16// Our includes
17#include <CD_CdrPlasmaTagger.H>
18#include <CD_NamespaceHeader.H>
19
20namespace Physics {
21 namespace CdrPlasma {
22
31 {
32 public:
37
42
49 void
50 computeTracers() const override final;
51
55 virtual void
56 parseOptions() override = 0;
57
58 protected:
62 mutable EBAMRCellData m_scratch;
63
67 mutable EBAMRCellData m_electricField;
68
72 mutable EBAMRCellData m_gradElectricField;
73
77 virtual void
78 allocateStorage() const;
79
83 virtual void
84 deallocateStorage() const;
85
91 virtual void
92 computeElectricField(EBAMRCellData& a_electricField, EBAMRCellData& a_gradElectricField) const;
93
107 virtual Vector<Real>
108 tracer(const RealVect& a_pos,
109 const Real a_time,
110 const Real a_dx,
111 const RealVect& a_electricField,
112 const Real a_minElectricField,
113 const Real a_maxElectricField,
114 const RealVect& a_gradElectricField,
115 const Real a_minGradElectricField,
116 const Real a_maxGradElectricField) const = 0;
117
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_tracers,
134 const Vector<RealVect>& a_gradTracers) const override = 0;
135
146 virtual bool
147 refineCell(const RealVect& a_pos,
148 const Real a_time,
149 const Real a_dx,
150 const int a_lvl,
151 const Vector<Real>& a_tracers,
152 const Vector<RealVect>& a_gradTracers) const override = 0;
153 };
154 } // namespace CdrPlasma
155} // namespace Physics
156
157#include <CD_NamespaceFooter.H>
158
159#endif
Declaration of the Physics::CdrPlasma::CdrPlasmaTagger abstract class.
Intermediate CdrPlasmaTagger subclass that computes tracer fields from the electric field only.
Definition CD_CdrPlasmaFieldTagger.H:31
virtual ~CdrPlasmaFieldTagger()
Destructor.
virtual void computeElectricField(EBAMRCellData &a_electricField, EBAMRCellData &a_gradElectricField) const
Compute the centroid-centered electric field and its gradient magnitude.
Definition CD_CdrPlasmaFieldTagger.cpp:62
virtual void allocateStorage() const
Allocate transient storage for the electric field, its gradient, and scratch.
Definition CD_CdrPlasmaFieldTagger.cpp:36
void computeTracers() const override final
Compute tracer fields from the electric field on the AMR hierarchy.
Definition CD_CdrPlasmaFieldTagger.cpp:90
EBAMRCellData m_electricField
Cell-centered electric field vector (SpaceDim components).
Definition CD_CdrPlasmaFieldTagger.H:67
CdrPlasmaFieldTagger()
Default constructor. Sets the tagger name.
Definition CD_CdrPlasmaFieldTagger.cpp:23
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
Decide whether a cell should be coarsened based on tracer fields.
EBAMRCellData m_gradElectricField
Cell-centered gradient of the electric field magnitude, i.e., grad(|E|).
Definition CD_CdrPlasmaFieldTagger.H:72
virtual void parseOptions() override=0
Parse user-defined options. Must be implemented by subclasses.
virtual void deallocateStorage() const
Release transient storage allocated by allocateStorage().
Definition CD_CdrPlasmaFieldTagger.cpp:49
EBAMRCellData m_scratch
Scratch storage for scalar intermediate quantities.
Definition CD_CdrPlasmaFieldTagger.H:62
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
Decide whether a cell should be refined based on tracer fields.
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
Per-cell tracer field evaluation. Must be implemented by subclasses.
Abstract CellTagger base class for the CDR plasma physics module.
Definition CD_CdrPlasmaTagger.H:37
Namespace containing physics models for use with chombo-discharge.
Definition CD_AdvectionDiffusion.H:16