NeoN
A framework for CFD software
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
12
13namespace NeoN
14{
15
30{
31public:
32
66 );
67
73 const vectorVector& points() const;
74
80 const scalarVector& cellVolumes() const;
81
87 const vectorVector& cellCentres() const;
88
94 const vectorVector& faceCentres() const;
95
101 const vectorVector& faceAreas() const;
102
109
115 const labelVector& faceOwner() const;
116
123
130
137
144
151
158
165
172
178 const Executor& exec() const;
179
180private:
181
187 const Executor exec_;
188
192 vectorVector points_;
193
197 scalarVector cellVolumes_;
198
202 vectorVector cellCentres_;
203
210 vectorVector faceAreas_;
211
215 vectorVector faceCentres_;
216
220 scalarVector magFaceAreas_;
221
225 labelVector faceOwner_;
226
230 labelVector faceNeighbour_;
231
235 localIdx nCells_;
236
240 localIdx nInternalFaces_;
241
245 localIdx nBoundaryFaces_;
246
250 localIdx nBoundaries_;
251
255 localIdx nFaces_;
256
263 BoundaryMesh boundaryMesh_;
264
270 mutable StencilDataBase stencilDataBase_;
271};
272
282
289
290
291} // 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.
Definition array.hpp:19
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