13#ifndef CD_ITOKMCSTREAMERTAGGERIMPLEM_H
14#define CD_ITOKMCSTREAMERTAGGERIMPLEM_H
21#include <CD_NamespaceHeader.H>
23using namespace Physics::ItoKMC;
28 CH_TIME(
"ItoKMCStreamerTagger::ItoKMCStreamerTagger");
30 this->
m_name =
"ItoKMCStreamerTagger";
40 const RefCountedPtr<S>& a_timeStepper,
41 const RefCountedPtr<AmrMesh>& a_amr) noexcept
44 CH_TIME(
"ItoKMCStreamerTagger::ItoKMCStreamerTagger");
46 pout() <<
"ItoKMCStreamerTagger::ItoKMCStreamerTagger" << endl;
49 this->
define(a_physics, a_timeStepper, a_amr);
56 CH_TIME(
"ItoKMCStreamerTagger::parseOptions");
58 pout() <<
"ItoKMCStreamerTagger::parseOptions" << endl;
66 ParmParse pp(this->
m_name.c_str());
78 CH_TIME(
"ItoKMCStreamerTagger::parseRuntimeOptions");
80 pout() <<
"ItoKMCStreamerTagger::parseRuntimeOptions" << endl;
88 ParmParse pp(this->
m_name.c_str());
104 const RealVect& a_gradE,
105 const Real a_minGradE,
106 const Real a_maxGradE)
const noexcept
108 CH_TIME(
"ItoKMCStreamerTagger::computeTagFields");
110 pout() <<
"ItoKMCStreamerTagger::computeTagFields" << endl;
115 const Real E = a_E.vectorLength();
116 tagFields[0] = E / a_maxE;
117 tagFields[1] = this->
m_physics->computeAlpha(E, a_pos) * a_dx;
118 tagFields[1] -= this->
m_physics->computeEta(E, a_pos) * a_dx;
129 const Vector<Real>& a_tagFields,
130 const Vector<RealVect>& a_gradTagFields)
const noexcept
132 CH_TIME(
"ItoKMCStreamerTagger::coarsenCell");
134 pout() <<
"ItoKMCStreamerTagger::coarsenCell" << endl;
137 bool coarsen =
false;
140 const Real E = a_tagFields[0];
141 const Real alphaDx = a_tagFields[1];
142 const RealVect gradE = a_gradTagFields[0];
147 coarsen = coarsenCurv && coarsenAlpha;
162 const Vector<Real>& a_tagFields,
163 const Vector<RealVect>& a_gradTagFields)
const noexcept
165 CH_TIME(
"ItoKMCStreamerTagger::refineCell");
167 pout() <<
"ItoKMCStreamerTagger::refineCell" << endl;
170 const Real E = a_tagFields[0];
171 const Real alphaDx = a_tagFields[1];
172 const RealVect gradE = a_gradTagFields[0];
178 return refineCurv || refineAlpha || refineManual;
181#include <CD_NamespaceFooter.H>
Declaration of the Physics::ItoKMC::ItoKMCStreamerTagger CellTagger.
int m_verbosity
Class verbosity.
Definition CD_CellTagger.H:138
virtual void parseTagBoxes()
Parse boxes.
Definition CD_CellTagger.cpp:108
virtual void parseVerbosity()
Parse the verbosity from the input file or command line.
Definition CD_CellTagger.cpp:236
std::string m_name
Cell tagger class name (default is CellTagger).
Definition CD_CellTagger.H:133
virtual void parseRefinementBoxes()
Parse refinement boxes.
Definition CD_CellTagger.cpp:159
virtual void parseBuffer()
Parse refinement buffer.
Definition CD_CellTagger.cpp:220
int getManualRefinementLevel(const RealVect &a_pos) const
Get the specified level for this position when doing manual refinement.
Definition CD_CellTagger.cpp:273
int m_maxCoarsenLevel
Set coarsening level.
Definition CD_ItoKMCStreamerTagger.H:89
ItoKMCStreamerTagger() noexcept
Constructor. Must subsequently call the define function.
Definition CD_ItoKMCStreamerTaggerImplem.H:26
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
Determine if a particular cell should be refined.
Definition CD_ItoKMCStreamerTaggerImplem.H:158
Real m_refineAlpha
Threshold for ionization refinement.
Definition CD_ItoKMCStreamerTagger.H:79
Real m_refineCurvature
Threshold for refinement based on curvature.
Definition CD_ItoKMCStreamerTagger.H:74
virtual void parseRuntimeOptions() noexcept override
Parse runtime-configurable class options.
Definition CD_ItoKMCStreamerTaggerImplem.H:76
virtual Vector< Real > computeTagFields(const RealVect &a_pos, const Real a_time, const Real a_dx, const RealVect &a_E, const Real a_minE, const Real a_maxE, const RealVect &a_gradE, const Real a_minGradE, const Real a_maxGradE) const noexcept override
Compute per-cell tagging fields from the electric field and its gradient.
Definition CD_ItoKMCStreamerTaggerImplem.H:98
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
Determine if a particular cell should be coarsened.
Definition CD_ItoKMCStreamerTaggerImplem.H:125
Real m_coarsenCurvature
Threshold for coarsening based on curvature.
Definition CD_ItoKMCStreamerTagger.H:69
Real m_coarsenAlpha
Threshold for ionization coarsening.
Definition CD_ItoKMCStreamerTagger.H:84
virtual ~ItoKMCStreamerTagger() noexcept
Destructor.
Definition CD_ItoKMCStreamerTaggerImplem.H:35
virtual void parseOptions() noexcept override
Parse class options.
Definition CD_ItoKMCStreamerTaggerImplem.H:54
int m_numTagFields
Number of tagging fields.
Definition CD_ItoKMCTagger.H:178
RefCountedPtr< ItoKMCPhysics > m_physics
Physics implementation.
Definition CD_ItoKMCTagger.H:163
virtual void define(const RefCountedPtr< ItoKMCPhysics > &a_physics, const RefCountedPtr< S > &a_timeStepper, const RefCountedPtr< AmrMesh > &a_amr) noexcept
Define function.
Definition CD_ItoKMCTaggerImplem.H:57