30#include <CD_NamespaceHeader.H>
124 setRealm(
const std::string& a_realm);
165 const std::function<Real(const RealVect x)>& a_densityFunc,
166 const Vector<
int>& a_maxParticlesPerCell) const noexcept;
176 const std::function<Real(const RealVect x)>& a_densityFunc,
177 int a_maxParticlesPerCell) const noexcept;
186 regrid(
int a_lmin,
int a_oldFinestLevel,
int a_newFinestLevel);
336 int a_level) const noexcept;
346 template <typename Gather>
351 Gather a_gather) const noexcept;
379 template <typename P, typename Traits>
397 template <typename Gather>
403 Gather a_gather) const;
485 const
bool a_deleteParticles,
512 const bool a_deleteParticles,
538 const bool a_deleteParticles,
552 computeLoads(Vector<long int>& a_loads,
const DisjointBoxLayout& a_dbl,
int a_level);
565 virtual Vector<std::string>
579 const std::string& a_outputRealm,
580 int a_level)
const noexcept;
588 virtual unsigned long long
610 setAmr(
const RefCountedPtr<AmrMesh>& a_amr);
634 setTime(
int a_step, Real a_time, Real a_dt);
646 writeCheckpointLevel(HDF5Handle& a_handle,
int a_level)
const;
658 readCheckpointLevel(HDF5Handle& a_handle,
int a_level);
666 setSpecies(
const RefCountedPtr<ItoSpecies>& a_species);
675 preRegrid(
int a_lbase,
int a_oldFinestLevel);
711 virtual const RefCountedPtr<ItoSpecies>&
718 virtual EBAMRCellData&
725 virtual EBAMRCellData&
732 virtual const EBAMRCellData&
739 virtual EBAMRCellData&
746 virtual const EBAMRCellData&
753 virtual EBAMRCellData&
760 virtual const EBAMRCellData&
891 const Vector<int>& a_particlesPerCell,
902 virtual const Vector<int>&
993 computeDt(
int a_lvl, const DataIndex& a_dit) const;
1050 computeHopDt(Real a_maxCellsToMove,
int a_lvl, const DataIndex& a_dit) const;
1536 const Vector<int>& a_particlesPerCell,
1551 const Vector<int>& a_particlesPerCell,
1669 template <NnPairSearchBackend Backend>
1720 const Vector<int>& a_particlesPerCell,
1721 bool a_enableBoundaryCarve);
1775 writeCheckPointLevelParticles(HDF5Handle& a_handle,
int a_level)
const;
1789 writeCheckPointLevelFluid(HDF5Handle& a_handle,
int a_level)
const;
1800 readCheckpointLevelParticles(HDF5Handle& a_handle,
int a_level);
1812 readCheckpointLevelFluid(HDF5Handle& a_handle,
int a_level);
1823 drawNewParticles(
const LevelData<EBCellFAB>& a_particlesPerCell,
int a_level,
int a_newPPC);
1856 depositHybrid(EBAMRCellData& a_depositionH, EBAMRIVData& a_massDifference,
const EBAMRIVData& a_depositionNC)
const;
1865 interpolateMobilities(
int a_lvl,
const DataIndex& a_dit,
const EBCellFAB& a_velocityMagnitude)
noexcept;
1925 writeData(LevelData<EBCellFAB>& a_output,
1927 const EBAMRCellData& a_data,
1928 const std::string& a_outputRealm,
1930 bool a_interpToCentroids,
1931 bool a_interpGhost)
const noexcept;
1934#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 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:40
void mergeKDImpl(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell, bool a_enableBoundaryCarve)
Whole-container merge: whole-patch kd-tree build – shared implementation behind the kd_carve and kd_p...
Definition CD_ItoSolver.cpp:4698
virtual void computeAverageEnergy(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average particle energy..
Definition CD_ItoSolver.cpp:2018
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:2979
int m_nnPairMaxCellDistance
nn_pair_tree/nn_pair_hash: maximum merge distance in whole cells (Chebyshev). A negative value means ...
Definition CD_ItoSolver.H:1225
void mergeNnPairSearch(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell)
Whole-container merge: distributed nearest-neighbour pair merge – shared implementation behind the nn...
Definition CD_ItoSolver.cpp:4124
virtual void interpolateMobilities()
Interpolate mobilities.
Definition CD_ItoSolver.cpp:2549
WhichContainer
Enum class for distinguishing various types of particle containers.
Definition CD_ItoSolver.H:51
phase::which_phase getPhase() const
Return phase.
Definition CD_ItoSolver.cpp:3374
void parseDiffusionHop()
Parse diffusion hop.
void mergeEqualWeightKD(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell)
Cell-based merge: equal-weight KD partition, one weighted-centroid particle per leaf.
Definition CD_ItoSolver.cpp:3674
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:1769
CoarseFineDeposition m_coarseFineDeposition
Coarse-fine deposition strategy.
Definition CD_ItoSolver.H:1413
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:3470
bool m_plotPhi
Flag for outputting m_phi to plot files.
Definition CD_ItoSolver.H:1358
virtual Vector< std::string > getPlotVariableNames() const
Get output plot names.
Definition CD_ItoSolver.cpp:1604
virtual void setSpecies(const RefCountedPtr< ItoSpecies > &a_species)
Set the species.
Definition CD_ItoSolver.cpp:1175
EBAMRCellData m_diffusionFunction
Diffusion-centerer field used for interpolating diffusion coefficients.
Definition CD_ItoSolver.H:1438
virtual void registerOperators() const
Register operators.
Definition CD_ItoSolver.cpp:582
int m_nnPairMaxRounds
nn_pair_tree/nn_pair_onecell/nn_pair_hash: maximum number of drain rounds run per makeSuperparticles(...
Definition CD_ItoSolver.H:1234
virtual void depositParticles()
Deposit particles onto mesh.
Definition CD_ItoSolver.cpp:2054
CoarseFineDeposition getCoarseFineDeposition() const
Get the coarse-fine deposition strategy.
Definition CD_ItoSolver.cpp:3368
bool m_plotEnergyDensity
Flag for plotting the energy density on the mesh.
Definition CD_ItoSolver.H:1398
Real m_kdSplitWeightLeafDx
Leaf size, in cell widths, at or below which the tree build switches from count-median to weight-medi...
Definition CD_ItoSolver.H:1244
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:2178
virtual void makeSuperparticles(WhichContainer a_container)
Make superparticles for a full container, merging to the solver's configured target.
Definition CD_ItoSolver.cpp:3406
void mergeReinitializeBVH(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell)
Cell-based merge: as mergeEqualWeightKD(), with reinitialized leaf positions.
Definition CD_ItoSolver.cpp:3782
Real m_bisectionStep
Bisection step size to use for particle intersection tests with EBs.
Definition CD_ItoSolver.H:1298
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:3927
int m_restartPPC
Number of particles used when restarting a simulation – this is relevant only when restarting from a ...
Definition CD_ItoSolver.H:1250
NnPairSearchBackend
Which EBGeometry point-cloud index backs mergeNnPairSearch()'s per-patch spatial search – see Particl...
Definition CD_ItoSolver.H:1607
@ Tree
EBGeometry::PointCloudBVH – ParticleManagement::mergeNearestNeighborsTree().
@ Hash
EBGeometry::PointCloudHashGrid – ParticleManagement::mergeNearestNeighborsHash().
virtual void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set computational geometry.
Definition CD_ItoSolver.cpp:556
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:3588
ParticleContainer< ItoMergeParticle > m_regridParticles
The bulk particles, in reduced form, between preRegrid() and regrid().
Definition CD_ItoSolver.H:1485
void parseIntersectionEB()
Parse EB intersection algorithms.
Definition CD_ItoSolver.cpp:325
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:989
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amr)
Set the AmrMesh object.
Definition CD_ItoSolver.cpp:569
void mergeNnSfc(ParticleContainer< ItoMergeParticle > &a_particles, const Vector< int > &a_particlesPerCell)
Cell-based merge: Hilbert-curve sort, then merge adjacent pairs down to the target.
Definition CD_ItoSolver.cpp:3875
bool m_forceHaloNGP
Force usage of NGP when depositing "halo" particles.
Definition CD_ItoSolver.H:1333
virtual std::string getRealm() const
Get the realm where this solver is registered.
Definition CD_ItoSolver.cpp:76
static constexpr int m_nComp
Default number of component in data holders (do not touch).
Definition CD_ItoSolver.H:1130
void parseRedistribution()
Parse whether or not to use redistribution.
Definition CD_ItoSolver.cpp:351
bool m_forceIrregInterpolationNGP
NGP interpolation in cut cells or not.
Definition CD_ItoSolver.H:1328
EBAMRIVData m_depositionNC
Scratch storage for holding the non-conservative deposition.
Definition CD_ItoSolver.H:1456
virtual Real computeDiffusiveDt() const
Compute the diffusive dt. This computes dt = dx*dx/(2*SpaceDim*D) for all particles.
Definition CD_ItoSolver.cpp:3236
void parseParticleMerger()
Parse the super-particle merger.
Definition CD_ItoSolver.cpp:401
std::string m_className
Class name.
Definition CD_ItoSolver.H:1286
virtual void updateDiffusion()
Update mobilities parametrically from the particle energy.
Definition CD_ItoSolver.cpp:2811
bool m_plotParticles
Flag for depositing and plotting the bulk particles on the mesh.
Definition CD_ItoSolver.H:1373
int m_timeStep
Time step.
Definition CD_ItoSolver.H:1308
void coarsenAndFillGhosts(EBAMRCellData &a_phi) const
Coarsen the input data and interpolate its ghost cells.
Definition CD_ItoSolver.cpp:2121
virtual EBAMRCellData & getVelocityFunction()
Get cell-centered velocity mesh data.
Definition CD_ItoSolver.cpp:2332
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:2625
bool m_forceIrregDepositionNGP
NGP deposition in cut cells or not.
Definition CD_ItoSolver.H:1323
std::string m_realm
Realm where this solve lives.
Definition CD_ItoSolver.H:1255
virtual void depositConductivity(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Deposit conductivities (i.e. mass*mobility / volume)
Definition CD_ItoSolver.cpp:1835
virtual const Vector< int > & getParticlesPerCell() const noexcept
Get the configured target number of computational particles per cell, per AMR level.
Definition CD_ItoSolver.cpp:519
virtual void interpolateVelocities()
Interpolate the particle velocities.
Definition CD_ItoSolver.cpp:2482
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:2657
virtual void parseOptions()
Parse class options.
Definition CD_ItoSolver.cpp:114
bool m_plotParticlesSource
Flag for depositing and plotting the source particles on the mesh.
Definition CD_ItoSolver.H:1388
virtual Real computeDt() const
Compute a time step for the advance – this calls the level function.
Definition CD_ItoSolver.cpp:2862
RefCountedPtr< ItoSpecies > m_species
Species that this solver solves for.
Definition CD_ItoSolver.H:1270
DepositionType m_deposition
Deposition method when depositing particles to the mesh.
Definition CD_ItoSolver.H:1408
virtual void interpolateDiffusion()
Interpolate the diffusion field to the particle positions.
Definition CD_ItoSolver.cpp:2757
virtual void computeAverageMobility(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average mobility.
Definition CD_ItoSolver.cpp:1948
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:53
Real m_dt
Time step.
Definition CD_ItoSolver.H:1318
ItoSolver()
Constructor – user must subsequently set the realm and, parse class options, set the species etc.
Definition CD_ItoSolver.cpp:42
std::string m_name
Solver name.
Definition CD_ItoSolver.H:1280
virtual std::string getName() const
Get this solver's name.
Definition CD_ItoSolver.cpp:68
ItoSolver & operator=(const ItoSolver &)=delete
Deleted copy assignment operator.
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:4306
EBAMRCellData m_velocityFunction
Cell-centered field used for interpolating velocities.
Definition CD_ItoSolver.H:1433
virtual void removeCoveredParticles(EBRepresentation a_representation, Real a_tol)
Remove particles that are inside the EB.
Definition CD_ItoSolver.cpp:865
WhichCheckpoint m_checkpointing
How to checkpoint files. particles => write particles to HDF5. numbers => write numbers to HDF5.
Definition CD_ItoSolver.H:1156
virtual ~ItoSolver()
Destructor (does nothing).
Definition CD_ItoSolver.cpp:62
void parseCheckpointing()
Parse checkpointing method.
Definition CD_ItoSolver.cpp:377
bool m_isDiffusive
If true, solver is diffusive.
Definition CD_ItoSolver.H:1348
bool m_plotAverageEnergy
Flag for plotting the average particle energy on the mesh.
Definition CD_ItoSolver.H:1403
DepositionType m_plotDeposition
Deposition method when depositing particles to mesh during plotting.
Definition CD_ItoSolver.H:1418
RealVect randomGaussian() const
Draw a random N-dimensional Gaussian number from a normal distribution with zero with and unit standa...
Definition CD_ItoSolverImplem.H:32
virtual ParticleContainer< ItoParticle > & getParticles(WhichContainer a_container)
Get a general particle container.
Definition CD_ItoSolver.cpp:2299
virtual void setPhase(phase::which_phase a_phase)
Set phase where the particles will live.
Definition CD_ItoSolver.cpp:630
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:535
virtual void remap()
Remap the bulk particle container.
Definition CD_ItoSolver.cpp:3338
virtual void organizeParticlesByCell(WhichContainer a_container)
Sort the input particle container by cell.
Definition CD_ItoSolver.cpp:3380
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:836
virtual void setRealm(const std::string &a_realm)
Set the realm where this solver will live.
Definition CD_ItoSolver.cpp:84
bool m_useRedistribution
Use mass redistribution or not.
Definition CD_ItoSolver.H:1338
EBAMRCellData m_mobilityFunction
Mobility function – used when interpolating particle mobilities.
Definition CD_ItoSolver.H:1428
virtual void updateMobilities()
Update mobilities parametrically from the particle energy.
Definition CD_ItoSolver.cpp:2708
std::map< WhichContainer, ParticleContainer< ItoParticle > > m_particleContainers
Various particle containers with identifiers.
Definition CD_ItoSolver.H:1466
virtual bool isMobile() const
Check if solver is mobile.
Definition CD_ItoSolver.cpp:2243
virtual EBAMRCellData & getDiffusionFunction()
Get the diffusion function.
Definition CD_ItoSolver.cpp:2354
void splitFromMergeContainer(ParticleContainer< ItoMergeParticle > &a_merge, int a_numParticlesPerCellThresh)
Split every under-full cell up to the target count.
Definition CD_ItoSolver.cpp:3998
int m_verbosity
Verbosity level for this solver.
Definition CD_ItoSolver.H:1303
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:132
virtual void setParticleDiffusion(Real a_diffCo)
Sets diffusion coefficient for all particles.
Definition CD_ItoSolver.cpp:2452
virtual void depositDiffusivity(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Deposit diffusivity (i.e. mass*D/volume)
Definition CD_ItoSolver.cpp:1876
WhichCheckpoint
How to checkpoint files.
Definition CD_ItoSolver.H:1137
Real m_normalDistributionTruncation
Truncation value for normal distribution.
Definition CD_ItoSolver.H:1293
std::optional< ParticleManagement::ParticleMergeMethod > m_regridMergeMethod
Which merge method to run inside ItoSolver::regrid(), or nullopt for "whatever merge_algorithm says".
Definition CD_ItoSolver.H:1204
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:1450
bool m_plotParticlesEB
Flag for depositing and plotting the EB particles on the mesh.
Definition CD_ItoSolver.H:1378
bool m_blendConservation
Flag for blending the deposition clouds with the "non-conservative" divergence.
Definition CD_ItoSolver.H:1343
virtual EBAMRCellData & getPhi()
Get the mesh data.
Definition CD_ItoSolver.cpp:2321
virtual void allocate()
Allocate internal storage.
Definition CD_ItoSolver.cpp:1189
void mergeKDSkinNn(ParticleContainer< ItoMergeParticle > &merge, const Vector< int > &a_particlesPerCell)
Whole-container merge: kd-tree with a nearest-neighbour skin (the kd_skin_nn selector).
Definition CD_ItoSolver.cpp:4424
virtual void setVelocityFunction(const RealVect &a_velocity)
Utility function – set a constant velocity.
Definition CD_ItoSolver.cpp:2409
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:1162
void parseVerbosity()
Parse class verbosity.
Definition CD_ItoSolver.cpp:153
static constexpr int m_comp
Default component in data holders (do not touch).
Definition CD_ItoSolver.H:1125
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:2194
void parseDivergenceComputation()
Parse whether or not to compute a "non-conservative" divergence when redistributing mass.
Definition CD_ItoSolver.cpp:364
RefCountedPtr< AmrMesh > m_amr
AMR; needed for grid stuff.
Definition CD_ItoSolver.H:1265
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:1912
void parseRNG()
Parse RNG options – this parses the RNG seed and instantiates the distributions.
Definition CD_ItoSolver.cpp:166
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:2078
DepositionType getDeposition() const
Get deposition method.
Definition CD_ItoSolver.cpp:3362
void parseTruncation()
Parse the normal distribution truncation level.
Definition CD_ItoSolver.cpp:180
EBAMRIVData m_massDiff
Scratch storage for holding the mass difference when using hybrid deposition.
Definition CD_ItoSolver.H:1461
virtual void setParticleMobility(Real a_mobility)
Sets mobility coefficient for all particles.
Definition CD_ItoSolver.cpp:2422
bool m_nnPairIterate
nn_pair_tree/nn_pair_onecell/nn_pair_hash: iterate the local trivial tier to convergence within each ...
Definition CD_ItoSolver.H:1212
EBAMRCellData m_phi
Storage for particle mesh data.
Definition CD_ItoSolver.H:1423
virtual void initialData()
Set the initial data.
Definition CD_ItoSolver.cpp:666
virtual void computeAverageDiffusion(EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
Compute average diffusion coefficient.
Definition CD_ItoSolver.cpp:1983
virtual void parseRuntimeOptions()
Parse class runtime configurable options.
Definition CD_ItoSolver.cpp:134
bool m_plotDiffCo
Flag for outputting m_diffusionFunction to plot files.
Definition CD_ItoSolver.H:1368
ParticleManagement::ParticleMerger< ItoMergeParticle > m_particleCellMerger
User-supplied per-cell merger for merge_algorithm = external (set via setParticleCellMerger())....
Definition CD_ItoSolver.H:1169
virtual void setTime(int a_step, Real a_time, Real a_dt)
Set the time for this solver.
Definition CD_ItoSolver.cpp:653
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:925
virtual void remapAll()
Remap all particle containers.
Definition CD_ItoSolver.cpp:3325
int m_nnPairFallback
nn_pair_tree/nn_pair_onecell/nn_pair_hash: number of fallback candidates per query....
Definition CD_ItoSolver.H:1218
WhichMobilityInterpolation
Enum for deciding how to interpolate particle mobilities.
Definition CD_ItoSolver.H:1148
virtual const RefCountedPtr< ItoSpecies > & getSpecies() const
Get the species.
Definition CD_ItoSolver.cpp:101
bool m_isMobile
If true, solver is mobile, i.e. advection is turned on.
Definition CD_ItoSolver.H:1353
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:3734
virtual int getNumberOfPlotVariables() const
Get number of plot variables.
Definition CD_ItoSolver.cpp:1560
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:84
virtual void preRegrid(int a_lbase, int a_oldFinestLevel)
Perform pre-regrid operations.
Definition CD_ItoSolver.cpp:2259
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:1652
Vector< int > m_particlesPerCell
Target number of computational particles per cell, per AMR level.
Definition CD_ItoSolver.H:1192
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:729
EBAMRFAB m_kdMergeCellHistogram
Per-cell occupancy scratch for the kd merges (see ParticleManagement::mergeKDCarve).
Definition CD_ItoSolver.H:1446
virtual void redistributeAMR(EBAMRCellData &a_phi) const
Redistribute mass in an AMR context.
Definition CD_ItoSolver.cpp:2133
bool m_plotParticlesCovered
Flag for depositing and plotting the covered particles on the mesh.
Definition CD_ItoSolver.H:1393
EBIntersection m_intersectionAlg
Algorithm for EB intersection.
Definition CD_ItoSolver.H:1490
Real m_time
Current time.
Definition CD_ItoSolver.H:1313
virtual void setParticleCellMerger(const ParticleManagement::ParticleMerger< ItoMergeParticle > &a_particleCellMerger) noexcept
Set the user-supplied per-cell particle merger used by merge_algorithm = external.
Definition CD_ItoSolver.cpp:92
virtual void regrid(int a_lmin, int a_oldFinestLevel, int a_newFinestLevel)
Regrid this solver.
Definition CD_ItoSolver.cpp:1084
virtual void clear(WhichContainer a_container)
Clear a particle container – this will delete all the particles in the input container.
Definition CD_ItoSolver.cpp:4828
ParticleManagement::ParticleMergeMethod m_mergeMethod
The configured merge method (which specific algorithm).
Definition CD_ItoSolver.H:1177
phase::which_phase m_phase
Phase where this solver lives.
Definition CD_ItoSolver.H:1275
virtual bool isDiffusive() const
Check if solver is diffusive.
Definition CD_ItoSolver.cpp:2251
void rebuildFromMergeContainer(WhichContainer a_container, ParticleContainer< ItoMergeParticle > &a_merge)
Rebuild a container's ItoParticles from the reduced particles.
Definition CD_ItoSolver.cpp:4073
virtual EBIntersection getIntersectionAlgorithm() const noexcept
Get the EB-particle intersection algorithm.
Definition CD_ItoSolver.cpp:508
virtual EBAMRCellData & getMobilityFunction()
Get mobility function.
Definition CD_ItoSolver.cpp:2376
void parseDeposition()
Parse particle deposition methods.
Definition CD_ItoSolver.cpp:252
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Computational geometry.
Definition CD_ItoSolver.H:1260
virtual void setDiffusionFunction(Real a_diffusionCoefficient)
Utility function – set a constant diffusion coefficient.
Definition CD_ItoSolver.cpp:2398
virtual ParticleContainer< ItoMergeParticle > & getRegridParticles() noexcept
Get the reduced holder the bulk particles ride across a regrid in.
Definition CD_ItoSolver.cpp:527
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:3145
void invalidateParticleIDs(ParticleContainer< ItoMergeParticle > &a_particles) const
Set every particle id in a reduced-particle container to ParticleSoA::s_invalidID.
Definition CD_ItoSolver.cpp:3567
virtual void organizeParticlesByPatch(WhichContainer a_container)
Sort the input particle container by patch.
Definition CD_ItoSolver.cpp:3393
EBAMRFAB m_kdMergeLeafQuota
Per-cell merge-quota scratch for the kd merges. Same lifetime as m_kdMergeCellHistogram.
Definition CD_ItoSolver.H:1451
virtual void setVerbosity(int a_verbosity)
Set verbosity level for this solver.
Definition CD_ItoSolver.cpp:641
void parsePlotVariables()
Parse plot variables.
Definition CD_ItoSolver.cpp:193
bool m_plotParticlesDomain
Flag for depositing and plotting the domain particles on the mesh.
Definition CD_ItoSolver.H:1383
bool m_plotVelocity
Flag for outputting m_velocityFunction to plot files.
Definition CD_ItoSolver.H:1363
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
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:84
ParticleMergeMethod
The specific super-particle merge methods.
Definition CD_ParticleManagement.H:40
@ EqualWeightKD
Cell: makeEqualWeightKDMerger.
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