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-2021 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 Foam::fvBoundaryMesh
32
33SourceFiles
34 fvBoundaryMesh.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_fvBoundaryMesh_H
39#define Foam_fvBoundaryMesh_H
40
41#include "fvPatch.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49// Forward Declarations
50class fvMesh;
51class polyBoundaryMesh;
52class wordRes;
53
54/*---------------------------------------------------------------------------*\
55 Class fvBoundaryMesh Declaration
56\*---------------------------------------------------------------------------*/
59:
60 public fvPatchList
61{
62 // Private Data
63
64 //- Reference to mesh
65 const fvMesh& mesh_;
66
67
68 // Private Member Functions
69
70 //- Add fvPatches corresponding to the given polyBoundaryMesh
71 void addPatches(const polyBoundaryMesh&);
72
73
74 //- No copy construct
75 fvBoundaryMesh(const fvBoundaryMesh&) = delete;
76
77 //- No copy assignment
78 void operator=(const fvBoundaryMesh&) = delete;
79
80
81protected:
82
83 //- Update boundary based on new polyBoundaryMesh
84 void readUpdate(const polyBoundaryMesh&);
85
86
87public:
89 friend class fvMesh;
90
91
92 // Constructors
93
94 //- Construct zero size with mesh reference
95 explicit fvBoundaryMesh(const fvMesh&);
96
97 //- Construct from polyBoundaryMesh
99
100
101 // Member Functions
102
103 //- Return the mesh reference
104 const fvMesh& mesh() const noexcept
105 {
106 return mesh_;
107 }
108
109 //- Return a list of faceCells for each patch
111
112 //- Return a list of pointers for each patch
113 //- with only those pointing to interfaces being set
115
116 //- Return (sorted) patch indices for all matches.
117 // A no-op (returns empty list) for an empty matcher
118 labelList indices(const wordRe& matcher, const bool useGroups) const;
119
120 //- Return (sorted) patch indices for all matches.
121 // A no-op (returns empty list) for an empty matcher
122 labelList indices(const wordRes& matcher, const bool useGroups) const;
123
124 //- Find patch index given a name
125 // A no-op (returns -1) for an empty patchName
126 label findPatchID(const word& patchName) const;
127
128 //- Correct patches after moving points
129 void movePoints();
130
131
132 // Member Operators
133
134 //- Return const and non-const reference to fvPatch by index.
135 using fvPatchList::operator[];
136
137 //- Return const reference to fvPatch by name.
138 const fvPatch& operator[](const word&) const;
139
140 //- Return reference to fvPatch by name.
141 fvPatch& operator[](const word&);
142
143
144 // Housekeeping
145
146 //- Identical to the indices() method (AUG-2018)
147 FOAM_DEPRECATED_FOR(2018-08, "indices() method")
148 labelList findIndices(const wordRe& key, bool useGroups) const
149 {
150 return indices(key, useGroups);
151 }
152};
153
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157} // End namespace Foam
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161#endif
162
163// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Foam::fvBoundaryMesh.
const fvMesh & mesh() const noexcept
Return the mesh reference.
lduInterfacePtrsList interfaces() const
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
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
Return (sorted) patch indices for all matches.
labelList findIndices(const wordRe &key, bool useGroups) const
Identical to the indices() method (AUG-2018)
label findPatchID(const word &patchName) const
Find patch index given a name.
const fvPatch & operator[](const word &) const
Return const reference to fvPatch by name.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:83
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition: stdFoam.H:52