fvBoundaryMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fvBoundaryMesh
26 
27 Description
28  Foam::fvBoundaryMesh
29 
30 SourceFiles
31  fvBoundaryMesh.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvBoundaryMesh_H
36 #define fvBoundaryMesh_H
37 
38 #include "fvPatchList.H"
39 #include "lduInterfacePtrsList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class fvMesh;
47 class polyBoundaryMesh;
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvBoundaryMesh Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fvBoundaryMesh
54 :
55  public fvPatchList
56 {
57  // Private Data
58 
59  //- Reference to mesh
60  const fvMesh& mesh_;
61 
62 
63  // Private Member Functions
64 
65  //- Add fvPatches corresponding to the given polyBoundaryMesh
66  void addPatches(const polyBoundaryMesh&);
67 
68 
69 protected:
70 
71  //- Update boundary based on new polyBoundaryMesh
72  void readUpdate(const polyBoundaryMesh&);
73 
74 
75 public:
76 
77  friend class fvMesh;
78 
79 
80  // Constructors
81 
82  //- Construct with zero size
83  fvBoundaryMesh(const fvMesh&);
84 
85  //- Construct from polyBoundaryMesh
86  fvBoundaryMesh(const fvMesh&, const polyBoundaryMesh&);
87 
88  //- Move constructor
89  fvBoundaryMesh(fvBoundaryMesh&&) = default;
90 
91  //- Disallow default bitwise copy construction
92  fvBoundaryMesh(const fvBoundaryMesh&) = delete;
93 
94 
95  // Member Functions
96 
97  // Access
98 
99  //- Return the mesh reference
100  const fvMesh& mesh() const
101  {
102  return mesh_;
103  }
104 
105  //- Return a list of pointers for each patch
106  // with only those pointing to interfaces being set
108 
109  //- Find patch index given a name
110  label findPatchID(const word& patchName) const;
111 
112  //- Find patch indices given a name
113  labelList findIndices(const wordRe&, const bool useGroups) const;
114 
115 
116  //- Correct patches after moving points
117  void movePoints();
118 
119  //- Reorders patches. Ordering does not have to be done in
120  // ascending or descending order. Reordering has to be unique.
121  // (is shuffle). If validBoundary call needs to be parallel
122  // sync
123  void shuffle(const labelUList& newToOld, const bool validBoundary);
124 
125 
126  // Member Operators
127 
128  //- Return const and non-const reference to fvPatch by index.
129  using fvPatchList::operator[];
130 
131  //- Return const reference to fvPatch by name.
132  const fvPatch& operator[](const word&) const;
133 
134  //- Return reference to fvPatch by name.
135  fvPatch& operator[](const word&);
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const fvBoundaryMesh&);
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
friend Ostream & operator(Ostream &, const UPtrList< T > &)
Write UPtrList to Ostream.
Foam::fvBoundaryMesh.
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
const fvMesh & mesh() const
Return the mesh reference.
fvBoundaryMesh(const fvMesh &)
Construct with zero size.
void operator=(const fvBoundaryMesh &)
Disallow default bitwise assignment.
void movePoints()
Correct patches after moving points.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
labelList findIndices(const wordRe &, const bool useGroups) const
Find patch indices given a name.
label findPatchID(const word &patchName) const
Find patch index given a name.
void shuffle(const labelUList &newToOld, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
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:101
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Foam::polyBoundaryMesh.
A wordRe is a word, but can also have a regular expression for matching words.
Definition: wordRe.H:77
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59