NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
boundaryPatchMixin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoFOAM authors
3#pragma once
4
7
9
11{
12
26{
27
28public:
29
31
32 virtual ~BoundaryPatchMixin() = default;
33
35 : patchID_(patchID), start_(static_cast<label>(mesh.boundaryMesh().offset()[patchID_])),
36 end_(static_cast<label>(mesh.boundaryMesh().offset()[patchID_ + 1]))
37 {}
38
40 : patchID_(patchID), start_(start), end_(end)
41 {}
42
43 label patchStart() const { return start_; };
44
45 label patchEnd() const { return start_; };
46
47 size_t patchSize() const { return static_cast<size_t>(end_ - start_); }
48
49 size_t patchID() const { return patchID_; }
50
51 std::pair<size_t, size_t> range() { return {start_, end_}; }
52
53protected:
54
55 size_t patchID_;
58};
59}
Represents an unstructured mesh in NeoFOAM.
A base class for implementing derived boundary conditions.
label end_
The end index of the patch in the boundaryField.
BoundaryPatchMixin(const UnstructuredMesh &mesh, size_t patchID)
BoundaryPatchMixin(label start, label end, size_t patchID)
label start_
The start index of the patch in the boundaryField.
int32_t label
Definition label.hpp:13