NeoN
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
unstructuredMesh.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoN authors
3
4#pragma once
5
6#include "Kokkos_Sort.hpp"
7
11
12namespace NeoN
13{
14
29{
30public:
31
65 );
66
72 const vectorVector& points() const;
73
79 const scalarVector& cellVolumes() const;
80
86 const vectorVector& cellCentres() const;
87
93 const vectorVector& faceCentres() const;
94
100 const vectorVector& faceAreas() const;
101
108
114 const labelVector& faceOwner() const;
115
122
129
136
143
150
157
164
171
177 const Executor& exec() const;
178
179private:
180
186 const Executor exec_;
187
191 vectorVector points_;
192
196 scalarVector cellVolumes_;
197
201 vectorVector cellCentres_;
202
209 vectorVector faceAreas_;
210
214 vectorVector faceCentres_;
215
219 scalarVector magFaceAreas_;
220
224 labelVector faceOwner_;
225
229 labelVector faceNeighbour_;
230
234 localIdx nCells_;
235
239 localIdx nInternalFaces_;
240
244 localIdx nBoundaryFaces_;
245
249 localIdx nBoundaries_;
250
254 localIdx nFaces_;
255
262 BoundaryMesh boundaryMesh_;
263
269 mutable StencilDataBase stencilDataBase_;
270};
271
281
288
289
290} // namespace NeoN
Represents boundaries of an unstructured mesh.
A class that represents a stencil database.
Represents an unstructured mesh in NeoN.
localIdx nCells() const
Get the number of cells in the mesh.
const scalarVector & cellVolumes() const
Get the field of cell volumes in the mesh.
localIdx nBoundaryFaces() const
Get the number of boundary faces in the mesh.
const scalarVector & magFaceAreas() const
Get the field of magnitudes of face areas.
localIdx nBoundaries() const
Get the number of boundaries in the mesh.
const vectorVector & faceCentres() const
Get the field of face centres.
localIdx nInternalFaces() const
Get the number of internal faces in the mesh.
StencilDataBase & stencilDB() const
Get the stencil data base.
const vectorVector & faceAreas() const
Get the field of area face normals.
const Executor & exec() const
Get the executor.
const labelVector & faceNeighbour() const
Get the field of face neighbour cells.
const vectorVector & cellCentres() const
Get the field of cell centres in the mesh.
const labelVector & faceOwner() const
Get the field of face owner cells.
localIdx nFaces() const
Get the number of faces in the mesh.
const BoundaryMesh & boundaryMesh() const
Get the boundary mesh.
const vectorVector & points() const
Get the field of mesh points.
UnstructuredMesh(vectorVector points, scalarVector cellVolumes, vectorVector cellCentres, vectorVector faceAreas, vectorVector faceCentres, scalarVector magFaceAreas, labelVector faceOwner, labelVector faceNeighbour, localIdx nCells, localIdx nInternalFaces, localIdx nBoundaryFaces, localIdx nBoundaries, localIdx nFaces, BoundaryMesh boundaryMesh)
Constructor for the UnstructuredMesh class.
int32_t localIdx
Definition label.hpp:30
UnstructuredMesh create1DUniformMesh(const Executor exec, const localIdx nCells)
A factory function for a 1D mesh.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:16
UnstructuredMesh createSingleCellMesh(const Executor exec)
creates a mesh containing only a single cell @warn currently this is only a 2D mesh