NeoN
A framework for CFD software
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
NeoN::la::CellBasedIterator Class Reference

Iteration strategy that traverses cells and their face stencils. More...

#include <meshIterationStrategies.hpp>

Inheritance diagram for NeoN::la::CellBasedIterator:
NeoN::la::MeshIterationStrategy

Classes

struct  CellBasedData
 Pre-computed connectivity required for cell-based assembly. More...
 

Public Member Functions

 CellBasedIterator ()
 
std::string name () const override
 Returns the strategy name.
 
size_t size () const override
 Returns the number of iteration elements (cells or faces).
 
 ~CellBasedIterator () override
 
std::shared_ptr< CellBasedDatagetCellBasedData ()
 Returns the pre-computed connectivity data, or nullptr if not yet initialised.
 
template<typename SparsityType >
void setComputeCellBasedData (const UnstructuredMesh &mesh, std::shared_ptr< const SparsityType > sparsityPattern, std::shared_ptr< const la::FaceToMatrixAddress > faceToMatrixAddress)
 Computes and stores the cell-based connectivity data.
 
template<typename SparsityType >
std::shared_ptr< CellBasedDatacomputeCellBasedData (const UnstructuredMesh &mesh, std::shared_ptr< const SparsityType > sparsityPattern, const std::shared_ptr< const la::FaceToMatrixAddress > faceToMatrixAddress)
 Builds and returns cell-based connectivity data without storing it.
 
- Public Member Functions inherited from NeoN::la::MeshIterationStrategy
virtual ~MeshIterationStrategy ()
 

Public Attributes

std::shared_ptr< CellBasedDatacellBasedIteratorData_
 

Detailed Description

Iteration strategy that traverses cells and their face stencils.

Pre-computes a cell-centric connectivity table (CellBasedData) so that each cell can independently gather all face contributions during assembly, which is better suited for GPU-parallel execution than the face-based approach.

Definition at line 89 of file meshIterationStrategies.hpp.

Constructor & Destructor Documentation

◆ CellBasedIterator()

NeoN::la::CellBasedIterator::CellBasedIterator ( )

◆ ~CellBasedIterator()

NeoN::la::CellBasedIterator::~CellBasedIterator ( )
inlineoverride

Definition at line 160 of file meshIterationStrategies.hpp.

Member Function Documentation

◆ computeCellBasedData()

template<typename SparsityType >
std::shared_ptr< CellBasedData > NeoN::la::CellBasedIterator::computeCellBasedData ( const UnstructuredMesh mesh,
std::shared_ptr< const SparsityType >  sparsityPattern,
const std::shared_ptr< const la::FaceToMatrixAddress faceToMatrixAddress 
)

Builds and returns cell-based connectivity data without storing it.

Launches a parallel kernel that, for every cell, iterates over its face stencil and records the neighbour cell, the face sign, and the matrix column index for each face.

Template Parameters
SparsityTypeSparsity pattern type (e.g. CsrSparsityPattern, CooSparsityPattern).
Parameters
meshThe mesh providing owner/neighbour topology.
sparsityPatternSparsity pattern of the linear system.
faceToMatrixAddressMapping from faces to matrix row offsets.
Returns
Shared pointer to the newly allocated CellBasedData.

◆ getCellBasedData()

std::shared_ptr< CellBasedData > NeoN::la::CellBasedIterator::getCellBasedData ( )

Returns the pre-computed connectivity data, or nullptr if not yet initialised.

◆ name()

std::string NeoN::la::CellBasedIterator::name ( ) const
overridevirtual

Returns the strategy name.

Implements NeoN::la::MeshIterationStrategy.

◆ setComputeCellBasedData()

template<typename SparsityType >
void NeoN::la::CellBasedIterator::setComputeCellBasedData ( const UnstructuredMesh mesh,
std::shared_ptr< const SparsityType >  sparsityPattern,
std::shared_ptr< const la::FaceToMatrixAddress faceToMatrixAddress 
)

Computes and stores the cell-based connectivity data.

Template Parameters
SparsityTypeSparsity pattern type (e.g. CsrSparsityPattern, CooSparsityPattern).
Parameters
meshThe mesh providing owner/neighbour topology.
sparsityPatternSparsity pattern of the linear system.
faceToMatrixAddressMapping from faces to matrix row offsets.

◆ size()

size_t NeoN::la::CellBasedIterator::size ( ) const
overridevirtual

Returns the number of iteration elements (cells or faces).

Implements NeoN::la::MeshIterationStrategy.

Member Data Documentation

◆ cellBasedIteratorData_

std::shared_ptr<CellBasedData> NeoN::la::CellBasedIterator::cellBasedIteratorData_

Definition at line 200 of file meshIterationStrategies.hpp.


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