chombo-discharge
Loading...
Searching...
No Matches
CD_TracerParticleSolverImplem.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_TRACERPARTICLESOLVERIMPLEM_H
14#define CD_TRACERPARTICLESOLVERIMPLEM_H
15
16// Chombo includes
17#include <ParmParse.H>
18
19// Our includes
21#include <CD_DischargeIO.H>
22#include <CD_ParallelOps.H>
23#include <CD_NamespaceHeader.H>
24
25template <typename P>
27{
28 CH_TIME("TracerParticleSolver::TracerParticleSolver()");
29
30 // Default settings
31 m_verbosity = -1;
32 m_name = "TracerParticleSolver";
33 m_className = "TracerParticleSolver";
36 m_plotVelocity = true;
37 m_plotWeight = true;
38 m_volumeScale = false;
39 m_deposition = DepositionType::CIC;
40 m_interpolation = DepositionType::CIC;
41 m_coarseFineDeposition = CoarseFineDeposition::Transition;
42}
43
44template <typename P>
48{
49 CH_TIME("TracerParticleSolver::TracerParticleSolver(RefCountedPtr<AmrMesh>, RefCountedPtr<ComputationalGeometry>)");
50
51 m_amr = a_amr;
53}
54
55template <typename P>
57{
58 CH_TIME("TracerParticleSolver::~TracerParticleSolver()");
59}
60
61template <typename P>
62inline void
64{
65 CH_TIME("TracerParticleSolver::parseOptions()");
66 if (m_verbosity > 5) {
67 pout() << m_name + "::parseOptions()" << endl;
68 }
69
70 this->parseDeposition();
71 this->parsePlotVariables();
72 this->parseVerbosity();
73}
74
75template <typename P>
76inline void
78{
79 CH_TIME("TracerParticleSolver::parseRuntimeOptions()");
80 if (m_verbosity > 5) {
81 pout() << m_name + "::parseRuntimeOptions()" << endl;
82 }
83
84 this->parseDeposition();
85 this->parsePlotVariables();
86 this->parseVerbosity();
87}
88
89template <typename P>
90inline void
92{
93 CH_TIME("TracerParticleSolver::parseDeposition()");
94 if (m_verbosity > 5) {
95 pout() << m_name + "::parseDeposition()" << endl;
96 }
97
98 ParmParse pp(m_className.c_str());
99
101
102 // Deposition for particle-mesh operations
103 pp.get("deposition", str);
104 if (str == "ngp") {
105 m_deposition = DepositionType::NGP;
106 }
107 else if (str == "cic") {
108 m_deposition = DepositionType::CIC;
109 }
110 else {
111 MayDay::Error("TracerParticleSolver::parseDeposition - unknown deposition method requested.");
112 }
113
114 pp.get("deposition_cf", str);
115 if (str == "interp") {
116 m_coarseFineDeposition = CoarseFineDeposition::Interp;
117 }
118 else if (str == "halo") {
119 m_coarseFineDeposition = CoarseFineDeposition::Halo;
120 }
121 else if (str == "halo_ngp") {
122 m_coarseFineDeposition = CoarseFineDeposition::HaloNGP;
123 }
124 else if (str == "transition") {
125 m_coarseFineDeposition = CoarseFineDeposition::Transition;
126 }
127 else {
128 MayDay::Error("TracerParticleSolver::parseDeposition - unknown coarse-fine deposition method requested.");
129 }
130
131 // Interpolation type particle-mesh operations
132 pp.get("interpolation", str);
133 if (str == "ngp") {
134 m_interpolation = DepositionType::NGP;
135 }
136 else if (str == "cic") {
137 m_interpolation = DepositionType::CIC;
138 }
139 else {
140 MayDay::Error("TracerParticleSolver::parseDeposition - unknown interpolation method requested.");
141 }
142
143 pp.get("volume_scale", m_volumeScale);
144}
145
146template <typename P>
147inline void
149{
150 CH_TIME("TracerParticleSolver::parsePlotVariables()");
151 if (m_verbosity > 5) {
152 pout() << m_name + "::parsePlotVariables()" << endl;
153 }
154
155 ParmParse pp(m_className.c_str());
156
157 pp.get("plot_weight", m_plotWeight);
158 pp.get("plot_velocity", m_plotVelocity);
159}
160
161template <typename P>
162inline void
164{
165 CH_TIME("TracerParticleSolver::parseVerbosity()");
166 if (m_verbosity > 5) {
167 pout() << m_name + "::parseVerbosity()" << endl;
168 }
169
170 ParmParse pp(m_className.c_str());
171
172 pp.get("verbosity", m_verbosity);
173}
174
175template <typename P>
176inline void
178{
179 CH_TIME("TracerParticleSolver::registerOperators()");
180 if (m_verbosity > 5) {
181 pout() << m_name + "::registerOperators()" << endl;
182 }
183
184 if (m_amr.isNull()) {
185 MayDay::Abort("TracerParticleSolver::registerOperators - need to set AmrMesh!");
186 }
187 else {
188 m_amr->registerOperator(s_particle_mesh, m_realm, m_phase);
189 m_amr->registerOperator(s_eb_coar_ave, m_realm, m_phase);
190 }
191}
192
193template <typename P>
194inline void
196{
197 CH_TIME("TracerParticleSolver::allocate()");
198 if (m_verbosity > 5) {
199 pout() << m_name + "::allocate()" << endl;
200 }
201
202 // Allocate data for storing the velocity field on the mesh, and storage for the particles.
205}
206
207template <typename P>
208inline void
210{
211 CH_TIME("TracerParticleSolver::setName(std::string)");
212 if (m_verbosity > 5) {
213 pout() << m_name + "::setName(std::string)" << endl;
214 }
215
216 m_name = a_name;
217}
218
219template <typename P>
220inline void
222{
223 CH_TIME("TracerParticleSolver::setVolumeScale(bool)");
224 if (m_verbosity > 5) {
225 pout() << m_name + "::setVolumeScale(bool)" << endl;
226 }
227
228 m_volumeScale = a_scale;
229}
230
231template <typename P>
232inline void
234{
235 CH_TIME("TracerParticleSolver::setRealm(std::string)");
236 if (m_verbosity > 5) {
237 pout() << m_name + "::setRealm(std::string)" << endl;
238 }
239
241}
242
243template <typename P>
244inline void
246{
247 CH_TIME("TracerParticleSolver::setPhase(phase::which_phase)");
248 if (m_verbosity > 5) {
249 pout() << m_name + "::setPhase(phase::which_phase)" << endl;
250 }
251
253}
254
255template <typename P>
256void
258{
259 CH_TIME("TracerParticleSolver::setTime(int, Real, Real)");
260 if (m_verbosity > 5) {
261 pout() << m_name + "::setTime(int, Real, Real)" << endl;
262 }
263
265 m_time = a_time;
266 m_dt = a_dt;
267}
268
269template <typename P>
270inline void
272{
273 CH_TIME("TracerParticleSolver::setAmr(RefCountedPtr<AmrMesh>)");
274 if (m_verbosity > 5) {
275 pout() << m_name + "::setAmr(RefCountedPtr<AmrMesh>)" << endl;
276 }
277
279}
280
281template <typename P>
282inline void
284{
285 CH_TIME("TracerParticleSolver::setComputationalGeometry(RefCountedPtr<ComputationalGeometry>)");
286 if (m_verbosity > 5) {
287 pout() << m_name + "::setComputationalGeometry(RefCountedPtr<ComputationalGeometry>)" << endl;
288 }
289
291}
292
293template <typename P>
294inline void
296{
297 CH_TIME("TracerParticleSolver::setVelocity(EBAMRCellData)");
298 if (m_verbosity > 5) {
299 pout() << m_name + "::setVelocity(EBAMRCellData)" << endl;
300 }
301
303}
304
305template <typename P>
306inline void
308{
309 CH_TIME("TracerParticleSolver::preRegrid(int, int)");
310 if (m_verbosity > 5) {
311 pout() << m_name + "::preRegrid(int, int)" << endl;
312 }
313
314 CH_assert(a_lbase >= 0);
315
316 // Put particles in pre-regrid mode.
318}
319
320template <typename P>
321inline void
323{
324 CH_TIME("TracerParticleSolver::regrid(int, int, int)");
325 if (m_verbosity > 5) {
326 pout() << m_name + "::regrid(int, int, int)" << endl;
327 }
328
329 CH_assert(a_lmin >= 0);
332
333 m_amr->remapToNewGrids(m_particles, a_lmin, a_newFinestLevel);
335}
336
337template <typename P>
338inline void
340{
341 CH_TIME("TracerParticleSolver::remap()");
342 if (m_verbosity > 5) {
343 pout() << m_name + "::remap()" << endl;
344 }
345
347}
348
349template <typename P>
350inline void
352{
353 CH_TIME("TracerParticleSolver::setDeposition");
354 if (m_verbosity > 5) {
355 pout() << m_name + "::setDeposition" << endl;
356 }
357
358 m_deposition = a_deposition;
359}
360
361template <typename P>
362inline void
364{
365 CH_TIME("TracerParticleSolver::deposit(EBAMRCellData)");
366 if (m_verbosity > 5) {
367 pout() << m_name + "::deposit(EBAMRCellData)" << endl;
368 }
369
371
372 this->depositParticles<P, const Real&, &P::weight>(a_phi, m_particles, m_deposition, m_coarseFineDeposition);
373
374 if (m_volumeScale) {
375 DataOps::volumeScale(a_phi, m_amr->getDx());
376 }
377}
378
379template <typename P>
380void
382{
383 CH_TIME("TracerParticleSolver::interpolateWeight(EBAMRCellData)");
384 if (m_verbosity > 5) {
385 pout() << m_name + "::interpolateWeight(EBAMRCellData)" << endl;
386 }
387
388 m_amr->interpolateParticles<P, Real&, &P::weight>(m_particles, m_realm, m_phase, a_scalar, m_interpolation, true);
389}
390
391template <typename P>
392inline void
394{
395 CH_TIME("TracerParticleSolver::interpolateVelocities()");
396 if (m_verbosity > 5) {
397 pout() << m_name + "::interpolateVelocities()" << endl;
398 }
399
400 m_amr->interpolateParticles<P, RealVect&, &P::velocity>(m_particles,
401 m_realm,
402 m_phase,
405 true);
406}
407
408template <typename P>
409inline void
411{
412 CH_TIME("TracerParticleSolver::writePlotFile()");
413 if (m_verbosity > 5) {
414 pout() << m_name + "::writePlotFile()" << endl;
415 }
416
417 // Number of output components and their names
418 const int numPlotVars = this->getNumberOfPlotVariables();
420
421 // Allocate storage
425
426 // Copy internal data to be plotted over to 'output'
427 int icomp = 0;
428 for (int lvl = 0; lvl <= m_amr->getFinestLevel(); lvl++) {
429 this->writePlotData(*output[lvl], icomp, m_realm, lvl);
430 }
431
432 // Filename
433 char filename[100];
434 sprintf(filename, "%s.step%07d.%dd.hdf5", m_name.c_str(), m_timeStep, SpaceDim);
436
437 // Alias, because Chombo's EBAMRIO wants raw pointers (but we stick to smart pointers, like God intended).
439 m_amr->alias(outputPtr, output);
440
441#ifdef CH_USE_HDF5
442 constexpr int numPlotGhost = 0;
443
444 DischargeIO::writeEBHDF5(fname,
446 m_amr->getGrids(m_realm),
447 outputPtr,
448 m_amr->getDomains(),
449 m_amr->getDx(),
450 m_amr->getRefinementRatios(),
451 m_dt,
452 m_time,
453 m_amr->getProbLo(),
454 m_amr->getFinestLevel() + 1,
456#endif
457}
458
459template <typename P>
460inline int
462{
463 CH_TIME("TracerParticleSolver::getNumberOfPlotVariables()");
464 if (m_verbosity > 5) {
465 pout() << m_name + "::getNumberOfPlotVariables()" << endl;
466 }
467
468 int numPlotVars = 0;
469
470 if (m_plotWeight) {
471 numPlotVars += 1;
472 }
473 if (m_plotVelocity) {
475 }
476
477 return numPlotVars;
478}
479
480template <typename P>
483{
484 CH_TIME("TracerParticleSolver::getPlotVariableNames()");
485 if (m_verbosity > 5) {
486 pout() << m_name + "::getPlotVariableNames()" << endl;
487 }
488
490
491 if (m_plotWeight) {
492 plotVarNames.push_back(m_name + " density");
493 }
494 if (m_plotVelocity) {
495 plotVarNames.push_back("x-velocity " + m_name);
496 }
497 if (m_plotVelocity) {
498 plotVarNames.push_back("y-velocity " + m_name);
499 }
500#if CH_SPACEDIM == 3
501 if (m_plotVelocity) {
502 plotVarNames.push_back("z-velocity " + m_name);
503 }
504#endif
505
506 return plotVarNames;
507}
508
509template <typename P>
510inline void
512 int& a_comp,
514 const int a_level) const noexcept
515{
516 CH_TIME("TracerParticleSolver::writePlotData");
517 if (m_verbosity > 5) {
518 pout() << m_name + "::writePlotData" << endl;
519 }
520
521 // Write the particle scalars.
522 if (m_plotWeight) {
523 EBAMRCellData weight;
524 m_amr->allocate(weight, m_realm, m_phase, 1);
525
526 this->deposit(weight);
527
528 this->writeData(a_output, a_comp, weight, a_outputRealm, a_level, false, true);
529 }
530
531 // Write the velocity field to the output data holder.
532 if (m_plotVelocity) {
533 this->writeData(a_output, a_comp, m_velocityField, a_outputRealm, a_level, true, true);
534 }
535}
536
537template <typename P>
538void
540 int& a_comp,
541 const EBAMRCellData& a_data,
543 const int a_level,
544 const bool a_interpToCentroids,
545 const bool a_interpGhost) const noexcept
546{
547 CH_TIMERS("TracerParticleSolver::writeData");
548 CH_TIMER("TracerParticleSolver::writeData::allocate", t1);
549 CH_TIMER("TracerParticleSolver::writeData::local_copy", t2);
550 CH_TIMER("TracerParticleSolver::writeData::interp_ghost", t3);
551 CH_TIMER("TracerParticleSolver::writeData::interp_centroid", t4);
552 CH_TIMER("TracerParticleSolver::writeData::final_copy", t5);
553 if (m_verbosity > 5) {
554 pout() << m_name + "::writeData" << endl;
555 }
556
557 // Number of components we are working with.
558 const int numComp = a_data[a_level]->nComp();
559
560 CH_START(t1);
562 m_amr->allocate(scratch, m_realm, m_phase, a_level, numComp);
563 CH_STOP(t1);
564
565 CH_START(t2);
566 m_amr->copyData(scratch, *a_data[a_level], a_level, m_realm, m_realm);
567 CH_STOP(t2);
568
569 // Interpolate ghost cells
570 CH_START(t3);
571 if (a_level > 0 && a_interpGhost) {
572 m_amr->interpGhost(scratch, *a_data[a_level - 1], a_level, m_realm, m_phase);
573 }
574 CH_STOP(t3);
575
576 CH_START(t4);
578 m_amr->interpToCentroids(scratch, m_realm, m_phase, a_level);
579 }
580 CH_STOP(t4);
581
582 DataOps::setCoveredValue(scratch, *m_amr->getCoveredCells(m_realm, m_phase)[a_level], 0.0);
583
584 CH_START(t5);
585 const Interval srcInterv(0, numComp - 1);
586 const Interval dstInterv(a_comp, a_comp + numComp - 1);
587 m_amr->copyData(a_output, scratch, a_level, a_outputRealm, m_realm, dstInterv, srcInterv);
588 CH_STOP(t5);
589
590 a_comp += numComp;
591}
592
593#ifdef CH_USE_HDF5
594template <typename P>
595inline void
597{
598 CH_TIME("TracerParticleSolver::writeCheckpointLevel(HDF5Handle, int)");
599 if (m_verbosity > 5) {
600 pout() << m_name + "::writeCheckpointLevel(HDF5Handle, int)" << endl;
601 }
602
603 DischargeIO::writeCheckParticlesToHDF(a_handle, m_particles[a_level], m_name + "_particles");
604}
605#endif
606
607#ifdef CH_USE_HDF5
608template <typename P>
609inline void
611{
612 CH_TIME("TracerParticleSolver::readCheckpointLevel(HDF5Handle, int)");
613 if (m_verbosity > 5) {
614 pout() << m_name + "::readCheckpointLevel(HDF5Handle, int)" << endl;
615 }
616
617 DischargeIO::readCheckParticlesFromHDF(a_handle, m_particles[a_level], m_name + "_particles");
618}
619#endif
620
621template <typename P>
622Real
624{
625 CH_TIME("TracerParticleSolver::computeDt()");
626 if (m_verbosity > 5) {
627 pout() << m_name + "::computeDt()" << endl;
628 }
629
630 Real dt = std::numeric_limits<Real>::infinity();
631
632 for (int lvl = 0; lvl <= m_amr->getFinestLevel(); lvl++) {
633 const DisjointBoxLayout& dbl = m_amr->getGrids(m_realm)[lvl];
634 const DataIterator& dit = dbl.dataIterator();
635 const Real dx = m_amr->getDx()[lvl];
636
637 const int nbox = dit.size();
638
639#pragma omp parallel for schedule(runtime) reduction(min : dt)
640 for (int mybox = 0; mybox < nbox; mybox++) {
641 const DataIndex& din = dit[mybox];
642
643 const List<P>& particles = m_particles[lvl][din].listItems();
644
645 for (ListIterator<P> lit(particles); lit.ok(); ++lit) {
646 const RealVect& v = lit().velocity();
647
648 for (int dir = 0; dir < SpaceDim; dir++) {
649 dt = std::min(dt, dx / std::abs(v[dir]));
650 }
651 }
652 }
653 }
654
655 // Get the minimum of dt over all MPI ranks.
657
658 return dt;
659}
660
661template <typename P>
664{
665 CH_TIME("TracerParticleSolver::getParticles()");
666 if (m_verbosity > 5) {
667 pout() << m_name + "::getParticles()" << endl;
668 }
669
670 return m_particles;
671}
672
673template <typename P>
674inline const ParticleContainer<P>&
676{
677 CH_TIME("TracerParticleSolver::getParticles()");
678 if (m_verbosity > 5) {
679 pout() << m_name + "::getParticles()" << endl;
680 }
681
682 return m_particles;
683}
684
685template <typename P>
686inline const EBAMRCellData&
688{
689 CH_TIME("TracerParticleSolver::getVelocityField()");
690 if (m_verbosity > 5) {
691 pout() << m_name + "::getVelocityField()" << endl;
692 }
693
694 return m_velocityField;
695}
696
697template <typename P>
698inline DepositionType
700{
701 CH_TIME("TracerParticleSolver::getDepositionType");
702 if (m_verbosity > 5) {
703 pout() << m_name + "::getDepositionType" << endl;
704 }
705
706 return m_deposition;
707}
708
709template <typename P>
712{
713 CH_TIME("TracerParticleSolver::getCoarseFineDepositionType");
714 if (m_verbosity > 5) {
715 pout() << m_name + "::getCoarseFineDepositionType" << endl;
716 }
717
719}
720
721template <typename P>
722inline DepositionType
724{
725 CH_TIME("TracerParticleSolver::getInterpolationType");
726 if (m_verbosity > 5) {
727 pout() << m_name + "::getInterpolationType" << endl;
728 }
729
730 return m_interpolation;
731}
732
733template <typename P>
734template <class T, class Ret, Ret (T::*MemberFunc)() const>
735void
739 const CoarseFineDeposition a_coarseFineDeposition) const noexcept
740{
741 CH_TIME("TracerParticleSolver::depositParticles()");
742 if (m_verbosity > 5) {
743 pout() << m_name + "::depositParticles()" << endl;
744 }
745
746 CH_assert(a_phi[0]->nComp() == 1);
747
748 m_amr->depositParticles<T, Ret, MemberFunc>(a_phi,
749 m_realm,
750 m_phase,
754 false);
755}
756
757#include <CD_NamespaceFooter.H>
758
759#endif
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition CD_CoarseFineDeposition.H:27
DepositionType
Deposition types.
Definition CD_DepositionType.H:24
Silly, but useful functions that override standard Chombo HDF5 IO.
Agglomeration of basic MPI reductions.
Declaration of a solver class that advances tracer particles.
static void volumeScale(EBAMRCellData &a_data, const Vector< Real > &a_dx)
Scale data by dx^SpaceDim.
Definition CD_DataOps.cpp:2236
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 setCoveredValue(EBAMRCellData &a_lhs, const EBAMRCellData &a_coveredMask, const int a_comp, const Real a_value)
Set value in covered cells. Does specified component.
Definition CD_DataOps.cpp:2655
static void copy(MFAMRCellData &a_dst, const MFAMRCellData &a_src)
Copy data from one data holder to another.
Definition CD_DataOps.cpp:1201
static const std::string primal
Identifier for perimal realm.
Definition CD_Realm.H:44
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
virtual CoarseFineDeposition getCoarseFineDepositionType() const
Get the coarse-fine deposition type.
Definition CD_TracerParticleSolverImplem.H:711
ParticleContainer< P > m_particles
Computational particles.
Definition CD_TracerParticleSolver.H:412
virtual void remap()
Remap particles.
Definition CD_TracerParticleSolverImplem.H:339
virtual void setRealm(const std::string &a_realm)
Set the solver realm.
Definition CD_TracerParticleSolverImplem.H:233
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
void parsePlotVariables()
Parse plot variables.
Definition CD_TracerParticleSolverImplem.H:148
virtual void registerOperators() const
Register operators needed for AMR core functionality.
Definition CD_TracerParticleSolverImplem.H:177
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_TracerParticleSolver.H:367
virtual void setName(const std::string &a_name) noexcept
Set the solver name.
Definition CD_TracerParticleSolverImplem.H:209
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
virtual void setTime(const int a_step, const Real a_time, const Real a_dt)
Set the time for this solver.
Definition CD_TracerParticleSolverImplem.H:257
virtual void deposit(EBAMRCellData &a_phi) const noexcept
Deposit particle weight on mesh.
Definition CD_TracerParticleSolverImplem.H:363
CoarseFineDeposition m_coarseFineDeposition
Coarse-fine deposition strategy.
Definition CD_TracerParticleSolver.H:347
bool m_volumeScale
Do volumetric scaling when depositing (or not).
Definition CD_TracerParticleSolver.H:402
virtual void writeData(LevelData< EBCellFAB > &a_output, int &a_comp, const EBAMRCellData &a_data, const std::string a_outputRealm, const int a_level, const bool a_interpToCentroids, const bool a_interpGhost) const noexcept
Write data to output. Convenience function.
Definition CD_TracerParticleSolverImplem.H:539
virtual ~TracerParticleSolver()
Destructor.
Definition CD_TracerParticleSolverImplem.H:56
std::string m_realm
Realm where this solver lives.
Definition CD_TracerParticleSolver.H:352
virtual void preRegrid(const int a_lbase, const int a_oldFinestLevel)
Perform pre-regrid operations.
Definition CD_TracerParticleSolverImplem.H:307
DepositionType m_interpolation
Deposition type when interpolating to particles.
Definition CD_TracerParticleSolver.H:342
bool m_plotWeight
Hook for adding weight to plot file.
Definition CD_TracerParticleSolver.H:392
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition CD_TracerParticleSolverImplem.H:663
void parseDeposition()
Parse deposition method.
Definition CD_TracerParticleSolverImplem.H:91
void parseVerbosity()
Parse solver verbosity.
Definition CD_TracerParticleSolverImplem.H:163
int m_verbosity
Verbosity level.
Definition CD_TracerParticleSolver.H:387
RefCountedPtr< AmrMesh > m_amr
Handle to AMR mesh.
Definition CD_TracerParticleSolver.H:327
virtual Vector< std::string > getPlotVariableNames() const
Get plot variable names.
Definition CD_TracerParticleSolverImplem.H:482
DepositionType m_deposition
Deposition type when depositing particles to grid.
Definition CD_TracerParticleSolver.H:337
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Handle to computational geometry.
Definition CD_TracerParticleSolver.H:332
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_comp, const std::string &a_outputRealm, const int a_level) const noexcept
Write plot data.
Definition CD_TracerParticleSolverImplem.H:511
virtual void parseRuntimeOptions()
Parse solver run-time options.
Definition CD_TracerParticleSolverImplem.H:77
virtual void writePlotFile()
Write plot file.
Definition CD_TracerParticleSolverImplem.H:410
virtual void setDeposition(const DepositionType a_deposition) noexcept
Set deposition method.
Definition CD_TracerParticleSolverImplem.H:351
virtual void setPhase(const phase::which_phase &a_phase)
Set the solver phase.
Definition CD_TracerParticleSolverImplem.H:245
virtual DepositionType getDepositionType() const
Get the deposition type.
Definition CD_TracerParticleSolverImplem.H:699
Real m_dt
Time step.
Definition CD_TracerParticleSolver.H:372
virtual void allocate()
Allocate storage for this solver.
Definition CD_TracerParticleSolverImplem.H:195
std::string m_name
Solver name.
Definition CD_TracerParticleSolver.H:357
bool m_plotVelocity
Hook for adding velocity field to plot file.
Definition CD_TracerParticleSolver.H:397
int m_timeStep
Time step.
Definition CD_TracerParticleSolver.H:382
virtual DepositionType getInterpolationType() const
Get the interpolation type.
Definition CD_TracerParticleSolverImplem.H:723
virtual void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_compGeom)
Set the computational geometry.
Definition CD_TracerParticleSolverImplem.H:283
virtual void interpolateVelocities()
Interpolate particles velocities.
Definition CD_TracerParticleSolverImplem.H:393
const EBAMRCellData & getVelocityField() const
Return the velocity field.
Definition CD_TracerParticleSolverImplem.H:687
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
Regrid this solver.
Definition CD_TracerParticleSolverImplem.H:322
std::string m_className
Class name.
Definition CD_TracerParticleSolver.H:362
virtual void parseOptions()
Parse solver options.
Definition CD_TracerParticleSolverImplem.H:63
virtual void setVelocity(const EBAMRCellData &a_velocityField)
Set the tracer particle velocity field.
Definition CD_TracerParticleSolverImplem.H:295
Real m_time
Time.
Definition CD_TracerParticleSolver.H:377
virtual void interpolateWeight(const EBAMRCellData &a_scalar) noexcept
Interpolate a scalar field onto the particle weight.
Definition CD_TracerParticleSolverImplem.H:381
EBAMRCellData m_velocityField
Mesh-based velocity field. Must be set through setVelocity.
Definition CD_TracerParticleSolver.H:407
virtual int getNumberOfPlotVariables() const
Get the number of plot variables.
Definition CD_TracerParticleSolverImplem.H:461
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amrMesh)
Set AmrMesh.
Definition CD_TracerParticleSolverImplem.H:271
virtual Real computeDt() const
Compute dt = dx/max(v_x, v_y, v_z) minimized over all particles.
Definition CD_TracerParticleSolverImplem.H:623
virtual void setVolumeScale(const bool a_scale) noexcept
Turn on/off volume scaling.
Definition CD_TracerParticleSolverImplem.H:221
Real min(const Real &a_input) noexcept
Get the minimum of the input, reduced over MPI ranks (in the Chombo communicator)
Definition CD_ParallelOpsImplem.H:59
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38
@ gas
Gas phase.
Definition CD_MultiFluidIndexSpace.H:39