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-2023 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 Foam_pointBoundaryMesh_H
39 #define Foam_pointBoundaryMesh_H
40 
41 #include "pointPatch.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  //- Assign facePointPatches corresponding to the given polyBoundaryMesh
73  void addPatches(const polyBoundaryMesh& pbm);
74 
75  //- No copy construct
76  pointBoundaryMesh(const pointBoundaryMesh&) = delete;
77 
78  //- No copy assignment
79  void operator=(const pointBoundaryMesh&) = delete;
80 
81 
82 public:
83 
84  //- Declare friendship with pointMesh
85  friend class pointMesh;
86 
87 
88  // Constructors
89 
90  //- Construct from polyBoundaryMesh
92 
93 
94  // Member Functions
95 
96  //- Return the mesh reference
97  const pointMesh& mesh() const noexcept
98  {
99  return mesh_;
100  }
101 
102  //- Return (sorted) patch indices for all matches.
103  // A no-op (returns empty list) for an empty matcher
104  labelList indices(const wordRe& matcher, const bool useGroups) const;
105 
106  //- Return (sorted) patch indices for all matches.
107  // A no-op (returns empty list) for an empty matcher
108  labelList indices(const wordRes& matcher, const bool useGroups) const;
109 
110  //- Return (sorted) patch indices for all selected matches that
111  //- are not ignored.
112  //- The selection logic as per Foam::wordRes::filter.
113  // Optionally matches patch groups.
114  // A no-op (returns empty list) for an empty select matcher
116  (
117  const wordRes& select,
118  const wordRes& ignore,
119  const bool useGroups
120  ) const;
121 
122  //- Find patch index given a name
123  // A no-op (returns -1) for an empty patchName
124  label findPatchID(const word& patchName) const;
125 
126  //- Correct polyBoundaryMesh after moving points
127  void movePoints(const pointField&);
128 
129  //- Correct polyBoundaryMesh after topology update
130  void updateMesh();
131 
132 
133  // Housekeeping
134 
135  //- Identical to the indices() method (AUG-2018)
136  FOAM_DEPRECATED_FOR(2018-08, "indices() method")
137  labelList findIndices(const wordRe& key, bool useGroups) const
138  {
139  return indices(key, useGroups);
140  }
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
const polyBoundaryMesh & pbm
Foam::pointBoundaryMesh.
void movePoints(const pointField &)
Correct polyBoundaryMesh after moving points.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
Definition: BitOps.C:134
label findPatchID(const word &patchName) const
Find patch index given a name.
FOAM_DEPRECATED_FOR(2022-09, "get(), set() or test() methods") const T *operator()(const label i) const
Deprecated(2022-09) - same as get()
Definition: UPtrList.H:492
labelList indices(const wordRe &matcher, const bool useGroups) const
Return (sorted) patch indices for all matches.
const pointMesh & mesh() const noexcept
Return the mesh reference.
void updateMesh()
Correct polyBoundaryMesh after topology update.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:45
labelList findIndices(const wordRe &key, bool useGroups) const
Identical to the indices() method (AUG-2018)
A class for handling words, derived from Foam::string.
Definition: word.H:63
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
Definition: wordRe.H:78
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const direction noexcept
Definition: Scalar.H:258
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:103
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Namespace for OpenFOAM.