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

A class for handling particle deposition clouds that hang over refinement boundaries. This class does not include any deposition functionality but provides buffers for moving mass between two levels. More...

#include <CD_EBCoarseFineParticleMesh.H>

Public Types

enum  Average { Arithmetic , Conservative }
 Simple enum for switch between arithmetic and conservative averaging.
 

Public Member Functions

 EBCoarseFineParticleMesh () noexcept
 Default constructor. Leaves object in undefined state and subsequently requires a call to define.
 
 EBCoarseFineParticleMesh (const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, const int a_refRat, const IntVect a_ghost) noexcept
 Full constructor. Calls define.
 
virtual ~EBCoarseFineParticleMesh () noexcept
 Destructor (does nothing)
 
virtual void define (const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, const int a_refRat, const IntVect a_ghost) noexcept
 Define function.
 
virtual void addFineGhostsToCoarse (LevelData< EBCellFAB > &a_coarData, const LevelData< EBCellFAB > &a_fineData) const noexcept
 Coarsen the fine-level ghost cells and add them to the coarse level.
 
virtual void addFiCoDataToFine (LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_fiCoData) const noexcept
 Add the valid+ghost cells on the refined coarse level to the valid cells on the fine level.
 
virtual void addInvalidCoarseToFine (LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_coarData) const noexcept
 Function which piecewise interpolates the data underneath the fine grid and adds it to the fine grid.
 
virtual void exchangeAndAddFiCoData (LevelData< EBCellFAB > &a_fiCoData) const noexcept
 Function which performs an exchange+add operation on the refined coarse data.
 
virtual void restrictAndAddFiCoDataToCoar (LevelData< EBCellFAB > &a_coarData, const LevelData< EBCellFAB > &a_fiCoData, const EBCoarseFineParticleMesh::Average a_average) const noexcept
 Coarsen the data on the refined coarse grid to the coarse grid. The grids must be defined over the same layout.
 
const EBLevelGridgetEblgFiCo () const
 Get the refined version of the coarse eblevelgrid.
 
template<int NCOMP>
LevelData< EBCellFAB > & getBufferFiCo () const noexcept
 Get buffer storage on the refined coarse level.
 
template<>
LevelData< EBCellFAB > & getBufferFiCo () const noexcept
 
template<>
LevelData< EBCellFAB > & getBufferFiCo () const noexcept
 

Protected Member Functions

void defineVoFIterators () noexcept
 Define the vof iterators.
 
void defineStencils () noexcept
 Define the vof iterators.
 
void defineBufferFiCo () noexcept
 Define the buffer storages.
 
void conservativeAverageAndAdd (EBCellFAB &a_coarData, const EBCellFAB &a_fineData, const DataIndex &a_din) const noexcept
 Conservatively average and add data from the refined coarse data to the coarse data.
 
void arithmeticAverageAndAdd (EBCellFAB &a_coarData, const EBCellFAB &a_fineData, const DataIndex &a_din) const noexcept
 Arithmetically average and add data from the refined coarse data to the coarse data.
 

Protected Attributes

bool m_isDefined
 Is defined or not.
 
bool m_verbose
 Verbose or not. Useful for debugging.
 
EBLevelGrid m_eblgCoar
 Coarse EBLevelGrid.
 
EBLevelGrid m_eblgFine
 Fine EBLevelGrid.
 
EBLevelGrid m_eblgFiCo
 Refined coarse EBLevelGrid.
 
EBLevelGrid m_eblgCoFi
 Coarsening of m_eblgFine.
 
Copier m_copierFiCoToFineIncludeGhosts
 Copier for copying data from the refined coarse level to the fine level.
 
Copier m_copierCoFiToCoarIncludeGhosts
 Copier for copying data from the coarsened fine level to the coarse level.
 
Copier m_copierFiCoToFineNoGhosts
 Copier for copying data from the refined coarse level to the fine level.
 
Copier m_copierFiCoToFiCo
 Copier for that moves data from valid+ghost -> valid on the refined coarse level.
 
LevelData< EBCellFABm_bufferFiCoReal
 Buffer storage on the refined coarse level. One component only.
 
LevelData< EBCellFABm_bufferFiCoRealVect
 Buffer storage on the refined coarse level. One component only.
 
LayoutData< VoFIteratorm_vofIterFineGhosts
 VoFIterator for fine-grid irregular ghost cells.
 
