|
chombo-discharge
|
Class for handling particle-mesh operations with AMR. More...
#include <CD_EBAMRParticleMesh.H>
Protected Member Functions | |
| void | defineLevelMotion () |
| Define level copiers. | |
| void | defineCoarseFineMotion () |
| Define coarse-fine data motion operators. | |
| void | defineEBParticleMesh () |
| Define EBParticleMesh objects. | |
| void | defineOuterHaloMasks () |
| Define the outer halo masks. | |
| void | defineTransitionMasks () |
| Define the coarse-fine transition masks. | |
| int | getTransitionMaskWidth (const DepositionType a_depositionType, const int a_refRat) const |
| Get transition mask width. | |
| template<class P , class Ret , Ret(P::*)() const MemberFunc> | |
| void | depositInterp (EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) |
| Deposit particles on the mesh, interpolating the coarse-grid invalid mass to the fine grid. | |
| template<class P , class Ret , Ret(P::*)() const MemberFunc> | |
| void | depositHalo (EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) |
| Deposit particles on the mesh, keeping the original particle width everywhere and depositing directly into every level. | |
| template<class P , class Ret , Ret(P::*)() const MemberFunc> | |
| void | depositHaloNGP (EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) |
| Deposit particles on the mesh, using an NGP scheme for coarse-grid particles on the refinement boundary. | |
| template<class P , class Ret , Ret(P::*)() const MemberFunc> | |
| void | depositTransition (EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) |
| Deposit particles on the mesh. | |
| template<class P > | |
| void | transferMaskParticlesTransition (ParticleContainer< P > &a_particles, const DepositionType a_depositionType) const |
| Support function for transferring particles that lie in the transition zone around a refinement boundary. | |
Protected Attributes | |
| bool | m_isDefined |
| Is defined or not. | |
| bool | m_verbose |
| Verbose or not. | |
| RealVect | m_probLo |
| Lower-left corner of physical domain. | |
| int | m_ghost |
| Number of ghost cells. | |
| int | m_finestLevel |
| Finest AMR level. | |
| Vector< RefCountedPtr< EBLevelGrid > > | m_eblgs |
| Grids on each level. | |
| Vector< int > | m_refRat |
| Refinement ratios between levels. | |
| Vector< Real > | m_dx |
| Grid resolutions. | |
| Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > | m_ebParticleMesh |
| Regular particle-mesh object on each grid level. | |
| Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > | m_ebParticleMeshFiCo |
| Special particle-mesh objects for depositing on the coarsened fine grid. | |
| Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > | m_validCells |
| Valid grid cells. | |
| std::map< int, Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > > | m_outerHaloMasks |
| Outer halo masks with various widths. | |
| std::map< int, Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > > | m_transitionMasks |
| Transition masks with various widths. | |
| Vector< RefCountedPtr< EBCoarseFineParticleMesh > > | m_coarseFinePM |
| Buffers for handling arithmetic for mass moving from coarse to fine level and vice versa. | |
| Vector< Copier > | m_levelCopiers |
| Copier for moving data from valid+ghost to valid on each AMR level. | |
Class for handling particle-mesh operations with AMR.
This class contains templated functions for depositing particles with AMR. When depositing, the user must specify the deposition type (e.g., CIC) as well as how to handle coarse-fine boundary conditions and cut-cell deposition. Because of the many degrees of freedom in depositing particles with AMR (and EB), the user must expect to preprocess his particle data before solving. There are several ways deposition works through this class:
When specifying CoarseFineDeposition::Interp, the deposition is done by first depositing the data as usual on both levels. On the fine level, there may be mass that hangs over the refinement boundaries; that mass is added to the coarse level. On the coarse level some of the particles will deposit mass into cells that are covered by a finer level; that mass is interpolated with piece-wise constant interpolation and then added to the fine level.
When specifying CoarseFineDeposition::Halo, the handling of the coarse-side deposition is different. The mass from the fine-level particles that hangs over the refinement boundaries is put on the coarse mesh. However, the coarse-level particles are deposited in two separate steps so that the coarse-level particles have the same physical widths on the coarse and fine levels. We first deposit ALL the coarse-level particles on the coarse level. Some of these particles (halo particles) will have clouds that overlap with the fine level. We take the set of these particles and deposit them directly onto the fine level (via buffers) with 2x or 4x the original particle width (depending on the refinement ratios between the levels). Essentially, this differs CoarseFineDeposition::Interp in the sense that the original particle width is maintained on the fine level.
When specifying CoarseFineDeposition::HaloNGP, the particles whose deposition clouds hang over the refinement boundary are deposited on the fine level, and the ghosted mass is then added to the coarse side. Particles that live on the coarse side of a refinement boundary are deposited using an NGP scheme.
When specifying CoarseFineDeposition::Transition, the particles immediately on the coarse-side of the refinement boundary deposit with the fine-grid particle width.
| EBAMRParticleMesh::EBAMRParticleMesh | ( | 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 | ||
| ) |
Full constructor. Calls the define function.
| [in] | a_eblgs | Grids |
| [in] | a_refRat | Refinement factory between levels |
| [in] | a_dx | Grid resolutions. @πaram[in] a_probLo Lower-left corner of physical domain. |
| [in] | a_ghost | Ghost cells in data holders. |
| [in] | a_finestLevel | Finest grid level |
| void EBAMRParticleMesh::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 function.
| [in] | a_eblgs | Grids |
| [in] | a_refRat | Refinement factory between levels |
| [in] | a_dx | Grid resolutions. @πaram[in] a_probLo Lower-left corner of physical domain. |
| [in] | a_ghost | Ghost cells in data holders. |
| [in] | a_finestLevel | Finest grid level |
|
protected |
Define coarse-fine data motion operators.
This defines the necessary constructors for
|
protected |
Define level copiers.
| void EBAMRParticleMesh::deposit | ( | EBAMRCellData & | a_meshData, |
| const ParticleContainer< P > & | a_particles, | ||
| const DepositionType | a_depositionType, | ||
| const CoarseFineDeposition | a_coarseFineDeposition, | ||
| const bool | a_forceIrregNGP = false |
||
| ) |
Class for deposition of particles of a type P to the mesh. This is the main function that users should call.
P is the particle type, Ret is the returned value of the particle member function, and must be a Real or a RealVect. MemFunc is a pointer to a member function of P. E.g., deposit<P, const RealVect&, &P::position>.
| [out] | a_meshData | Mesh data. Must have exactly one compnent. @πaram[in] a_particles Particle container. Must be in "usable state" for deposition. |
| [in] | a_depositionType | Specification of deposition kernel (e.g., CIC) |
| [in] | a_coarseFineDeposition | Specification of handling of coarse-fine boundaries. |
| [in] | a_forceIrregNGP | Force NGP deposition in irregular cells or not. |
|
protected |
Deposit particles on the mesh, keeping the original particle width everywhere and depositing directly into every level.
| [out] | a_meshData | Mesh data. |
| [in] | a_particles | Particle container. Must be in "usable state" for deposition. |
| [in] | a_depositionType | Specification of deposition kernel (e.g., CIC) |
| [in] | a_forceIrregNGP | Force NGP deposition in irregular cells or not. |
|
protected |
Deposit particles on the mesh, using an NGP scheme for coarse-grid particles on the refinement boundary.
| [out] | a_meshData | Mesh data. |
| [in] | a_particles | Particle container. Must be in "usable state" for deposition. |
| [in] | a_depositionType | Specification of deposition kernel (e.g., CIC) |
| [in] | a_forceIrregNGP | Force NGP deposition in irregular cells or not. |
|
protected |
Deposit particles on the mesh, interpolating the coarse-grid invalid mass to the fine grid.
| [out] | a_meshData | Mesh data. |
| [in] | a_particles | Particle container. Must be in "usable state" for deposition. |
| [in] | a_depositionType | Specification of deposition kernel (e.g., CIC) |
| [in] | a_forceIrregNGP | Force NGP deposition in irregular cells or not. |
|
protected |
Deposit particles on the mesh.
In this version the particles abutting the refinement boundary from the coarse side are deposited with the fine-grid resolution.
| [out] | a_meshData | Mesh data. |
| [in] | a_particles | Particle container. Must be in "usable state" for deposition. |
| [in] | a_depositionType | Specification of deposition kernel (e.g., CIC) |
| [in] | a_forceIrregNGP | Force NGP deposition in irregular cells or not. |
| Vector< RefCountedPtr< EBCoarseFineParticleMesh > > & EBAMRParticleMesh::getEBCoarseFineParticleMesh | ( | ) | const |
Get buffers for handling deposition over refinement boundaries.
| const EBParticleMesh & EBAMRParticleMesh::getEBParticleMesh | ( | const int | a_lvl, |
| const DataIndex & | a_dit | ||
| ) | const |
Get EBParticleMesh deposition/interpolation object for specified grid patch.
This routine is used for when users want to interpolate on a per-patch basis. This is useful when the user has written his interpolation functions on a per-patch basis. I fail to see any other reason where this routine is useful.
| [in] | a_lvl | Grid level |
| [in] | a_dit | Grid index |
|
protected |
Get transition mask width.
Used when depositing with a transition zone.
| [in] | a_depositionType | Deposition type |
| [in] | a_refRat | Refinement ratio between levels |
| void EBAMRParticleMesh::interpolate | ( | ParticleContainer< P > & | a_particles, |
| const EBAMRCellData & | a_meshData, | ||
| const DepositionType | a_interpType, | ||
| const bool | a_forceIrregNGP = false |
||
| ) | const |
Interpolate a scalar field onto the particle position.
P is the particle type, Ret is the returned value of the particle member function, and must be a Real or a RealVect. MemFunc is a pointer to a member function of P. E.g., interpolate<P, RealVect&, &P::position>.
| [in,out] | a_particles | Particles to be interpolated. |
| [in] | a_meshData | Mesh data |
| [in] | a_interpType | Interpolation type. |
| [in] | a_forceIrregNGP | Force NGP interpolation in cut-cells. |
|
protected |
Support function for transferring particles that lie in the transition zone around a refinement boundary.
| [in,out] | a_particles | Input particles |
| [in] | a_depositionType | Deposition type. |
|
mutableprotected |
Buffers for handling arithmetic for mass moving from coarse to fine level and vice versa.
|
protected |
Special particle-mesh objects for depositing on the coarsened fine grid.
These are deposition/interpolation objects defined on the refined coarse grid. They are used when we need to deposit coarse-grid particles on the fine grid.
Copier for moving data from valid+ghost to valid on each AMR level.
|
protected |
Outer halo masks with various widths.
These masks are true on the coarse side on the refinement boundary.
|
protected |
Transition masks with various widths.
These masks are true in the fine-grid ghost cells on the coarse-side of the refinement boundary.