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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fvBoundaryMesh
29 
30 Description
31  Foam::fvBoundaryMesh
32 
33 SourceFiles
34  fvBoundaryMesh.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef fvBoundaryMesh_H
39 #define fvBoundaryMesh_H
40 
41 #include "fvPatchList.H"
42 #include "lduInterfacePtrsList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward Declarations
50 class fvMesh;
51 class polyBoundaryMesh;
52 class wordRes;
53 
54 /*---------------------------------------------------------------------------*\
55  Class fvBoundaryMesh Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class fvBoundaryMesh
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 
81 protected:
82 
83  //- Update boundary based on new polyBoundaryMesh
84  void readUpdate(const polyBoundaryMesh&);
85 
86 
87 public:
88 
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
98  fvBoundaryMesh(const fvMesh&, const 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 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::fvBoundaryMesh::indices
labelList indices(const wordRe &matcher, const bool useGroups) const
Return (sorted) patch indices for all matches.
Definition: fvBoundaryMesh.C:76
Foam::fvBoundaryMesh::findPatchID
label findPatchID(const word &patchName) const
Find patch index given a name.
Definition: fvBoundaryMesh.C:95
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
Foam::fvBoundaryMesh::readUpdate
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
Definition: fvBoundaryMesh.C:171
fvPatchList.H
Foam::fvBoundaryMesh::mesh
const fvMesh & mesh() const noexcept
Return the mesh reference.
Definition: fvBoundaryMesh.H:103
Foam::wordRe
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:80
lduInterfacePtrsList.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fvBoundaryMesh::interfaces
lduInterfacePtrsList interfaces() const
Definition: fvBoundaryMesh.C:149
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::fvBoundaryMesh::operator[]
const fvPatch & operator[](const word &) const
Return const reference to fvPatch by name.
Definition: fvBoundaryMesh.C:181
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fvBoundaryMesh::faceCells
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
Definition: fvBoundaryMesh.C:134
Foam::List< label >
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::FOAM_DEPRECATED_FOR
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:69
Foam::fvBoundaryMesh::findIndices
labelList findIndices(const wordRe &key, bool useGroups) const
Identical to the indices() method (AUG-2018)
Definition: fvBoundaryMesh.H:147
Foam::fvBoundaryMesh::movePoints
void movePoints()
Correct patches after moving points.
Definition: fvBoundaryMesh.C:117