LayoutData< VoFIteratorm_vofIterCoFiGhosts
 VoFIterator for coarse grid cells that are coarsenings of fine-grid ghost irregular cells.
 
LayoutData< VoFIteratorm_vofIterCoar
 VoFIterator for coarse cells.
 
LayoutData< BaseIVFAB< VoFStencil > > m_cellArithmeticStencils
 Stencils for arithmetic coarsening of volume data.
 
LayoutData< BaseIVFAB< VoFStencil > > m_cellConservativeStencils
 Stencils for conservative coarsening of volume data.
 
int m_refRat
 Refinement ratio between the two levels.
 
IntVect m_ghost
 Number of ghost cells in data holders.
 

Static Protected Attributes

static constexpr int m_comp = 0
 Default component.
 
static constexpr int m_nComp = 1
 Maximum number of components.
 

Detailed Description

A class for handling particle deposition clouds that hang over refinement boundaries. This class does not include any deposition functionality but provides buffers for moving mass between two levels.

To use this class, the user can directly some functions:

  1. addFineGhostsToCoarse which adds the contribution of the fine level's particles to the coarse level. This will add the part of the particle clouds that hang over the refinement boundary to the coarse level. Likewise, the user can get a buffer (getFiCoBuffer) for getting a temporary data holder on which he can use special deposition procedures.
  2. addFiCoDataToFine where the user will have deposited coarse-level particles on a fine-grid buffer, and he/she wants to add the result back to the fine grid.
  3. addInvalidCoarseToFine where the coarse-grid deposition clouds are interpolated to the fine grid. This is the case when e.g. the coarse-grid clouds deposit underneath the fine level but the mass should end up on the fine level.
  4. exchangeAndAddFiCoData where deposited particles on the refined coarse grids have their masses synchronized (ghost cells are added across patches).

Constructor & Destructor Documentation

◆ EBCoarseFineParticleMesh()

EBCoarseFineParticleMesh::EBCoarseFineParticleMesh ( const EBLevelGrid a_eblgCoar,
const EBLevelGrid a_eblgFine,
const int  a_refRat,
const IntVect  a_ghost 
)
noexcept

Full constructor. Calls define.

Parameters
[in]a_eblgCoarCoarse grids
[in]a_eblgFineFine grids
[in]a_refRatRefinement factory between levels
[in]a_ghostNumber of ghost cells in mesh data holders.

Member Function Documentation

◆ addFiCoDataToFine()

void EBCoarseFineParticleMesh::addFiCoDataToFine ( LevelData< EBCellFAB > &  a_fineData,
const LevelData< EBCellFAB > &  a_fiCoData 
) const
virtualnoexcept

Add the valid+ghost cells on the refined coarse level to the valid cells on the fine level.

This routine is used when the user have deposited coarse-level particles into a_fiCoData (which is a refinement of the coarse level). This routine then adds that data to the fine level. The motion plan defines the computation region as valid+ghost -> valid, which is what we want.

Parameters
[in,out]a_fineDataFine mesh data
[in]a_fiCoDataRefined coarse data buffer. Users will have deposited the mesh data onto this

◆ addFineGhostsToCoarse()

void EBCoarseFineParticleMesh::addFineGhostsToCoarse ( LevelData< EBCellFAB > &  a_coarData,
const LevelData< EBCellFAB > &  a_fineData 
) const
virtualnoexcept

Coarsen the fine-level ghost cells and add them to the coarse level.

On output, the contents in the ghost cells on the refinement boundary are added from the fine level to the coarse level. This routine is used when the fine-level particles have particle clouds that deposit into the ghost cells outside the fine level, i.e. over the refinement boundary. This routine coarsens that data and adds the mass to the coarse level.

Parameters
[in,out]a_coarDataCoarse mesh data.
[in]a_fineDataFine mesh data.

◆ addInvalidCoarseToFine()

void EBCoarseFineParticleMesh::addInvalidCoarseToFine ( LevelData< EBCellFAB > &  a_fineData,
const LevelData< EBCellFAB > &  a_coarData 
) const
virtualnoexcept

Function which piecewise interpolates the data underneath the fine grid and adds it to the fine grid.

The data-motion plan is to use the valid+ghost cells on the coarse level and add it into the valid region on the fine level. However, the buffers' ghost regions are set to zero so this should only add non-ghosted data between the levels.

