chombo-discharge
|
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. | |
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.
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 | ( | 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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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.
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
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
[in] | a_particleList | Particles to be deposited |
[in,out] | a_rho | Mesh data |
[in] | a_depositionType | Deposition method |
[in] | a_forceIrregNGP | If true, force NGP in cut-cells |
|
inlineprotected |
Wrapper function for depositing a single particle.
[in,out] | a_rho | Mesh data |
[in] | a_probLo | Lower-left corner of domain |
[in] | a_dx | Grid resolution |
[in] | a_position | Particle position |
[in] | a_strength | Mass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent) |
[in] | a_components | Components to deposit |
[in] | a_depositionType | Deposition type |
[in] | a_forceIrregNGP | Force NGP in cut-cells |
|
inlineprotected |
Wrapper function for depositing a single particle which has twice the usual cloud width.
[in,out] | a_rho | Mesh data |
[in] | a_probLo | Lower-left corner of domain |
[in] | a_dx | Grid resolution |
[in] | a_position | Particle position |
[in] | a_strength | Mass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent) |
[in] | a_components | Components to deposit |
[in] | a_depositionType | Deposition type |
[in] | a_forceIrregNGP | Force NGP in cut-cells |
|
inlineprotected |
Wrapper function for depositing a single particle which has four times the usual cloud width.
[in,out] | a_rho | Mesh data |
[in] | a_probLo | Lower-left corner of domain |
[in] | a_dx | Grid resolution |
[in] | a_position | Particle position |
[in] | a_strength | Mass (or similar quantity) to be deposited. Must be of type Real[] (or &Real if single comopnent) |
[in] | a_components | Components to deposit |
[in] | a_depositionType | Deposition type |
[in] | a_forceIrregNGP | Force NGP in cut-cells |
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.
[in,out] | a_particleList | Particles to be interpolated. |
[in] | a_meshScalarField | Scalar field on the mesh |
[in] | a_interpType | Interpolation type. |
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.
[in,out] | a_particleList | Particles to be interpolated. |
[in] | a_meshVectorField | Vector field on the mesh |
[in] | a_interpType | Interpolation type. |
|
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.
[out] | a_particleField | Field evaluations at the particle position. Must be of type Real[]. |
[in] | a_field | Field. |
[in] | a_validRegion | Region where particle can live without kernels reaching outside the domain. |
[in] | a_probLo | Lower-left corner of domain |
[in] | a_dx | Grid resolution |
[in] | a_position | Particle position |
[in] | a_interval | Components to interpolate |
[in] | a_interpType | Interpolation type. |
[in] | a_forceIrregNGP | Force NGP in cut-cells |