NeoN
A framework for CFD software
Loading...
Searching...
No Matches
unstructuredMesh.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2023 - 2025 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include "Kokkos_Sort.hpp"
8
13
14namespace NeoN
15{
16
31{
32public:
33
67 );
68
74 const vectorVector& points() const;
75
81 const scalarVector& cellVolumes() const;
82
88 const vectorVector& cellCentres() const;
89
95 const vectorVector& faceCentres() const;
96
102 const vectorVector& faceAreas() const;
103
110
116 const labelVector& faceOwner() const;
117
124
131
138
145
152
159
166
173
179 const Executor& exec() const;
180
181private:
182
188 const Executor exec_;
189
193 vectorVector points_;
194
198 scalarVector cellVolumes_;
199
203 vectorVector cellCentres_;
204
211 vectorVector faceAreas_;
212
216 vectorVector faceCentres_;
217
221 scalarVector magFaceAreas_;
222
226 labelVector faceOwner_;
227
231 labelVector faceNeighbour_;
232
236 localIdx nCells_;
237
241 localIdx nInternalFaces_;
242
246 localIdx nBoundaryFaces_;
247
251 localIdx nBoundaries_;
252
256 localIdx nFaces_;
257
264 BoundaryMesh boundaryMesh_;
265
271 mutable StencilDataBase stencilDataBase_;
272};
273
283
290
291
292} // 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:20
int32_t localIdx
Definition label.hpp:32
UnstructuredMesh create1DUniformMesh(const Executor exec, const localIdx nCells)
A factory function for a 1D mesh.
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:18
UnstructuredMesh createSingleCellMesh(const Executor exec)
creates a mesh containing only a single cell @warn currently this is only a 2D mesh