Parameters
[in,out]a_fineDataFine-level data.
[in]a_coarDataCoarse-level data.

◆ arithmeticAverageAndAdd()

void EBCoarseFineParticleMesh::arithmeticAverageAndAdd ( EBCellFAB a_coarData,
const EBCellFAB a_fineData,
const DataIndex a_din 
) const
protectednoexcept

Arithmetically average and add data from the refined coarse data to the coarse data.

Parameters
[in,out]a_coarDataCoarse-grid data
[in]a_fineDataFine-grid data (must be on a refined layout of the coarse grid)
[in]a_dinGrid idnex

◆ conservativeAverageAndAdd()

void EBCoarseFineParticleMesh::conservativeAverageAndAdd ( EBCellFAB a_coarData,
const EBCellFAB a_fineData,
const DataIndex a_din 
) const
protectednoexcept

Conservatively average and add data from the refined coarse data to the coarse data.

Parameters
[in,out]a_coarDataCoarse-grid data
[in]a_fineDataFine-grid data (must be on a refined layout of the coarse grid)
[in]a_dinGrid index

◆ define()

void EBCoarseFineParticleMesh::define ( const EBLevelGrid a_eblgCoar,
const EBLevelGrid a_eblgFine,
const int  a_refRat,
const IntVect  a_ghost 
)
virtualnoexcept

Define function.

Parameters
[in]a_eblgCoarCoarse grids
[in]a_eblgFineFine grids
[in]a_refRatRefinement factory between levels
[in]a_ghostNumber of ghost cells in mesh data holders.

◆ restrictAndAddFiCoDataToCoar()

void EBCoarseFineParticleMesh::restrictAndAddFiCoDataToCoar ( LevelData< EBCellFAB > &  a_coarData,
const LevelData< EBCellFAB > &  a_fiCoData,
const EBCoarseFineParticleMesh::Average  a_average 
) const
virtualnoexcept

Coarsen the data on the refined coarse grid to the coarse grid. The grids must be defined over the same layout.

Parameters
[in,out]a_coarDataCoarse-grid data
[in]a_fineDataData on the refined coarse grid
[in]a_averageAveraging method. Either arithmetic or conservative.

Member Data Documentation

◆ m_cellArithmeticStencils

LayoutData<BaseIVFAB<VoFStencil> > EBCoarseFineParticleMesh::m_cellArithmeticStencils
protected

Stencils for arithmetic coarsening of volume data.

This is defined on the coarse grid, and indexes into the refined coarse grid.

◆ m_cellConservativeStencils

LayoutData<BaseIVFAB<VoFStencil> > EBCoarseFineParticleMesh::m_cellConservativeStencils
protected

Stencils for conservative coarsening of volume data.

This is defined on the coarse grid, and indexes into the refined coarse grid.

◆ m_copierCoFiToCoarIncludeGhosts

Copier EBCoarseFineParticleMesh::m_copierCoFiToCoarIncludeGhosts
protected

Copier for copying data from the coarsened fine level to the coarse level.

Note
This copier moves from valid+ghost in the source to valid+ghost in the destination.

◆ m_copierFiCoToFiCo

Copier EBCoarseFineParticleMesh::m_copierFiCoToFiCo
protected

Copier for that moves data from valid+ghost -> valid on the refined coarse level.

Needed for some of the deposition methods that deposit on the refined coarse level and then later needs to synchronize their data

◆ m_copierFiCoToFineIncludeGhosts

Copier EBCoarseFineParticleMesh::m_copierFiCoToFineIncludeGhosts
protected

Copier for copying data from the refined coarse level to the fine level.

Note
This copier moves from valid+ghost in the source to valid+ghost in the destination.

◆ m_copierFiCoToFineNoGhosts

Copier EBCoarseFineParticleMesh::m_copierFiCoToFineNoGhosts
protected

Copier for copying data from the refined coarse level to the fine level.

This copier moves from valid+ghost in the source to valid in the destination (as opposed to m_copierCOFiToCoarIncludeGhosts which adds mass into the ghost cells).

◆ m_vofIterCoFiGhosts

LayoutData<VoFIterator> EBCoarseFineParticleMesh::m_vofIterCoFiGhosts
mutableprotected

VoFIterator for coarse grid cells that are coarsenings of fine-grid ghost irregular cells.

Essentially a coarsening of m_vofIterFineGhosts.


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