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-2020 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 
53 /*---------------------------------------------------------------------------*\
54  Class fvBoundaryMesh Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class fvBoundaryMesh
58 :
59  public fvPatchList
60 {
61  // Private Data
62 
63  //- Reference to mesh
64  const fvMesh& mesh_;
65 
66 
67  // Private Member Functions
68 
69  //- Add fvPatches corresponding to the given polyBoundaryMesh
70  void addPatches(const polyBoundaryMesh&);
71 
72 
73  //- No copy construct
74  fvBoundaryMesh(const fvBoundaryMesh&) = delete;
75 
76  //- No copy assignment
77  void operator=(const fvBoundaryMesh&) = delete;
78 
79 
80 protected:
81 
82  //- Update boundary based on new polyBoundaryMesh
83  void readUpdate(const polyBoundaryMesh&);
84 
85 
86 public:
87 
88  friend class fvMesh;
89 
90 
91  // Constructors
92 
93  //- Construct with zero size
94  fvBoundaryMesh(const fvMesh&);
95 
96  //- Construct from polyBoundaryMesh
97  fvBoundaryMesh(const fvMesh&, const polyBoundaryMesh&);
98 
99 
100  // Member Functions
101 
102  //- Return the mesh reference
103  const fvMesh& mesh() const
104  {
105  return mesh_;
106  }
107 
108  //- Return a list of pointers for each patch
109  //- with only those pointing to interfaces being set
111 
112  //- Return patch indices for all matches.
113  // A no-op (returns empty list) for an empty key
114  labelList indices(const keyType& key, const bool useGroups) const;
115 
116  //- Find patch index given a name
117  // A no-op (returns -1) for an empty patchName
118  label findPatchID(const word& patchName) const;
119 
120  //- Correct patches after moving points
121  void movePoints();
122 
123 
124  // Member Operators
125 
126  //- Return const and non-const reference to fvPatch by index.
127  using fvPatchList::operator[];
128 
129  //- Return const reference to fvPatch by name.
130  const fvPatch& operator[](const word&) const;
131 
132  //- Return reference to fvPatch by name.
133  fvPatch& operator[](const word&);
134 
135 
136  // Housekeeping
137 
138  //- Identical to the indices() method (AUG-2018)
139  FOAM_DEPRECATED_FOR(2018-08, "indices() method")
140  labelList findIndices(const keyType& key, const bool useGroups) const
141  {
142  return indices(key, useGroups);
143  }
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:62
Foam::fvBoundaryMesh::findPatchID
label findPatchID(const word &patchName) const
Find patch index given a name.
Definition: fvBoundaryMesh.C:86
Foam::fvBoundaryMesh::readUpdate
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
Definition: fvBoundaryMesh.C:146
fvPatchList.H
Foam::fvBoundaryMesh::mesh
const fvMesh & mesh() const
Return the mesh reference.
Definition: fvBoundaryMesh.H:102
lduInterfacePtrsList.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:56
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:60
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fvBoundaryMesh::interfaces
lduInterfacePtrsList interfaces() const
Definition: fvBoundaryMesh.C:124
Foam::UPtrList< const lduInterface >
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::fvBoundaryMesh::operator[]
const fvPatch & operator[](const word &) const
Return const reference to fvPatch by name.
Definition: fvBoundaryMesh.C:156
Foam::fvBoundaryMesh::findIndices
labelList findIndices(const keyType &key, const bool useGroups) const
Identical to the indices() method (AUG-2018)
Definition: fvBoundaryMesh.H:139
Foam::fvBoundaryMesh::indices
labelList indices(const keyType &key, const bool useGroups) const
Return patch indices for all matches.
Definition: fvBoundaryMesh.C:77
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::FOAM_DEPRECATED_FOR
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:69
Foam::fvBoundaryMesh::movePoints
void movePoints()
Correct patches after moving points.
Definition: fvBoundaryMesh.C:108