|
|
|
| EBAMRParticleMesh () |
| | Default constructor. Leaves the object undefined; call define().
|
| |
|
| ~EBAMRParticleMesh ()=default |
| | Destructor.
|
| |
|
| EBAMRParticleMesh (const EBAMRParticleMesh &)=delete |
| | Copy construction is deleted (shared RefCountedPtr state).
|
| |
| EBAMRParticleMesh & | operator= (const EBAMRParticleMesh &)=delete |
| | Copy assignment is deleted.
|
| |
| void | define (const Vector< RefCountedPtr< EBLevelGrid > > &a_eblgs, const Vector< int > &a_refRat, const Vector< Real > &a_dx, const RealVect &a_probLo, const int a_ghost, const int a_finestLevel) |
| | Define the per-level leaves, coarse-fine mesh operators, and halo/transition masks.
|
| |
|
| template<auto... Members, typename P , typename Traits > |
| void | interpolate (ParticleContainer< P, Traits > &a_particles, const EBAMRCellData &a_meshData, const DepositionType a_interpType, const bool a_forceIrregNGP) const |
| | Interpolate a mesh field onto one or more payload columns, across all levels.
|
| |
| template<typename P , typename Traits > |
| void | interpolateWeight (ParticleContainer< P, Traits > &a_particles, const EBAMRCellData &a_meshData, const DepositionType a_interpType, const bool a_forceIrregNGP) const |
| | Interpolate a mesh field onto the container-owned weight column, across all levels.
|
| |
|
| template<typename P , typename Traits > |
| void | depositWeight (EBAMRCellData &a_meshData, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP) |
| | Deposit the container-owned weight onto the AMR mesh.
|
| |
| template<typename P , typename Traits , typename CellGather > |
| void | depositGathered (EBAMRCellData &a_meshData, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP, CellGather a_cellGather) |
| | Deposit a custom per-particle scalar (computed by a_cellGather) onto the AMR mesh.
|
| |
| template<auto... Members, typename P , typename Traits > |
| void | deposit (EBAMRCellData &a_meshData, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP) |
| | Deposit one or more payload columns onto the AMR mesh.
|
| |
|
|
void | errorUnsupported () const |
| | Abort on an unrecognized coarse-fine deposition strategy.
|
| |
|
void | defineEBParticleMesh () |
| | Build the per-level per-patch EBParticleMesh leaves (valid grids + refined-coarse grids).
|
| |
|
void | defineLevelMotion () |
| | Build the per-level valid+ghost -> valid Copiers.
|
| |
|
void | defineCoarseFineMotion () |
| | Build the per-level coarse-fine mesh operators (null on level 0).
|
| |
| template<typename Container , typename PatchDeposit > |
| void | depositInterpCore (EBAMRCellData &a_meshData, const Container &a_particles, const int a_numComp, PatchDeposit a_patchDeposit) const |
| | The CoarseFineDeposition::Interp deposition algorithm, parameterized by the per-patch deposit.
|
| |
| void | defineOuterHaloMasks () |
| | Build the per-width outer-halo masks: per level, the coarse cells just outside the fine patch.
|
| |
| template<int NCOMP, typename Container , typename PatchDeposit > |
| void | depositHaloCore (EBAMRCellData &a_meshData, const Container &a_particles, PatchDeposit a_patchDeposit) const |
| | The CoarseFineDeposition::Halo deposition algorithm.
|
| |
| template<int NCOMP, typename Container , typename PatchDeposit , typename PatchDepositNGP > |
| void | depositHaloNGPCore (EBAMRCellData &a_meshData, const Container &a_particles, PatchDeposit a_patch, PatchDepositNGP a_patchNGP) const |
| | The CoarseFineDeposition::HaloNGP deposition algorithm.
|
| |
| int | getTransitionMaskWidth (const DepositionType a_depositionType, const int a_refRat) const |
| | Transition-mask width for a kernel: CIC -> refRat/2, TSC -> refRat (NGP is handled upstream).
|
| |
| void | defineTransitionMasks () |
| | Build the per-width transition masks: the fine-side transition band, on the refined-coarse grid.
|
| |
| template<typename Container > |
| void | transferMaskParticlesTransition (Container &a_particles, const DepositionType a_depositionType) const |
| | Move the coarse-side transition particles into the container mask holder (using the FiCo mask).
|
| |
| template<int NCOMP, typename Container , typename PatchDeposit > |
| void | depositTransitionCore (EBAMRCellData &a_meshData, const Container &a_particles, const DepositionType a_depositionType, PatchDeposit a_patch) const |
| | The CoarseFineDeposition::Transition deposition algorithm.
|
| |
|
|
Vector< RefCountedPtr< EBLevelGrid > > | m_eblgs |
| | Per-level EB level grids.
|
| |
|
Vector< int > | m_refRat |
| | Per-level refinement ratios.
|
| |
|
Vector< Real > | m_dx |
| | Per-level grid spacing (isotropic).
|
| |
|
RealVect | m_probLo |
| | Lower-left corner of the physical domain.
|
| |
|
int | m_ghost |
| | Number of ghost cells in the mesh data holders.
|
| |
|
int | m_finestLevel |
| | Finest AMR level index.
|
| |
|
bool | m_isDefined |
| | Whether define() has been called.
|
| |
|
Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > | m_ebParticleMesh |
| | Per-level per-patch deposition/interpolation leaves.
|
| |
|
Vector< Copier > | m_levelCopiers |
| | Per-level valid+ghost -> valid Copiers (fold ghost-deposited mass into the owner patch).
|
| |
|
Vector< RefCountedPtr< EBCoarseFineParticleMesh > > | m_coarseFinePM |
| | Per-level coarse-fine mesh operators (null on level 0).
|
| |
|
Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > | m_ebParticleMeshFiCo |
| | Per-level per-patch leaves on the refined-coarse (FiCo) grid (null on level 0).
|
| |
|
std::map< int, Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > > | m_outerHaloMasks |
| | Outer-halo masks keyed by halo width: per-level coarse cells just outside the fine patch.
|
| |
|
std::map< int, Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > > | m_transitionMasks |
| | Transition masks keyed by width: per-level fine-side transition band, on the refined-coarse grid.
|
| |
AMR driver that deposits/interpolates ParticleContainer particles across the hierarchy.
EBAMRParticleMesh deposits the particles of a ParticleContainer onto AMR mesh data and interpolates mesh data back onto particle columns, by driving the per-patch EBParticleMesh leaf on every box of every level. define() builds the per-level leaves (on the valid grids and the refined-coarse grids), the level valid+ghost -> valid Copiers, the EBCoarseFineParticleMesh operators, and the halo/transition masks; it must be called before any deposit or interpolate.
Interpolation
interpolate() and interpolateWeight() are purely per-level/per-patch: the mesh is assumed to be valid+ghosted by the caller, so no coarse-fine coupling is needed.
Deposition
deposit(), depositWeight(), and depositGathered() conserve mass across refinement boundaries, and select how the coarse-fine overlap is handled through CoarseFineDeposition:
- Interp – move the over-boundary mass between levels with the coarse-fine mesh operators.
- Halo – re-deposit the coarse-side halo particles on the refined-coarse grid (via the container's mask holder and the FiCo buffer) and add them to the fine level.
- HaloNGP – deposit the near-boundary halo particles with NGP so their clouds do not spread across the boundary (no refined-coarse buffer is needed).
- Transition – deposit the coarse-side transition particles on the refined-coarse grid at the fine-grid width, distributing the result to both levels. Halo, HaloNGP, and Transition require at least one ghost cell.
| void EBAMRParticleMesh::defineOuterHaloMasks |
( |
| ) |
|
|
inlineprotected |
Build the per-width outer-halo masks: per level, the coarse cells just outside the fine patch.
For each ghost width in [1, m_ghost] and each level with a finer level, marks the coarse cells within that width of the refinement boundary (on the coarse side), excluding the coarsened-fine valid region and its neighbours. The mask drives copyMaskParticles in the Halo deposit. Storage-agnostic (operates on the grids only). Empty BaseFabs are undefined.
| void EBAMRParticleMesh::defineTransitionMasks |
( |
| ) |
|
|
inlineprotected |
Build the per-width transition masks: the fine-side transition band, on the refined-coarse grid.
For each width in [1, m_ghost] and each level with a finer level, builds the fine-grid coarse-fine interface band (fine ghost cells just outside the fine boxes), transfers it to the refined-coarse (FiCo) grid of the finer level, and stores it as a boolean mask there. Storage- agnostic. Empty BaseFabs are undefined.
template<typename P , typename Traits , typename CellGather >
| void EBAMRParticleMesh::depositGathered |
( |
EBAMRCellData & |
a_meshData, |
|
|
const ParticleContainer< P, Traits > & |
a_particles, |
|
|
const DepositionType |
a_depositionType, |
|
|
const CoarseFineDeposition |
a_coarseFineDeposition, |
|
|
const bool |
a_forceIrregNGP, |
|
|
CellGather |
a_cellGather |
|
) |
| |
|
inline |
Deposit a custom per-particle scalar (computed by a_cellGather) onto the AMR mesh.
Generalizes depositWeight() to an arbitrary per-particle value (a product of columns such as weight*mobility), dispatching on the coarse-fine strategy exactly like depositWeight(). Deposits one mesh component.
- Template Parameters
-
| P | Payload type (deduced). |
| Traits | Column descriptor (deduced). |
| CellGather | Callable (const ParticleSoA<P, Traits>& a_leaf, std::size_t a_i) -> Real. |
- Parameters
-
| [in,out] | a_meshData | AMR mesh data (one component; RESET then filled). |
| [in] | a_particles | Particles to deposit. |
| [in] | a_depositionType | Deposition kernel (NGP/CIC/TSC). |
| [in] | a_coarseFineDeposition | Coarse-fine handling (Interp / Halo / HaloNGP / Transition). |
| [in] | a_forceIrregNGP | Force NGP in cut cells. |
| [in] | a_cellGather | Per-particle value gatherer (leaf, index) -> Real. |
template<int NCOMP, typename Container , typename PatchDeposit >
| void EBAMRParticleMesh::depositHaloCore |
( |
EBAMRCellData & |
a_meshData, |
|
|
const Container & |
a_particles, |
|
|
PatchDeposit |
a_patchDeposit |
|
) |
| const |
|
inlineprotected |
The CoarseFineDeposition::Halo deposition algorithm.
Like Interp for the on-level deposit + fine-ghost->coarse transfer, but instead of interpolating the coarse mass under the fine grid, it re-deposits the coarse-side halo particles (selected by the width-1 outer-halo mask, copied into the container mask holder) on the refined-coarse grid with widthScale = refinement ratio, and adds that to the fine level.
- Template Parameters
-
- Parameters
-
| [in,out] | a_meshData | AMR mesh data (RESET then filled). |
| [in] | a_particles | Particle container (its mask holder is filled then cleared). |
| [in] | a_patchDeposit | Per-patch deposition functor. |
template<int NCOMP, typename Container , typename PatchDeposit , typename PatchDepositNGP >
| void EBAMRParticleMesh::depositHaloNGPCore |
( |
EBAMRCellData & |
a_meshData, |
|
|
const Container & |
a_particles, |
|
|
PatchDeposit |
a_patch, |
|
|
PatchDepositNGP |
a_patchNGP |
|
) |
| const |
|
inlineprotected |
The CoarseFineDeposition::HaloNGP deposition algorithm.
Moves the coarse-side halo particles (width-1 mask) out of the valid holder, deposits the remaining (non-halo) particles with the requested kernel and the halo particles with NGP onto the same level mesh, folds fine-ghost mass to the coarse level, then transfers the halo particles back to the valid holder. NGP keeps the near-boundary clouds from spreading over the refinement boundary, so no refined-coarse buffer is needed.
- Template Parameters
-
| NCOMP | Number of mesh components (compile-time). |
| Container | ParticleContainer type (deduced). |
| PatchDeposit | Per-patch deposit with the requested kernel. |
| PatchDepositNGP | Per-patch deposit forced to NGP. |
- Parameters
-
| [in,out] | a_meshData | AMR mesh data (RESET then filled). |
| [in] | a_particles | Particle container (halo particles are moved out then back). |
| [in] | a_patch | Per-patch deposit functor (requested kernel). |
| [in] | a_patchNGP | Per-patch deposit functor (NGP). |
template<typename Container , typename PatchDeposit >
| void EBAMRParticleMesh::depositInterpCore |
( |
EBAMRCellData & |
a_meshData, |
|
|
const Container & |
a_particles, |
|
|
const int |
a_numComp, |
|
|
PatchDeposit |
a_patchDeposit |
|
) |
| const |
|
inlineprotected |
The CoarseFineDeposition::Interp deposition algorithm, parameterized by the per-patch deposit.
Resets the mesh, deposits each level's valid particles (via a_patchDeposit), folds ghost-deposited mass into the owner patch (level Copier + EBAddOp), then moves the over-boundary mass between levels with the coarse-fine operators. Uses only valid particles.
- Template Parameters
-
- Parameters
-
| [in,out] | a_meshData | AMR mesh data (RESET then filled). |
| [in] | a_particles | Particle container. |
| [in] | a_numComp | Number of mesh components written. |
| [in] | a_patchDeposit | Per-patch deposition functor. |
template<int NCOMP, typename Container , typename PatchDeposit >
| void EBAMRParticleMesh::depositTransitionCore |
( |
EBAMRCellData & |
a_meshData, |
|
|
const Container & |
a_particles, |
|
|
const DepositionType |
a_depositionType, |
|
|
PatchDeposit |
a_patch |
|
) |
| const |
|
inlineprotected |
The CoarseFineDeposition::Transition deposition algorithm.
NGP short-circuits to the Interp result. Otherwise: moves the coarse-side transition particles out of the valid holder; deposits the remaining particles with the kernel and folds fine-ghost mass to coarse; then deposits the transition particles on the refined-coarse grid with the fine-grid width and distributes that buffer to both the fine level (addFiCoDataToFine + exchangeAndAddFiCoData) and the coarse level (restrictAndAddFiCoDataToCoar); finally returns the transition particles to the valid holder.
- Template Parameters
-
| NCOMP | Number of mesh components (compile-time). |
| Container | ParticleContainer type (deduced). |
| PatchDeposit | Per-patch deposit with the requested kernel. |
- Parameters
-
| [in,out] | a_meshData | AMR mesh data (RESET then filled). |
| [in] | a_particles | Particle container. |
| [in] | a_depositionType | Deposition kernel. |
| [in] | a_patch | Per-patch deposit functor (requested kernel). |
template<auto... Members, typename P , typename Traits >
| void EBAMRParticleMesh::interpolate |
( |
ParticleContainer< P, Traits > & |
a_particles, |
|
|
const EBAMRCellData & |
a_meshData, |
|
|
const DepositionType |
a_interpType, |
|
|
const bool |
a_forceIrregNGP |
|
) |
| const |
|
inline |
Interpolate a mesh field onto one or more payload columns, across all levels.
Per level, per patch: calls EBParticleMesh::interpolate. The mesh is assumed to be valid+ghosted by the caller (no coarse-fine coupling is needed for interpolation).
- Template Parameters
-
| Members | Pack of payload data-member pointers selecting the target column(s). |
| P | Payload type (deduced). |
| Traits | Column descriptor (deduced). |
- Parameters
-
| [in,out] | a_particles | Particles whose target columns are overwritten. |
| [in] | a_meshData | AMR mesh data (>= sizeof...(Members) components). |
| [in] | a_interpType | Interpolation kernel (NGP/CIC/TSC). |
| [in] | a_forceIrregNGP | Force NGP in cut cells. |
template<typename P , typename Traits >
| void EBAMRParticleMesh::interpolateWeight |
( |
ParticleContainer< P, Traits > & |
a_particles, |
|
|
const EBAMRCellData & |
a_meshData, |
|
|
const DepositionType |
a_interpType, |
|
|
const bool |
a_forceIrregNGP |
|
) |
| const |
|
inline |
Interpolate a mesh field onto the container-owned weight column, across all levels.
Per level, per patch: calls EBParticleMesh::interpolateWeight. The mesh is assumed to be valid+ghosted by the caller (no coarse-fine coupling is needed for interpolation). This is the interpolation mirror of depositWeight.
- Template Parameters
-
| P | Payload type (deduced). |
| Traits | Column descriptor (deduced). |
- Parameters
-
| [in,out] | a_particles | Particles whose weight column is overwritten. |
| [in] | a_meshData | AMR mesh data (>= 1 component). |
| [in] | a_interpType | Interpolation kernel (NGP/CIC/TSC). |
| [in] | a_forceIrregNGP | Force NGP in cut cells. |