chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EBParticleMesh Class Reference

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 Member Functions

void depositParticleNGP (EBCellFAB &a_rho, const RealVect &a_position, const Real &a_volumeFactor, const Real *a_strength, const int &a_numComp) const noexcept
 Wrapper function for depositing a single particle with a standard NGP scheme.
 
void depositParticleCIC (EBCellFAB &a_rho, const RealVect &a_position, const RealVect &a_particleWidth, const Box &a_particleBox, const Real &a_volumeFactor, const Real *a_strength, const int &a_numComp, const bool a_forceIrregNGP) const noexcept
 Function for depositing a single particle with a CIC scheme.
 
void depositParticleTSC (EBCellFAB &a_rho, const RealVect &a_position, const RealVect &a_particleWidth, const Box &a_particleBox, const Real &a_volumeFactor, const Real *a_strength, const int &a_numComp, const bool a_forceIrregNGP) const noexcept
 Function for depositing a single particle with a TSC scheme.
 
void interpolateParticleNGP (Real *a_particleField, const EBCellFAB &a_meshData, const RealVect &a_position, const int &a_numComp) const noexcept
 Particle interpolation function using an NGP scheme.
 
void interpolateParticleCIC (Real *a_particleField, const EBCellFAB &a_meshData, const Box &a_validBox, const Box &a_gatherBox, const RealVect &a_position, const int &a_numComp, const bool a_forceIrregNGP) const noexcept
 Particle interpolation function using a CIC scheme.
 
void interpolateParticleTSC (Real *a_particleField, const EBCellFAB &a_meshData, const Box &a_validBox, const Box &a_gatherBox, const RealVect &a_position, const int &a_numComp, const bool a_forceIrregNGP) const noexcept
 Particle interpolation function using a TSC scheme.
 

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.
 

Detailed Description

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.

Note
When depositing, this class will never divide by kappa.

Constructor & Destructor Documentation

◆ EBParticleMesh()

EBParticleMesh::EBParticleMesh ( const ProblemDomain a_domain,
const Box a_region,
const EBISBox a_ebisbox,
const RealVect a_dx,
const RealVect a_probLo 
)

Full constructor.

Parameters
[in]a_domainComputational domain
[in]a_regionCell-centered box
[in]a_ebisboxEBIS box
[in]a_dxResolution
[in]a_probLoLower-left corner of computational domain

Member Function Documentation

◆ define()

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.

Parameters
[in]a_domainComputational domain
[in]a_regionCell-centered box
[in]a_ebisboxEBIS box
[in]a_dxResolution
[in]a_probLoLower-left corner of computational domain

◆ deposit()

template<class P , class Ret , Ret(P::*)() const MemberFunc>
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.

Parameters
[in,out]a_rhoMesh data
[in]a_particlesParticles to be deposited
[in]a_depositionTypeDeposition method
[in]a_widthScaleParticle scale multiplier.
[in]a_forceIrregNGPIf true, force NGP in cut-cells
Note
This routine will INCREMENT a_rho.

◆ depositParticleCIC()

void EBParticleMesh::depositParticleCIC ( EBCellFAB a_rho,
const RealVect a_position,
const RealVect a_particleWidth,
const Box a_particleBox,
const Real a_volumeFactor,
const Real a_strength,
const int a_numComp,
const bool  a_forceIrregNGP 
) const
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).

Parameters
[in,out]a_rhoMesh data
[in]a_positionParticle position
[in]a_particleWidthParticle width (relative to grid resolution)
[in]a_particleBoxBasic box that is guaranteed to contain the particle.
[in]a_volumeFactorVolume factor to multiply by
[in]a_strengthMass (or similar quantity) to be deposited.
[in]a_numCOmpNumber of components to deposit
[in]a_forceIrregNGPForce NGP in cut-cells or not

◆ depositParticleNGP()

