chombo-discharge
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EBParticleMesh Class Reference

A class for depositing and interpolating particles. Contains various useful routines for interpolation of different fields in the base particle class (e.g., mass, "mobility"). This class also contains functions for depositing particles with 2/4 times the usual particle width, which is included because we want to support deposition of particles over refinement boundaries. 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. More...
 
void define (const ProblemDomain &a_domain, const Box &a_region, const EBISBox &a_ebisbox, const RealVect &a_dx, const RealVect &a_probLo)
 Define function. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void deposit (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using a standard cloud width. More...
 
template<class P , Real(P::*)() const particleScalarField>
void deposit (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using a standard cloud width. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void deposit2 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using twice the standard cloud width. More...
 
template<class P , Real(P::*)() const particleScalarField>
void deposit2 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using twice the standard cloud width. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void deposit4 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using 4x the standard cloud width. More...
 
template<class P , Real(P::*)() const particleScalarField>
void deposit4 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using 4x the standard cloud width. More...
 
template<class P , const RealVect &(P::*)() const particleVectorField>
void deposit (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using a standard cloud width. More...
 
template<class P , RealVect(P::*)() const particleVectorField>
void deposit (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using a standard cloud width. More...
 
template<class P , const RealVect &(P::*)() const particleVectorField>
void deposit2 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using twice the standard cloud width. More...
 
template<class P , RealVect(P::*)() const particleVectorField>
void deposit2 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using twice the standard cloud width. More...
 
template<class P , const RealVect &(P::*)() const particleVectorField>
void deposit4 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using 4x the standard cloud width. More...
 
template<class P , RealVect(P::*)() const particleVectorField>
void deposit4 (const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
 Deposit particle onto the mesh using 4x the standard cloud width. More...
 
template<class P , Real &(P::*)() particleScalarField>
void interpolate (List< P > &a_particleList, const EBCellFAB &a_meshScalarField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
 Interpolate a scalar field onto the particle position. More...
 
template<class P , RealVect &(P::*)() particleVectorField>
void interpolate (List< P > &a_particleList, const EBCellFAB &a_meshVectorField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
 Interpolate a vector field onto the particle position. More...
 

Protected Member Functions

void depositParticle (EBCellFAB &a_rho, const RealVect &a_probLo, const RealVect &a_dx, const RealVect &a_position, const Real *a_strength, const Interval a_components, const DepositionType a_depositionType, const bool a_forceIrregNGP) const
 Wrapper function for depositing a single particle. More...
 
void depositParticle2 (EBCellFAB &a_rho, const RealVect &a_probLo, const RealVect &a_dx, const RealVect &a_position, const Real *a_strength, const Interval a_components, const DepositionType a_depositionType, const bool a_forceIrregNGP) const
 Wrapper function for depositing a single particle which has twice the usual cloud width. More...
 
void depositParticle4 (EBCellFAB &a_rho, const RealVect &a_probLo, const RealVect &a_dx, const RealVect &a_position, const Real *a_strength, const Interval a_components, const DepositionType a_depositionType, const bool a_forceIrregNGP) const
 Wrapper function for depositing a single particle which has four times the usual cloud width. More...
 
void interpolateParticle (Real *a_particleField, const EBCellFAB &a_field, const Box &a_validBox, const RealVect &a_probLo, const RealVect &a_dx, const RealVect &a_position, const Interval &a_interval, const DepositionType a_interpType, const bool a_forceIrregNGP) const
 Wrapper function that interpolates a particle fields onto positions. More...
 

Protected Attributes

ProblemDomain m_domain
 Problem domain.
 
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. Contains various useful routines for interpolation of different fields in the base particle class (e.g., mass, "mobility"). This class also contains functions for depositing particles with 2/4 times the usual particle width, which is included because we want to support deposition of particles over refinement boundaries.

Currently, this class is cheap to construct and thus does not need to stored for each box during regrids.

Note
If the user sets the object to force ngp deposition in cut-cells, the result is not kappa-weighted in any form, i.e. the cut-cell will contain the full deposited mass (without multiplying or dividing by kappa). Likewise, it will force NGP interpolation in cut-cells.

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() [1/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using a standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleScalarField' This should be a pointer to a member function with signature const Real& P::function() const. E.g. if we are depositing mass through a function const Real& P::mass() const we will specifiy

deposit<Particle, &Particle::mass>(a_particleList, a_rho, a_depositionType, a_forceIrregNGP)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit() [2/4]

template<class P , Real(P::*)() const particleScalarField>
void EBParticleMesh::deposit ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using a standard cloud width.

Just like the version above, except that the function signature is Real P::particleScalarField() const.

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

◆ deposit() [3/4]

template<class P , const RealVect &(P::*)() const particleVectorField>
void EBParticleMesh::deposit ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using a standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleVectorField' This should be a pointer to a member function with signature const Real& P::function() const. E.g. if we are depositing mass through a function const Real& P::mass() const we will specifiy

deposit<Particle, &Particle::mass>(a_particleList, a_rho, a_depositionType, a_forceIrregNGP)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit() [4/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using a standard cloud width.

Just like the version above, except that the function signature is Real P::particleVectorField() const.

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

◆ deposit2() [1/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit2 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using twice the standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleScalarField' This should be a pointer to a member function with signature const Real& P::function() const. E.g. if we are depositing mass through a function const Real& P::mass() const we will specifiy

interpolate<Particle, &Particle::mass>(a_particleList, a_rho, a_interpType)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit2() [2/4]

template<class P , Real(P::*)() const particleScalarField>
void EBParticleMesh::deposit2 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using twice the standard cloud width.

Justl ike the version above, except that the function signature is Real P::particleScalarField() const.

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

◆ deposit2() [3/4]

template<class P , const RealVect &(P::*)() const particleVectorField>
void EBParticleMesh::deposit2 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using twice the standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleVectorField' This should be a pointer to a member function with signature const Real& P::function() const. E.g. if we are depositing mass through a function const Real& P::mass() const we will specifiy

interpolate<Particle, &Particle::mass>(a_particleList, a_rho, a_interpType)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit2() [4/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit2 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using twice the standard cloud width.

Justl ike the version above, except that the function signature is Real P::particleVectorField() const.

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

◆ deposit4() [1/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit4 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using 4x the standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleScalarField' This should be a pointer to a member function with signature const Real& P::a_particleScalarField. E.g. if we are depositing mass through a function const Real& P::mass() we will specifiy

interpolate<Particle, &Particle::mass>(a_particleList, a_rho, a_interpType)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit4() [2/4]

template<class P , Real(P::*)() const particleScalarField>
void EBParticleMesh::deposit4 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using 4x the standard cloud width.

Just like the version above except that the function signature is Real P::particleScalarField() const

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

◆ deposit4() [3/4]

template<class P , const RealVect &(P::*)() const particleVectorField>
void EBParticleMesh::deposit4 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using 4x the standard cloud width.

This is just like regular particle-mesh deposition. The mesh field should have exactly one component and the quantity to be deposited is fetched from the specified template parameter 'a_particleVectorField' This should be a pointer to a member function with signature const Real& P::a_particleVectorField. E.g. if we are depositing mass through a function const Real& P::mass() we will specifiy

interpolate<Particle, &Particle::mass>(a_particleList, a_rho, a_interpType)

To deposit a different quantity, simply change the function pointer in the input parameter.

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

◆ deposit4() [4/4]

template<class P , RealVect(P::*)() const particleVectorField>
void EBParticleMesh::deposit4 ( const List< P > &  a_particleList,
EBCellFAB &  a_rho,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP = false 
) const

Deposit particle onto the mesh using 4x the standard cloud width.

Just like the version above except that the function signature is Real P::particleVectorField() const

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

◆ depositParticle()

void EBParticleMesh::depositParticle ( EBCellFAB &  a_rho,
const RealVect &  a_probLo,
const RealVect &  a_dx,
const RealVect &  a_position,
const Real *  a_strength,
const Interval  a_components,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP 
) const
inlineprotected

Wrapper function for depositing a single particle.

Parameters
[in,out]a_rhoMesh data
[in]a_probLoLower-left corner of domain
[in]a_dxGrid resolution
[in]a_positionParticle position
[in]a_strengthMass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent)
[in]a_componentsComponents to deposit
[in]a_depositionTypeDeposition type
[in]a_forceIrregNGPForce NGP in cut-cells

◆ depositParticle2()

void EBParticleMesh::depositParticle2 ( EBCellFAB &  a_rho,
const RealVect &  a_probLo,
const RealVect &  a_dx,
const RealVect &  a_position,
const Real *  a_strength,
const Interval  a_components,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP 
) const
inlineprotected

Wrapper function for depositing a single particle which has twice the usual cloud width.

Parameters
[in,out]a_rhoMesh data
[in]a_probLoLower-left corner of domain
[in]a_dxGrid resolution
[in]a_positionParticle position
[in]a_strengthMass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent)
[in]a_componentsComponents to deposit
[in]a_depositionTypeDeposition type
[in]a_forceIrregNGPForce NGP in cut-cells

◆ depositParticle4()

void EBParticleMesh::depositParticle4 ( EBCellFAB &  a_rho,
const RealVect &  a_probLo,
const RealVect &  a_dx,
const RealVect &  a_position,
const Real *  a_strength,
const Interval  a_components,
const DepositionType  a_depositionType,
const bool  a_forceIrregNGP 
) const
inlineprotected

Wrapper function for depositing a single particle which has four times the usual cloud width.

Parameters
[in,out]a_rhoMesh data
[in]a_probLoLower-left corner of domain
[in]a_dxGrid resolution
[in]a_positionParticle position
[in]a_strengthMass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent)
[in]a_componentsComponents to deposit
[in]a_depositionTypeDeposition type
[in]a_forceIrregNGPForce NGP in cut-cells

◆ interpolate() [1/2]

template<class P , RealVect &(P::*)() particleVectorField>
void EBParticleMesh::interpolate ( List< P > &  a_particleList,
const EBCellFAB &  a_meshScalarField,
const DepositionType  a_interpType,
const bool  a_forceIrregNGP = false 
) const

Interpolate a scalar field onto the particle position.

This is just like regular particle-mesh interpolation. The input field should have exactly one component and the the field will be interpolated onto the template parameter's input field. The template parameter 'particleScalar' should be a pointer to a member function which will set the particle field. E.g. the function must have a signature Real& P::particleScalarField(). A valid expression is e.g.

interpolate<Particle, &Particle::mass>(a_particleList, a_meshScalarField, a_interpType)

To interpolate onto a different field, e.g. the acceleration field, use interpolate<Particle, &Particle::acceleration>, etc.

Parameters
[in,out]a_particleListParticles to be interpolated.
[in]a_meshScalarFieldScalar field on the mesh
[in]a_interpTypeInterpolation type.

◆ interpolate() [2/2]

template<class P , RealVect &(P::*)() particleVectorField>
void EBParticleMesh::interpolate ( List< P > &  a_particleList,
const EBCellFAB &  a_meshVectorField,
const DepositionType  a_interpType,
const bool  a_forceIrregNGP = false 
) const

Interpolate a vector field onto the particle position.

This is just like regular particle-mesh interpolation. The input field should have SpaceDim components and the the field will be interpolated onto the template parameter's input field. The template parameter 'particleVectorField' should be a pointer to a member function which will set the particle field. E.g. the function must have a signature RealVect& P::particleVectorField(). A valid expression is e.g.

interpolate<Particle, &Particle::velocity>(a_particleList, a_meshVectorField, a_interpType)

To interpolate onto a different field, e.g. the acceleration field, use interpolate<Particle, &Particle::acceleration>, etc.

Parameters
[in,out]a_particleListParticles to be interpolated.
[in]a_meshVectorFieldVector field on the mesh
[in]a_interpTypeInterpolation type.

◆ interpolateParticle()

void EBParticleMesh::interpolateParticle ( Real *  a_particleField,
const EBCellFAB &  a_field,
const Box &  a_validBox,
const RealVect &  a_probLo,
const RealVect &  a_dx,
const RealVect &  a_position,
const Interval &  a_interval,
const DepositionType  a_interpType,
const bool  a_forceIrregNGP 
) const
inlineprotected

Wrapper function that interpolates a particle fields onto positions.

This switches between various possible kernels, NGP, CIC, TSC, W4. It can interpolate both vectors and scalars, the user inputs the data holder as a Real[] and specifies the components to interpolate.

Parameters
[out]a_particleFieldField evaluations at the particle position. Must be of type Real[].
[in]a_fieldField.
[in]a_validRegionRegion where particle can live without kernels reaching outside the domain.
[in]a_probLoLower-left corner of domain
[in]a_dxGrid resolution
[in]a_positionParticle position
[in]a_intervalComponents to interpolate
[in]a_interpTypeInterpolation type.
[in]a_forceIrregNGPForce NGP in cut-cells

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