13#ifndef CD_ITOKMCFIELDTAGGERIMPLEM_H
14#define CD_ITOKMCFIELDTAGGERIMPLEM_H
20#include <CD_NamespaceHeader.H>
22using namespace Physics::ItoKMC;
27 CH_TIME(
"ItoKMCFieldTagger::ItoKMCFieldTagger");
29 pout() <<
"ItoKMCFieldTagger::ItoKMCFieldTagger" <<
endl;
32 this->
m_name =
"ItoKMCFieldTagger";
43 CH_TIME(
"ItoKMCFieldTagger::allocateStorage");
59 CH_TIME(
"ItoKMCFieldTagger::deallocateStorage");
64 this->
m_amr->deallocate(m_scratch);
65 this->
m_amr->deallocate(m_E);
66 this->
m_amr->deallocate(m_gradE);
73 CH_TIME(
"ItoKMCFieldTagger::computeElectricField");
74 if (this->m_verbosity > 5) {
75 pout() << this->m_name +
"::computeElectricField" <<
endl;
82 this->m_timeStepper->computeElectricField(
a_E, this->m_phase);
87 this->m_amr->computeGradient(
a_gradE, m_scratch, this->m_realm, this->m_phase);
89 this->m_amr->conservativeAverage(
a_gradE, this->m_realm, this->m_phase);
90 this->m_amr->interpGhost(
a_gradE, this->m_realm, this->m_phase);
93 this->m_amr->interpToCentroids(
a_E, this->m_realm, this->m_phase);
94 this->m_amr->interpToCentroids(
a_gradE, this->m_realm, this->m_phase);
101 CH_TIME(
"ItoKMCFieldTagger::computeTagFields");
108 this->allocateStorage();
109 this->computeElectricField(m_E, m_gradE);
112 const Real time = this->m_timeStepper->getTime();
131#pragma omp parallel for schedule(runtime)
146 for (
int i = 0;
i < this->m_numTagFields;
i++) {
163 for (
int i = 0;
i < this->m_numTagFields;
i++) {
180 for (
int i = 0;
i < this->m_numTagFields;
i++) {
192 for (
int i = 0;
i < this->m_numTagFields;
i++) {
198 for (
int i = 0;
i < this->m_numTagFields;
i++) {
199 this->
m_amr->computeGradient(this->m_gradTagFields[
i], this->m_tagFields[
i], this->
m_realm, this->
m_phase);
204 this->deallocateStorage();
207#include <CD_NamespaceFooter.H>
Agglomeration of useful data operations.
Declaration of the Physics::ItoKMC::ItoKMCFieldTagger abstract CellTagger.
Declaration of cell positions.
static void getMaxMinNorm(Real &a_max, Real &a_min, EBAMRCellData &data, const Vector< RefCountedPtr< LayoutData< VoFIterator > > > &a_vofIter)
Get maximum and minimum value of normed data.
Definition CD_DataOps.cpp:1879
static void vectorLength(EBAMRCellData &a_lhs, const EBAMRCellData &a_rhs, const EBAMRCellData &a_notCovered, const Vector< RefCountedPtr< LayoutData< VoFIterator > > > &a_vofIter)
Compute the vector length of a data holder. Sets a_lhs = |a_rhs| where a_rhs contains SpaceDim compon...
Definition CD_DataOps.cpp:3500
ItoKMCFieldTagger() noexcept
Weak constructor. User MUST subsequently call define.
Definition CD_ItoKMCFieldTaggerImplem.H:25
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 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 deallocateStorage() const noexcept
Deallocate memory.
Definition CD_ItoKMCFieldTaggerImplem.H:57
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_TracerParticleSolver.H:367
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
std::string m_realm
Realm where this solver lives.
Definition CD_TracerParticleSolver.H:352
int m_verbosity
Verbosity level.
Definition CD_TracerParticleSolver.H:387
RefCountedPtr< AmrMesh > m_amr
Handle to AMR mesh.
Definition CD_TracerParticleSolver.H:327
virtual void allocate()
Allocate storage for this solver.
Definition CD_TracerParticleSolverImplem.H:195
std::string m_name
Solver name.
Definition CD_TracerParticleSolver.H:357
ALWAYS_INLINE void loop(const Box &a_computeBox, Functor &&kernel)
Launch a C++ kernel over a regular grid with compile-time per-dimension strides.
Definition CD_BoxLoopsImplem.H:39
RealVect position(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:21