void EBParticleMesh::depositParticleNGP ( EBCellFAB a_rho,
const RealVect a_position,
const Real a_volumeFactor,
const Real a_strength,
const int a_numComp 
) const
inlineprotectednoexcept

Wrapper function for depositing a single particle with a standard NGP scheme.

Parameters
[in,out]a_rhoMesh data
[in]a_positionParticle position
[in]a_volumeFactorVolume factor to multiply by
[in]a_strengthMass (or similar quantity) to be deposited.
[in]a_numCompNumber of components to deposit

◆ depositParticleTSC()

void EBParticleMesh::depositParticleTSC ( EBCellFAB a_rho,
const RealVect a_position,
const RealVect a_particleWidth,
const Box a_particleBox,
const Real a_volumeFactor,
const Real a_strength,
const int a_numComp,
const bool  a_forceIrregNGP 
) const
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).

Parameters
[in,out]a_rhoMesh data
[in]a_positionParticle position
[in]a_particleWidthParticle width (relative to grid resolution)
[in]a_particleBoxBasic box that is guaranteed to contain the particle.
[in]a_volumeFactorVolume factor to multiply by
[in]a_strengthMass (or similar quantity) to be deposited.
[in]a_numCOmpNumber of components to deposit
[in]a_forceIrregNGPForce NGP in cut-cells or not

◆ interpolate()

template<class P , class Ret , Ret(P::*)() MemberFunc>
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.

Parameters
[in,out]a_particlesParticles to be deposited
[in]a_meshDataMesh data
[in]a_depositionTypeDeposition method
[in]a_widthScaleParticle scale multiplier.
[in]a_forceIrregNGPIf true, force NGP in cut-cells
Note
This routine will INCREMENT a_rho.

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

◆ interpolateParticleCIC()

void EBParticleMesh::interpolateParticleCIC ( Real a_particleField,
const EBCellFAB a_meshData,
const Box a_validBox,
const Box a_gatherBox,
const RealVect a_position,
const int a_numComp,
const bool  a_forceIrregNGP 
) const
inlineprotectednoexcept

Particle interpolation function using a CIC scheme.

Parameters
[out]a_particleFieldParticle quantity to interpolate into.
[in]a_meshDataMesh data
[in]a_validRegionRegion where particle can live without kernels reaching outside the domain.
[in]a_gatherBoxBox from which we gather the field.
[in]a_positionParticle position
[in]a_numCompNumber of components to interpolate.
[in]a_forceIrregNGPForce NGP in cut-cells

◆ interpolateParticleNGP()

void EBParticleMesh::interpolateParticleNGP ( Real a_particleField,
const EBCellFAB a_meshData,
const RealVect a_position,
const int a_numComp 
) const
inlineprotectednoexcept

Particle interpolation function using an NGP scheme.

Parameters
[out]a_particleFieldParticle quantity to interpolate into.
[in]a_meshDataMesh data
[in]a_positionParticle position
[in]a_numCompNumber of components to interpolate.

◆ interpolateParticleTSC()

void EBParticleMesh::interpolateParticleTSC ( Real a_particleField,
const EBCellFAB a_meshData,
const Box a_validBox,
const Box a_gatherBox,
const RealVect a_position,
const int a_numComp,
const bool  a_forceIrregNGP 
) const
inlineprotectednoexcept

Particle interpolation function using a TSC scheme.

Parameters
[out]a_particleFieldParticle quantity to interpolate into.
[in]a_meshDataMesh data
[in]a_validRegionRegion where particle can live without kernels reaching outside the domain.
[in]a_gatherBoxBox from which we gather the field.
[in]a_positionParticle position
[in]a_numCompNumber of components to interpolate.
[in]a_forceIrregNGPForce NGP in cut-cells

◆ sanitize()

template<typename Ret >
static constexpr int EBParticleMesh::sanitize ( )
inlinestaticconstexprnoexcept

Sanitize the return function type, ensuring it is either Real or RealVect.

Returns
Returns the number of components corresponding to Ret

The documentation for this class was generated from the following files: