NeoFOAM
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 NeoFOAM authors
3
4#pragma once
5
9
10namespace NeoFOAM
11{
12
27{
28public:
29
57 size_t nCells,
58 size_t nInternalFaces,
59 size_t nBoundaryFaces,
60 size_t nBoundaries,
61 size_t nFaces,
63 );
64
70 const vectorField& points() const;
71
77 const scalarField& cellVolumes() const;
78
84 const vectorField& cellCentres() const;
85
91 const vectorField& faceCentres() const;
92
98 const vectorField& faceAreas() const;
99
105 const scalarField& magFaceAreas() const;
106
112 const labelField& faceOwner() const;
113
119 const labelField& faceNeighbour() const;
120
126 size_t nCells() const;
127
133 size_t nInternalFaces() const;
134
140 size_t nBoundaryFaces() const;
141
147 size_t nBoundaries() const;
148
154 size_t nFaces() const;
155
162
169
175 const Executor& exec() const;
176
177private:
178
184 const Executor exec_;
185
189 vectorField points_;
190
194 scalarField cellVolumes_;
195
199 vectorField cellCentres_;
200
207 vectorField faceAreas_;
208
212 vectorField faceCentres_;
213
217 scalarField magFaceAreas_;
218
222 labelField faceOwner_;
223
227 labelField faceNeighbour_;
228
232 size_t nCells_;
233
237 size_t nInternalFaces_;
238
242 size_t nBoundaryFaces_;
243
247 size_t nBoundaries_;
248
252 size_t nFaces_;
253
260 BoundaryMesh boundaryMesh_;
261
267 mutable StencilDataBase stencilDataBase_;
268};
269
279
285UnstructuredMesh create1DUniformMesh(const Executor exec, const size_t nCells);
286
287} // namespace NeoFOAM
Represents boundaries of an unstructured mesh.
A class that represents a stencil database.
Represents an unstructured mesh in NeoFOAM.
const BoundaryMesh & boundaryMesh() const
Get the boundary mesh.
StencilDataBase & stencilDB() const
Get the stencil data base.
const scalarField & cellVolumes() const
Get the field of cell volumes in the mesh.
const vectorField & faceAreas() const
Get the field of area face normals.
const vectorField & cellCentres() const
Get the field of cell centres in the mesh.
size_t nInternalFaces() const
Get the number of internal faces in the mesh.
const Executor & exec() const
Get the executor.
const scalarField & magFaceAreas() const
Get the field of magnitudes of face areas.
size_t nBoundaryFaces() const
Get the number of boundary faces in the mesh.
size_t nFaces() const
Get the number of faces in the mesh.
size_t nCells() const
Get the number of cells in the mesh.
const labelField & faceOwner() const
Get the field of face owner cells.
size_t nBoundaries() const
Get the number of boundaries in the mesh.
UnstructuredMesh(vectorField points, scalarField cellVolumes, vectorField cellCentres, vectorField faceAreas, vectorField faceCentres, scalarField magFaceAreas, labelField faceOwner, labelField faceNeighbour, size_t nCells, size_t nInternalFaces, size_t nBoundaryFaces, size_t nBoundaries, size_t nFaces, BoundaryMesh boundaryMesh)
Constructor for the UnstructuredMesh class.
const labelField & faceNeighbour() const
Get the field of face neighbour cells.
const vectorField & points() const
Get the field of mesh points.
const vectorField & faceCentres() const
Get the field of face centres.
UnstructuredMesh createSingleCellMesh(const Executor exec)
creates a mesh containing only a single cell @warn currently this is only a 2D mesh
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:16
UnstructuredMesh create1DUniformMesh(const Executor exec, const size_t nCells)
A factory function for a 1D mesh.