nonConformalBoundary.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) 2022-2024 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::nonConformalBoundary
26 
27 Description
28  Mesh object that stores an all boundary patch and mapping to and from it
29  and the mesh and the individual patches
30 
31 SourceFiles
32  nonConformalBoundary.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef nonConformalBoundary_H
37 #define nonConformalBoundary_H
38 
39 #include "DemandDrivenMeshObject.H"
40 #include "polyMesh.H"
41 #include "indirectPrimitivePatch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class nonConformalCoupledPolyPatch;
49 
50 /*---------------------------------------------------------------------------*\
51  Class nonConformalBoundary Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
57  <
58  polyMesh,
59  MoveableMeshObject,
60  nonConformalBoundary
61  >
62 {
63  // Private Data
64 
65  //- Primitive patch of the owner-orig boundary
66  indirectPrimitivePatch ownerOrigBoundary_;
67 
68  //- A map from mesh point to owner-orig boundary point
69  mutable autoPtr<labelList> meshPointOwnerOrigBoundaryPointPtr_;
70 
71  //- A map from owner-orig boundary point to mesh point
72  mutable autoPtr<labelList> ownerOrigBoundaryPointMeshPointPtr_;
73 
74  //- A map from owner-orig boundary edge to mesh edge
75  mutable autoPtr<labelList> ownerOrigBoundaryEdgeMeshEdgePtr_;
76 
77  //- Owner-orig boundary edges, referring to boundary points
78  mutable autoPtr<edgeList> ownerOrigBoundaryEdgesPtr_;
79 
80  //- Owner-orig boundary edges, referring to mesh points
81  mutable autoPtr<edgeList> ownerOrigBoundaryMeshEdgesPtr_;
82 
83  //- A map from patch point to owner-orig boundary points
84  mutable PtrList<labelList> patchPointOwnerOrigBoundaryPointsPtr_;
85 
86  //- A map from patch edge to owner-orig boundary edge
87  mutable PtrList<labelList> patchEdgeOwnerOrigBoundaryEdgesPtr_;
88 
89  //- Point normals for the owner-orig boundary
90  mutable autoPtr<vectorField> ownerOrigBoundaryPointNormalsPtr_;
91 
92  //- Old point normals for the owner-orig boundary
93  mutable autoPtr<vectorField> ownerOrigBoundaryPointNormals0Ptr_;
94 
95 
96  // Private Member Functions
97 
98  //- Construct a boundary for the given patch set
99  indirectPrimitivePatch boundary(const labelList& patches) const;
100 
101  //- Simple wrapper for a type and a method
102  template<class Type, class Method>
103  struct TypeMethod;
104 
105  //- Helper to construct a type-method
106  template<class Type, class Method>
107  static TypeMethod<Type, Method> typeMethod(const Method& method);
108 
109  //- Construct a list of non-conformal non-coupled patch indices
110  template<class ... NcPpTypeMethods>
111  labelList nonConformalOtherPatchIndices
112  (
113  const label side,
114  NcPpTypeMethods ... typeMethods
115  ) const;
116 
117  //- Construct a list of non-conformal non-coupled patch indices. Helper
118  // for the above overload.
119  template<class NcPpType, class NcPpMethod, class ... NcPpTypeMethods>
120  void nonConformalOtherPatchIndices
121  (
122  labelHashSet& origPatchIDTable,
123  DynamicList<label>& nonCoupledPatchIndices,
124  const label side,
125  const TypeMethod<NcPpType, NcPpMethod>& typeMethod,
126  NcPpTypeMethods ... typeMethods
127  ) const;
128 
129  //- Construct a list of non-conformal non-coupled patch indices. Helper
130  // for the above overload.
131  void nonConformalOtherPatchIndices
132  (
133  labelHashSet& origPatchIDTable,
134  DynamicList<label>& nonCoupledPatchIndices,
135  const label side
136  ) const;
137 
138  //- Get point normals for the owner-orig boundary
139  const vectorField& ownerOrigBoundaryPointNormals() const;
140 
141  //- Get old point normals for the owner-orig boundary
142  const vectorField& ownerOrigBoundaryPointNormals0() const;
143 
144 
145 protected:
146 
147  friend class DemandDrivenMeshObject
148  <
149  polyMesh,
152  >;
153 
154  // Protected Constructors
155 
156  //- Construct from mesh
157  explicit nonConformalBoundary(const polyMesh& mesh);
158 
159 
160 public:
161 
162  //- Runtime type information
163  TypeName("nonConformalBoundary");
164 
165 
166  // Constructors
167 
168  //- Disallow default bitwise copy construction
170 
171 
172  //- Destructor
174 
175 
176  // Member Functions
177 
178  //- Update for mesh motion
179  virtual bool movePoints();
180 
181  //- Return a list of the orig patch indices
183 
184  //- Return a list of the error patch indices
186 
187  //- Return a list of the owner-orig patch indices
189 
190  //- Return a list of the owner error patch indices
192 
193  //- Get a map from owner-orig boundary point to mesh point
195 
196  //- Get a map from owner-orig boundary edge to mesh edge
198 
199  //- Get the owner-orig boundary edges, referring to boundary points
200  const edgeList& ownerOrigBoundaryEdges() const;
201 
202  //- Get the owner-orig boundary edges, referring to mesh points
203  const edgeList& ownerOrigBoundaryMeshEdges() const;
204 
205  //- Get a map from patch point to owner-orig boundary point
207  (
208  const label patchi
209  ) const;
210 
211  //- Get a map from patch edge to owner-orig boundary edge
213  (
214  const label patchi
215  ) const;
216 
217  //- Get parallel consistent point normals for the patch
219 
220  //- Get parallel consistent old-time point normals for the patch
222 
223 
224  // Member Operators
225 
226  //- Disallow default bitwise assignment
227  void operator=(const nonConformalBoundary&) = delete;
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh object that stores an all boundary patch and mapping to and from it and the mesh and the individ...
labelList ownerOrigPatchIndices() const
Return a list of the owner-orig patch indices.
labelList ownerErrorPatchIndices() const
Return a list of the owner error patch indices.
virtual bool movePoints()
Update for mesh motion.
TypeName("nonConformalBoundary")
Runtime type information.
const edgeList & ownerOrigBoundaryMeshEdges() const
Get the owner-orig boundary edges, referring to mesh points.
tmp< vectorField > patchPointNormals(const label patchi) const
Get parallel consistent point normals for the patch.
labelList allOrigPatchIndices() const
Return a list of the orig patch indices.
const labelList & patchEdgeOwnerOrigBoundaryEdges(const label patchi) const
Get a map from patch edge to owner-orig boundary edge.
nonConformalBoundary(const polyMesh &mesh)
Construct from mesh.
const labelList & ownerOrigBoundaryEdgeMeshEdge() const
Get a map from owner-orig boundary edge to mesh edge.
const labelList & patchPointOwnerOrigBoundaryPoints(const label patchi) const
Get a map from patch point to owner-orig boundary point.
labelList allErrorPatchIndices() const
Return a list of the error patch indices.
tmp< vectorField > patchPointNormals0(const label patchi) const
Get parallel consistent old-time point normals for the patch.
void operator=(const nonConformalBoundary &)=delete
Disallow default bitwise assignment.
const labelList & ownerOrigBoundaryPointMeshPoint() const
Get a map from owner-orig boundary point to mesh point.
const edgeList & ownerOrigBoundaryEdges() const
Get the owner-orig boundary edges, referring to boundary points.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for managing temporary objects.
Definition: tmp.H:55
label patchi
const fvPatchList & patches
Namespace for OpenFOAM.
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:59
Simple wrapper for a type and a method.