pointBoundaryMesh.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-2013 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::pointBoundaryMesh
29 
30 Description
31  Foam::pointBoundaryMesh
32 
33 SourceFiles
34  pointBoundaryMesh.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pointBoundaryMesh_H
39 #define pointBoundaryMesh_H
40 
41 #include "pointPatchList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 class pointMesh;
50 class polyBoundaryMesh;
51 class wordRes;
52 
53 /*---------------------------------------------------------------------------*\
54  Class pointBoundaryMesh Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public pointPatchList
60 {
61  // Private Data
62 
63  //- Reference to mesh
64  const pointMesh& mesh_;
65 
66 
67  // Private Member Functions
68 
69  //- Calculate geometry for the patches (transformation tensors etc.)
70  void calcGeometry();
71 
72  //- No copy construct
73  pointBoundaryMesh(const pointBoundaryMesh&) = delete;
74 
75  //- No copy assignment
76  void operator=(const pointBoundaryMesh&) = delete;
77 
78 
79 public:
80 
81  //- Declare friendship with pointMesh
82  friend class pointMesh;
83 
84 
85  // Constructors
86 
87  //- Construct from polyBoundaryMesh
89  (
90  const pointMesh&,
91  const polyBoundaryMesh&
92  );
93 
94 
95  // Member Functions
96 
97  //- Return the mesh reference
98  const pointMesh& mesh() const noexcept
99  {
100  return mesh_;
101  }
102 
103  //- Return (sorted) patch indices for all matches.
104  // A no-op (returns empty list) for an empty matcher
105  labelList indices(const wordRe& matcher, const bool useGroups) const;
106 
107  //- Return (sorted) patch indices for all matches.
108  // A no-op (returns empty list) for an empty matcher
109  labelList indices(const wordRes& matcher, const bool useGroups) const;
110 
111  //- Find patch index given a name
112  // A no-op (returns -1) for an empty patchName
113  label findPatchID(const word& patchName) const;
114 
115  //- Correct polyBoundaryMesh after moving points
116  void movePoints(const pointField&);
117 
118  //- Correct polyBoundaryMesh after topology update
119  void updateMesh();
120 
121 
122  // Housekeeping
123 
124  //- Identical to the indices() method (AUG-2018)
125  FOAM_DEPRECATED_FOR(2018-08, "indices() method")
126  labelList findIndices(const wordRe& key, bool useGroups) const
127  {
128  return indices(key, useGroups);
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
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::pointBoundaryMesh::movePoints
void movePoints(const pointField &)
Correct polyBoundaryMesh after moving points.
Definition: pointBoundaryMesh.C:136
Foam::pointBoundaryMesh::findIndices
labelList findIndices(const wordRe &key, bool useGroups) const
Identical to the indices() method (AUG-2018)
Definition: pointBoundaryMesh.H:125
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::pointBoundaryMesh::findPatchID
label findPatchID(const word &patchName) const
Find patch index given a name.
Definition: pointBoundaryMesh.C:84
Foam::pointBoundaryMesh::mesh
const pointMesh & mesh() const noexcept
Return the mesh reference.
Definition: pointBoundaryMesh.H:97
Foam::wordRe
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:80
Foam::pointBoundaryMesh::updateMesh
void updateMesh()
Correct polyBoundaryMesh after topology update.
Definition: pointBoundaryMesh.C:182
Foam::Field< vector >
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::pointBoundaryMesh::indices
labelList indices(const wordRe &matcher, const bool useGroups) const
Return (sorted) patch indices for all matches.
Definition: pointBoundaryMesh.C:65
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:56
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
pointPatchList.H