NeoN
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 NeoN authors
3#pragma once
4
7
9
11{
12
26{
27
28public:
29
31
32 virtual ~BoundaryPatchMixin() = default;
33
35 : patchID_(patchID), start_(mesh.boundaryMesh().offset()[static_cast<size_t>(patchID_)]),
36 end_(mesh.boundaryMesh().offset()[static_cast<size_t>(patchID_) + 1])
37 {}
38
42
43 localIdx patchStart() const { return start_; };
44
45 localIdx patchEnd() const { return start_; };
46
47 localIdx patchSize() const { return end_ - start_; }
48
49 localIdx patchID() const { return patchID_; }
50
51 std::pair<localIdx, localIdx> range() { return {start_, end_}; }
52
53protected:
54
58};
59}
Represents an unstructured mesh in NeoN.
A base class for implementing derived boundary conditions.
localIdx end_
The end index of the patch in the boundaryVector.
BoundaryPatchMixin(const UnstructuredMesh &mesh, localIdx patchID)
localIdx start_
The start index of the patch in the boundaryVector.
BoundaryPatchMixin(localIdx start, localIdx end, localIdx patchID)
int32_t localIdx
Definition label.hpp:30
std::size_t size_t
Definition label.hpp:36