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";
50template <
typename I,
typename C,
typename R,
typename F>
53 CH_TIME(
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper");
54 if (this->m_verbosity > 5) {
55 pout() <<
"ItoKMCGodunovStepper::~ItoKMCGodunovStepper" <<
endl;
59template <
typename I,
typename C,
typename R,
typename F>
63 CH_TIME(
"ItoKMCGodunovStepper::registerOperators");
64 if (this->m_verbosity > 5) {
65 pout() <<
"ItoKMCGodunovStepper::registerOperators" <<
endl;
71 (this->m_amr)->registerOperator(s_particle_mesh, this->m_particleRealm, phase::solid);
74template <
typename I,
typename C,
typename R,
typename F>
78 CH_TIME(
"ItoKMCGodunovStepper::allocate");
79 if (this->m_verbosity > 5) {
80 pout() <<
"ItoKMCGodunovStepper::allocate" <<
endl;
102 (this->m_amr)->allocate(*m_conductivityParticles[
idx], this->m_particleRealm);
103 (this->m_amr)->allocate(*m_irregularParticles[
idx], this->m_particleRealm);
104 (this->m_amr)->allocate(*m_rhoDaggerParticles[
idx], this->m_particleRealm);
108template <
typename I,
typename C,
typename R,
typename F>
112 CH_TIME(
"ItoKMCGodunovStepper::allocateInternals");
113 if (this->m_verbosity > 5) {
114 pout() << this->m_name +
"::allocateInternals" <<
endl;
119 const int numCdrSpecies = this->m_physics->getNumCdrSpecies();
123 this->m_amr->
allocate(m_cdrDivD[
i], this->m_fluidRealm, this->m_plasmaPhase, 1);
126 this->m_amr->
allocate(m_semiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
127 this->m_amr->
allocate(m_semiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
130template <
typename I,
typename C,
typename R,
typename F>
134 CH_TIME(
"ItoKMCGodunovStepper::barrier");
135 if (this->m_verbosity > 5) {
136 pout() << this->m_name +
"::barrier" <<
endl;
139 if ((this->m_profile)) {
144template <
typename I,
typename C,
typename R,
typename F>
148 CH_TIME(
"ItoKMCGodunovStepper::parseOptions");
149 if (this->m_verbosity > 5) {
150 pout() << this->m_name +
"::parseOptions" <<
endl;
155 this->parseAlgorithm();
156 this->parseFiltering();
157 this->parseCheckpointParticles();
158 this->parseSecondaryEmissionSpecification();
161template <
typename I,
typename C,
typename R,
typename F>
165 CH_TIME(
"ItoKMCGodunovStepper::parseRuntimeOptions");
166 if (this->m_verbosity > 5) {
167 pout() << this->m_name +
"::parseRuntimeOptions" <<
endl;
172 this->parseAlgorithm();
173 this->parseFiltering();
174 this->parseCheckpointParticles();
175 this->parseSecondaryEmissionSpecification();
178template <
typename I,
typename C,
typename R,
typename F>
182 CH_TIME(
"ItoKMCGodunovStepper::parseAlgorithm");
183 if (this->m_verbosity > 5) {
184 pout() << this->m_name +
"::parseAlgorithm" <<
endl;
190 pp.get(
"extend_conductivity", m_extendConductivityEB);
191 pp.get(
"algorithm",
str);
192 pp.get(
"abort_max_field", m_maxFieldAbort);
195 if (
str ==
"euler_maruyama") {
196 m_algorithm = WhichAlgorithm::EulerMaruyama;
199 MayDay::Abort(
"ItoKMCGodunovStepper::parseAlgorithm - unknown algorithm requested");
203template <
typename I,
typename C,
typename R,
typename F>
207 CH_TIME(
"ItoKMCGodunovStepper::parseFiltering");
208 if (this->m_verbosity > 5) {
209 pout() << this->m_name +
"::parseFiltering" <<
endl;
216 m_rhoFilterMaxStride = 1;
217 m_rhoFilterAlpha = 0.5;
219 m_condFilterNum = -1;
220 m_condFilterMaxStride = 1;
221 m_condFilterAlpha = 0.5;
223 pp.get(
"rho_filter_num", m_rhoFilterNum);
224 pp.get(
"rho_filter_max_stride", m_rhoFilterMaxStride);
225 pp.get(
"rho_filter_alpha", m_rhoFilterAlpha);
227 pp.get(
"cond_filter_num", m_condFilterNum);
228 pp.get(
"cond_filter_max_stride", m_condFilterMaxStride);
229 pp.get(
"cond_filter_alpha", m_condFilterAlpha);
232 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for rho_filter");
235 MayDay::Abort(
"ItoKMCGodunovStepper::parseFiltering -- cannot have alpha <= 0 or alpha >= 1 for cond_filter");
239template <
typename I,
typename C,
typename R,
typename F>
243 CH_TIME(
"ItoKMCGodunovStepper::parseCheckpointParticles");
244 if (this->m_verbosity > 5) {
245 pout() << this->m_name +
"::parseCheckpointParticles" <<
endl;
250 pp.query(
"checkpoint_particles", m_writeCheckpointParticles);
253template <
typename I,
typename C,
typename R,
typename F>
257 CH_TIME(
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecifiation");
258 if (this->m_verbosity > 5) {
259 pout() << this->m_name +
"::parseSecondaryEmissionSpecification" <<
endl;
266 pp.query(
"secondary_emission",
str);
268 if (
str ==
"before_reactions") {
269 m_emitSecondaryParticlesBeforeReactions =
true;
271 else if (
str ==
"after_reactions") {
272 m_emitSecondaryParticlesBeforeReactions =
false;
277 err =
"ItoKMCGodunovStepper::parseSecondaryEmissionSpecification - expected 'before_reactions' or 'after_reactions'";
284template <
typename I,
typename C,
typename R,
typename F>
288 CH_TIME(
"ItoKMCGodunovStepper::computeDt");
289 if (this->m_verbosity > 5) {
290 pout() << this->m_name +
"::computeDt" <<
endl;
295 if ((this->m_maxReducedField > m_maxFieldAbort) && (m_maxFieldAbort > 0.0)) {
296 pout() << this->m_name +
" stopping because maximum field is too high (" << this->m_maxReducedField <<
")" <<
endl;
298 this->m_keepGoing =
false;
304template <
typename I,
typename C,
typename R,
typename F>
308 CH_TIME(
"ItoKMCGodunovStepper::advance");
309 if (this->m_verbosity > 5) {
310 pout() << this->m_name +
"::advance" <<
endl;
314 const Real Qtot = this->computeTotalCharge();
324 m_canRegridOnRestart =
true;
326 m_timer =
Timer(
"ItoKMCGodunovStepper::advance");
331 this->m_prevDt =
a_dt;
334 m_timer.startEvent(
"Deposit photons");
343 m_timer.stopEvent(
"Deposit photons");
347 switch (m_algorithm) {
348 case WhichAlgorithm::EulerMaruyama: {
349 this->advanceEulerMaruyama(
a_dt);
362 m_timer.startEvent(
"EB/Particle intersection");
363 if (m_extendConductivityEB) {
376 return p.tmpReal() < 0.0;
380 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
381 ParticleOps::setData<ItoParticle>(
it()->getParticles(ItoSolver::WhichContainer::Bulk),
setFlag);
385 const bool deleteParticles =
false;
386 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles,
nonDeletionModifier);
389 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
394 const int Z =
species->getChargeNumber();
403 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
409#pragma omp parallel for schedule(runtime)
433 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
439 const bool deleteParticles =
true;
441 this->intersectParticles(SpeciesSubset::AllMobileOrDiffusive, deleteParticles);
446 for (
auto it = this->m_ito->iterator();
it.ok(); ++
it) {
454 m_timer.stopEvent(
"EB/Particle intersection");
459 m_timer.startEvent(
"Photon transport");
461 m_timer.stopEvent(
"Photon transport");
464 if ((this->m_physics)->needGradients()) {
465 m_timer.startEvent(
"Gradient calculation");
466 (this->m_ito)->depositParticles();
467 this->computeDensityGradients();
468 m_timer.stopEvent(
"Gradient calculation");
473 if (m_emitSecondaryParticlesBeforeReactions) {
475 m_timer.startEvent(
"EB particle injection");
476 this->fillSecondaryEmissionEB(
a_dt);
477 this->resolveSecondaryEmissionEB(
a_dt);
478 m_timer.stopEvent(
"EB particle injection");
483 m_timer.startEvent(
"Sort by cell");
484 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
485 this->sortPhotonsByCell(McPhoto::WhichContainer::Bulk);
486 this->sortPhotonsByCell(McPhoto::WhichContainer::Source);
487 m_timer.stopEvent(
"Sort by cell");
491 m_timer.startEvent(
"Reaction network");
492 this->advanceReactionNetwork(
a_dt);
493 m_timer.stopEvent(
"Reaction network");
497 m_timer.startEvent(
"Sort by patch");
498 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
499 this->sortPhotonsByPatch(McPhoto::WhichContainer::Bulk);
500 this->sortPhotonsByPatch(McPhoto::WhichContainer::Source);
501 m_timer.stopEvent(
"Sort by patch");
505 if (!m_emitSecondaryParticlesBeforeReactions) {
507 m_timer.startEvent(
"EB particle injection");
508 this->fillSecondaryEmissionEB(
a_dt);
509 this->resolveSecondaryEmissionEB(
a_dt);
510 m_timer.stopEvent(
"EB particle injection");
516 m_timer.startEvent(
"Remove covered");
517 this->removeCoveredParticles(SpeciesSubset::AllMobileOrDiffusive, EBRepresentation::Discrete, this->m_toleranceEB);
518 m_timer.stopEvent(
"Remove covered");
522 solverIt()->clear(ItoSolver::WhichContainer::EB);
523 solverIt()->clear(ItoSolver::WhichContainer::Domain);
528 m_timer.startEvent(
"Post-compute v");
529 this->computeDriftVelocities();
530 m_timer.stopEvent(
"Post-compute v");
533 m_timer.startEvent(
"Post-compute D");
534 this->computeDiffusionCoefficients();
535 m_timer.stopEvent(
"Post-compute D");
537 this->computePhysicsDt();
539 if ((this->m_profile)) {
540 m_timer.eventReport(
pout(),
false);
546 this->m_maxReducedField = this->computeMaxReducedElectricField(this->m_plasmaPhase);
551template <
typename I,
typename C,
typename R,
typename F>
555 CH_TIME(
"ItoKMCGodunovStepper::preRegrid");
556 if (this->m_verbosity > 5) {
557 pout() <<
"ItoKMCGodunovStepper::preRegrid" <<
endl;
560 const int numItoSpecies = (this->m_physics)->getNumItoSpecies();
561 const int numCdrSpecies = (this->m_physics)->getNumCdrSpecies();
575 this->m_amr->
allocate(m_scratchSemiImplicitRhoCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
576 this->m_amr->
allocate(m_scratchSemiImplicitConductivityCDR, this->m_fluidRealm, this->m_plasmaPhase, 1);
578 DataOps::copy(m_scratchSemiImplicitRhoCDR, m_semiImplicitRhoCDR);
579 DataOps::copy(m_scratchSemiImplicitConductivityCDR, m_semiImplicitConductivityCDR);
583 m_cdrDivD[
i].clear();
586 m_semiImplicitRhoCDR.clear();
587 m_semiImplicitConductivityCDR.clear();
590template <
typename I,
typename C,
typename R,
typename F>
596 CH_TIME(
"ItoKMCGodunovStepper::regrid");
597 if (this->m_verbosity > 5) {
598 pout() <<
"ItoKMCGodunovStepper::regrid" <<
endl;
601 m_timer =
Timer(
"ItoKMCGodunovStepper::regrid");
605 if (!m_canRegridOnRestart) {
607 const std::string err1 =
"checkpoint file does not contain particles. Set Driver.initial_regrids=0";
615 m_timer.startEvent(
"Regrid ItoSolver");
617 if (this->m_timeStep == 0) {
621 (this->m_ito)->depositParticles();
623 m_timer.stopEvent(
"Regrid ItoSolver");
625 m_timer.startEvent(
"Regrid CdrSolver");
627 m_timer.stopEvent(
"Regrid CdrSolver");
629 m_timer.startEvent(
"Regrid FieldSolver");
631 m_timer.stopEvent(
"Regrid FieldSolver");
633 m_timer.startEvent(
"Regrid RTE");
635 m_timer.stopEvent(
"Regrid RTE");
637 m_timer.startEvent(
"Regrid SurfaceODESolver");
639 m_timer.stopEvent(
"Regrid SurfaceODESolver");
642 m_timer.startEvent(
"Allocate internals");
643 this->allocateInternals();
644 m_timer.stopEvent(
"Allocate internals");
647 m_timer.startEvent(
"Remap algorithm-particles");
654 m_timer.stopEvent(
"Remap algorithm-particles");
657 this->m_amr->interpToNewGrids(m_semiImplicitRhoCDR,
658 m_scratchSemiImplicitRhoCDR,
663 EBCoarseToFineInterp::Type::ConservativePWC);
665 this->m_amr->interpToNewGrids(m_semiImplicitConductivityCDR,
666 m_scratchSemiImplicitConductivityCDR,
671 EBCoarseToFineInterp::Type::ConservativePWC);
675 m_timer.startEvent(
"Setup field solver");
676 (this->m_fieldSolver)->setupSolver();
677 this->computeConductivities(m_conductivityParticles);
678 this->setupSemiImplicitPoisson(this->m_prevDt);
679 m_timer.stopEvent(
"Setup field solver");
682 m_timer.startEvent(
"Solve Poisson");
683 if (this->m_timeStep == 0) {
684 this->computeSpaceChargeDensity();
687 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::All);
688 this->computeSemiImplicitRho();
691 const bool converged = this->solvePoisson();
694 const std::string errMsg =
"ItoKMCGodunovStepper::regrid - Poisson solve did not converge after regrid";
698 if (this->m_abortOnFailure) {
699 MayDay::Error(
errMsg.c_str());
702 m_timer.stopEvent(
"Solve Poisson");
705 if (this->m_regridSuperparticles) {
706 m_timer.startEvent(
"Make superparticles");
707 (this->m_ito)->organizeParticlesByCell(ItoSolver::WhichContainer::Bulk);
708 (this->m_ito)->makeSuperparticles(ItoSolver::WhichContainer::Bulk, (this->m_particlesPerCell));
709 (this->m_ito)->organizeParticlesByPatch(ItoSolver::WhichContainer::Bulk);
710 m_timer.stopEvent(
"Make superparticles");
714 m_timer.startEvent(
"Deposit particles");
715 (this->m_ito)->depositParticles();
716 m_timer.stopEvent(
"Deposit particles");
719 m_timer.startEvent(
"Prepare next step");
720 this->computeDiffusionCoefficients();
721 this->computeDriftVelocities();
722 m_timer.stopEvent(
"Prepare next step");
724 m_timer.eventReport(
pout(),
false);
727 m_scratchSemiImplicitRhoCDR.clear();
728 m_scratchSemiImplicitConductivityCDR.clear();
731 this->fillNeutralDensity();
734template <
typename I,
typename C,
typename R,
typename F>
738 CH_TIME(
"ItoKMCGodunovStepper::setOldPositions");
739 if (this->m_verbosity > 5) {
740 pout() << this->m_name +
"::setOldPositions" <<
endl;
746 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
754#pragma omp parallel for schedule(runtime)
770template <
typename I,
typename C,
typename R,
typename F>
776 CH_TIME(
"ItoKMCGodunovStepper::remapPointParticles");
777 if (this->m_verbosity > 5) {
778 pout() << this->m_name +
"::remapPointParticles" <<
endl;
792 case SpeciesSubset::All: {
797 case SpeciesSubset::AllMobile: {
804 case SpeciesSubset::AllDiffusive: {
811 case SpeciesSubset::AllMobileOrDiffusive: {
818 case SpeciesSubset::AllMobileAndDiffusive: {
825 case SpeciesSubset::Charged: {
832 case SpeciesSubset::ChargedMobile: {
839 case SpeciesSubset::ChargedDiffusive: {
846 case SpeciesSubset::ChargedMobileOrDiffusive: {
853 case SpeciesSubset::ChargedMobileAndDiffusive: {
860 case SpeciesSubset::Stationary: {
868 MayDay::Abort(
"ItoKMCGodunovStepper::remapPointParticles - logic bust");
876template <
typename I,
typename C,
typename R,
typename F>
882 CH_TIME(
"ItoKMCGodunovStepper::depositPointParticles");
883 if (this->m_verbosity > 5) {
884 pout() << this->m_name +
"::depositPointParticles" <<
endl;
898 case SpeciesSubset::All: {
903 case SpeciesSubset::AllMobile: {
911 case SpeciesSubset::AllDiffusive: {
919 case SpeciesSubset::AllMobileOrDiffusive: {
926 case SpeciesSubset::AllMobileAndDiffusive: {
933 case SpeciesSubset::Charged: {
940 case SpeciesSubset::ChargedMobile: {
947 case SpeciesSubset::ChargedDiffusive: {
955 case SpeciesSubset::ChargedMobileOrDiffusive: {
963 case SpeciesSubset::ChargedMobileAndDiffusive: {
971 case SpeciesSubset::Stationary: {
980 MayDay::Abort(
"ItoKMCGodunovStepper::depositPointParticles - logic bust");
988template <
typename I,
typename C,
typename R,
typename F>
994 CH_TIME(
"ItoKMCGodunovStepper::clearPointParticles");
995 if (this->m_verbosity > 5) {
996 pout() << this->m_name +
"::clearPointParticles" <<
endl;
1010 case SpeciesSubset::All: {
1015 case SpeciesSubset::AllMobile: {
1022 case SpeciesSubset::AllDiffusive: {
1029 case SpeciesSubset::AllMobileOrDiffusive: {
1036 case SpeciesSubset::AllMobileAndDiffusive: {
1043 case SpeciesSubset::Charged: {
1050 case SpeciesSubset::ChargedMobile: {
1057 case SpeciesSubset::ChargedDiffusive: {
1064 case SpeciesSubset::ChargedMobileOrDiffusive: {
1071 case SpeciesSubset::ChargedMobileAndDiffusive: {
1078 case SpeciesSubset::Stationary: {
1086 MayDay::Abort(
"ItoKMCGodunovStepper::clearPointParticles - logic bust");
1094template <
typename I,
typename C,
typename R,
typename F>
1099 CH_TIME(
"ItoKMCGodunovStepper::computeConductivities");
1100 if (this->m_verbosity > 5) {
1101 pout() << this->m_name +
"::computeConductivities" <<
endl;
1104 this->computeCellConductivity((this->m_conductivityCell),
a_particles);
1105 this->computeFaceConductivity();
1108template <
typename I,
typename C,
typename R,
typename F>
1114 CH_TIME(
"ItoKMCGodunovStepper::computeCellConductivity(EBAMRCellData, PointParticle");
1115 if (this->m_verbosity > 5) {
1116 pout() << this->m_name +
"::computeCellConductivity(EBAMRCellData, PointParticle)" <<
endl;
1127 const int Z =
species->getChargeNumber();
1129 if (
Z != 0 &&
solver->isMobile()) {
1136 (this->m_amr)->copyData(this->m_fluidScratch1, this->m_particleScratch1);
1147 const int index =
solverIt.index();
1148 const int Z =
species->getChargeNumber();
1150 if (
Z != 0 &&
solver->isMobile()) {
1165 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1166 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1169 if (m_condFilterNum > 0 && m_condFilterMaxStride > 0) {
1170 for (
int i = 0;
i < m_condFilterNum;
i++) {
1174 (this->m_amr)->arithmeticAverage(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1175 (this->m_amr)->interpGhostPwl(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1180 (this->m_amr)->interpToCentroids(
a_conductivityCell, this->m_fluidRealm, (this->m_plasmaPhase));
1183template <
typename I,
typename C,
typename R,
typename F>
1187 CH_TIME(
"ItoKMCGodunovStepper::computeFaceConductivity");
1188 if (this->m_verbosity > 5) {
1189 pout() << this->m_name +
"::computeFaceConductivity" <<
endl;
1197 const Average average = Average::Arithmetic;
1202 (this->m_conductivityCell),
1203 (this->m_amr)->getDomains(),
1210 DataOps::incr((this->m_conductivityEB), (this->m_conductivityCell), 1.0);
1213template <
typename I,
typename C,
typename R,
typename F>
1217 CH_TIMERS(
"ItoKMCGodunovStepper::computeSemiImplicitRho");
1218 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::plasma_phase",
t1);
1219 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::solid_phase",
t2);
1220 CH_TIMER(
"ItoKMCGodunovStepper::computeSemiImplicitRho::filter",
t3);
1221 if (this->m_verbosity > 5) {
1222 pout() << this->m_name +
"::computeSemiImplicitRho" <<
endl;
1226 CH_assert(this->m_plasmaPhase == phase::gas);
1238 rhoSolid = (this->m_amr)->alias(phase::solid,
rho);
1248 const int Z =
species->getChargeNumber();
1251 (this->m_amr)->copyData(this->m_fluidScratch1,
solver->getPhi());
1270 (this->m_amr)->allocate(
particleScratch, this->m_particleRealm, phase::solid, 1);
1271 (this->m_amr)->allocate(
fluidScratch, this->m_fluidRealm, phase::solid, 1);
1276 const int Z =
species->getChargeNumber();
1285 this->m_particleRealm,
1287 *m_rhoDaggerParticles[
solverIt.index()],
1288 DepositionType::CIC,
1289 CoarseFineDeposition::Halo,
1302 this->m_amr->arithmeticAverage(
rho, this->m_fluidRealm);
1303 this->m_amr->interpGhostPwl(
rho, this->m_fluidRealm);
1306 if (m_rhoFilterNum > 0 && m_rhoFilterMaxStride > 0) {
1308 for (
int i = 0;
i < m_rhoFilterNum;
i++) {
1313 this->m_amr->arithmeticAverage(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1314 this->m_amr->interpGhost(
rhoGas, this->m_fluidRealm, this->m_plasmaPhase);
1321 this->m_amr->interpToCentroids(
rhoGas, this->m_fluidRealm, phase::gas);
1323 this->m_amr->interpToCentroids(
rhoSolid, this->m_fluidRealm, phase::solid);
1327template <
typename I,
typename C,
typename R,
typename F>
1331 CH_TIME(
"ItoKMCGodunovStepper::setupSemiImplicitPoisson");
1332 if (this->m_verbosity > 5) {
1333 pout() << this->m_name +
"::setupSemiImplicitPoisson" <<
endl;
1337 (this->m_fieldSolver)->setPermittivities();
1354 (this->m_amr)->arithmeticAverage(
permFaceGas, this->m_fluidRealm, (this->m_plasmaPhase));
1355 (this->m_amr)->arithmeticAverage(
permEBGas, this->m_fluidRealm, (this->m_plasmaPhase));
1361template <
typename I,
typename C,
typename R,
typename F>
1368 CH_TIME(
"ItoKMCGodunovStepper::removeCoveredPointParticles");
1369 if (this->m_verbosity > 5) {
1370 pout() << this->m_name +
"::removeCoveredPointParticles" <<
endl;
1378 case EBRepresentation::Discrete: {
1383 case EBRepresentation::ImplicitFunction: {
1388 case EBRepresentation::Voxel: {
1389 (this->m_amr)->removeCoveredParticlesVoxels(
particles, (this->m_plasmaPhase));
1394 MayDay::Error(
"ItoKMCGodunovStepper::removeCoveredParticles - logic bust");
1401template <
typename I,
typename C,
typename R,
typename F>
1406 CH_TIME(
"ItoKMCGodunovStepper::copyConductivityParticles");
1407 if (this->m_verbosity > 5) {
1408 pout() << this->m_name +
"::copyConductivityParticles" <<
endl;
1419 const int Z =
species->getChargeNumber();
1421 if (
Z != 0 &&
solver->isMobile()) {
1424 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1430#pragma omp parallel for schedule(runtime)
1455template <
typename I,
typename C,
typename R,
typename F>
1459 CH_TIME(
"ItoKMCGodunovStepper::solvePoisson()");
1460 if (this->m_verbosity > 5) {
1461 pout() << this->m_name +
"::solvePoisson()" <<
endl;
1471 (this->m_fieldSolver)->computeElectricField();
1476 (this->m_amr)->allocatePointer(
E, this->m_fluidRealm);
1477 (this->m_amr)->alias(
E, this->m_plasmaPhase, (this->m_fieldSolver)->getElectricField());
1480 (this->m_amr)->copyData(this->m_electricFieldFluid,
E);
1481 (this->m_amr)->conservativeAverage(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1482 (this->m_amr)->interpGhostPwl(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1483 (this->m_amr)->interpToCentroids(this->m_electricFieldFluid, this->m_fluidRealm, this->m_plasmaPhase);
1486 (this->m_amr)->copyData(this->m_electricFieldParticle,
E);
1487 (this->m_amr)->conservativeAverage(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1488 (this->m_amr)->interpGhostPwl(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1489 (this->m_amr)->interpToCentroids(this->m_electricFieldParticle, this->m_particleRealm, this->m_plasmaPhase);
1494template <
typename I,
typename C,
typename R,
typename F>
1498 CH_TIME(
"ItoKMCGodunovStepper::advanceEulerMaruyama");
1499 if (this->m_verbosity > 5) {
1500 pout() << this->m_name +
"::advanceEulerMaruyama" <<
endl;
1504 this->setOldPositions();
1509 m_timer.startEvent(
"Diffuse particles");
1510 this->diffuseParticlesEulerMaruyama(m_rhoDaggerParticles,
a_dt);
1511 this->remapPointParticles(m_rhoDaggerParticles, SpeciesSubset::ChargedDiffusive);
1512 m_timer.stopEvent(
"Diffuse particles");
1516 m_timer.startEvent(
"Diffuse CDR");
1517 this->computeDiffusionTermCDR(m_semiImplicitRhoCDR,
a_dt);
1518 m_timer.stopEvent(
"Diffuse CDR");
1522 m_timer.startEvent(
"Compute conductivities");
1523 this->copyConductivityParticles(m_conductivityParticles);
1524 this->computeConductivities(m_conductivityParticles);
1525 m_timer.stopEvent(
"Compute conductivities");
1529 m_timer.startEvent(
"Setup Poisson");
1530 this->setupSemiImplicitPoisson(
a_dt);
1531 m_timer.stopEvent(
"Setup Poisson");
1536 m_timer.startEvent(
"Deposit point particles");
1537 this->depositPointParticles(m_rhoDaggerParticles, SpeciesSubset::Charged);
1538 this->computeSemiImplicitRho();
1539 m_timer.stopEvent(
"Deposit point particles");
1543 m_timer.startEvent(
"Solve Poisson");
1544 const bool converged = this->solvePoisson();
1546 const std::string errMsg =
"ItoKMCGodunovStepper::advanceEulerMaruyama - Poisson solve did not converge";
1550 if (this->m_abortOnFailure) {
1551 MayDay::Error(
errMsg.c_str());
1554 m_timer.stopEvent(
"Solve Poisson");
1559 m_timer.startEvent(
"Step-compute v");
1561 this->setCdrVelocityFunctions();
1562 this->setItoVelocityFunctions();
1563 (this->m_ito)->interpolateVelocities();
1564 this->multiplyCdrVelocitiesByMobilities();
1566 this->computeDriftVelocities();
1568 m_timer.stopEvent(
"Step-compute v");
1572 m_timer.startEvent(
"Euler-Maruyama step");
1573 this->stepEulerMaruyamaParticles(
a_dt);
1574 this->remapParticles(SpeciesSubset::AllMobileOrDiffusive);
1575 this->stepEulerMaruyamaCDR(
a_dt);
1576 m_timer.stopEvent(
"Euler-Maruyama step");
1579template <
typename I,
typename C,
typename R,
typename F>
1585 CH_TIME(
"ItoKMCGodunovStepper::diffuseParticlesEulerMaruyama");
1586 if (this->m_verbosity > 5) {
1587 pout() << this->m_name +
"::diffuseParticlesEulerMaruyama" <<
endl;
1600 const int Z =
species->getChargeNumber();
1604 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1612#pragma omp parallel for schedule(runtime)
1638template <
typename I,
typename C,
typename R,
typename F>
1642 CH_TIME(
"ItoKMCGodunovStepper::diffuseCDREulerMaruyama");
1643 if (this->m_verbosity > 5) {
1644 pout() << this->m_name +
"::diffuseCDREulerMaruyama" <<
endl;
1653 const int index =
solverIt.index();
1654 const int Z =
species->getChargeNumber();
1659 if (
solver->isDiffusive()) {
1660 solver->computeDivD(m_cdrDivD[index],
solver->getPhi(),
false,
false,
false);
1666 if (
solver->isDiffusive()) {
1678template <
typename I,
typename C,
typename R,
typename F>
1682 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaParticles");
1683 if (this->m_verbosity > 5) {
1684 pout() << this->m_name +
"::stepEulerMaruyamaParticles" <<
endl;
1697 for (
int lvl = 0;
lvl <= (this->m_amr)->getFinestLevel();
lvl++) {
1705#pragma omp parallel for schedule(runtime)
1724template <
typename I,
typename C,
typename R,
typename F>
1728 CH_TIME(
"ItoKMCGodunovStepper::stepEulerMaruyamaCDR");
1729 if (this->m_verbosity > 5) {
1730 pout() << this->m_name +
"::stepEulerMaruyamaCDR" <<
endl;
1736 const int index =
solverIt.index();
1740 this->m_amr->conservativeAverage(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1741 this->m_amr->interpGhostPwl(
phi, this->m_fluidRealm, this->m_plasmaPhase);
1744 if (
solver->isMobile()) {
1749 solver->computeDivF(this->m_fluidScratch1,
phi, 0.5 *
a_dt,
false,
true,
true);
1755 if (
solver->isDiffusive()) {
1762 this->coarsenCDRSolvers();
1766template <
typename I,
typename C,
typename R,
typename F>
1770 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointHeader");
1771 if (this->m_verbosity > 5) {
1772 pout() << this->m_name +
"::writeCheckpointHeader" <<
endl;
1775 a_header.m_real[
"prev_dt"] = this->m_prevDt;
1776 a_header.m_real[
"physics_dt"] = this->m_physicsDt;
1777 a_header.m_int[
"checkpoint_particles"] = m_writeCheckpointParticles ? 1 : 0;
1782template <
typename I,
typename C,
typename R,
typename F>
1786 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointHeader");
1787 if (this->m_verbosity > 5) {
1788 pout() << this->m_name +
"::readCheckpointHeader" <<
endl;
1791 this->m_prevDt =
a_header.m_real[
"prev_dt"];
1792 this->m_physicsDt =
a_header.m_real[
"physics_dt"];
1794 m_readCheckpointParticles = (
a_header.m_int[
"checkpoint_particles"] != 0) ?
true :
false;
1795 m_canRegridOnRestart = m_readCheckpointParticles;
1800template <
typename I,
typename C,
typename R,
typename F>
1804 CH_TIME(
"ItoKMCGodunovStepper::writeCheckpointData");
1805 if (this->m_verbosity > 5) {
1806 pout() << this->m_name +
"::writeCheckpointData" <<
endl;
1812 if (m_writeCheckpointParticles) {
1813 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1826 if (this->m_physics->getNumCdrSpecies() > 0) {
1827 write(
a_handle, *m_semiImplicitRhoCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitRhoCDR");
1828 write(
a_handle, *m_semiImplicitConductivityCDR[
a_lvl],
"ItoKMCGodunovStepper::semiImplicitConductivityCDR");
1834template <
typename I,
typename C,
typename R,
typename F>
1838 CH_TIME(
"ItoKMCGodunovStepper::readCheckpointData");
1839 if (this->m_verbosity > 5) {
1840 pout() << this->m_name +
"::readCheckpointData" <<
endl;
1846 if (m_readCheckpointParticles) {
1847 for (
int i = 0;
i < (this->m_physics)->getNumItoSpecies();
i++) {
1860 if (this->m_physics->getNumCdrSpecies() > 0) {
1864 *m_semiImplicitRhoCDR[
a_lvl],
1865 "ItoKMCGodunovStepper::semiImplicitRhoCDR",
1866 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1871 *m_semiImplicitConductivityCDR[
a_lvl],
1872 "ItoKMCGodunovStepper::semiImplicitConductivityCDR",
1873 this->m_amr->getGrids(
this->m_fluidRealm)[
a_lvl],
1880template <
typename I,
typename C,
typename R,
typename F>
1884 CH_TIME(
"ItoKMCGodunovStepper::postPlot");
1885 if (this->m_verbosity > 5) {
1886 pout() << this->m_name +
"::postPlot" <<
endl;
1889 this->m_physicsPlotVariables.clear();
1891 this->plotParticles();
1894template <
typename I,
typename C,
typename R,
typename F>
1898 CH_TIME(
"ItoKMCGodunovStepper::plotParticles");
1899 if (this->m_verbosity > 2) {
1900 pout() << this->m_name +
"::plotParticles" <<
endl;
1903 bool plotParticles =
false;
1907 pp.query(
"plot_particles", plotParticles);
1909 if (plotParticles) {
1923 MayDay::Error(
"ItoKMCGodunovStepper::plotParticles - could not create 'particles' directory");
1936 this->m_amr->getProbLo(),
1942#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:1329
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:592
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:1363
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:1640
virtual void allocate() noexcept override
Allocate storage required for advancing the equations.
Definition CD_ItoKMCGodunovStepperImplem.H:76
bool m_readCheckpointParticles
If true, then the HDF5 checkpoint file contained particles that we can read.
Definition CD_ItoKMCGodunovStepper.H:166
virtual Real advance(const Real a_dt) override
Advance the Ito-Poisson-KMC system over a_dt.
Definition CD_ItoKMCGodunovStepperImplem.H:306
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:878
virtual void allocateInternals() noexcept override
Allocate "internal" storage.
Definition CD_ItoKMCGodunovStepperImplem.H:110
Real m_maxFieldAbort
Limit for maximum field abort.
Definition CD_ItoKMCGodunovStepper.H:227
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:1096
virtual void stepEulerMaruyamaCDR(const Real a_dt) noexcept
Step the CDR equations according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1726
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:1581
virtual void parseAlgorithm() noexcept
Parse advancement algorithm.
Definition CD_ItoKMCGodunovStepperImplem.H:180
virtual void postPlot() noexcept override
Perform post-plot operations.
Definition CD_ItoKMCGodunovStepperImplem.H:1882
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCGodunovStepperImplem.H:286
virtual void parseSecondaryEmissionSpecification() noexcept
Parse when secondary particles are emitted.
Definition CD_ItoKMCGodunovStepperImplem.H:255
virtual void parseFiltering() noexcept
Parse filter settings.
Definition CD_ItoKMCGodunovStepperImplem.H:205
virtual void parseRuntimeOptions() noexcept override
Parse run-time options.
Definition CD_ItoKMCGodunovStepperImplem.H:163
virtual bool solvePoisson() noexcept override
Solve the electrostatic problem.
Definition CD_ItoKMCGodunovStepperImplem.H:1457
bool m_canRegridOnRestart
If true, then the class supports regrid-on-restart.
Definition CD_ItoKMCGodunovStepper.H:172
virtual void computeFaceConductivity() noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1185
virtual ~ItoKMCGodunovStepper()
Destructor. Does nothing.
Definition CD_ItoKMCGodunovStepperImplem.H:51
bool m_extendConductivityEB
For achieving a slightly smoother gradient in the conductivity near the EB.
Definition CD_ItoKMCGodunovStepper.H:177
virtual void setOldPositions() noexcept
Set the starting positions for the ItoSolver particles.
Definition CD_ItoKMCGodunovStepperImplem.H:736
bool m_writeCheckpointParticles
If true, then the particles are checkpointed so we can regrid on checkpoint-restart.
Definition CD_ItoKMCGodunovStepper.H:161
virtual void remapPointParticles(Vector< RefCountedPtr< ParticleContainer< PointParticle > > > &a_particles, const SpeciesSubset a_subset) noexcept
Remap the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:772
virtual void computeSemiImplicitRho() noexcept
Set up the space charge density for the regrid operation.
Definition CD_ItoKMCGodunovStepperImplem.H:1215
virtual void advanceEulerMaruyama(const Real a_dt) noexcept
Advance the particles using the Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1496
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) noexcept override
Perform pre-regrid operations.
Definition CD_ItoKMCGodunovStepperImplem.H:553
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCGodunovStepperImplem.H:61
virtual void plotParticles() const noexcept
Utility function for plotting the ItoSolver particles. These are written in a particles folder.
Definition CD_ItoKMCGodunovStepperImplem.H:1896
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:1110
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:1403
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:990
virtual void parseCheckpointParticles() noexcept
Parse checkpoint-restart functionality.
Definition CD_ItoKMCGodunovStepperImplem.H:241
virtual void barrier() const noexcept
Set an MPI barrier if using debug mode.
Definition CD_ItoKMCGodunovStepperImplem.H:132
virtual void parseOptions() noexcept override
Parse options.
Definition CD_ItoKMCGodunovStepperImplem.H:146
virtual void stepEulerMaruyamaParticles(const Real a_dt) noexcept
Step the particles according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1680
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:1599
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