|
chombo-discharge
|
A class for depositing and interpolating particles on a single grid patch. More...
#include <CD_EBParticleMesh.H>
Public Member Functions | |
| EBParticleMesh () | |
| Default constructor. Must subsequently call define. | |
| EBParticleMesh (const ProblemDomain &a_domain, const Box &a_region, const EBISBox &a_ebisbox, const RealVect &a_dx, const RealVect &a_probLo) | |
| Full constructor. | |
| void | define (const ProblemDomain &a_domain, const Box &a_region, const EBISBox &a_ebisbox, const RealVect &a_dx, const RealVect &a_probLo) |
| Define function. | |
| template<class P , class Ret , Ret(P::*)() const MemberFunc> | |
| void | deposit (EBCellFAB &a_meshData, const List< P > &a_particles, const DepositionType a_depositionType, const Real a_widthScale, const bool a_forceIrregNGP=false) const |
| Deposit a particle onto the mesh. | |
| template<class P , class Ret , Ret(P::*)() MemberFunc> | |
| void | interpolate (List< P > &a_particles, const EBCellFAB &a_meshData, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const |
| Interpolate mesh data onto a particle. | |
Static Public Member Functions | |
| template<typename Ret > | |
| static constexpr int | sanitize () noexcept |
| Sanitize the return function type, ensuring it is either Real or RealVect. | |
Protected Attributes | |
| ProblemDomain | m_domain |
| Problem domain. | |
| bool | m_verbose |
| Verbose or not. | |
| Box | m_region |
| Cell-centered box, i.e. valid region. | |
| EBISBox | m_ebisbox |
| EBIS box. | |
| RealVect | m_dx |
| Grid resolution. | |
| RealVect | m_probLo |
| Lower-left corner of computational domain. | |
A class for depositing and interpolating particles on a single grid patch.
Currently, this class is cheap to construct and thus does not need to stored for each box during regrids.
| EBParticleMesh::EBParticleMesh | ( | const ProblemDomain & | a_domain, |
| const Box & | a_region, | ||
| const EBISBox & | a_ebisbox, | ||
| const RealVect & | a_dx, | ||
| const RealVect & | a_probLo | ||
| ) |
Full constructor.
| [in] | a_domain | Computational domain |
| [in] | a_region | Cell-centered box |
| [in] | a_ebisbox | EBIS box |
| [in] | a_dx | Resolution |
| [in] | a_probLo | Lower-left corner of computational domain |
| void EBParticleMesh::define | ( | const ProblemDomain & | a_domain, |
| const Box & | a_region, | ||
| const EBISBox & | a_ebisbox, | ||
| const RealVect & | a_dx, | ||
| const RealVect & | a_probLo | ||
| ) |
Define function.
| [in] | a_domain | Computational domain |
| [in] | a_region | Cell-centered box |
| [in] | a_ebisbox | EBIS box |
| [in] | a_dx | Resolution |
| [in] | a_probLo | Lower-left corner of computational domain |
| void EBParticleMesh::deposit | ( | EBCellFAB & | a_meshData, |
| const List< P > & | a_particles, | ||
| const DepositionType | a_depositionType, | ||
| const Real | a_widthScale, | ||
| const bool | a_forceIrregNGP = false |
||
| ) | const |
Deposit a particle onto the mesh.
The template parameters indicate the particle type and a pointer to a particle function. The user can scale the particle width by changing a_widthScale. If this is set to one, the standard width for CIC becomes the grid cell size, and the standard width for TSC becomes twice the grid size.
| [in,out] | a_rho | Mesh data |
| [in] | a_particles | Particles to be deposited |
| [in] | a_depositionType | Deposition method |
| [in] | a_widthScale | Particle scale multiplier. |
| [in] | a_forceIrregNGP | If true, force NGP in cut-cells |
|
inlineprotectednoexcept |
Function for depositing a single particle with a CIC scheme.
The user can input a differerent particle width than the standard width byu adjusting a_particleWidth. The input box a_particleBox must be large enough to contain the particle. E.g., if a_particleWidth = 1, then the box must be at least Box(-IntVect::Unit, IntVect::Unit).
| [in,out] | a_rho | Mesh data |
| [in] | a_position | Particle position |
| [in] | a_particleWidth | Particle width (relative to grid resolution) |
| [in] | a_particleBox | Basic box that is guaranteed to contain the particle. |
| [in] | a_volumeFactor | Volume factor to multiply by |
| [in] | a_strength | Mass (or similar quantity) to be deposited. |
| [in] | a_numCOmp | Number of components to deposit |
| [in] | a_forceIrregNGP | Force NGP in cut-cells or not |
|
inlineprotectednoexcept |
Wrapper function for depositing a single particle with a standard NGP scheme.
| [in,out] | a_rho | Mesh data |
| [in] | a_position | Particle position |
| [in] | a_volumeFactor | Volume factor to multiply by |
| [in] | a_strength | Mass (or similar quantity) to be deposited. |
| [in] | a_numComp | Number of components to deposit |
|
inlineprotectednoexcept |
Function for depositing a single particle with a TSC scheme.
The user can input a differerent particle width than the standard width byu adjusting a_particleWidth. The input box (a_particleBox) must be large enough to contain a particle. E.g., if a_particleWidth = 2, then the box must be at least Box(-2*IntVect::Unit, 2*IntVect::Unit).
| [in,out] | a_rho | Mesh data |
| [in] | a_position | Particle position |
| [in] | a_particleWidth | Particle width (relative to grid resolution) |
| [in] | a_particleBox | Basic box that is guaranteed to contain the particle. |
| [in] | a_volumeFactor | Volume factor to multiply by |
| [in] | a_strength | Mass (or similar quantity) to be deposited. |
| [in] | a_numCOmp | Number of components to deposit |
| [in] | a_forceIrregNGP | Force NGP in cut-cells or not |
| void EBParticleMesh::interpolate | ( | List< P > & | a_particles, |
| const EBCellFAB & | a_meshData, | ||
| const DepositionType | a_interpType, | ||
| const bool | a_forceIrregNGP = false |
||
| ) | const |
Interpolate mesh data onto a particle.
The template parameters indicate the particle type and a pointer to a particle function.
| [in,out] | a_particles | Particles to be deposited |
| [in] | a_meshData | Mesh data |
| [in] | a_depositionType | Deposition method |
| [in] | a_widthScale | Particle scale multiplier. |
| [in] | a_forceIrregNGP | If true, force NGP in cut-cells |
Local helper class for turning a Real or a RealVect into a pointer to the beginning of the object. I'm doing this so that I can use a single version of interpolateParticle that does not require template specialization.
Return as pointer
Return pointer to start of RealVect object
|
inlineprotectednoexcept |
Particle interpolation function using a CIC scheme.
| [out] | a_particleField | Particle quantity to interpolate into. |
| [in] | a_meshData | Mesh data |
| [in] | a_validRegion | Region where particle can live without kernels reaching outside the domain. |
| [in] | a_gatherBox | Box from which we gather the field. |
| [in] | a_position | Particle position |
| [in] | a_numComp | Number of components to interpolate. |
| [in] | a_forceIrregNGP | Force NGP in cut-cells |
|
inlineprotectednoexcept |
Particle interpolation function using an NGP scheme.
| [out] | a_particleField | Particle quantity to interpolate into. |
| [in] | a_meshData | Mesh data |
| [in] | a_position | Particle position |
| [in] | a_numComp | Number of components to interpolate. |
|
inlineprotectednoexcept |
Particle interpolation function using a TSC scheme.
| [out] | a_particleField | Particle quantity to interpolate into. |
| [in] | a_meshData | Mesh data |
| [in] | a_validRegion | Region where particle can live without kernels reaching outside the domain. |
| [in] | a_gatherBox | Box from which we gather the field. |
| [in] | a_position | Particle position |
| [in] | a_numComp | Number of components to interpolate. |
| [in] | a_forceIrregNGP | Force NGP in cut-cells |
Sanitize the return function type, ensuring it is either Real or RealVect.