31#include <CD_NamespaceHeader.H>
125 setRealm(
const std::string& a_realm);
175 const std::function<Real(const RealVect x)>& a_densityFunc,
176 const Vector<
int>& a_maxParticlesPerCell) const noexcept;
186 const std::function<Real(const RealVect x)>& a_densityFunc,
187 int a_maxParticlesPerCell) const noexcept;
196 regrid(
int a_lmin,
int a_oldFinestLevel,
int a_newFinestLevel);
346 int a_level) const noexcept;
356 template <typename Gather>
361 Gather a_gather) const noexcept;
389 template <typename P, typename Traits>
407 template <typename Gather>
413 Gather a_gather) const;
436 template <typename P, typename Traits, typename Strength>
442 const Strength a_strength) const;
524 const
bool a_deleteParticles,
551 const bool a_deleteParticles,
577 const bool a_deleteParticles,
591 computeLoads(Vector<long int>& a_loads,
const DisjointBoxLayout& a_dbl,
int a_level);
604 virtual Vector<std::string>
618 const std::string& a_outputRealm,
619 int a_level)
const noexcept;
627 virtual unsigned long long
649 setAmr(
const RefCountedPtr<AmrMesh>& a_amr);
673 setTime(
int a_step, Real a_time, Real a_dt);
685 writeCheckpointLevel(HDF5Handle& a_handle,
int a_level)
const;
697 readCheckpointLevel(HDF5Handle& a_handle,
int a_level);
705 setSpecies(
const RefCountedPtr<ItoSpecies>& a_species);
714 preRegrid(
int a_lbase,
int a_oldFinestLevel);
750 virtual const RefCountedPtr<ItoSpecies>&
757 virtual EBAMRCellData&
764 virtual EBAMRCellData&
771 virtual const EBAMRCellData&
778 virtual EBAMRCellData&
785 virtual const EBAMRCellData&
792 virtual EBAMRCellData&
799 virtual const EBAMRCellData&
969 const Vector<
int>& a_particlesPerCell,
980 virtual const Vector<
int>&
1080 computeDt(
int a_lvl, const DataIndex& a_dit) const;
1137 computeHopDt(Real a_maxCellsToMove,
int a_lvl, const DataIndex& a_dit) const;
1709 const Vector<int>& a_particlesPerCell,
1724 const Vector<int>& a_particlesPerCell,
1883 const Vector<
int>& a_particlesPerCell,
1884 bool a_enableBoundaryCarve);
1932 writeCheckPointLevelParticles(HDF5Handle& a_handle,
int a_level)
const;
1946 writeCheckPointLevelFluid(HDF5Handle& a_handle,
int a_level)
const;
1957 readCheckpointLevelParticles(HDF5Handle& a_handle,
int a_level);
1969 readCheckpointLevelFluid(HDF5Handle& a_handle,
int a_level);
1980 drawNewParticles(
const LevelData<EBCellFAB>& a_particlesPerCell,
int a_level,
int a_newPPC);
2013 depositHybrid(EBAMRCellData& a_depositionH, EBAMRIVData& a_massDifference,
const EBAMRIVData& a_depositionNC)
const;
2073 writeData(LevelData<EBCellFAB>& a_output,
2075 const EBAMRCellData& a_data,
2076 const std::string& a_outputRealm,
2078 bool a_interpToCentroids,
2079 bool a_interpGhost)
const noexcept;
2082#include <CD_NamespaceFooter.H>
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Simple class for holding some quantities relevant in a grid cell.
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition CD_CoarseFineDeposition.H:28
Declaration of base class for defining geometries.
DepositionType
Deposition types.
Definition CD_DepositionType.H:24
Enum for putting some logic into EB intersection tests.
EBIntersection
Enum for putting some logic into how we think about intersection between particles and EBs.
Definition CD_EBIntersection.H:22
Enum for putting some logic into EB intersection tests.
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:23
Declaration of cut-cell deposition strategies.
IrregularDeposition
How a deposition scheme treats the cut cells.
Definition CD_IrregularDeposition.H:36
Declaration of the reduced Ito particle used for merging and for regrid transport.
SoA payload for Ito diffusion particles (drifting Brownian walkers)
Implementation of CD_ItoSolver.H.
Declaration of an ItoSpecies class that passes in names and initial data to ItoSolvers.
Declaration of an AMR-hierarchy container that owns per-patch ParticleSoA leaves.
Namespace containing various particle management utilities.
Base class for Ito diffusion particle models.
Definition CD_ItoSolver.H:41
void mergeKDImpl(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell, bool a_enableBoundaryCarve)
Whole-container merge: whole-patch kd-tree build – shared implementation behind kd_patch and kd_amr w...
Definition CD_ItoSolver.cpp:4888
virtual void computeAverageEnergy(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average particle energy..
Definition CD_ItoSolver.cpp:2125
RealVect randomDirection() const
Draw a random direction in N-dimensional space.
virtual Real computeHopDt(Real a_maxCellsToMove) const
Compute the largest possible time step such that the particles does not move more than a specified nu...
Definition CD_ItoSolver.cpp:3176
ParticleContainer< NoPayload > m_mirrorImages
Reflected images of the band particles, for IrregularDeposition::Mirror.
Definition CD_ItoSolver.H:1623
void mergeNnPairSearch(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell)
Whole-container merge: distributed nearest-neighbour pair merge – shared implementation behind nn_sea...
Definition CD_ItoSolver.cpp:4300
virtual void interpolateMobilities()
Interpolate mobilities.
Definition CD_ItoSolver.cpp:2658
WhichContainer
Enum class for distinguishing various types of particle containers.
Definition CD_ItoSolver.H:52
phase::which_phase getPhase() const
Return phase.
Definition CD_ItoSolver.cpp:3571
void parseDiffusionHop()
Parse diffusion hop.
virtual void writeData(LevelData< EBCellFAB > &a_output, int &a_comp, const EBAMRCellData &a_data, const std::string &a_outputRealm, int a_level, bool a_interpToCentroids, bool a_interpGhost) const noexcept
Write data to output. Convenience function.
Definition CD_ItoSolver.cpp:1876
CoarseFineDeposition m_coarseFineDeposition
Coarse-fine deposition strategy.
Definition CD_ItoSolver.H:1553
void mergeLite(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell, ParticleManagement::ParticleMergeMethod a_method)
Run one merge method over an already-extracted reduced-particle container.
Definition CD_ItoSolver.cpp:3667
bool m_plotPhi
Flag for outputting m_phi to plot files.
Definition CD_ItoSolver.H:1493
virtual Vector< std::string > getPlotVariableNames() const
Get output plot names.
Definition CD_ItoSolver.cpp:1699
virtual void setSpecies(const RefCountedPtr< ItoSpecies > &a_species)
Set the species.
Definition CD_ItoSolver.cpp:1249
EBAMRCellData m_diffusionFunction
Diffusion-centerer field used for interpolating diffusion coefficients.
Definition CD_ItoSolver.H:1578
virtual void registerOperators() const
Register operators.
Definition CD_ItoSolver.cpp:627
EBAMRCellData m_mirrorScratch
Mesh scratch the mirror images deposit into, before being added to the real field.
Definition CD_ItoSolver.H:1634
virtual void depositParticles()
Deposit particles onto mesh.
Definition CD_ItoSolver.cpp:2161
CoarseFineDeposition getCoarseFineDeposition() const
Get the coarse-fine deposition strategy.
Definition CD_ItoSolver.cpp:3565
bool m_plotEnergyDensity
Flag for plotting the energy density on the mesh.
Definition CD_ItoSolver.H:1538
void parseDiffusionGradient()
Parse whether or not to add the grad(D) drift correction.
Definition CD_ItoSolver.cpp:192
void mergeKDCell(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell)
Cell-based merge: partition each cell's particles with a kd tree and reduce every leaf to one particl...
Definition CD_ItoSolver.cpp:3900
virtual void depositNonConservative(EBAMRIVData &a_depositionNC, const EBAMRCellData &a_depositionKappaC) const
Make the "non-conservative" kappa deposition – computing depositionNC = sum(kappa*depositionC)/sum(ka...
Definition CD_ItoSolver.cpp:2286
virtual void makeSuperparticles(WhichContainer a_container)
Make superparticles for a full container, merging to the solver's configured target.
Definition CD_ItoSolver.cpp:3603
Real m_bisectionStep
Bisection step size to use for particle intersection tests with EBs.
Definition CD_ItoSolver.H:1433
void extractIntoMergeContainer(WhichContainer a_container, ParticleContainer< ItoMergeParticle > &a_merge)
Extract a container's ItoParticles into a minimal ItoMergeParticle container on the same realm/patch,...
Definition CD_ItoSolver.cpp:4082
int m_restartPPC
Number of particles used when restarting a simulation – this is relevant only when restarting from a ...
Definition CD_ItoSolver.H:1385
virtual void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set computational geometry.
Definition CD_ItoSolver.cpp:601
void applyCellMerger(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell, const ParticleManagement::ParticleMerger< ItoMergeParticle > &a_merger)
Apply a per-cell merger over an entire reduced-particle container, cell by cell.
Definition CD_ItoSolver.cpp:3789
ParticleContainer< ItoMergeParticle > m_regridParticles
The bulk particles, in reduced form, between preRegrid() and regrid().
Definition CD_ItoSolver.H:1658
void parseIntersectionEB()
Parse EB intersection algorithms.
Definition CD_ItoSolver.cpp:356
virtual void intersectParticles(const EBIntersection a_ebIntersection, const bool a_deleteParticles, const std::function< void(ParticleSoA< ItoParticle > &, std::size_t)> &a_nonDeletionModifier=[](ParticleSoA< ItoParticle > &, std::size_t) -> void { return;})
Do boundary intersection tests.
Definition CD_ItoSolver.cpp:1042
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amr)
Set the AmrMesh object.
Definition CD_ItoSolver.cpp:614
bool m_forceHaloNGP
Force usage of NGP when depositing "halo" particles.
Definition CD_ItoSolver.H:1470
Real m_kdHybridLeafDx
kd_partition = hybrid: node size, in cell widths, at or below which the split plane switches from the...
Definition CD_ItoSolver.H:1379
virtual std::string getRealm() const
Get the realm where this solver is registered.
Definition CD_ItoSolver.cpp:78
static constexpr int m_nComp
Default number of component in data holders (do not touch).
Definition CD_ItoSolver.H:1235
void mirrorPass(EBAMRCellData &a_phi, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition, const Strength a_strength) const
Add the mirrored contribution of the band particles to an already-deposited field.
Definition CD_ItoSolverImplem.H:176
ParticleManagement::KDPlacement m_kdPlacement
kd_cell/kd_patch/kd_amr: where the particle a leaf reduces to is placed.
Definition CD_ItoSolver.H:1293
bool m_forceIrregInterpolationNGP
NGP interpolation in cut cells or not.
Definition CD_ItoSolver.H:1465
virtual void interpolateDiffusionGradient()
Interpolate the mesh diffusion gradient onto the particles' scratch vector storage.
Definition CD_ItoSolver.cpp:2935
EBAMRIVData m_depositionNC
Scratch storage for holding the non-conservative deposition.
Definition CD_ItoSolver.H:1604
virtual Real computeDiffusiveDt() const
Compute the diffusive dt. This computes dt = dx*dx/(2*SpaceDim*D) for all particles.
Definition CD_ItoSolver.cpp:3433
void parseParticleMerger()
Parse the super-particle merger.
Definition CD_ItoSolver.cpp:406
std::string m_className
Class name.
Definition CD_ItoSolver.H:1421
virtual void updateDiffusion()
Update mobilities parametrically from the particle energy.
Definition CD_ItoSolver.cpp:3008
bool m_plotParticles
Flag for depositing and plotting the bulk particles on the mesh.
Definition CD_ItoSolver.H:1513
int m_timeStep
Time step.
Definition CD_ItoSolver.H:1443
void coarsenAndFillGhosts(EBAMRCellData &a_phi) const
Coarsen the input data and interpolate its ghost cells.
Definition CD_ItoSolver.cpp:2228
virtual EBAMRCellData & getVelocityFunction()
Get cell-centered velocity mesh data.
Definition CD_ItoSolver.cpp:2441
virtual void interpolateMobilitiesDirect(int a_lvl, const DataIndex &a_dit) noexcept
Directly interpolate mobilities. Interpolates for all particles in the specified grid patch.
Definition CD_ItoSolver.cpp:2729
virtual void computeDiffusionGradient()
Compute the cell-centered gradient of the mesh diffusion field.
Definition CD_ItoSolver.cpp:2915
std::string m_realm
Realm where this solve lives.
Definition CD_ItoSolver.H:1390
virtual void depositConductivity(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Deposit conductivities (i.e. mass*mobility / volume)
Definition CD_ItoSolver.cpp:1942
ParticleManagement::KDPartition m_kdPartition
kd_cell/kd_patch/kd_amr: how each node is divided into two children.
Definition CD_ItoSolver.H:1287
virtual const Vector< int > & getParticlesPerCell() const noexcept
Get the configured target number of computational particles per cell, per AMR level.
Definition CD_ItoSolver.cpp:564
virtual void interpolateVelocities()
Interpolate the particle velocities.
Definition CD_ItoSolver.cpp:2591
virtual void interpolateMobilitiesVelocity(int a_lvl, const DataIndex &a_dit, const EBCellFAB &a_velocityMagnitude) noexcept
Interpolate mobilities through the velocity. Interpolates for all particles in the specified grid pat...
Definition CD_ItoSolver.cpp:2761
virtual void parseOptions()
Parse class options.
Definition CD_ItoSolver.cpp:116
bool m_plotParticlesSource
Flag for depositing and plotting the source particles on the mesh.
Definition CD_ItoSolver.H:1528
virtual Real computeDt() const
Compute a time step for the advance – this calls the level function.
Definition CD_ItoSolver.cpp:3059
RefCountedPtr< ItoSpecies > m_species
Species that this solver solves for.
Definition CD_ItoSolver.H:1405
DepositionType m_deposition
Deposition method when depositing particles to the mesh.
Definition CD_ItoSolver.H:1548
virtual void interpolateDiffusion()
Interpolate the diffusion field to the particle positions.
Definition CD_ItoSolver.cpp:2861
virtual void computeAverageMobility(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average mobility.
Definition CD_ItoSolver.cpp:2055
void depositWeight(EBAMRCellData &a_phi, const ParticleContainer< P, Traits > &a_particles, DepositionType a_deposition, CoarseFineDeposition a_coarseFineDeposition) const
Deposit the SoA weight column on the mesh (kappa-conservative + redistribution).
Definition CD_ItoSolverImplem.H:56
Real m_dt
Time step.
Definition CD_ItoSolver.H:1453
ItoSolver()
Constructor – user must subsequently set the realm and, parse class options, set the species etc.
Definition CD_ItoSolver.cpp:44
std::string m_name
Solver name.
Definition CD_ItoSolver.H:1415
EBAMRCellData m_diffusionGradient
Cell-centered gradient of m_diffusionFunction, used for the grad(D) drift correction.
Definition CD_ItoSolver.H:1586
virtual std::string getName() const
Get this solver's name.
Definition CD_ItoSolver.cpp:70
ItoSolver & operator=(const ItoSolver &)=delete
Deleted copy assignment operator.
int m_nnMaxRounds
nn_amr: maximum number of drain rounds run per makeSuperparticles() call.
Definition CD_ItoSolver.H:1369
void mergeNnPairOneCell(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell)
Whole-container merge: distributed nearest-neighbour pair merge, per-cell PointCloudBVH search.
Definition CD_ItoSolver.cpp:4481
EBAMRCellData m_velocityFunction
Cell-centered field used for interpolating velocities.
Definition CD_ItoSolver.H:1573
virtual void removeCoveredParticles(EBRepresentation a_representation, Real a_tol)
Remove particles that are inside the EB.
Definition CD_ItoSolver.cpp:918
WhichCheckpoint m_checkpointing
How to checkpoint files. particles => write particles to HDF5. numbers => write numbers to HDF5.
Definition CD_ItoSolver.H:1261
virtual ~ItoSolver()
Destructor (does nothing).
Definition CD_ItoSolver.cpp:64
void parseCheckpointing()
Parse checkpointing method.
Definition CD_ItoSolver.cpp:382
bool m_isDiffusive
If true, solver is diffusive.
Definition CD_ItoSolver.H:1475
bool m_plotAverageEnergy
Flag for plotting the average particle energy on the mesh.
Definition CD_ItoSolver.H:1543
IrregularDeposition m_irregularDeposition
How the cut cells are treated when depositing.
Definition CD_ItoSolver.H:1460
DepositionType m_plotDeposition
Deposition method when depositing particles to mesh during plotting.
Definition CD_ItoSolver.H:1558
RealVect randomGaussian() const
Draw a random N-dimensional Gaussian number from a normal distribution with zero with and unit standa...
Definition CD_ItoSolverImplem.H:35
virtual ParticleContainer< ItoParticle > & getParticles(WhichContainer a_container)
Get a general particle container.
Definition CD_ItoSolver.cpp:2408
virtual bool isDiffusionGradientDrift() const noexcept
Check if the grad(D) drift correction is enabled.
Definition CD_ItoSolver.cpp:3002
virtual void setPhase(phase::which_phase a_phase)
Set phase where the particles will live.
Definition CD_ItoSolver.cpp:683
virtual unsigned long long getNumParticles(WhichContainer a_whichContainer, bool a_localOnly) const
Get number of particles in a specified particle container.
Definition CD_ItoSolver.cpp:580
virtual void remap()
Remap the bulk particle container.
Definition CD_ItoSolver.cpp:3535
virtual void organizeParticlesByCell(WhichContainer a_container)
Sort the input particle container by cell.
Definition CD_ItoSolver.cpp:3577
virtual void computeLoads(Vector< long int > &a_loads, const DisjointBoxLayout &a_dbl, int a_level)
Compute particle load on a specific grid level – this will compute the number of particles in each bo...
Definition CD_ItoSolver.cpp:889
ParticleManagement::NNSearch m_nnSearch
nn_amr: which spatial index the neighbour search is backed by.
Definition CD_ItoSolver.H:1313
virtual void setRealm(const std::string &a_realm)
Set the realm where this solver will live.
Definition CD_ItoSolver.cpp:86
EBAMRCellData m_mobilityFunction
Mobility function – used when interpolating particle mobilities.
Definition CD_ItoSolver.H:1568
virtual void updateMobilities()
Update mobilities parametrically from the particle energy.
Definition CD_ItoSolver.cpp:2812
std::map< WhichContainer, ParticleContainer< ItoParticle > > m_particleContainers
Various particle containers with identifiers.
Definition CD_ItoSolver.H:1639
virtual bool isMobile() const
Check if solver is mobile.
Definition CD_ItoSolver.cpp:2351
int m_nnFallback
nn_amr: number of fallback candidates per query. The k-nearest search is done with k = 1 + this....
Definition CD_ItoSolver.H:1354
virtual EBAMRCellData & getDiffusionFunction()
Get the diffusion function.
Definition CD_ItoSolver.cpp:2463
Real kdWeightMedianCellWidths() const noexcept
Turn ItoSolver.kd_partition (and, for 'hybrid', ItoSolver.kd_hybrid_leaf_dx) into the single crossove...
Definition CD_ItoSolver.cpp:3875
void splitFromMergeContainer(ParticleContainer< ItoMergeParticle > &a_merge, int a_numParticlesPerCellThresh)
Split every under-full cell up to the target count.
Definition CD_ItoSolver.cpp:4174
int m_verbosity
Verbosity level for this solver.
Definition CD_ItoSolver.H:1438
ItoSolver(const ItoSolver &)=delete
Deleted copy constructor.
void depositGathered(EBAMRCellData &a_phi, const ParticleContainer< ItoParticle > &a_particles, DepositionType a_deposition, CoarseFineDeposition a_coarseFineDeposition, Gather a_gather) const
Deposit a gathered per-particle quantity on the mesh (kappa-conservative + redistribution).
Definition CD_ItoSolverImplem.H:140
virtual void setParticleDiffusion(Real a_diffCo)
Sets diffusion coefficient for all particles.
Definition CD_ItoSolver.cpp:2561
virtual void depositDiffusivity(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Deposit diffusivity (i.e. mass*D/volume)
Definition CD_ItoSolver.cpp:1983
WhichCheckpoint
How to checkpoint files.
Definition CD_ItoSolver.H:1242
bool m_diffusionGradientDrift
If true, grad(D) is added to the particle drift.
Definition CD_ItoSolver.H:1488
Real m_normalDistributionTruncation
Truncation value for normal distribution.
Definition CD_ItoSolver.H:1428
std::optional< ParticleManagement::ParticleMergeMethod > m_regridMergeMethod
Which merge method to run inside ItoSolver::regrid(), or nullopt for "whatever merge_method says".
Definition CD_ItoSolver.H:1340
void drawNewParticles(const LevelData< EBCellFAB > &a_particlesPerCell, int a_level, int a_newPPC)
Restart particles from a specified number of particles in the grid cell.
Definition CD_ItoSolver.cpp:1542
bool m_plotParticlesEB
Flag for depositing and plotting the EB particles on the mesh.
Definition CD_ItoSolver.H:1518
virtual EBAMRCellData & getPhi()
Get the mesh data.
Definition CD_ItoSolver.cpp:2430
virtual void allocate()
Allocate internal storage.
Definition CD_ItoSolver.cpp:1263
void mergeKDSkinNn(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell)
Whole-container merge: kd-tree with a nearest-neighbour skin (kd_amr_boundary = nn).
Definition CD_ItoSolver.cpp:4599
virtual void setVelocityFunction(const RealVect &a_velocity)
Utility function – set a constant velocity.
Definition CD_ItoSolver.cpp:2518
WhichMobilityInterpolation m_mobilityInterp
Switch for deciding how to interpolate mobilities, i.e. interpolating either mu*E or just mu (to the ...
Definition CD_ItoSolver.H:1267
void parseVerbosity()
Parse class verbosity.
Definition CD_ItoSolver.cpp:152
static constexpr int m_comp
Default component in data holders (do not touch).
Definition CD_ItoSolver.H:1230
virtual void depositHybrid(EBAMRCellData &a_depositionH, EBAMRIVData &a_massDifference, const EBAMRIVData &a_depositionNC) const
Make the "hybrid" deposition phiH = kappa*phiC + (1-kappa)*phiNC. On input, a_depositionH should cont...
Definition CD_ItoSolver.cpp:2302
int m_nnMaxCellDistance
nn_amr: maximum merge distance in whole cells (Chebyshev). A negative value means unbounded (std::nul...
Definition CD_ItoSolver.H:1360
RefCountedPtr< AmrMesh > m_amr
AMR; needed for grid stuff.
Definition CD_ItoSolver.H:1400
bool m_nnIterate
nn_amr: iterate the local trivial tier to convergence within each round.
Definition CD_ItoSolver.H:1348
ItoSolver(ItoSolver &&)=default
Default move constructor.
virtual void depositEnergyDensity(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Deposit energy densities (i.e. mass*energy/volume => total energy per unit volume)
Definition CD_ItoSolver.cpp:2019
void parseRNG()
Parse RNG options – this parses the RNG seed and instantiates the distributions.
Definition CD_ItoSolver.cpp:165
void depositWeightNGP(LevelData< EBCellFAB > &a_output, const ParticleContainer< ItoParticle > &a_particles, int a_level) const noexcept
Do an NGP deposit of the SoA weight column on a specific grid level. Used for IO.
Definition CD_ItoSolver.cpp:2185
DepositionType getDeposition() const
Get deposition method.
Definition CD_ItoSolver.cpp:3559
void parseTruncation()
Parse the normal distribution truncation level.
Definition CD_ItoSolver.cpp:179
EBAMRIVData m_massDiff
Scratch storage for holding the mass difference when using hybrid deposition.
Definition CD_ItoSolver.H:1609
virtual void setParticleMobility(Real a_mobility)
Sets mobility coefficient for all particles.
Definition CD_ItoSolver.cpp:2531
EBAMRCellData m_phi
Storage for particle mesh data.
Definition CD_ItoSolver.H:1563
virtual void initialData()
Set the initial data.
Definition CD_ItoSolver.cpp:719
virtual void computeAverageDiffusion(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average diffusion coefficient.
Definition CD_ItoSolver.cpp:2090
virtual void parseRuntimeOptions()
Parse class runtime configurable options.
Definition CD_ItoSolver.cpp:135
bool m_plotDiffCo
Flag for outputting m_diffusionFunction to plot files.
Definition CD_ItoSolver.H:1503
ParticleManagement::ParticleMerger< ItoMergeParticle > m_particleCellMerger
User-supplied per-cell merger for merge_method = external (set via setParticleCellMerger())....
Definition CD_ItoSolver.H:1274
virtual Real getBisectionStep() const noexcept
Get the path-march length used by the bisection intersection algorithm.
Definition CD_ItoSolver.cpp:553
virtual void setTime(int a_step, Real a_time, Real a_dt)
Set the time for this solver.
Definition CD_ItoSolver.cpp:706
virtual void transferCoveredParticles(EBRepresentation a_representation, Real a_tol)
Transfer particles that are covered (within a_tol distance from EB) to another container.
Definition CD_ItoSolver.cpp:978
virtual void remapAll()
Remap all particle containers.
Definition CD_ItoSolver.cpp:3522
bool m_plotDiffusionGradient
Flag for outputting m_diffusionGradient to plot files.
Definition CD_ItoSolver.H:1508
WhichMobilityInterpolation
Enum for deciding how to interpolate particle mobilities.
Definition CD_ItoSolver.H:1253
virtual const RefCountedPtr< ItoSpecies > & getSpecies() const
Get the species.
Definition CD_ItoSolver.cpp:103
bool m_isMobile
If true, solver is mobile, i.e. advection is turned on.
Definition CD_ItoSolver.H:1480
void mergeReinitialize(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell)
Cell-based merge: redistribute each cell's physical particles into near-equal integer weights at rand...
Definition CD_ItoSolver.cpp:4034
virtual int getNumberOfPlotVariables() const
Get number of plot variables.
Definition CD_ItoSolver.cpp:1652
void depositGatheredNGP(LevelData< EBCellFAB > &a_output, const ParticleContainer< ItoParticle > &a_particles, int a_level, Gather a_gather) const noexcept
Do an NGP deposit of a gathered per-particle quantity on a specific grid level. Used for IO.
Definition CD_ItoSolverImplem.H:92
virtual void preRegrid(int a_lbase, int a_oldFinestLevel)
Perform pre-regrid operations.
Definition CD_ItoSolver.cpp:2367
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_comp, const std::string &a_outputRealm, int a_level) const noexcept
Write plot data.
Definition CD_ItoSolver.cpp:1754
Vector< int > m_particlesPerCell
Target number of computational particles per cell, per AMR level.
Definition CD_ItoSolver.H:1328
virtual void generateParticlesFromDensity(ParticleContainer< ItoParticle > &a_particles, const std::function< Real(const RealVect x)> &a_densityFunc, const Vector< int > &a_maxParticlesPerCell) const noexcept
Fill a particle container randomly with particles such that we obtain the target uniform density,...
Definition CD_ItoSolver.cpp:782
EBAMRFAB m_kdMergeCellHistogram
Per-cell occupancy scratch for the kd merges (see ParticleManagement::mergeKDCarve).
Definition CD_ItoSolver.H:1594
virtual void redistributeAMR(EBAMRCellData &a_phi) const
Redistribute mass in an AMR context.
Definition CD_ItoSolver.cpp:2240
bool m_plotParticlesCovered
Flag for depositing and plotting the covered particles on the mesh.
Definition CD_ItoSolver.H:1533
EBIntersection m_intersectionAlg
Algorithm for EB intersection.
Definition CD_ItoSolver.H:1663
Real m_time
Current time.
Definition CD_ItoSolver.H:1448
virtual void setParticleCellMerger(const ParticleManagement::ParticleMerger< ItoMergeParticle > &a_particleCellMerger) noexcept
Set the user-supplied per-cell particle merger used by merge_method = external.
Definition CD_ItoSolver.cpp:94
ParticleManagement::KDAmrBoundary m_kdAmrBoundary
kd_amr: how leaves that touch a patch or rank boundary are resolved.
Definition CD_ItoSolver.H:1307
virtual void regrid(int a_lmin, int a_oldFinestLevel, int a_newFinestLevel)
Regrid this solver.
Definition CD_ItoSolver.cpp:1140
virtual void clear(WhichContainer a_container)
Clear a particle container – this will delete all the particles in the input container.
Definition CD_ItoSolver.cpp:5046
ParticleManagement::ParticleMergeMethod m_mergeMethod
The configured merge method (which scope the merge groups particles over).
Definition CD_ItoSolver.H:1281
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_ItoSolver.H:1410
virtual bool isDiffusive() const
Check if solver is diffusive.
Definition CD_ItoSolver.cpp:2359
void rebuildFromMergeContainer(WhichContainer a_container, ParticleContainer< ItoMergeParticle > &a_merge)
Rebuild a container's ItoParticles from the reduced particles.
Definition CD_ItoSolver.cpp:4249
virtual EBIntersection getIntersectionAlgorithm() const noexcept
Get the EB-particle intersection algorithm.
Definition CD_ItoSolver.cpp:542
virtual EBAMRCellData & getMobilityFunction()
Get mobility function.
Definition CD_ItoSolver.cpp:2485
void parseDeposition()
Parse particle deposition methods.
Definition CD_ItoSolver.cpp:270
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Computational geometry.
Definition CD_ItoSolver.H:1395
virtual void setDiffusionFunction(Real a_diffusionCoefficient)
Utility function – set a constant diffusion coefficient.
Definition CD_ItoSolver.cpp:2507
virtual ParticleContainer< ItoMergeParticle > & getRegridParticles() noexcept
Get the reduced holder the bulk particles ride across a regrid in.
Definition CD_ItoSolver.cpp:572
ItoSolver & operator=(ItoSolver &&)=default
Default move assignment operator.
virtual Real computeAdvectiveDt() const
Compute advection time step dt = dx/vMax where vMax is the largest velocity component of the particle...
Definition CD_ItoSolver.cpp:3342
void invalidateParticleIDs(ParticleContainer< ItoMergeParticle > &a_particles) const
Set every particle id in a reduced-particle container to ParticleSoA::s_invalidID.
Definition CD_ItoSolver.cpp:3768
virtual void organizeParticlesByPatch(WhichContainer a_container)
Sort the input particle container by patch.
Definition CD_ItoSolver.cpp:3590
EBAMRFAB m_kdMergeLeafQuota
Per-cell merge-quota scratch for the kd merges. Same lifetime as m_kdMergeCellHistogram.
Definition CD_ItoSolver.H:1599
virtual void setVerbosity(int a_verbosity)
Set verbosity level for this solver.
Definition CD_ItoSolver.cpp:694
ParticleManagement::KDSplitPlacement m_kdSplitPlacement
Where the pieces of a split particle are placed.
Definition CD_ItoSolver.H:1301
void parsePlotVariables()
Parse plot variables.
Definition CD_ItoSolver.cpp:207
bool m_plotParticlesDomain
Flag for depositing and plotting the domain particles on the mesh.
Definition CD_ItoSolver.H:1523
bool m_plotVelocity
Flag for outputting m_velocityFunction to plot files.
Definition CD_ItoSolver.H:1498
AMR-hierarchy container of computational particles, stored per patch in Struct-of-Arrays form.
Definition CD_ParticleContainer.H:123
Arena-backed Struct-of-Arrays particle container for a single grid patch.
Definition CD_ParticleSoA.H:655
Namespace for various particle management tools.
Definition CD_KDParticleMerge.H:33
std::function< void(ParticleSoA< P, Traits > &a_particles, const CellInfo &a_cellInfo, const int a_numTargetParticles)> ParticleMerger
Concept for splitting/merging particles.
Definition CD_ParticleManagement.H:197
KDSplitPlacement
Where the pieces of a split particle go.
Definition CD_ParticleManagement.H:65
@ Center
Every piece at the parent's position. No spatial perturbation, duplicate positions.
KDPartition
How a kd merge divides a node into two children.
Definition CD_ParticleManagement.H:48
@ Weight
Split at the weight median at every node; halves carry near-equal weight.
KDAmrBoundary
How the AMR-scope kd merge resolves the leaves that touch a patch or rank boundary.
Definition CD_ParticleManagement.H:94
@ Carve
Arbitrate contested particles between patches (z-buffer carve).
NNSearch
How the AMR-scope nearest-neighbour merge finds a particle's merge candidates.
Definition CD_ParticleManagement.H:105
@ Tree
One whole-patch PointCloudBVH per patch.
KDPlacement
Where a kd merge puts the particle a leaf reduces to.
Definition CD_ParticleManagement.H:80
@ Centroid
The leaf's weighted centroid.
ParticleMergeMethod
The super-particle merge methods, named by the scope they group particles over.
Definition CD_ParticleManagement.H:118
@ KdCell
Cell: makeKDCellMerger, one kd tree per cell.
Phase names namespace.
Definition CD_MultiFluidIndexSpace.H:28
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38
Reduced Ito particle: everything an ItoParticle carries that is not recomputed from the mesh.
Definition CD_ItoMergeParticle.H:40
SoA payload for ItoSolver particles, i.e. drifting Brownian walkers.
Definition CD_ItoParticle.H:31