12#ifndef CD_ItoKMCGodunovStepperImplem_H
13#define CD_ItoKMCGodunovStepperImplem_H
26#include <CD_NamespaceHeader.H>
28using namespace Physics::ItoKMC;
30template <
typename I,
typename C,
typename R,
typename F>
34 CH_TIME(
"ItoKMCGodunovStepper::ItoKMCGodunovStepper");
36 this->
m_name =
"ItoKMCGodunovStepper";
48template <
typename I,
typename C,
typename R,
typename F>
51 CH_TIME(
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper");
52 if (this->m_verbosity > 5) {
53 pout() <<
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper" <<
endl;
57template <
typename I,
typename C,
typename R,
typename F>
61 CH_TIME(
"ItoKMCGodunovStepper::registerOperators");
62 if (this->m_verbosity > 5) {
63 pout() <<
"ItoKMCGodunovStepper::registerOperators" <<
endl;
69 (this->m_amr)->registerOperator(s_particle_mesh, this->m_particleRealm, phase::solid);
72template <
typename I,
typename C,
typename R,
typename F>
76 CH_TIME(
"ItoKMCGodunovStepper::allocate");
77 if (this->m_verbosity > 5) {
78 pout() <<
"ItoKMCGodunovStepper::allocate" <<
endl;
86 const int numItoSpecies = this->m_physics->getNumItoSpecies();
100 (this->m_amr)->allocate(*m_conductivityParticles[
idx], this->m_particleRealm);
101 (this->m_amr)->allocate(*m_irregularParticles[
idx], this->m_particleRealm);
102 (this->m_amr)->allocate(*m_rhoDaggerParticles[
idx], this->m_particleRealm);
106template <
typename I,
typename C,
typename R,
typename F>
110 CH_TIME(
"ItoKMCGodunovStepper::allocateInternals");
111 if (this->m_verbosity > 5) {
112 pout() << this->m_name +
"::allocateInternals" <<
endl;
117 const int numCdrSpecies = this->m_physics->getNumCdrSpecies();
121 this->m_amr->
allocate(m_cdrDivD[
i], this->m_fluidRealm, this->m_plasmaPhase, 1);
124 this->m_amr->
allocate(m_semiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
125 this->m_amr->
allocate(m_semiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
128template <
typename I,
typename C,
typename R,
typename F>
132 CH_TIME(
"ItoKMCGodunovStepper::barrier");
133 if (this->m_verbosity > 5) {
134 pout() << this->m_name +
"::barrier" <<
endl;
137 if ((this->m_profile)) {
142template <
typename I,
typename C,
typename R,
typename F>
146 CH_TIME(
"ItoKMCGodunovStepper::parseOptions");
147 if (this->m_verbosity > 5) {
148 pout() << this->m_name +
"::parseOptions" <<
endl;
153 this->parseAlgorithm();
154 this->parseFiltering();
155 this->parseCheckpointParticles();
156 this->parseSecondaryEmissionSpecification();
159template <
typename I,
typename C,
typename R,
typename F>
163 CH_TIME(
"ItoKMCGodunovStepper::parseRuntimeOptions");
164 if (this->m_verbosity > 5) {
165 pout() << this->m_name +
"::parseRuntimeOptions" <<
endl;
170 this->parseAlgorithm();
171 this->parseFiltering();
172 this->parseCheckpointParticles();
173 this->parseSecondaryEmissionSpecification();
176template <
typename I,
typename C,
typename R,
typename F>
180 CH_TIME(
"ItoKMCGodunovStepper::parseAlgorithm");
181 if (this->m_verbosity > 5) {
182 pout() << this->m_name +
"::parseAlgorithm" <<
endl;
188 pp.get(
"extend_conductivity", m_extendConductivityEB);
189 pp.get(
"algorithm",
str);
190 pp.get(
"abort_max_field", m_maxFieldAbort);
193 if (
str ==
"euler_maruyama") {
194 m_algorithm = WhichAlgorithm::EulerMaruyama;
197 MayDay::Abort(
"ItoKMCGodunovStepper::parseAlgorithm - unknown algorithm requested");
201template <
typename I,
typename C,
typename R,
typename F>
205 CH_TIME(
"ItoKMCGodunovStepper::parseFiltering");
206 if (this->m_verbosity > 5) {
207 pout() << this->m_name +
"::parseFiltering" <<
endl;
214 m_rhoFilterMaxStride = 1;
215 m_rhoFilterAlpha = 0.5;
217 m_condFilterNum = -1;
218 m_condFilterMaxStride = 1;
219 m_condFilterAlpha = 0.5;
221 pp.get(
"rho_filter_num", m_rhoFilterNum);
222 pp.get(
"rho_filter_max_stride", m_rhoFilterMaxStride);
223 pp.get(
"rho_filter_alpha", m_rhoFilterAlpha);
225 pp.get(
"cond_filter_num", m_condFilterNum);
226 pp.get(
"cond_filter_max_stride", m_condFilterMaxStride);
227 pp.get(
"cond_filter_alpha", m_condFilterAlpha);
230 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for rho_filter");
233 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for cond_filter");
237template <
typename I,
typename C,
typename R,
typename F>
241 CH_TIME(
"ItoKMCGodunovStepper::parseCheckpointParticles");
242 if (this->m_verbosity > 5) {
243 pout() << this->m_name +
"::parseCheckpointParticles" <<
endl;
248 pp.query(
"checkpoint_particles", m_writeCheckpointParticles);
251template <
typename I,
typename C,
typename R,
typename F>
255 CH_TIME(
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecifiation");
256 if (this->m_verbosity > 5) {
257 pout() << this->m_name +
"::parseSecondaryEmissionSpecification" <<
endl;
264 pp.query(
"secondary_emission",
str);
266 if (
str ==
"before_reactions") {
267 m_emitSecondaryParticlesBeforeReactions =
true;
269 else if (
str ==
"after_reactions") {
270 m_emitSecondaryParticlesBeforeReactions =
false;
275 err =
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecification - expected 'before_reactions' or 'after_reactions'";
282template <
typename I,
typename C,
typename R,
typename F>
286 CH_TIME(
"ItoKMCGodunovStepper::computeDt");
287 if (this->m_verbosity > 5) {
288 pout() << this->m_name +
"::computeDt" <<
endl;
293 if ((this->m_maxReducedField > m_maxFieldAbort) && (m_maxFieldAbort > 0.0)) {
294 pout() << this->m_name +
" aborting because maximum field is too high (" << this->m_maxReducedField <<
")" <<
endl;
302template <
typename I,
typename C,
typename R,
typename F>
306 CH_TIME(
"ItoKMCGodunovStepper::advance");
307 if (this->m_verbosity > 5) {
308 pout() << this->m_name +
"::advance" <<
endl;
312 const Real Qtot = this->computeTotalCharge();
322 m_canRegridOnRestart =
true;
324 m_timer =
Timer(
"ItoKMCGodunovStepper::advance");
329 this->m_prevDt =
a_dt;
332 m_timer.startEvent(
"Deposit photons");
341 m_timer.stopEvent(
"Deposit photons");
345 switch (m_algorithm) {
346 case WhichAlgorithm::EulerMaruyama: {
347 this->advanceEulerMaruyama(
a_dt);
360 m_timer.startEvent(
"EB/Particle intersection");
361 if (m_extendConductivityEB) {
374 return p.tmpReal() < 0.0;
378 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
379 ParticleOps::setData<ItoParticle>(
it()->getParticles(ItoSolver::WhichContainer::Bulk),
setFlag);
383 const bool deleteParticles =
false;
384 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles,
nonDeletionModifier);
387 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
391 const int idx =
it.index();
392 const int Z =
species->getChargeNumber();
400 if (
Z != 0 &&
solver->isMobile()) {
401 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
407#pragma omp parallel for schedule(runtime)
431 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
437 const bool deleteParticles =
true;
439 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles);
444 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
452 m_timer.stopEvent(
"EB/Particle intersection");
457 m_timer.startEvent(
"Photon transport");
458 this->advancePhotons(
a_dt);
459 m_timer.stopEvent(
"Photon transport");
462 if ((this->m_physics)->needGradients()) {
463 m_timer.startEvent(
"Gradient calculation");
464 (this->m_ito)->depositParticles();
465 this->computeDensityGradients();
466 m_timer.stopEvent(
"Gradient calculation");
471 if (m_emitSecondaryParticlesBeforeReactions) {
473 m_timer.startEvent(
"EB particle injection");
474 this->fillSecondaryEmissionEB(
a_dt);
475 this->resolveSecondaryEmissionEB(
a_dt);
476 m_timer.stopEvent(
"EB particle injection");
481 m_timer.startEvent(
"Sort by cell");
482 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
483 this->sortPhotonsByCell(McPhoto::WhichContainer::Bulk);
484 this->sortPhotonsByCell(McPhoto::WhichContainer::Source);
485 m_timer.stopEvent(
"Sort by cell");
489 m_timer.startEvent(
"Reaction network");
490 this->advanceReactionNetwork(
a_dt);
491 m_timer.stopEvent(
"Reaction network");
495 m_timer.startEvent(
"Sort by patch");
496 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
497 this->sortPhotonsByPatch(McPhoto::WhichContainer::Bulk);
498 this->sortPhotonsByPatch(McPhoto::WhichContainer::Source);
499 m_timer.stopEvent(
"Sort by patch");
503 if (!m_emitSecondaryParticlesBeforeReactions) {
505 m_timer.startEvent(
"EB particle injection");
506 this->fillSecondaryEmissionEB(
a_dt);
507 this->resolveSecondaryEmissionEB(
a_dt);
508 m_timer.stopEvent(
"EB particle injection");
514 m_timer.startEvent(
"Remove covered");
515 this->removeCoveredParticles(SpeciesSubset::AllMobileOrDiffusive, EBRepresentation::Discrete, this->m_toleranceEB);
516 m_timer.stopEvent(
"Remove covered");
520 solverIt()->clear(ItoSolver::WhichContainer::EB);
521 solverIt()->clear(ItoSolver::WhichContainer::Domain);
526 m_timer.startEvent(
"Post-compute v");
527 this->computeDriftVelocities();
528 m_timer.stopEvent(
"Post-compute v");
531 m_timer.startEvent(
"Post-compute D");
532 this->computeDiffusionCoefficients();
533 m_timer.stopEvent(
"Post-compute D");
535 this->computePhysicsDt();
537 if ((this->m_profile)) {
538 m_timer.eventReport(
pout(),
false);
544 this->m_maxReducedField = this->computeMaxReducedElectricField(this->m_plasmaPhase);
549template <
typename I,
typename C,
typename R,
typename F>
553 CH_TIME(
"ItoKMCGodunovStepper::preRegrid");
554 if (this->m_verbosity > 5) {
555 pout() <<
"ItoKMCGodunovStepper::preRegrid" <<
endl;
558 const int numItoSpecies = (this->m_physics)->getNumItoSpecies();
559 const int numCdrSpecies = (this->m_physics)->getNumCdrSpecies();
573 this->m_amr->
allocate(m_scratchSemiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
574 this->m_amr->
allocate(m_scratchSemiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
576 DataOps::copy(m_scratchSemiImplicitRhoCDR, m_semiImplicitRhoCDR);
577 DataOps::copy(m_scratchSemiImplicitConductivityCDR, m_semiImplicitConductivityCDR);
581 m_cdrDivD[
i].clear();
584 m_semiImplicitRhoCDR.clear();
585 m_semiImplicitConductivityCDR.clear();
588template <
typename I,
typename C,
typename R,
typename F>
594 CH_TIME(
"ItoKMCGodunovStepper::regrid");
595 if (this->m_verbosity > 5) {
596 pout() <<
"ItoKMCGodunovStepper::regrid" <<
endl;
599 m_timer =
Timer(
"ItoKMCGodunovStepper::regrid");
603 if (!m_canRegridOnRestart) {
605 const std::string err1 =
"checkpoint file does not contain particles. Set Driver.initial_regrids=0";
613 m_timer.startEvent(
"Regrid ItoSolver");
615 if (this->m_timeStep == 0) {
619 (this->m_ito)->depositParticles();
621 m_timer.stopEvent(
"Regrid ItoSolver");
623 m_timer.startEvent(
"Regrid CdrSolver");
625 m_timer.stopEvent(
"Regrid CdrSolver");
627 m_timer.startEvent(
"Regrid FieldSolver");
629 m_timer.stopEvent(
"Regrid FieldSolver");
631 m_timer.startEvent(
"Regrid RTE");
633 m_timer.stopEvent(
"Regrid RTE");
635 m_timer.startEvent(
"Regrid SurfaceODESolver");
637 m_timer.stopEvent(
"Regrid SurfaceODESolver");
640 m_timer.startEvent(
"Allocate internals");
641 this->allocateInternals();
642 m_timer.stopEvent(
"Allocate internals");
645 m_timer.startEvent(
"Remap algorithm-particles");
652 m_timer.stopEvent(
"Remap algorithm-particles");
655 this->m_amr->interpToNewGrids(m_semiImplicitRhoCDR,
656 m_scratchSemiImplicitRhoCDR,
661 EBCoarseToFineInterp::Type::ConservativePWC);
663 this->m_amr->interpToNewGrids(m_semiImplicitConductivityCDR,
664 m_scratchSemiImplicitConductivityCDR,
669 EBCoarseToFineInterp::Type::ConservativePWC);
673 m_timer.startEvent(
"Setup field solver");
674 (this->m_fieldSolver)->setupSolver();
675 this->computeConductivities(m_conductivityParticles);
676 this->setupSemiImplicitPoisson(this->m_prevDt);
677 m_timer.stopEvent(
"Setup field solver");
680 m_timer.startEvent(
"Solve Poisson");
681 if (this->m_timeStep == 0) {
682 this->computeSpaceChargeDensity();
685 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::All);
686 this->computeSemiImplicitRho();
689 const bool converged = this->solvePoisson();
692 const std::string errMsg =
"ItoKMCGodunovStepper::regrid - Poisson solve did not converge after regrid";
696 if (this->m_abortOnFailure) {
697 MayDay::Error(
errMsg.c_str());
700 m_timer.stopEvent(
"Solve Poisson");
703 if (this->m_regridSuperparticles) {
704 m_timer.startEvent(
"Make superparticles");
705 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
706 (this->m_ito)->makeSuperparticles(ItoSolver::WhichContainer::Bulk, (this->m_particlesPerCell));
707 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
708 m_timer.stopEvent(
"Make superparticles");
712 m_timer.startEvent(
"Deposit particles");
713 (this->m_ito)->depositParticles();
714 m_timer.stopEvent(
"Deposit particles");
717 m_timer.startEvent(
"Prepare next step");
718 this->computeDiffusionCoefficients();
719 this->computeDriftVelocities();
720 m_timer.stopEvent(
"Prepare next step");
722 m_timer.eventReport(
pout(),
false);
725 m_scratchSemiImplicitRhoCDR.clear();
726 m_scratchSemiImplicitConductivityCDR.clear();
729 this->fillNeutralDensity();
732template <
typename I,
typename C,
typename R,
typename F>
736 CH_TIME(
"ItoKMCGodunovStepper::setOldPositions");
737 if (this->m_verbosity > 5) {
738 pout() << this->m_name +
"::setOldPositions" <<
endl;
744 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
752#pragma omp parallel for schedule(runtime)
768template <
typename I,
typename C,
typename R,
typename F>
774 CH_TIME(
"ItoKMCGodunovStepper::remapPointParticles");
775 if (this->m_verbosity > 5) {
776 pout() << this->m_name +
"::remapPointParticles" <<
endl;
790 case SpeciesSubset::All: {
795 case SpeciesSubset::AllMobile: {
802 case SpeciesSubset::AllDiffusive: {
809 case SpeciesSubset::AllMobileOrDiffusive: {
816 case SpeciesSubset::AllMobileAndDiffusive: {
823 case SpeciesSubset::Charged: {
830 case SpeciesSubset::ChargedMobile: {
837 case SpeciesSubset::ChargedDiffusive: {
844 case SpeciesSubset::ChargedMobileOrDiffusive: {
851 case SpeciesSubset::ChargedMobileAndDiffusive: {
858 case SpeciesSubset::Stationary: {
866 MayDay::Abort(
"ItoKMCGodunovStepper::remapPointParticles - logic bust");
874template <
typename I,
typename C,
typename R,
typename F>
880 CH_TIME(
"ItoKMCGodunovStepper::depositPointParticles");
881 if (this->m_verbosity > 5) {
882 pout() << this->m_name +
"::depositPointParticles" <<
endl;
896 case SpeciesSubset::All: {
901 case SpeciesSubset::AllMobile: {
909 case SpeciesSubset::AllDiffusive: {
917 case SpeciesSubset::AllMobileOrDiffusive: {
924 case SpeciesSubset::AllMobileAndDiffusive: {
931 case SpeciesSubset::Charged: {
938 case SpeciesSubset::ChargedMobile: {
945 case SpeciesSubset::ChargedDiffusive: {
953 case SpeciesSubset::ChargedMobileOrDiffusive: {
961 case SpeciesSubset::ChargedMobileAndDiffusive: {
969 case SpeciesSubset::Stationary: {
978 MayDay::Abort(
"ItoKMCGodunovStepper::depositPointParticles - logic bust");
986template <
typename I,
typename C,
typename R,
typename F>
992 CH_TIME(
"ItoKMCGodunovStepper::clearPointParticles");
993 if (this->m_verbosity > 5) {
994 pout() << this->m_name +
"::clearPointParticles" <<
endl;
1008 case SpeciesSubset::All: {
1013 case SpeciesSubset::AllMobile: {
1020 case SpeciesSubset::AllDiffusive: {
1027 case SpeciesSubset::AllMobileOrDiffusive: {
1034 case SpeciesSubset::AllMobileAndDiffusive: {
1041 case SpeciesSubset::Charged: {
1048 case SpeciesSubset::ChargedMobile: {
1055 case SpeciesSubset::ChargedDiffusive: {
1062 case SpeciesSubset::ChargedMobileOrDiffusive: {
1069 case SpeciesSubset::ChargedMobileAndDiffusive: {
1076 case SpeciesSubset::Stationary: {
1084 MayDay::Abort(
"ItoKMCGodunovStepper::clearPointParticles - logic bust");
1092template <
typename I,
typename C,
typename R,
typename F>
1097 CH_TIME(
"ItoKMCGodunovStepper::computeConductivities");
1098 if (this->m_verbosity > 5) {
1099 pout() << this->m_name +
"::computeConductivities" <<
endl;
1102 this->computeCellConductivity((this->m_conductivityCell),
a_particles);
1103 this->computeFaceConductivity();
1106template <
typename I,
typename C,
typename R,
typename F>
1112 CH_TIME(
"ItoKMCGodunovStepper::computeCellConductivity(EBAMRCellData, PointParticle");
1113 if (this->m_verbosity > 5) {
1114 pout() << this->m_name +
"::computeCellConductivity(EBAMRCellData, PointParticle)" <<
endl;
1125 const int Z =
species->getChargeNumber();
1127 if (
Z != 0 &&
solver->isMobile()) {
1134 (this->m_amr)->copyData(this->m_fluidScratch1, this->m_particleScratch1);
1145 const int index =
solverIt.index();
1146 const int Z =
species->getChargeNumber();
1148 if (
Z != 0 &&
solver->isMobile()) {
1163 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1164 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1167 if (m_condFilterNum > 0 && m_condFilterMaxStride > 0) {
1168 for (
int i = 0;
i < m_condFilterNum;
i++) {
1172 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1173 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1178 (this->m_amr)->interpToCentroids(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1181template <
typename I,
typename C,
typename R,
typename F>
1185 CH_TIME(
"ItoKMCGodunovStepper::computeFaceConductivity");
1186 if (this->m_verbosity > 5) {
1187 pout() << this->m_name +
"::computeFaceConductivity" <<
endl;
1195 const Average average = Average::Arithmetic;
1200 (this->m_conductivityCell),
1201 (this->m_amr)->getDomains(),
1208 DataOps::incr((this->m_conductivityEB), (this->m_conductivityCell), 1.0);
1211template <
typename I,
typename C,
typename R,
typename F>
1215 CH_TIMERS(
"ItoKMCGodunovStepper::computeSemiImplicitRho");
1216 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::plasma_phase",
t1);
1217 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::solid_phase",
t2);
1218 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::filter",
t3);
1219 if (this->m_verbosity > 5) {
1220 pout() << this->m_name +
"::computeSemiImplicitRho" <<
endl;
1224 CH_assert(this->m_plasmaPhase == phase::gas);
1236 rhoSolid = (this->m_amr)->alias(phase::solid,
rho);
1246 const int Z =
species->getChargeNumber();
1249 (this->m_amr)->copyData(this->m_fluidScratch1,
solver->getPhi());
1268 (this->m_amr)->allocate(
particleScratch, this->m_particleRealm, phase::solid, 1);
1269 (this->m_amr)->allocate(
fluidScratch, this->m_fluidRealm, phase::solid, 1);
1274 const int Z =
species->getChargeNumber();
1283 this->m_particleRealm,
1285 *m_rhoDaggerParticles[
solverIt.index()],
1286 DepositionType::CIC,
1287 CoarseFineDeposition::Halo,
1300 this->m_amr->arithmeticAverage(
rho, this->m_fluidRealm);
1301 this->m_amr->interpGhostPwl(
rho, this->m_fluidRealm);
1304 if (m_rhoFilterNum > 0 && m_rhoFilterMaxStride > 0) {
1306 for (
int i = 0;
i < m_rhoFilterNum;
i++) {
1311 this->m_amr->arithmeticAverage(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1312 this->m_amr->interpGhost(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1319 this->m_amr->interpToCentroids(
rhoGas, this->m_fluidRealm, phase::gas);
1321 this->m_amr->interpToCentroids(
rhoSolid, this->m_fluidRealm, phase::solid);
1325template <
typename I,
typename C,
typename R,
typename F>
1329 CH_TIME(
"ItoKMCGodunovStepper::setupSemiImplicitPoisson");
1330 if (this->m_verbosity > 5) {
1331 pout() << this->m_name +
"::setupSemiImplicitPoisson" <<
endl;
1335 (this->m_fieldSolver)->setPermittivities();
1352 (this->m_amr)->arithmeticAverage(
permFaceGas, this->m_fluidRealm, (this->m_plasmaPhase));
1353 (this->m_amr)->arithmeticAverage(
permEBGas, this->m_fluidRealm, (this->m_plasmaPhase));
1359template <
typename I,
typename C,
typename R,
typename F>
1366 CH_TIME(
"ItoKMCGodunovStepper::removeCoveredPointParticles");
1367 if (this->m_verbosity > 5) {
1368 pout() << this->m_name +
"::removeCoveredPointParticles" <<
endl;
1376 case EBRepresentation::Discrete: {
1381 case EBRepresentation::ImplicitFunction: {
1386 case EBRepresentation::Voxel: {
1387 (this->m_amr)->removeCoveredParticlesVoxels(
particles, (this->m_plasmaPhase));
1392 MayDay::Error(
"ItoKMCGodunovStepper::removeCoveredParticles - logic bust");
1399template <
typename I,
typename C,
typename R,
typename F>
1404 CH_TIME(
"ItoKMCGodunovStepper::copyConductivityParticles");
1405 if (this->m_verbosity > 5) {
1406 pout() << this->m_name +
"::copyConductivityParticles" <<
endl;
1417 const int Z =
species->getChargeNumber();
1419 if (
Z != 0 &&
solver->isMobile()) {
1422 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1428#pragma omp parallel for schedule(runtime)
1453template <
typename I,
typename C,
typename R,
typename F>
1457 CH_TIME(
"ItoKMCGodunovStepper::solvePoisson()");
1458 if (this->m_verbosity > 5) {
1459 pout() << this->m_name +
"::solvePoisson()" <<
endl;
1469 (this->m_fieldSolver)->computeElectricField();
1474 (this->m_amr)->allocatePointer(
E, this->m_fluidRealm);
1475 (this->m_amr)->alias(
E, this->m_plasmaPhase, (this->m_fieldSolver)->getElectricField());
1478 (this->m_amr)->copyData(this->m_electricFieldFluid,
E);
1479 (this->m_amr)->conservativeAverage(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1480 (this->m_amr)->interpGhostPwl(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1481 (this->m_amr)->interpToCentroids(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1484 (this->m_amr)->copyData(this->m_electricFieldParticle,
E);
1485 (this->m_amr)->conservativeAverage(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1486 (this->m_amr)->interpGhostPwl(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1487 (this->m_amr)->interpToCentroids(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1492template <
typename I,
typename C,
typename R,
typename F>
1496 CH_TIME(
"ItoKMCGodunovStepper::advanceEulerMaruyama");
1497 if (this->m_verbosity > 5) {
1498 pout() << this->m_name +
"::advanceEulerMaruyama" <<
endl;
1502 this->setOldPositions();
1507 m_timer.startEvent(
"Diffuse particles");
1508 this->diffuseParticlesEulerMaruyama(m_rhoDaggerParticles,
a_dt);
1509 this->remapPointParticles(m_rhoDaggerParticles, SpeciesSubset::ChargedDiffusive);
1510 m_timer.stopEvent(
"Diffuse particles");
1514 m_timer.startEvent(
"Diffuse CDR");
1515 this->computeDiffusionTermCDR(m_semiImplicitRhoCDR,
a_dt);
1516 m_timer.stopEvent(
"Diffuse CDR");
1520 m_timer.startEvent(
"Compute conductivities");
1521 this->copyConductivityParticles(m_conductivityParticles);
1522 this->computeConductivities(m_conductivityParticles);
1523 m_timer.stopEvent(
"Compute conductivities");
1527 m_timer.startEvent(
"Setup Poisson");
1528 this->setupSemiImplicitPoisson(
a_dt);
1529 m_timer.stopEvent(
"Setup Poisson");
1534 m_timer.startEvent(
"Deposit point particles");
1535 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::Charged);
1536 this->computeSemiImplicitRho();
1537 m_timer.stopEvent(
"Deposit point particles");
1541 m_timer.startEvent(
"Solve Poisson");
1542 const bool converged = this->solvePoisson();
1544 const std::string errMsg =
"ItoKMCGodunovStepper::advanceEulerMaruyama - Poisson solve did not converge";
1548 if (this->m_abortOnFailure) {
1549 MayDay::Error(
errMsg.c_str());
1552 m_timer.stopEvent(
"Solve Poisson");
1557 m_timer.startEvent(
"Step-compute v");
1559 this->setCdrVelocityFunctions();
1560 this->setItoVelocityFunctions();
1561 (this->m_ito)->interpolateVelocities();
1562 this->multiplyCdrVelocitiesByMobilities();
1564 this->computeDriftVelocities();
1566 m_timer.stopEvent(
"Step-compute v");
1570 m_timer.startEvent(
"Euler-Maruyama step");
1571 this->stepEulerMaruyamaParticles(
a_dt);
1572 this->remapParticles(SpeciesSubset::AllMobileOrDiffusive);
1573 this->stepEulerMaruyamaCDR(
a_dt);
1574 m_timer.stopEvent(
"Euler-Maruyama step");
1577template <
typename I,
typename C,
typename R,
typename F>
1583 CH_TIME(
"ItoKMCGodunovStepper::diffuseParticlesEulerMaruyama");
1584 if (this->m_verbosity > 5) {
1585 pout() << this->m_name +
"::diffuseParticlesEulerMaruyama" <<
endl;
1598 const int Z =
species->getChargeNumber();
1602 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1610#pragma omp parallel for schedule(runtime)
1636template <
typename I,
typename C,
typename R,
typename F>
1640 CH_TIME(
"ItoKMCGodunovStepper::diffuseCDREulerMaruyama");
1641 if (this->m_verbosity > 5) {
1642 pout() << this->m_name +
"::diffuseCDREulerMaruyama" <<
endl;
1651 const int index =
solverIt.index();
1652 const int Z =
species->getChargeNumber();
1657 if (
solver->isDiffusive()) {
1658 solver->computeDivD(m_cdrDivD[index],
solver->getPhi(),
false,
false,
false);
1664 if (
solver->isDiffusive()) {
1676template <
typename I,
typename C,
typename R,
typename F>
1680 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaParticles");
1681 if (this->m_verbosity > 5) {
1682 pout() << this->m_name +
"::stepEulerMaruyamaParticles" <<
endl;
1695 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1703#pragma omp parallel for schedule(runtime)
1722template <
typename I,
typename C,
typename R,
typename F>
1726 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaCDR");
1727 if (this->m_verbosity > 5) {
1728 pout() << this->m_name +
"::stepEulerMaruyamaCDR" <<
endl;
1734 const int index =
solverIt.index();
1738 this->m_amr->conservativeAverage(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1739 this->m_amr->interpGhostPwl(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1742 if (
solver->isMobile()) {
1747 solver->computeDivF(this->m_fluidScratch1,
phi, 0.5 *
a_dt,
false,
true,
true);
1753 if (
solver->isDiffusive()) {
1760 this->coarsenCDRSolvers();
1764template <
typename I,
typename C,
typename R,
typename F>
1768 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointHeader");
1769 if (this->m_verbosity > 5) {
1770 pout() << this->m_name +
"::writeCheckpointHeader" <<
endl;
1773 a_header.m_real[
"prev_dt"] = this->m_prevDt;
1774 a_header.m_real[
"physics_dt"] = this->m_physicsDt;
1775 a_header.m_int[
"checkpoint_particles"] = m_writeCheckpointParticles ? 1 : 0;
1780template <
typename I,
typename C,
typename R,
typename F>
1784 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointHeader");
1785 if (this->m_verbosity > 5) {
1786 pout() << this->m_name +
"::readCheckpointHeader" <<
endl;
1789 this->m_prevDt =
a_header.m_real[
"prev_dt"];
1790 this->m_physicsDt =
a_header.m_real[
"physics_dt"];
1792 m_readCheckpointParticles = (
a_header.m_int[
"checkpoint_particles"] != 0) ?
true :
false;
1793 m_canRegridOnRestart = m_readCheckpointParticles;
1798template <
typename I,
typename C,
typename R,
typename F>
1802 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointData");
1803 if (this->m_verbosity > 5) {
1804 pout() << this->m_name +
"::writeCheckpointData" <<
endl;
1810 if (m_writeCheckpointParticles) {
1811 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1824 if (this->m_physics->getNumCdrSpecies() > 0) {
1825 write(
a_handle, *m_semiImplicitRhoCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitRhoCDR");
1826 write(
a_handle, *m_semiImplicitConductivityCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitConductivityCDR");
1832template <
typename I,
typename C,
typename R,
typename F>
1836 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointData");
1837 if (this->m_verbosity > 5) {
1838 pout() << this->m_name +
"::readCheckpointData" <<
endl;
1844 if (m_readCheckpointParticles) {
1845 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1858 if (this->m_physics->getNumCdrSpecies() > 0) {
1862 *m_semiImplicitRhoCDR[
a_lvl],
1863 "ItoKMCGodunovStepper::semiImplicitRhoCDR",
1864 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1869 *m_semiImplicitConductivityCDR[
a_lvl],
1870 "ItoKMCGodunovStepper::semiImplicitConductivityCDR",
1871 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1878template <
typename I,
typename C,
typename R,
typename F>
1882 CH_TIME(
"ItoKMCGodunovStepper::postPlot");
1883 if (this->m_verbosity > 5) {
1884 pout() << this->m_name +
"::postPlot" <<
endl;
1887 this->m_physicsPlotVariables.clear();
1889 this->plotParticles();
1892template <
typename I,
typename C,
typename R,
typename F>
1896 CH_TIME(
"ItoKMCGodunovStepper::plotParticles");
1897 if (this->m_verbosity > 2) {
1898 pout() << this->m_name +
"::plotParticles" <<
endl;
1901 bool plotParticles =
false;
1905 pp.query(
"plot_particles", plotParticles);
1907 if (plotParticles) {
1921 MayDay::Error(
"ItoKMCGodunovStepper::plotParticles - could not create 'particles' directory");
1934 this->m_amr->getProbLo(),
1940#include <CD_NamespaceFooter.H>
Average
Various averaging methods.
Definition CD_Average.H:24
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:22
Declaration of a class which uses a semi-implicit Godunov method for Ito plasma equations.
SpeciesSubset
Enum for differentiating between types of particles.
Definition CD_ItoKMCStepper.H:40
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:2398
static void floor(EBAMRCellData &a_lhs, const Real a_value)
Floor values in data holder. This sets all values below a_value to a_value.
Definition CD_DataOps.cpp:1394
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:660
static void multiply(EBAMRCellData &a_lhs, const EBAMRCellData &a_rhs)
Multiply data holder by another data holder.
Definition CD_DataOps.cpp:2156
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:801
static void setValue(LevelData< MFInterfaceFAB< T > > &a_lhs, const T &a_value)
Set value in an MFInterfaceFAB data holder.
Definition CD_DataOpsImplem.H:23
static void averageCellToFace(EBAMRFluxData &a_faceData, const EBAMRCellData &a_cellData, const Vector< ProblemDomain > &a_domains)
Average all components of the cell-centered data to faces.
Definition CD_DataOps.cpp:153
static void copy(MFAMRCellData &a_dst, const MFAMRCellData &a_src)
Copy data from one data holder to another.
Definition CD_DataOps.cpp:1132
RealVect & position()
Get the particle position.
Definition CD_GenericParticleImplem.H:49
A particle class for use with ItoSolvers, i.e. drifting Brownian walkers.
Definition CD_ItoParticle.H:40
Real & mobility()
Get mobility coefficient.
Definition CD_ItoParticleImplem.H:83
RealVect & oldPosition()
Get the old particle position.
Definition CD_ItoParticleImplem.H:119
RealVect & tmpVect()
Return scratch RealVect storage.
Definition CD_ItoParticleImplem.H:173
static std::vector< std::string > s_vectVariables
Naming convention for vector fields.
Definition CD_ItoParticle.H:17
Real & weight()
Get particle weight.
Definition CD_ItoParticleImplem.H:71
static std::vector< std::string > s_realVariables
Naming convention for scalar fields.
Definition CD_ItoParticle.H:16
RealVect & velocity()
Get the particle velocity.
Definition CD_ItoParticleImplem.H:131
Real & tmpReal()
Return scratch scalar storage.
Definition CD_ItoParticleImplem.H:161
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition CD_ParticleContainer.H:51
Particle class for usage with Monte Carlo radiative transfer.
Definition CD_Photon.H:29
Real & weight()
Get photon weight.
Definition CD_PhotonImplem.H:40
Implementation of ItoKMCStepper that uses a semi-implicit split-step formalism for advancing the Ito-...
Definition CD_ItoKMCGodunovStepper.H:29
virtual void setupSemiImplicitPoisson(const Real a_dt) noexcept
Set up the semi-implicit Poisson solver.
Definition CD_ItoKMCGodunovStepperImplem.H:1327
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:590
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:1361
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:1638
virtual void allocate() noexcept override
Allocate storage required for advancing the equations.
Definition CD_ItoKMCGodunovStepperImplem.H:74
bool m_readCheckpointParticles
If true, then the HDF5 checkpoint file contained particles that we can read.
Definition CD_ItoKMCGodunovStepper.H:164
virtual Real advance(const Real a_dt) override
Advance the Ito-Poisson-KMC system over a_dt.
Definition CD_ItoKMCGodunovStepperImplem.H:304
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:876
virtual void allocateInternals() noexcept override
Allocate "internal" storage.
Definition CD_ItoKMCGodunovStepperImplem.H:108
Real m_maxFieldAbort
Limit for maximum field abort.
Definition CD_ItoKMCGodunovStepper.H:225
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:1094
virtual void stepEulerMaruyamaCDR(const Real a_dt) noexcept
Step the CDR equations according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1724
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:1579
virtual void parseAlgorithm() noexcept
Parse advancement algorithm.
Definition CD_ItoKMCGodunovStepperImplem.H:178
virtual void postPlot() noexcept override
Perform post-plot operations.
Definition CD_ItoKMCGodunovStepperImplem.H:1880
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCGodunovStepperImplem.H:284
virtual void parseSecondaryEmissionSpecification() noexcept
Parse when secondary particles are emitted.
Definition CD_ItoKMCGodunovStepperImplem.H:253
virtual void parseFiltering() noexcept
Parse filter settings.
Definition CD_ItoKMCGodunovStepperImplem.H:203
virtual void parseRuntimeOptions() noexcept override
Parse run-time options.
Definition CD_ItoKMCGodunovStepperImplem.H:161
virtual bool solvePoisson() noexcept override
Solve the electrostatic problem.
Definition CD_ItoKMCGodunovStepperImplem.H:1455
bool m_canRegridOnRestart
If true, then the class supports regrid-on-restart.
Definition CD_ItoKMCGodunovStepper.H:170
virtual void computeFaceConductivity() noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1183
virtual ~ItoKMCGodunovStepper()
Destructor. Does nothing.
Definition CD_ItoKMCGodunovStepperImplem.H:49
bool m_extendConductivityEB
For achieving a slightly smoother gradient in the conductivity near the EB.
Definition CD_ItoKMCGodunovStepper.H:175
virtual void setOldPositions() noexcept
Set the starting positions for the ItoSolver particles.
Definition CD_ItoKMCGodunovStepperImplem.H:734
bool m_writeCheckpointParticles
If true, then the particles are checkpointed so we can regrid on checkpoint-restart.
Definition CD_ItoKMCGodunovStepper.H:159
virtual void remapPointParticles(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const SpeciesSubset a_subset) noexcept
Remap the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:770
virtual void computeSemiImplicitRho() noexcept
Set up the space charge density for the regrid operation.
Definition CD_ItoKMCGodunovStepperImplem.H:1213
virtual void advanceEulerMaruyama(const Real a_dt) noexcept
Advance the particles using the Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1494
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) noexcept override
Perform pre-regrid operations.
Definition CD_ItoKMCGodunovStepperImplem.H:551
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCGodunovStepperImplem.H:59
virtual void plotParticles() const noexcept
Utility function for plotting the ItoSolver particles. These are written in a particles folder.
Definition CD_ItoKMCGodunovStepperImplem.H:1894
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:1108
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:1401
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:988
virtual void parseCheckpointParticles() noexcept
Parse checkpoint-restart functionality.
Definition CD_ItoKMCGodunovStepperImplem.H:239
virtual void barrier() const noexcept
Set an MPI barrier if using debug mode.
Definition CD_ItoKMCGodunovStepperImplem.H:130
virtual void parseOptions() noexcept override
Parse options.
Definition CD_ItoKMCGodunovStepperImplem.H:144
virtual void stepEulerMaruyamaParticles(const Real a_dt) noexcept
Step the particles according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1678
Base time stepper class that advances the Ito-KMC-Poisson system of equations. If you want a differen...
Definition CD_ItoKMCStepper.H:60
virtual void parseRuntimeOptions() noexcept override
Parse runtime configurable options.
Definition CD_ItoKMCStepperImplem.H:109
std::string m_name
Time stepper name.
Definition CD_ItoKMCStepper.H:367
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCStepperImplem.H:1550
virtual void parseOptions() noexcept
Parse options.
Definition CD_ItoKMCStepperImplem.H:89
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:1598
Real m_prevDt
Previous time step.
Definition CD_ItoKMCStepper.H:506
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCStepperImplem.H:1421
virtual void allocateInternals() noexcept
Allocate "internal" storage.
Definition CD_ItoKMCStepperImplem.H:535
virtual void allocate() noexcept override
Allocate storage for solvers.
Definition CD_ItoKMCStepperImplem.H:517
A particle class that only has a position and a weight.
Definition CD_PointParticle.H:29
Real & weight()
Get weight.
Definition CD_PointParticleImplem.H:38
Class which is used for run-time monitoring of events.
Definition CD_Timer.H:31
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
virtual void remap()
Remap particles.
Definition CD_TracerParticleSolverImplem.H:338
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:735
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
virtual void preRegrid(const int a_lbase, const int a_oldFinestLevel)
Perform pre-regrid operations.
Definition CD_TracerParticleSolverImplem.H:306
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition CD_TracerParticleSolverImplem.H:662
virtual void allocate()
Allocate storage for this solver.
Definition CD_TracerParticleSolverImplem.H:194
int m_timeStep
Time step.
Definition CD_TracerParticleSolver.H:375
Real m_time
Time.
Definition CD_TracerParticleSolver.H:370
void writeH5Part(const std::string a_filename, const ParticleContainer< GenericParticle< M, N > > &a_particles, const std::vector< std::string > a_realVars=std::vector< std::string >(), const std::vector< std::string > a_vectVars=std::vector< std::string >(), const RealVect a_shift=RealVect::Zero, const Real a_time=0.0) noexcept
A shameless copy of Chombo's writeEBHDF5 but including the lower-left corner of the physical domain a...
Definition CD_DischargeIOImplem.H:29
void barrier() noexcept
MPI barrier.
Definition CD_ParallelOpsImplem.H:25
constexpr Real eps0
Permittivity of free space.
Definition CD_Units.H:29
constexpr Real Qe
Elementary charge.
Definition CD_Units.H:34