13#ifndef CD_ITOKMCGODUNOVSTEPPERIMPLEM_H
14#define CD_ITOKMCGODUNOVSTEPPERIMPLEM_H
27#include <CD_NamespaceHeader.H>
29using namespace Physics::ItoKMC;
31template <
typename I,
typename C,
typename R,
typename F>
35 CH_TIME(
"ItoKMCGodunovStepper::ItoKMCGodunovStepper");
37 this->
m_name =
"ItoKMCGodunovStepper";
51template <
typename I,
typename C,
typename R,
typename F>
54 CH_TIME(
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper");
55 if (this->m_verbosity > 5) {
56 pout() <<
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper" <<
endl;
60template <
typename I,
typename C,
typename R,
typename F>
64 CH_TIME(
"ItoKMCGodunovStepper::registerOperators");
65 if (this->m_verbosity > 5) {
66 pout() <<
"ItoKMCGodunovStepper::registerOperators" <<
endl;
72 (this->m_amr)->registerOperator(s_particle_mesh, this->m_particleRealm,
phase::solid);
75template <
typename I,
typename C,
typename R,
typename F>
79 CH_TIME(
"ItoKMCGodunovStepper::allocate");
80 if (this->m_verbosity > 5) {
81 pout() <<
"ItoKMCGodunovStepper::allocate" <<
endl;
89 const int numItoSpecies = this->m_physics->getNumItoSpecies();
103 (this->m_amr)->allocate(*m_conductivityParticles[
idx], this->m_particleRealm);
104 (this->m_amr)->allocate(*m_irregularParticles[
idx], this->m_particleRealm);
105 (this->m_amr)->allocate(*m_rhoDaggerParticles[
idx], this->m_particleRealm);
109template <
typename I,
typename C,
typename R,
typename F>
113 CH_TIME(
"ItoKMCGodunovStepper::allocateInternals");
114 if (this->m_verbosity > 5) {
115 pout() << this->m_name +
"::allocateInternals" <<
endl;
120 const int numCdrSpecies = this->m_physics->getNumCdrSpecies();
124 this->m_amr->
allocate(m_cdrDivD[
i], this->m_fluidRealm, this->m_plasmaPhase, 1);
127 this->m_amr->
allocate(m_semiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
128 this->m_amr->
allocate(m_semiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
131template <
typename I,
typename C,
typename R,
typename F>
135 CH_TIME(
"ItoKMCGodunovStepper::barrier");
136 if (this->m_verbosity > 5) {
137 pout() << this->m_name +
"::barrier" <<
endl;
140 if ((this->m_profile)) {
145template <
typename I,
typename C,
typename R,
typename F>
149 CH_TIME(
"ItoKMCGodunovStepper::parseOptions");
150 if (this->m_verbosity > 5) {
151 pout() << this->m_name +
"::parseOptions" <<
endl;
156 this->parseAlgorithm();
157 this->parseFiltering();
158 this->parseCheckpointParticles();
159 this->parseSecondaryEmissionSpecification();
162template <
typename I,
typename C,
typename R,
typename F>
166 CH_TIME(
"ItoKMCGodunovStepper::parseRuntimeOptions");
167 if (this->m_verbosity > 5) {
168 pout() << this->m_name +
"::parseRuntimeOptions" <<
endl;
173 this->parseAlgorithm();
174 this->parseFiltering();
175 this->parseCheckpointParticles();
176 this->parseSecondaryEmissionSpecification();
179template <
typename I,
typename C,
typename R,
typename F>
183 CH_TIME(
"ItoKMCGodunovStepper::parseAlgorithm");
184 if (this->m_verbosity > 5) {
185 pout() << this->m_name +
"::parseAlgorithm" <<
endl;
191 pp.get(
"extend_conductivity", m_extendConductivityEB);
192 pp.get(
"algorithm",
str);
193 pp.get(
"abort_max_field", m_maxFieldAbort);
196 if (
str ==
"euler_maruyama") {
197 m_algorithm = WhichAlgorithm::EulerMaruyama;
200 MayDay::Abort(
"ItoKMCGodunovStepper::parseAlgorithm - unknown algorithm requested");
204template <
typename I,
typename C,
typename R,
typename F>
208 CH_TIME(
"ItoKMCGodunovStepper::parseFiltering");
209 if (this->m_verbosity > 5) {
210 pout() << this->m_name +
"::parseFiltering" <<
endl;
217 m_rhoFilterMaxStride = 1;
218 m_rhoFilterAlpha = 0.5;
220 m_condFilterNum = -1;
221 m_condFilterMaxStride = 1;
222 m_condFilterAlpha = 0.5;
224 pp.get(
"rho_filter_num", m_rhoFilterNum);
225 pp.get(
"rho_filter_max_stride", m_rhoFilterMaxStride);
226 pp.get(
"rho_filter_alpha", m_rhoFilterAlpha);
228 pp.get(
"cond_filter_num", m_condFilterNum);
229 pp.get(
"cond_filter_max_stride", m_condFilterMaxStride);
230 pp.get(
"cond_filter_alpha", m_condFilterAlpha);
233 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for rho_filter");
236 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for cond_filter");
240template <
typename I,
typename C,
typename R,
typename F>
244 CH_TIME(
"ItoKMCGodunovStepper::parseCheckpointParticles");
245 if (this->m_verbosity > 5) {
246 pout() << this->m_name +
"::parseCheckpointParticles" <<
endl;
251 pp.query(
"checkpoint_particles", m_writeCheckpointParticles);
254template <
typename I,
typename C,
typename R,
typename F>
258 CH_TIME(
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecifiation");
259 if (this->m_verbosity > 5) {
260 pout() << this->m_name +
"::parseSecondaryEmissionSpecification" <<
endl;
267 pp.query(
"secondary_emission",
str);
269 if (
str ==
"before_reactions") {
270 m_emitSecondaryParticlesBeforeReactions =
true;
272 else if (
str ==
"after_reactions") {
273 m_emitSecondaryParticlesBeforeReactions =
false;
278 err =
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecification - expected 'before_reactions' or 'after_reactions'";
285template <
typename I,
typename C,
typename R,
typename F>
289 CH_TIME(
"ItoKMCGodunovStepper::computeDt");
290 if (this->m_verbosity > 5) {
291 pout() << this->m_name +
"::computeDt" <<
endl;
296 if ((this->m_maxReducedField > m_maxFieldAbort) && (m_maxFieldAbort > 0.0)) {
297 pout() << this->m_name +
" stopping because maximum field is too high (" << this->m_maxReducedField <<
")" <<
endl;
299 this->m_keepGoing =
false;
305template <
typename I,
typename C,
typename R,
typename F>
309 CH_TIME(
"ItoKMCGodunovStepper::advance");
310 if (this->m_verbosity > 5) {
311 pout() << this->m_name +
"::advance" <<
endl;
315 const Real Qtot = this->computeTotalCharge();
325 m_canRegridOnRestart =
true;
327 m_timer =
Timer(
"ItoKMCGodunovStepper::advance");
332 this->m_prevDt =
a_dt;
335 m_timer.startEvent(
"Deposit photons");
344 m_timer.stopEvent(
"Deposit photons");
348 switch (m_algorithm) {
349 case WhichAlgorithm::EulerMaruyama: {
350 this->advanceEulerMaruyama(
a_dt);
363 m_timer.startEvent(
"EB/Particle intersection");
364 if (m_extendConductivityEB) {
377 return p.tmpReal() < 0.0;
381 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
382 ParticleOps::setData<ItoParticle>(
it()->getParticles(ItoSolver::WhichContainer::Bulk),
setFlag);
386 const bool deleteParticles =
false;
387 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles,
nonDeletionModifier);
390 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
394 const int idx =
it.index();
395 const int Z =
species->getChargeNumber();
403 if (
Z != 0 &&
solver->isMobile()) {
404 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
410#pragma omp parallel for schedule(runtime)
434 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
440 const bool deleteParticles =
true;
442 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles);
447 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
455 m_timer.stopEvent(
"EB/Particle intersection");
460 m_timer.startEvent(
"Photon transport");
461 this->advancePhotons(
a_dt);
462 m_timer.stopEvent(
"Photon transport");
465 if ((this->m_physics)->needGradients()) {
466 m_timer.startEvent(
"Gradient calculation");
467 (this->m_ito)->depositParticles();
468 this->computeDensityGradients();
469 m_timer.stopEvent(
"Gradient calculation");
474 if (m_emitSecondaryParticlesBeforeReactions) {
476 m_timer.startEvent(
"EB particle injection");
477 this->fillSecondaryEmissionEB(
a_dt);
478 this->resolveSecondaryEmissionEB(
a_dt);
479 m_timer.stopEvent(
"EB particle injection");
484 m_timer.startEvent(
"Sort by cell");
485 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
486 this->sortPhotonsByCell(McPhoto::WhichContainer::Bulk);
487 this->sortPhotonsByCell(McPhoto::WhichContainer::Source);
488 m_timer.stopEvent(
"Sort by cell");
492 m_timer.startEvent(
"Reaction network");
493 this->advanceReactionNetwork(
a_dt);
494 m_timer.stopEvent(
"Reaction network");
498 m_timer.startEvent(
"Sort by patch");
499 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
500 this->sortPhotonsByPatch(McPhoto::WhichContainer::Bulk);
501 this->sortPhotonsByPatch(McPhoto::WhichContainer::Source);
502 m_timer.stopEvent(
"Sort by patch");
506 if (!m_emitSecondaryParticlesBeforeReactions) {
508 m_timer.startEvent(
"EB particle injection");
509 this->fillSecondaryEmissionEB(
a_dt);
510 this->resolveSecondaryEmissionEB(
a_dt);
511 m_timer.stopEvent(
"EB particle injection");
517 m_timer.startEvent(
"Remove covered");
518 this->removeCoveredParticles(SpeciesSubset::AllMobileOrDiffusive, EBRepresentation::Discrete, this->m_toleranceEB);
519 m_timer.stopEvent(
"Remove covered");
523 solverIt()->clear(ItoSolver::WhichContainer::EB);
524 solverIt()->clear(ItoSolver::WhichContainer::Domain);
529 m_timer.startEvent(
"Post-compute v");
530 this->computeDriftVelocities();
531 m_timer.stopEvent(
"Post-compute v");
534 m_timer.startEvent(
"Post-compute D");
535 this->computeDiffusionCoefficients();
536 m_timer.stopEvent(
"Post-compute D");
538 this->computePhysicsDt();
540 if ((this->m_profile)) {
541 m_timer.eventReport(
pout(),
false);
547 this->m_maxReducedField = this->computeMaxReducedElectricField(this->m_plasmaPhase);
552template <
typename I,
typename C,
typename R,
typename F>
556 CH_TIME(
"ItoKMCGodunovStepper::preRegrid");
557 if (this->m_verbosity > 5) {
558 pout() <<
"ItoKMCGodunovStepper::preRegrid" <<
endl;
561 const int numItoSpecies = (this->m_physics)->getNumItoSpecies();
562 const int numCdrSpecies = (this->m_physics)->getNumCdrSpecies();
576 this->m_amr->
allocate(m_scratchSemiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
577 this->m_amr->
allocate(m_scratchSemiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
579 DataOps::copy(m_scratchSemiImplicitRhoCDR, m_semiImplicitRhoCDR);
580 DataOps::copy(m_scratchSemiImplicitConductivityCDR, m_semiImplicitConductivityCDR);
584 m_cdrDivD[
i].clear();
587 m_semiImplicitRhoCDR.clear();
588 m_semiImplicitConductivityCDR.clear();
591template <
typename I,
typename C,
typename R,
typename F>
597 CH_TIME(
"ItoKMCGodunovStepper::regrid");
598 if (this->m_verbosity > 5) {
599 pout() <<
"ItoKMCGodunovStepper::regrid" <<
endl;
602 m_timer =
Timer(
"ItoKMCGodunovStepper::regrid");
606 if (!m_canRegridOnRestart) {
608 const std::string err1 =
"checkpoint file does not contain particles. Set Driver.initial_regrids=0";
616 m_timer.startEvent(
"Regrid ItoSolver");
618 if (this->m_timeStep == 0) {
622 (this->m_ito)->depositParticles();
624 m_timer.stopEvent(
"Regrid ItoSolver");
626 m_timer.startEvent(
"Regrid CdrSolver");
628 m_timer.stopEvent(
"Regrid CdrSolver");
630 m_timer.startEvent(
"Regrid FieldSolver");
632 m_timer.stopEvent(
"Regrid FieldSolver");
634 m_timer.startEvent(
"Regrid RTE");
636 m_timer.stopEvent(
"Regrid RTE");
638 m_timer.startEvent(
"Regrid SurfaceODESolver");
640 m_timer.stopEvent(
"Regrid SurfaceODESolver");
643 m_timer.startEvent(
"Allocate internals");
644 this->allocateInternals();
645 m_timer.stopEvent(
"Allocate internals");
648 m_timer.startEvent(
"Remap algorithm-particles");
655 m_timer.stopEvent(
"Remap algorithm-particles");
658 this->m_amr->interpToNewGrids(m_semiImplicitRhoCDR,
659 m_scratchSemiImplicitRhoCDR,
664 EBCoarseToFineInterp::Type::ConservativePWC);
666 this->m_amr->interpToNewGrids(m_semiImplicitConductivityCDR,
667 m_scratchSemiImplicitConductivityCDR,
672 EBCoarseToFineInterp::Type::ConservativePWC);
676 m_timer.startEvent(
"Setup field solver");
677 (this->m_fieldSolver)->setupSolver();
678 this->computeConductivities(m_conductivityParticles);
679 this->setupSemiImplicitPoisson(this->m_prevDt);
680 m_timer.stopEvent(
"Setup field solver");
683 m_timer.startEvent(
"Solve Poisson");
684 if (this->m_timeStep == 0) {
685 this->computeSpaceChargeDensity();
688 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::All);
689 this->computeSemiImplicitRho();
692 const bool converged = this->solvePoisson();
695 const std::string errMsg =
"ItoKMCGodunovStepper::regrid - Poisson solve did not converge after regrid";
699 if (this->m_abortOnFailure) {
700 MayDay::Error(
errMsg.c_str());
703 m_timer.stopEvent(
"Solve Poisson");
706 if (this->m_regridSuperparticles) {
707 m_timer.startEvent(
"Make superparticles");
708 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
709 (this->m_ito)->makeSuperparticles(ItoSolver::WhichContainer::Bulk, (this->m_particlesPerCell));
710 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
711 m_timer.stopEvent(
"Make superparticles");
715 m_timer.startEvent(
"Deposit particles");
716 (this->m_ito)->depositParticles();
717 m_timer.stopEvent(
"Deposit particles");
720 m_timer.startEvent(
"Prepare next step");
721 this->computeDiffusionCoefficients();
722 this->computeDriftVelocities();
723 m_timer.stopEvent(
"Prepare next step");
725 m_timer.eventReport(
pout(),
false);
728 m_scratchSemiImplicitRhoCDR.clear();
729 m_scratchSemiImplicitConductivityCDR.clear();
732 this->fillNeutralDensity();
735template <
typename I,
typename C,
typename R,
typename F>
739 CH_TIME(
"ItoKMCGodunovStepper::setOldPositions");
740 if (this->m_verbosity > 5) {
741 pout() << this->m_name +
"::setOldPositions" <<
endl;
747 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
755#pragma omp parallel for schedule(runtime)
771template <
typename I,
typename C,
typename R,
typename F>
777 CH_TIME(
"ItoKMCGodunovStepper::remapPointParticles");
778 if (this->m_verbosity > 5) {
779 pout() << this->m_name +
"::remapPointParticles" <<
endl;
793 case SpeciesSubset::All: {
798 case SpeciesSubset::AllMobile: {
805 case SpeciesSubset::AllDiffusive: {
812 case SpeciesSubset::AllMobileOrDiffusive: {
819 case SpeciesSubset::AllMobileAndDiffusive: {
826 case SpeciesSubset::Charged: {
833 case SpeciesSubset::ChargedMobile: {
840 case SpeciesSubset::ChargedDiffusive: {
847 case SpeciesSubset::ChargedMobileOrDiffusive: {
854 case SpeciesSubset::ChargedMobileAndDiffusive: {
861 case SpeciesSubset::Stationary: {
869 MayDay::Abort(
"ItoKMCGodunovStepper::remapPointParticles - logic bust");
877template <
typename I,
typename C,
typename R,
typename F>
883 CH_TIME(
"ItoKMCGodunovStepper::depositPointParticles");
884 if (this->m_verbosity > 5) {
885 pout() << this->m_name +
"::depositPointParticles" <<
endl;
899 case SpeciesSubset::All: {
904 case SpeciesSubset::AllMobile: {
912 case SpeciesSubset::AllDiffusive: {
920 case SpeciesSubset::AllMobileOrDiffusive: {
927 case SpeciesSubset::AllMobileAndDiffusive: {
934 case SpeciesSubset::Charged: {
941 case SpeciesSubset::ChargedMobile: {
948 case SpeciesSubset::ChargedDiffusive: {
956 case SpeciesSubset::ChargedMobileOrDiffusive: {
964 case SpeciesSubset::ChargedMobileAndDiffusive: {
972 case SpeciesSubset::Stationary: {
981 MayDay::Abort(
"ItoKMCGodunovStepper::depositPointParticles - logic bust");
989template <
typename I,
typename C,
typename R,
typename F>
995 CH_TIME(
"ItoKMCGodunovStepper::clearPointParticles");
996 if (this->m_verbosity > 5) {
997 pout() << this->m_name +
"::clearPointParticles" <<
endl;
1011 case SpeciesSubset::All: {
1016 case SpeciesSubset::AllMobile: {
1023 case SpeciesSubset::AllDiffusive: {
1030 case SpeciesSubset::AllMobileOrDiffusive: {
1037 case SpeciesSubset::AllMobileAndDiffusive: {
1044 case SpeciesSubset::Charged: {
1051 case SpeciesSubset::ChargedMobile: {
1058 case SpeciesSubset::ChargedDiffusive: {
1065 case SpeciesSubset::ChargedMobileOrDiffusive: {
1072 case SpeciesSubset::ChargedMobileAndDiffusive: {
1079 case SpeciesSubset::Stationary: {
1087 MayDay::Abort(
"ItoKMCGodunovStepper::clearPointParticles - logic bust");
1095template <
typename I,
typename C,
typename R,
typename F>
1100 CH_TIME(
"ItoKMCGodunovStepper::computeConductivities");
1101 if (this->m_verbosity > 5) {
1102 pout() << this->m_name +
"::computeConductivities" <<
endl;
1105 this->computeCellConductivity((this->m_conductivityCell),
a_particles);
1106 this->computeFaceConductivity();
1109template <
typename I,
typename C,
typename R,
typename F>
1115 CH_TIME(
"ItoKMCGodunovStepper::computeCellConductivity(EBAMRCellData, PointParticle");
1116 if (this->m_verbosity > 5) {
1117 pout() << this->m_name +
"::computeCellConductivity(EBAMRCellData, PointParticle)" <<
endl;
1128 const int Z =
species->getChargeNumber();
1130 if (
Z != 0 &&
solver->isMobile()) {
1137 (this->m_amr)->copyData(this->m_fluidScratch1, this->m_particleScratch1);
1148 const int index =
solverIt.index();
1149 const int Z =
species->getChargeNumber();
1151 if (
Z != 0 &&
solver->isMobile()) {
1166 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1167 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1170 if (m_condFilterNum > 0 && m_condFilterMaxStride > 0) {
1171 for (
int i = 0;
i < m_condFilterNum;
i++) {
1175 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1176 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1181 (this->m_amr)->interpToCentroids(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1184template <
typename I,
typename C,
typename R,
typename F>
1188 CH_TIME(
"ItoKMCGodunovStepper::computeFaceConductivity");
1189 if (this->m_verbosity > 5) {
1190 pout() << this->m_name +
"::computeFaceConductivity" <<
endl;
1198 const Average average = Average::Arithmetic;
1203 (this->m_conductivityFace),
1204 (this->m_conductivityCell),
1205 (this->m_amr)->getDomains(),
1210 (this->m_amr)->getFaceIteratorWithTangentialGhosts(this->m_fluidRealm, this->m_plasmaPhase));
1214 (this->m_conductivityCell),
1216 (this->m_amr)->getVofIterator(this->m_fluidRealm, this->m_plasmaPhase));
1219template <
typename I,
typename C,
typename R,
typename F>
1223 CH_TIMERS(
"ItoKMCGodunovStepper::computeSemiImplicitRho");
1224 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::plasma_phase",
t1);
1225 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::solid_phase",
t2);
1226 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::filter",
t3);
1227 if (this->m_verbosity > 5) {
1228 pout() << this->m_name +
"::computeSemiImplicitRho" <<
endl;
1254 const int Z =
species->getChargeNumber();
1257 (this->m_amr)->copyData(this->m_fluidScratch1,
solver->getPhi());
1282 const int Z =
species->getChargeNumber();
1291 this->m_particleRealm,
1293 *m_rhoDaggerParticles[
solverIt.index()],
1294 DepositionType::CIC,
1295 CoarseFineDeposition::Halo,
1308 this->m_amr->arithmeticAverage(
rho, this->m_fluidRealm);
1309 this->m_amr->interpGhostPwl(
rho, this->m_fluidRealm);
1312 if (m_rhoFilterNum > 0 && m_rhoFilterMaxStride > 0) {
1314 for (
int i = 0;
i < m_rhoFilterNum;
i++) {
1319 this->m_amr->arithmeticAverage(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1320 this->m_amr->interpGhost(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1333template <
typename I,
typename C,
typename R,
typename F>
1337 CH_TIME(
"ItoKMCGodunovStepper::setupSemiImplicitPoisson");
1338 if (this->m_verbosity > 5) {
1339 pout() << this->m_name +
"::setupSemiImplicitPoisson" <<
endl;
1343 (this->m_fieldSolver)->setPermittivities();
1358 (this->m_conductivityEB),
1360 (this->m_amr)->getVofIterator(this->m_fluidRealm, this->m_plasmaPhase));
1363 (this->m_amr)->arithmeticAverage(
permFaceGas, this->m_fluidRealm, (this->m_plasmaPhase));
1364 (this->m_amr)->arithmeticAverage(
permEBGas, this->m_fluidRealm, (this->m_plasmaPhase));
1370template <
typename I,
typename C,
typename R,
typename F>
1377 CH_TIME(
"ItoKMCGodunovStepper::removeCoveredPointParticles");
1378 if (this->m_verbosity > 5) {
1379 pout() << this->m_name +
"::removeCoveredPointParticles" <<
endl;
1387 case EBRepresentation::Discrete: {
1392 case EBRepresentation::ImplicitFunction: {
1397 case EBRepresentation::Voxel: {
1398 (this->m_amr)->removeCoveredParticlesVoxels(
particles, (this->m_plasmaPhase));
1403 MayDay::Error(
"ItoKMCGodunovStepper::removeCoveredParticles - logic bust");
1410template <
typename I,
typename C,
typename R,
typename F>
1415 CH_TIME(
"ItoKMCGodunovStepper::copyConductivityParticles");
1416 if (this->m_verbosity > 5) {
1417 pout() << this->m_name +
"::copyConductivityParticles" <<
endl;
1428 const int Z =
species->getChargeNumber();
1430 if (
Z != 0 &&
solver->isMobile()) {
1433 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1439#pragma omp parallel for schedule(runtime)
1464template <
typename I,
typename C,
typename R,
typename F>
1468 CH_TIME(
"ItoKMCGodunovStepper::solvePoisson()");
1469 if (this->m_verbosity > 5) {
1470 pout() << this->m_name +
"::solvePoisson()" <<
endl;
1480 (this->m_fieldSolver)->computeElectricField();
1485 (this->m_amr)->allocatePointer(
E, this->m_fluidRealm);
1486 (this->m_amr)->alias(
E, this->m_plasmaPhase, (this->m_fieldSolver)->getElectricField());
1489 (this->m_amr)->copyData(this->m_electricFieldFluid,
E);
1490 (this->m_amr)->conservativeAverage(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1491 (this->m_amr)->interpGhostPwl(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1492 (this->m_amr)->interpToCentroids(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1495 (this->m_amr)->copyData(this->m_electricFieldParticle,
E);
1496 (this->m_amr)->conservativeAverage(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1497 (this->m_amr)->interpGhostPwl(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1498 (this->m_amr)->interpToCentroids(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1503template <
typename I,
typename C,
typename R,
typename F>
1507 CH_TIME(
"ItoKMCGodunovStepper::advanceEulerMaruyama");
1508 if (this->m_verbosity > 5) {
1509 pout() << this->m_name +
"::advanceEulerMaruyama" <<
endl;
1513 this->setOldPositions();
1518 m_timer.startEvent(
"Diffuse particles");
1519 this->diffuseParticlesEulerMaruyama(m_rhoDaggerParticles,
a_dt);
1520 this->remapPointParticles(m_rhoDaggerParticles, SpeciesSubset::ChargedDiffusive);
1521 m_timer.stopEvent(
"Diffuse particles");
1525 m_timer.startEvent(
"Diffuse CDR");
1526 this->computeDiffusionTermCDR(m_semiImplicitRhoCDR,
a_dt);
1527 m_timer.stopEvent(
"Diffuse CDR");
1531 m_timer.startEvent(
"Compute conductivities");
1532 this->copyConductivityParticles(m_conductivityParticles);
1533 this->computeConductivities(m_conductivityParticles);
1534 m_timer.stopEvent(
"Compute conductivities");
1538 m_timer.startEvent(
"Setup Poisson");
1539 this->setupSemiImplicitPoisson(
a_dt);
1540 m_timer.stopEvent(
"Setup Poisson");
1545 m_timer.startEvent(
"Deposit point particles");
1546 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::Charged);
1547 this->computeSemiImplicitRho();
1548 m_timer.stopEvent(
"Deposit point particles");
1552 m_timer.startEvent(
"Solve Poisson");
1553 const bool converged = this->solvePoisson();
1555 const std::string errMsg =
"ItoKMCGodunovStepper::advanceEulerMaruyama - Poisson solve did not converge";
1559 if (this->m_abortOnFailure) {
1560 MayDay::Error(
errMsg.c_str());
1563 m_timer.stopEvent(
"Solve Poisson");
1568 m_timer.startEvent(
"Step-compute v");
1570 this->setCdrVelocityFunctions();
1571 this->setItoVelocityFunctions();
1572 (this->m_ito)->interpolateVelocities();
1573 this->multiplyCdrVelocitiesByMobilities();
1575 this->computeDriftVelocities();
1577 m_timer.stopEvent(
"Step-compute v");
1581 m_timer.startEvent(
"Euler-Maruyama step");
1582 this->stepEulerMaruyamaParticles(
a_dt);
1583 this->remapParticles(SpeciesSubset::AllMobileOrDiffusive);
1584 this->stepEulerMaruyamaCDR(
a_dt);
1585 m_timer.stopEvent(
"Euler-Maruyama step");
1588template <
typename I,
typename C,
typename R,
typename F>
1594 CH_TIME(
"ItoKMCGodunovStepper::diffuseParticlesEulerMaruyama");
1595 if (this->m_verbosity > 5) {
1596 pout() << this->m_name +
"::diffuseParticlesEulerMaruyama" <<
endl;
1609 const int Z =
species->getChargeNumber();
1613 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1621#pragma omp parallel for schedule(runtime)
1647template <
typename I,
typename C,
typename R,
typename F>
1651 CH_TIME(
"ItoKMCGodunovStepper::diffuseCDREulerMaruyama");
1652 if (this->m_verbosity > 5) {
1653 pout() << this->m_name +
"::diffuseCDREulerMaruyama" <<
endl;
1662 const int index =
solverIt.index();
1663 const int Z =
species->getChargeNumber();
1668 if (
solver->isDiffusive()) {
1669 solver->computeDivD(m_cdrDivD[index],
solver->getPhi(),
false,
false,
false);
1675 if (
solver->isDiffusive()) {
1687template <
typename I,
typename C,
typename R,
typename F>
1691 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaParticles");
1692 if (this->m_verbosity > 5) {
1693 pout() << this->m_name +
"::stepEulerMaruyamaParticles" <<
endl;
1706 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1714#pragma omp parallel for schedule(runtime)
1733template <
typename I,
typename C,
typename R,
typename F>
1737 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaCDR");
1738 if (this->m_verbosity > 5) {
1739 pout() << this->m_name +
"::stepEulerMaruyamaCDR" <<
endl;
1745 const int index =
solverIt.index();
1749 this->m_amr->conservativeAverage(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1750 this->m_amr->interpGhostPwl(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1753 if (
solver->isMobile()) {
1758 solver->computeDivF(this->m_fluidScratch1,
phi, 0.5 *
a_dt,
false,
true,
true);
1764 if (
solver->isDiffusive()) {
1771 this->coarsenCDRSolvers();
1775template <
typename I,
typename C,
typename R,
typename F>
1779 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointHeader");
1780 if (this->m_verbosity > 5) {
1781 pout() << this->m_name +
"::writeCheckpointHeader" <<
endl;
1784 a_header.m_real[
"prev_dt"] = this->m_prevDt;
1785 a_header.m_real[
"physics_dt"] = this->m_physicsDt;
1786 a_header.m_int[
"checkpoint_particles"] = m_writeCheckpointParticles ? 1 : 0;
1791template <
typename I,
typename C,
typename R,
typename F>
1795 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointHeader");
1796 if (this->m_verbosity > 5) {
1797 pout() << this->m_name +
"::readCheckpointHeader" <<
endl;
1800 this->m_prevDt =
a_header.m_real[
"prev_dt"];
1801 this->m_physicsDt =
a_header.m_real[
"physics_dt"];
1803 m_readCheckpointParticles = (
a_header.m_int[
"checkpoint_particles"] != 0) ?
true :
false;
1804 m_canRegridOnRestart = m_readCheckpointParticles;
1809template <
typename I,
typename C,
typename R,
typename F>
1813 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointData");
1814 if (this->m_verbosity > 5) {
1815 pout() << this->m_name +
"::writeCheckpointData" <<
endl;
1821 if (m_writeCheckpointParticles) {
1822 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1835 if (this->m_physics->getNumCdrSpecies() > 0) {
1836 write(
a_handle, *m_semiImplicitRhoCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitRhoCDR");
1837 write(
a_handle, *m_semiImplicitConductivityCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitConductivityCDR");
1843template <
typename I,
typename C,
typename R,
typename F>
1847 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointData");
1848 if (this->m_verbosity > 5) {
1849 pout() << this->m_name +
"::readCheckpointData" <<
endl;
1855 if (m_readCheckpointParticles) {
1856 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1869 if (this->m_physics->getNumCdrSpecies() > 0) {
1873 *m_semiImplicitRhoCDR[
a_lvl],
1874 "ItoKMCGodunovStepper::semiImplicitRhoCDR",
1875 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1880 *m_semiImplicitConductivityCDR[
a_lvl],
1881 "ItoKMCGodunovStepper::semiImplicitConductivityCDR",
1882 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1889template <
typename I,
typename C,
typename R,
typename F>
1893 CH_TIME(
"ItoKMCGodunovStepper::postPlot");
1894 if (this->m_verbosity > 5) {
1895 pout() << this->m_name +
"::postPlot" <<
endl;
1898 this->m_physicsPlotVariables.clear();
1900 this->plotParticles();
1903template <
typename I,
typename C,
typename R,
typename F>
1907 CH_TIME(
"ItoKMCGodunovStepper::plotParticles");
1908 if (this->m_verbosity > 2) {
1909 pout() << this->m_name +
"::plotParticles" <<
endl;
1912 bool plotParticles =
false;
1916 pp.query(
"plot_particles", plotParticles);
1918 if (plotParticles) {
1932 MayDay::Error(
"ItoKMCGodunovStepper::plotParticles - could not create 'particles' directory");
1945 this->m_amr->getProbLo(),
1951#include <CD_NamespaceFooter.H>
Average
Various averaging methods.
Definition CD_Average.H:25
Agglomeration of useful data operations.
Silly, but useful functions that override standard Chombo HDF5 IO.
EBRepresentation
Enum for putting some logic into how we think about EBs. This is just a simply supporting class for v...
Definition CD_EBRepresentation.H:23
Declaration of a class which uses a semi-implicit Godunov method for Ito plasma equations.
SpeciesSubset
Enum for selecting a subset of plasma species by mobility/diffusion/charge properties.
Definition CD_ItoKMCStepper.H:41
Agglomeration of basic MPI reductions.
Declaration of a photon class for particle methods.
Implementation of CD_Timer.H.
Declaration of various useful units.
static void scale(MFAMRCellData &a_lhs, const Real &a_scale) noexcept
Scale data by factor.
Definition CD_DataOps.cpp:2503
static void floor(EBAMRCellData &a_lhs, const Real a_value, const Vector< RefCountedPtr< LayoutData< VoFIterator > > > &a_vofIter)
Floor values in data holder. This sets all values below a_value to a_value.
Definition CD_DataOps.cpp:1465
static void filterSmooth(EBAMRCellData &a_data, const Real a_alpha, const int a_stride, const bool a_zeroEB) noexcept
Apply a convolved filter phi = alpha * phi_i + 0.5*(1-alpha) * [phi_(i+s) + phi_(i-s)] in each direct...
Definition CD_DataOps.cpp:679
static void multiply(EBAMRCellData &a_lhs, const EBAMRCellData &a_rhs)
Multiply data holder by another data holder.
Definition CD_DataOps.cpp:2246
static void incr(MFAMRCellData &a_lhs, const MFAMRCellData &a_rhs, const Real a_scale) noexcept
Function which increments data in the form a_lhs = a_lhs + a_rhs*a_scale for all components.
Definition CD_DataOps.cpp:820
static void setValue(LevelData< MFInterfaceFAB< T > > &a_lhs, const T &a_value)
Set value in an MFInterfaceFAB data holder.
Definition CD_DataOpsImplem.H:24
static void copy(MFAMRCellData &a_dst, const MFAMRCellData &a_src)
Copy data from one data holder to another.
Definition CD_DataOps.cpp:1201
static void averageCellToFace(EBAMRFluxData &a_faceData, const EBAMRCellData &a_cellData, const Vector< ProblemDomain > &a_domains, Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > &a_faceIter)
Average all components of the cell-centered data to faces (arithmetic, no tangential ghost faces).
Definition CD_DataOps.cpp:148
RealVect & position()
Get the particle position.
Definition CD_GenericParticleImplem.H:45
A particle class for use with ItoSolvers, i.e. drifting Brownian walkers.
Definition CD_ItoParticle.H:41
Real & mobility()
Get mobility coefficient.
Definition CD_ItoParticleImplem.H:84
RealVect & oldPosition()
Get the old particle position.
Definition CD_ItoParticleImplem.H:120
RealVect & tmpVect()
Return scratch RealVect storage.
Definition CD_ItoParticleImplem.H:174
static std::vector< std::string > s_vectVariables
Naming convention for vector fields.
Definition CD_ItoParticle.H:18
Real & weight()
Get particle weight.
Definition CD_ItoParticleImplem.H:72
static std::vector< std::string > s_realVariables
Naming convention for scalar fields.
Definition CD_ItoParticle.H:17
RealVect & velocity()
Get the particle velocity.
Definition CD_ItoParticleImplem.H:132
Real & tmpReal()
Return scratch scalar storage.
Definition CD_ItoParticleImplem.H:162
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition CD_ParticleContainer.H:52
Particle class for usage with Monte Carlo radiative transfer.
Definition CD_Photon.H:30
Real & weight()
Get photon weight.
Definition CD_PhotonImplem.H:41
Implementation of ItoKMCStepper that uses a semi-implicit split-step formalism for advancing the Ito-...
Definition CD_ItoKMCGodunovStepper.H:30
virtual void setupSemiImplicitPoisson(const Real a_dt) noexcept
Set up the semi-implicit Poisson solver.
Definition CD_ItoKMCGodunovStepperImplem.H:1335
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) noexcept override
Regrid methods – puts all data on the new mesh.
Definition CD_ItoKMCGodunovStepperImplem.H:593
virtual void removeCoveredPointParticles(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const EBRepresentation a_representation, const Real a_tolerance) const noexcept
Remove covered particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1372
virtual void computeDiffusionTermCDR(EBAMRCellData &m_semiImplicitRhoCDR, const Real a_dt) noexcept
Compute the diffusion term for the CDR equations as well as the resulting CDR-contributions to the sp...
Definition CD_ItoKMCGodunovStepperImplem.H:1649
virtual void allocate() noexcept override
Allocate storage required for advancing the equations.
Definition CD_ItoKMCGodunovStepperImplem.H:77
bool m_readCheckpointParticles
If true, then the HDF5 checkpoint file contained particles that we can read.
Definition CD_ItoKMCGodunovStepper.H:169
virtual Real advance(const Real a_dt) override
Advance the Ito-Poisson-KMC system over a_dt.
Definition CD_ItoKMCGodunovStepperImplem.H:307
virtual void depositPointParticles(const Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const SpeciesSubset a_subset) noexcept
Deposit the input point particles on the mesh.
Definition CD_ItoKMCGodunovStepperImplem.H:879
virtual void allocateInternals() noexcept override
Allocate "internal" storage.
Definition CD_ItoKMCGodunovStepperImplem.H:111
Real m_maxFieldAbort
Limit for maximum field abort.
Definition CD_ItoKMCGodunovStepper.H:230
virtual void computeConductivities(const Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles) noexcept
Compute all conductivities (cell, face, and EB) from the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1097
virtual void stepEulerMaruyamaCDR(const Real a_dt) noexcept
Step the CDR equations according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1735
virtual void diffuseParticlesEulerMaruyama(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_rhoDaggerParticles, const Real a_dt) noexcept
Perform the diffusive Ito advance in the Euler-Maruyama step.
Definition CD_ItoKMCGodunovStepperImplem.H:1590
virtual void parseAlgorithm() noexcept
Parse advancement algorithm.
Definition CD_ItoKMCGodunovStepperImplem.H:181
virtual void postPlot() noexcept override
Perform post-plot operations.
Definition CD_ItoKMCGodunovStepperImplem.H:1891
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCGodunovStepperImplem.H:287
virtual void parseSecondaryEmissionSpecification() noexcept
Parse when secondary particles are emitted.
Definition CD_ItoKMCGodunovStepperImplem.H:256
virtual void parseFiltering() noexcept
Parse filter settings.
Definition CD_ItoKMCGodunovStepperImplem.H:206
virtual void parseRuntimeOptions() noexcept override
Parse run-time options.
Definition CD_ItoKMCGodunovStepperImplem.H:164
virtual bool solvePoisson() noexcept override
Solve the electrostatic problem.
Definition CD_ItoKMCGodunovStepperImplem.H:1466
bool m_canRegridOnRestart
If true, then the class supports regrid-on-restart.
Definition CD_ItoKMCGodunovStepper.H:175
virtual void computeFaceConductivity() noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1186
virtual ~ItoKMCGodunovStepper()
Destructor. Does nothing.
Definition CD_ItoKMCGodunovStepperImplem.H:52
bool m_extendConductivityEB
For achieving a slightly smoother gradient in the conductivity near the EB.
Definition CD_ItoKMCGodunovStepper.H:180
virtual void setOldPositions() noexcept
Set the starting positions for the ItoSolver particles.
Definition CD_ItoKMCGodunovStepperImplem.H:737
bool m_writeCheckpointParticles
If true, then the particles are checkpointed so we can regrid on checkpoint-restart.
Definition CD_ItoKMCGodunovStepper.H:164
virtual void remapPointParticles(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const SpeciesSubset a_subset) noexcept
Remap the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:773
virtual void computeSemiImplicitRho() noexcept
Set up the space charge density for the regrid operation.
Definition CD_ItoKMCGodunovStepperImplem.H:1221
virtual void advanceEulerMaruyama(const Real a_dt) noexcept
Advance the particles using the Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1505
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) noexcept override
Perform pre-regrid operations.
Definition CD_ItoKMCGodunovStepperImplem.H:554
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCGodunovStepperImplem.H:62
virtual void plotParticles() const noexcept
Utility function for plotting the ItoSolver particles. These are written in a particles folder.
Definition CD_ItoKMCGodunovStepperImplem.H:1905
ItoKMCGodunovStepper()=delete
Disallowed default constructor. Use the full constructor.
virtual void computeCellConductivity(EBAMRCellData &a_conductivityCell, const Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles) noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1111
virtual void copyConductivityParticles(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_conductivityParticles) noexcept
Copy particles from the ItoSolver into PointParticles whose weight are ItoParticle::m_weight * ItoPar...
Definition CD_ItoKMCGodunovStepperImplem.H:1412
virtual void clearPointParticles(const Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const SpeciesSubset a_subset) noexcept
Clear the input particle data holders.
Definition CD_ItoKMCGodunovStepperImplem.H:991
virtual void parseCheckpointParticles() noexcept
Parse checkpoint-restart functionality.
Definition CD_ItoKMCGodunovStepperImplem.H:242
virtual void barrier() const noexcept
Set an MPI barrier if using debug mode.
Definition CD_ItoKMCGodunovStepperImplem.H:133
virtual void parseOptions() noexcept override
Parse options.
Definition CD_ItoKMCGodunovStepperImplem.H:147
virtual void stepEulerMaruyamaParticles(const Real a_dt) noexcept
Step the particles according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1689
Abstract TimeStepper for the Ito-KMC-Poisson system of equations.
Definition CD_ItoKMCStepper.H:64
virtual void parseRuntimeOptions() noexcept override
Parse runtime configurable options.
Definition CD_ItoKMCStepperImplem.H:110
std::string m_name
Time stepper name.
Definition CD_ItoKMCStepper.H:375
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCStepperImplem.H:1551
virtual void parseOptions() noexcept
Parse options.
Definition CD_ItoKMCStepperImplem.H:90
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) noexcept override
Perform pre-regrid operations - storing relevant data from the old grids.
Definition CD_ItoKMCStepperImplem.H:1600
Real m_prevDt
Previous time step.
Definition CD_ItoKMCStepper.H:514
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCStepperImplem.H:1422
virtual void allocateInternals() noexcept
Allocate "internal" storage.
Definition CD_ItoKMCStepperImplem.H:536
virtual void allocate() noexcept override
Allocate storage for solvers.
Definition CD_ItoKMCStepperImplem.H:518
A particle class that only has a position and a weight.
Definition CD_PointParticle.H:30
Real & weight()
Get weight.
Definition CD_PointParticleImplem.H:37
Class which is used for run-time monitoring of events.
Definition CD_Timer.H:32
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
virtual void remap()
Remap particles.
Definition CD_TracerParticleSolverImplem.H:339
void depositParticles(EBAMRCellData &a_phi, const ParticleContainer< T > &a_particles, const DepositionType a_baseDeposition, const CoarseFineDeposition a_coarseFineDeposition) const noexcept
Generic particle deposition method for putting a scalar field onto the mesh.
Definition CD_TracerParticleSolverImplem.H:736
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
virtual void preRegrid(const int a_lbase, const int a_oldFinestLevel)
Perform pre-regrid operations.
Definition CD_TracerParticleSolverImplem.H:307
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition CD_TracerParticleSolverImplem.H:663
virtual void allocate()
Allocate storage for this solver.
Definition CD_TracerParticleSolverImplem.H:195
int m_timeStep
Time step.
Definition CD_TracerParticleSolver.H:382
Real m_time
Time.
Definition CD_TracerParticleSolver.H:377
void writeH5Part(std::string a_filename, const ParticleContainer< GenericParticle< M, N > > &a_particles, std::vector< std::string > a_realVars, std::vector< std::string > a_vectVars, RealVect a_shift, Real a_time) noexcept
Write a particle container to an H5Part file. Good for quick and dirty visualization of particles.
Definition CD_DischargeIOImplem.H:30
void barrier() noexcept
MPI barrier.
Definition CD_ParallelOpsImplem.H:26
constexpr Real eps0
Permittivity of free space.
Definition CD_Units.H:30
constexpr Real Qe
Elementary charge.
Definition CD_Units.H:35
@ solid
Solid (dielectric) phase.
Definition CD_MultiFluidIndexSpace.H:40
@ gas
Gas phase.
Definition CD_MultiFluidIndexSpace.H:39