12#ifndef CD_ItoKMCFieldTaggerImplem_H
13#define CD_ItoKMCFieldTaggerImplem_H
19#include <CD_NamespaceHeader.H>
21using namespace Physics::ItoKMC;
26 CH_TIME(
"ItoKMCFieldTagger::ItoKMCFieldTagger");
28 pout() <<
"ItoKMCFieldTagger::ItoKMCFieldTagger" <<
endl;
31 this->
m_name =
"ItoKMCFieldTagger";
42 CH_TIME(
"ItoKMCFieldTagger::allocateStorage");
58 CH_TIME(
"ItoKMCFieldTagger::deallocateStorage");
63 this->
m_amr->deallocate(m_scratch);
64 this->
m_amr->deallocate(m_E);
65 this->
m_amr->deallocate(m_gradE);
72 CH_TIME(
"ItoKMCFieldTagger::computeElectricField");
73 if (this->m_verbosity > 5) {
74 pout() << this->m_name +
"::computeElectricField" <<
endl;
81 this->m_timeStepper->computeElectricField(
a_E, this->m_phase);
83 this->m_amr->computeGradient(
a_gradE, m_scratch, this->m_realm, this->m_phase);
85 this->m_amr->conservativeAverage(
a_gradE, this->m_realm, this->m_phase);
86 this->m_amr->interpGhost(
a_gradE, this->m_realm, this->m_phase);
89 this->m_amr->interpToCentroids(
a_E, this->m_realm, this->m_phase);
90 this->m_amr->interpToCentroids(
a_gradE, this->m_realm, this->m_phase);
97 CH_TIME(
"ItoKMCFieldTagger::computeTagFields");
104 this->allocateStorage();
105 this->computeElectricField(m_E, m_gradE);
108 const Real time = this->m_timeStepper->getTime();
124#pragma omp parallel for schedule(runtime)
139 for (
int i = 0;
i < this->m_numTagFields;
i++) {
156 for (
int i = 0;
i < this->m_numTagFields;
i++) {
173 for (
int i = 0;
i < this->m_numTagFields;
i++) {
184 for (
int i = 0;
i < this->m_numTagFields;
i++) {
190 for (
int i = 0;
i < this->m_numTagFields;
i++) {
191 this->
m_amr->computeGradient(this->m_gradTagFields[
i], this->m_tagFields[
i], this->
m_realm, this->
m_phase);
196 this->deallocateStorage();
199#include <CD_NamespaceFooter.H>
Agglomeration of useful data operations.
Declaration of an abstract field-only tagging class for ito plasmas.
Declaration of cell positions.
static void vectorLength(EBAMRCellData &a_lhs, const EBAMRCellData &a_rhs)
Compute the vector length of a data holder. Sets a_lhs = |a_rhs| where a_rhs contains SpaceDim compon...
Definition CD_DataOps.cpp:3410
static void getMaxMinNorm(Real &a_max, Real &a_min, EBAMRCellData &data)
Get maximum and minimum value of normed data.
Definition CD_DataOps.cpp:1797
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 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 deallocateStorage() const noexcept
Deallocate memory.
Definition CD_ItoKMCFieldTaggerImplem.H:56
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_TracerParticleSolver.H:360
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
std::string m_realm
Realm where this solver lives.
Definition CD_TracerParticleSolver.H:345
int m_verbosity
Verbosity level.
Definition CD_TracerParticleSolver.H:380
RefCountedPtr< AmrMesh > m_amr
Handle to AMR mesh.
Definition CD_TracerParticleSolver.H:320
virtual void allocate()
Allocate storage for this solver.
Definition CD_TracerParticleSolverImplem.H:194
std::string m_name
Solver name.
Definition CD_TracerParticleSolver.H:350
ALWAYS_INLINE void loop(const Box &a_computeBox, Functor &&kernel, const IntVect &a_stride=IntVect::Unit)
Launch a C++ kernel over a regular grid.
Definition CD_BoxLoopsImplem.H:20
RealVect position(const Location::Cell a_location, const VolIndex &a_vof, const EBISBox &a_ebisbox, const Real &a_dx)
Compute the position (ignoring the "origin) of a Vof.
Definition CD_LocationImplem.H:20