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