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 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 
51 class fvMesh;
52 class polyBoundaryMesh;
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 with zero size
95  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
105  {
106  return mesh_;
107  }
108 
109  //- Return a list of pointers for each patch
110  // with only those pointing to interfaces being set
112 
113  //- Return patch indices for all matches.
114  labelList indices(const keyType& key, const bool useGroups) const;
115 
116  //- Find patch index given a name
117  label findPatchID(const word& patchName) const;
118 
119  //- Correct patches after moving points
120  void movePoints();
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  // Housekeeping
136 
137  //- Identical to the indices() method (AUG-2018)
138  labelList findIndices(const keyType& key, const bool useGroups) const
139  {
140  return indices(key, useGroups);
141  }
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
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:141
fvPatchList.H
Foam::fvBoundaryMesh::mesh
const fvMesh & mesh() const
Return the mesh reference.
Definition: fvBoundaryMesh.H:103
lduInterfacePtrsList.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:60
Foam::label
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:62
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Foam::fvBoundaryMesh::interfaces
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Definition: fvBoundaryMesh.C:119
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:65
Foam::fvBoundaryMesh::operator[]
const fvPatch & operator[](const word &) const
Return const reference to fvPatch by name.
Definition: fvBoundaryMesh.C:151
Foam::fvBoundaryMesh::findIndices
labelList findIndices(const keyType &key, const bool useGroups) const
Identical to the indices() method (AUG-2018)
Definition: fvBoundaryMesh.H:137
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:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::fvBoundaryMesh::movePoints
void movePoints()
Correct patches after moving points.
Definition: fvBoundaryMesh.C:103