MatrixFreeCellBatchParticleCache< dim, number, ObstacleType > Class Template Reference

Developer Documentation: MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType > Class Template Reference
Developer Documentation
MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType > Class Template Reference

#include <cell_batch_particle_cache.hpp>

Collaboration diagram for MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >:
[legend]

Public Member Functions

 MatrixFreeCellBatchParticleCache (const MatrixFreeContext< dim, number > mf_context)
 
void update (CellListParticleHandler< dim, number, ObstacleType > &particle_handler, const typename CellListParticleHandler< dim, number, ObstacleType >::NotifyEvent event)
 
DEAL_II_ALWAYS_INLINE const std::vector< DEMParticleAccessor< dim, number > > & obstacles_in_cell_batch (const unsigned int cell_batch_id) const
 
DEAL_II_ALWAYS_INLINE std::vector< DEMParticleAccessor< dim, number > > & obstacles_in_cell_batch (const unsigned int cell_batch_id)
 

Private Attributes

const MatrixFreeContext< dim, number > mf_context
 
std::vector< std::vector< DEMParticleAccessor< dim, number > > > cell_batch_to_particle_cache
 

Detailed Description

template<int dim, typename number, typename ObstacleType>
class MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >

A cache that stores, for each cell batch in a matrix-free context, the particles relevant to the cells in that batch. This is useful for efficiently accessing particle data during matrix-free operations, as it avoids repeated searches for particles in each cell.

Constructor & Destructor Documentation

◆ MatrixFreeCellBatchParticleCache()

template<int dim, typename number , typename ObstacleType >
MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::MatrixFreeCellBatchParticleCache ( const MatrixFreeContext< dim, number >  mf_context)
inline

Constructor, stores a reference to the matrix-free object internally.

Parameters
mf_contextThe matrix-free context that provides information about the cell batches for which the particle cache is to be constructed.

Member Function Documentation

◆ obstacles_in_cell_batch() [1/2]

template<int dim, typename number , typename ObstacleType >
std::vector< DEMParticleAccessor< dim, number > > & MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::obstacles_in_cell_batch ( const unsigned int  cell_batch_id)
inline

Same as the above const version of obstacles_in_cell_batch, but returns a non-const reference to the vector of particles for the specified cell batch.

◆ obstacles_in_cell_batch() [2/2]

template<int dim, typename number , typename ObstacleType >
const std::vector< DEMParticleAccessor< dim, number > > & MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::obstacles_in_cell_batch ( const unsigned int  cell_batch_id) const
inline

Returns the particles relevant to the specified cell batch. For the definition of "relevant", see the documentation of the CellListParticleHandler class.

Parameters
cell_batch_idThe ID of the cell batch for which to retrieve particles.
Returns
A const reference to the vector of particles for the specified cell batch.

◆ update()

template<int dim, typename number , typename ObstacleType >
void MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::update ( CellListParticleHandler< dim, number, ObstacleType > &  particle_handler,
const typename CellListParticleHandler< dim, number, ObstacleType >::NotifyEvent  event 
)

Updates the particle cache by querying the provided obstacle field for the particles relevant to each cell batch in the matrix-free context. This function should be called whenever the particle-cell relationship changes.

Parameters
particle_handlerThe obstacle data structure that manages the particles in the domain.
eventThe type of event that triggered the update.

Member Data Documentation

◆ cell_batch_to_particle_cache

template<int dim, typename number , typename ObstacleType >
std::vector<std::vector<DEMParticleAccessor<dim, number> > > MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::cell_batch_to_particle_cache
private

Vector caching, for each cell batch, the particles relevant to the cells in that batch. The index of the outer vector corresponds to the cell batch id.

◆ mf_context

template<int dim, typename number , typename ObstacleType >
const MatrixFreeContext<dim, number> MeltPoolDG::MatrixFreeCellBatchParticleCache< dim, number, ObstacleType >::mf_context
private

The matrix-free context that provides information about the cell batches for which the particle cache is constructed.


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