12 #ifndef CD_TracerParticleSolver_H
13 #define CD_TracerParticleSolver_H
20 #include <CD_NamespaceHeader.H>
61 TracerParticleSolver(
const RefCountedPtr<AmrMesh>& a_amr,
const RefCountedPtr<ComputationalGeometry> a_compGeom);
99 setAmr(
const RefCountedPtr<AmrMesh>& a_amrMesh);
113 setName(
const std::string& a_name) noexcept;
127 setRealm(
const std::string& a_realm);
134 setPhase(
const phase::which_phase& a_phase);
144 setTime(
const int a_step,
const Real a_time,
const Real a_dt);
160 preRegrid(
const int a_lbase,
const int a_oldFinestLevel);
170 regrid(
const int a_lmin,
const int a_oldFinestLevel,
const int a_newFinestLevel);
235 virtual Vector<std::string>
249 const std::string a_outputRealm,
250 const int a_level)
const noexcept;
259 writeCheckpointLevel(HDF5Handle& a_handle,
const int a_level)
const;
269 readCheckpointLevel(HDF5Handle& a_handle,
const int a_level);
421 template <
typename T, const Real& (T::*particleScalarFunction)() const>
439 writeData(LevelData<EBCellFAB>& a_output,
442 const std::string a_outputRealm,
444 const bool a_interpToCentroids,
445 const bool a_interpGhost)
const noexcept;
448 #include <CD_NamespaceFooter.H>
Declaration of core class for handling AMR-related operations (with embedded boundaries)
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition: CD_CoarseFineDeposition.H:26
Declaration of base class for defining geometries.
DepositionType
Deposition types.
Definition: CD_DepositionType.H:23
Declaration of a class for holding particles on an AMR hierarchy.
Implementation of CD_TracerParticleSolver.H.
Declaration of a tracer particle class.
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition: CD_TracerParticleSolver.H:37
int m_haloBuffer
Halo buffer for particle deposition.
Definition: CD_TracerParticleSolver.H:369
TracerParticleSolver & operator=(const TracerParticleSolver &a_other)=delete
Disallowed assignment operator.
ParticleContainer< P > m_particles
Computational particles.
Definition: CD_TracerParticleSolver.H:394
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 parsePlotVariables()
Parse plot variables.
Definition: CD_TracerParticleSolverImplem.H:145
virtual void registerOperators() const
Register operators needed for AMR core functionality.
Definition: CD_TracerParticleSolverImplem.H:174
phase::which_phase m_phase
Phase where this solver lives.
Definition: CD_TracerParticleSolver.H:343
virtual void setName(const std::string &a_name) noexcept
Set the solver name.
Definition: CD_TracerParticleSolverImplem.H:209
TracerParticleSolver & operator=(const TracerParticleSolver &&a_other)=delete
Disallowed move assignment operator.
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: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:323
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:694
bool m_volumeScale
Do volumetric scaling when depositing (or not).
Definition: CD_TracerParticleSolver.H:384
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:533
virtual ~TracerParticleSolver()
Destructor.
Definition: CD_TracerParticleSolverImplem.H:56
std::string m_realm
Realm where this solver lives.
Definition: CD_TracerParticleSolver.H:328
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:318
bool m_plotWeight
Hook for adding weight to plot file.
Definition: CD_TracerParticleSolver.H:374
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition: CD_TracerParticleSolverImplem.H:657
void parseDeposition()
Parse deposition method.
Definition: CD_TracerParticleSolverImplem.H:91
void parseVerbosity()
Parse solver verbosity.
Definition: CD_TracerParticleSolverImplem.H:160
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:505
int m_verbosity
Verbosity level.
Definition: CD_TracerParticleSolver.H:363
RefCountedPtr< AmrMesh > m_amr
Handle to AMR mesh.
Definition: CD_TracerParticleSolver.H:303
virtual Vector< std::string > getPlotVariableNames() const
Get plot variable names.
Definition: CD_TracerParticleSolverImplem.H:476
DepositionType m_deposition
Deposition type when depositing particles to grid.
Definition: CD_TracerParticleSolver.H:313
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Handle to computational geometry.
Definition: CD_TracerParticleSolver.H:308
virtual void parseRuntimeOptions()
Parse solver run-time options.
Definition: CD_TracerParticleSolverImplem.H:77
virtual void writePlotFile()
Write plot file.
Definition: CD_TracerParticleSolverImplem.H:404
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
Real m_dt
Time step.
Definition: CD_TracerParticleSolver.H:348
TracerParticleSolver(const TracerParticleSolver &a_other)=delete
Disallowed constructor.
virtual void allocate()
Allocate storage for this solver.
Definition: CD_TracerParticleSolverImplem.H:195
std::string m_name
Solver name.
Definition: CD_TracerParticleSolver.H:333
bool m_plotVelocity
Hook for adding velocity field to plot file.
Definition: CD_TracerParticleSolver.H:379
int m_timeStep
Time step.
Definition: CD_TracerParticleSolver.H:358
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:392
const EBAMRCellData & getVelocityField() const
Return the velocity field.
Definition: CD_TracerParticleSolverImplem.H:681
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:338
virtual void parseOptions()
Parse solver options.
Definition: CD_TracerParticleSolverImplem.H:63
TracerParticleSolver(const TracerParticleSolver &&a_other)=delete
Disallowed move constructor.
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:353
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:389
virtual int getNumberOfPlotVariables() const
Get the number of plot variables.
Definition: CD_TracerParticleSolverImplem.H:455
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amrMesh)
Set AmrMesh.
Definition: CD_TracerParticleSolverImplem.H:271
virtual Real computeDt() const
Write checkpoint data into HDF5 file. @paramo[out] a_handle HDF5 file.
Definition: CD_TracerParticleSolverImplem.H:617
virtual void setVolumeScale(const bool a_scale) noexcept
Turn on/off volume scaling.
Definition: CD_TracerParticleSolverImplem.H:221