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-2020 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  //- Disallow default bitwise copy construction
90 
91 
92  // Member Functions
93 
94  // Access
95 
96  //- Return the mesh reference
97  const fvMesh& mesh() const
98  {
99  return mesh_;
100  }
101 
102  //- Return a list of pointers for each patch
103  // with only those pointing to interfaces being set
105 
106  //- Find patch index given a name
107  label findPatchID(const word& patchName) const;
108 
109  //- Find patch indices given a name
110  labelList findIndices(const wordRe&, const bool useGroups) const;
111 
112 
113  //- Correct patches after moving points
114  void movePoints();
115 
116  //- Reorders patches. Ordering does not have to be done in
117  // ascending or descending order. Reordering has to be unique.
118  // (is shuffle). If validBoundary call needs to be parallel
119  // sync
120  void shuffle(const labelUList& newToOld, const bool validBoundary);
121 
122 
123  // Member Operators
124 
125  //- Return const and non-const reference to fvPatch by index.
126  using fvPatchList::operator[];
127 
128  //- Return const reference to fvPatch by name.
129  const fvPatch& operator[](const word&) const;
130 
131  //- Return reference to fvPatch by name.
132  fvPatch& operator[](const word&);
133 
134 
135  // Member Operators
136 
137  //- Disallow default bitwise assignment
138  void operator=(const fvBoundaryMesh&);
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
label findPatchID(const word &patchName) const
Find patch index given a name.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
fvBoundaryMesh(const fvMesh &)
Construct with zero size.
friend Ostream & operator(Ostream &, const UPtrList< T > &)
Write UPtrList to Ostream.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
const fvPatch & operator[](const word &) const
Return const reference to fvPatch by name.
const fvMesh & mesh() const
Return the mesh reference.
A class for handling words, derived from string.
Definition: word.H:59
void shuffle(const labelUList &newToOld, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
A wordRe is a word, but can also have a regular expression for matching words.
Definition: wordRe.H:74
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::polyBoundaryMesh.
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
void operator=(const fvBoundaryMesh &)
Disallow default bitwise assignment.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Foam::fvBoundaryMesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
labelList findIndices(const wordRe &, const bool useGroups) const
Find patch indices given a name.
void movePoints()
Correct patches after moving points.
Namespace for OpenFOAM.