Loading...
Searching...
No Matches
fvBoundaryMesh.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fvBoundaryMesh
29
30Description
31 A fvBoundaryMesh is a fvPatch list with
32 a reference to the associated fvMesh,
33 with additional search methods etc.
34
35SourceFiles
36 fvBoundaryMesh.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_fvBoundaryMesh_H
41#define Foam_fvBoundaryMesh_H
42
43#include "fvPatch.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52class fvMesh;
54class wordRes;
56/*---------------------------------------------------------------------------*\
57 Class fvBoundaryMesh Declaration
58\*---------------------------------------------------------------------------*/
59
61:
62 public fvPatchList
63{
64 // Private Data
65
66 //- Reference to mesh
67 const fvMesh& mesh_;
68
69
70 // Private Member Functions
71
72 //- Assign fvPatches corresponding to the given polyBoundaryMesh
73 void addPatches(const polyBoundaryMesh& pbm);
74
75protected:
76
77 //- Update boundary based on new polyBoundaryMesh
78 void readUpdate(const polyBoundaryMesh&);
79
80
81public:
82
83 //- Declare friendship with fvMesh
84 friend class fvMesh;
85
86
87 // Generated Methods
88
89 //- No copy construct
90 fvBoundaryMesh(const fvBoundaryMesh&) = delete;
91
92 //- No copy assignment
93 void operator=(const fvBoundaryMesh&) = delete;
94
96 // Constructors
97
98 //- Construct zero size with mesh reference
99 explicit fvBoundaryMesh(const fvMesh&);
101 //- Construct from polyBoundaryMesh
102 fvBoundaryMesh(const fvMesh&, const polyBoundaryMesh&);
103
104
105 // Member Functions
106
107 //- Return the mesh reference
108 const fvMesh& mesh() const noexcept { return mesh_; }
109
110 //- Return a list of faceCells for each patch
112
113 //- Return a list of pointers for each patch
114 //- with only those pointing to interfaces being set
116
117 //- The (sorted) patch indices for all matches,
118 //- optionally matching patch groups.
119 // \returns an empty list for an empty matcher
120 labelList indices(const wordRe& matcher, const bool useGroups) const;
122 //- The (sorted) patch indices for all matches,
123 //- optionally matching patch groups.
124 // \returns an empty list for an empty matcher
125 labelList indices(const wordRes& matcher, const bool useGroups) const;
126
127 //- The (sorted) patch indices: logic as per Foam::wordRes::filter,
128 //- optionally matching patch groups.
129 //
130 // An empty \em allow accepts everything not in \em deny.
131 // A literal \em allow match has higher priority than any \em deny.
132 // A regex \em allow match has lower priority than any \em deny.
133 //
134 // \returns identity list when allow/deny are both empty.
136 (
137 const wordRes& allow,
138 const wordRes& deny,
139 const bool useGroups
140 ) const;
141
142 //- Find patch index given a name
143 // A no-op (returns -1) for an empty patchName
144 label findPatchID(const word& patchName) const;
145
146 //- Find patch by name and return const pointer.
147 //- \returns nullptr if not found or for an empty patchName
148 const fvPatch* cfindPatch(const word& patchName) const;
149
150 //- Correct patches after moving points
151 void movePoints();
152
153
154 // Member Operators
155
156 //- Return const and non-const reference to fvPatch by index.
157 using fvPatchList::operator[];
158
159 //- Return const reference to fvPatch by name.
160 const fvPatch& operator[](const word& patchName) const;
161
162 //- Return reference to fvPatch by name.
163 fvPatch& operator[](const word& patchName);
164
165
166 // Housekeeping
167
168 //- Identical to the indices() method (AUG-2018)
169 FOAM_DEPRECATED_FOR(2018-08, "indices() method")
170 labelList findIndices(const wordRe& key, bool useGroups) const
171 {
172 return indices(key, useGroups);
173 }
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#endif
184
185// ************************************************************************* //
const polyBoundaryMesh & pbm
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
const fvMesh & mesh() const noexcept
Return the mesh reference.
const fvPatch & operator[](const word &patchName) const
Return const reference to fvPatch by name.
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch with only those pointing to interfaces being set.
void operator=(const fvBoundaryMesh &)=delete
No copy assignment.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
friend class fvMesh
Declare friendship with fvMesh.
void movePoints()
Correct patches after moving points.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
labelList indices(const wordRe &matcher, const bool useGroups) const
The (sorted) patch indices for all matches, optionally matching patch groups.
labelList findIndices(const wordRe &key, bool useGroups) const
Identical to the indices() method (AUG-2018).
const fvPatch * cfindPatch(const word &patchName) const
Find patch by name and return const pointer.
label findPatchID(const word &patchName) const
Find patch index given a name.
fvBoundaryMesh(const fvBoundaryMesh &)=delete
No copy construct.
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition wordRe.H:81
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
Definition fvPatch.H:64
List< label > labelList
A List of labels.
Definition List.H:62
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
const direction noexcept
Definition scalarImpl.H:265
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43