NeoFOAM
WIP Prototype of a modern OpenFOAM core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Concepts
boundaryMesh.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoFOAM authors
3#pragma once
4
5#include <vector>
6
9
10namespace NeoFOAM
11{
12
28{
29public:
30
48 const Executor& exec,
58 std::vector<localIdx> offset
59 );
60
61
67 const labelField& faceCells() const;
68
75 std::span<const label> faceCells(const localIdx i) const;
76
82 const vectorField& cf() const;
83
90 std::span<const Vector> cf(const localIdx i) const;
91
97 const vectorField& cn() const;
98
105 std::span<const Vector> cn(const localIdx i) const;
106
112 const vectorField& sf() const;
113
120 std::span<const Vector> sf(const localIdx i) const;
121
128 const scalarField& magSf() const;
129
138 std::span<const scalar> magSf(const localIdx i) const;
139
145 const vectorField& nf() const;
146
153 std::span<const Vector> nf(const localIdx i) const;
154
160 const vectorField& delta() const;
161
168 std::span<const Vector> delta(const localIdx i) const;
169
175 const scalarField& weights() const;
176
183 std::span<const scalar> weights(const localIdx i) const;
184
190 const scalarField& deltaCoeffs() const;
191
198 std::span<const scalar> deltaCoeffs(const localIdx i) const;
199
205 const std::vector<localIdx>& offset() const;
206
207
208private:
209
213 const Executor exec_;
214
220 labelField faceCells_;
221
225 vectorField Cf_;
226
230 vectorField Cn_;
231
235 vectorField Sf_;
236
240 scalarField magSf_;
241
245 vectorField nf_;
246
253 vectorField delta_;
254
260 scalarField weights_;
261
267 scalarField deltaCoeffs_;
268
274 std::vector<localIdx> offset_;
275};
276
277} // namespace NeoFOAM
Represents boundaries of an unstructured mesh.
const vectorField & cn() const
Get the field of face normals.
std::span< const Vector > delta(const localIdx i) const
Get a span of delta vectors for a specific boundary face.
std::span< const label > faceCells(const localIdx i) const
Get a span of face cells for a specific boundary face.
std::span< const Vector > sf(const localIdx i) const
Get a span of face areas normals for a specific boundary face.
const vectorField & sf() const
Get the field of face areas normals.
std::span< const scalar > magSf(const localIdx i) const
Get a span of magnitudes of face areas normals for a specific boundary face.
const scalarField & magSf() const
Get the field of magnitudes of face areas normals.
std::span< const Vector > nf(const localIdx i) const
Get a span of face unit normals for a specific boundary face.
std::span< const scalar > weights(const localIdx i) const
Get a span of weights for a specific boundary face.
std::span< const Vector > cf(const localIdx i) const
Get a span of face centres for a specific boundary face.
const vectorField & cf() const
Get the field of face centres.
std::span< const scalar > deltaCoeffs(const localIdx i) const
Get a span of delta coefficients for a specific boundary face.
const std::vector< localIdx > & offset() const
Get the offset of the boundary faces.
const vectorField & delta() const
Get the field of delta vectors.
const vectorField & nf() const
Get the field of face unit normals.
const scalarField & deltaCoeffs() const
Get the field of delta coefficients.
BoundaryMesh(const Executor &exec, labelField faceCells, vectorField cf, vectorField cn, vectorField sf, scalarField magSf, vectorField nf, vectorField delta, scalarField weights, scalarField deltaCoeffs, std::vector< localIdx > offset)
Constructor for the BoundaryMesh class.
const scalarField & weights() const
Get the field of weights.
std::span< const Vector > cn(const localIdx i) const
Get a span of face normals for a specific boundary face.
const labelField & faceCells() const
Get the field of face cells.
uint32_t localIdx
Definition label.hpp:14
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
Definition executor.hpp:16