34 virtual std::string
name()
const = 0;
37 virtual size_t size()
const = 0;
50 std::shared_ptr<MeshIterationStrategy> strategy {};
55 void setStrategy(std::shared_ptr<MeshIterationStrategy> strategy);
58 std::shared_ptr<MeshIterationStrategy>
get()
const;
75 std::string
name()
const override {
return "FaceBased"; }
77 size_t size()
const override {
return 0; }
124 typename FaceNeighbour,
126 typename MatrixColumnIdx>
129 CellFaces&& cellFacesIn,
130 FaceNeighbour&& faceNeighbourIn,
131 FaceSign&& faceSignIn,
132 MatrixColumnIdx&& matrixColumnIdxIn
134 :
size(sizeIn),
cellFaces(std::forward<CellFaces>(cellFacesIn)),
136 faceSign(std::forward<FaceSign>(faceSignIn)),
156 std::string
name()
const override;
173 template<
typename SparsityType>
176 std::shared_ptr<const SparsityType> sparsityPattern,
177 std::shared_ptr<const la::FaceToMatrixAddress> faceToMatrixAddress
193 template<
typename SparsityType>
196 std::shared_ptr<const SparsityType> sparsityPattern,
197 const std::shared_ptr<const la::FaceToMatrixAddress> faceToMatrixAddress
Data structure that stores a segmented fields or a vector of vectors.
Represents an unstructured mesh in NeoN.
A class to contain the data and executors for a field and define some basic operations.
Iteration strategy that traverses cells and their face stencils.
std::shared_ptr< CellBasedData > cellBasedIteratorData_
std::shared_ptr< CellBasedData > getCellBasedData()
Returns the pre-computed connectivity data, or nullptr if not yet initialised.
~CellBasedIterator() override
std::string name() const override
Returns the strategy name.
std::shared_ptr< CellBasedData > 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.
size_t size() const override
Returns the number of iteration elements (cells or faces).
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.
Iteration strategy that traverses internal faces.
~FaceBasedIterator() override
size_t size() const override
Returns the number of iteration elements (cells or faces).
std::string name() const override
Returns the strategy name.
Abstract base class defining the interface for mesh iteration strategies.
virtual std::string name() const =0
Returns the strategy name.
virtual size_t size() const =0
Returns the number of iteration elements (cells or faces).
virtual ~MeshIterationStrategy()
Holds and exposes the active MeshIterationStrategy.
void setStrategy(std::shared_ptr< MeshIterationStrategy > strategy)
Replaces the active strategy.
std::string name() const
Returns the name of the active strategy, or an empty string if none is set.
std::shared_ptr< MeshIterationStrategy > get() const
Returns the active strategy, or nullptr if none has been set.
Pre-computed connectivity required for cell-based assembly.
SegmentedVector< localIdx, localIdx > cellFaces
Cell-to-face stencil; segments correspond to cells, values are face indices.
CellBasedData(localIdx sizeIn, CellFaces &&cellFacesIn, FaceNeighbour &&faceNeighbourIn, FaceSign &&faceSignIn, MatrixColumnIdx &&matrixColumnIdxIn)
Construct from pre-computed connectivity arrays.
Vector< scalar > faceSign
Sign of the face contribution: +1 if this cell owns the face, -1 otherwise.
Vector< localIdx > faceNeighbour
For each stencil entry: the cell on the other side of the face.
localIdx size
Number of cells.
Vector< localIdx > matrixColumnIdx
Flat index into the CSR matrix values array for each stencil entry.