patchIntersection.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) 2023 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::patchIntersection
26 
27 Description
28  Base class for patch intersections. Provides type name and debugging. See
29  templated derivatives for actual functionality.
30 
31 SourceFiles
32  patchIntersection.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef patchIntersection_H
37 #define patchIntersection_H
38 
39 #include "DynamicField.H"
40 #include "face.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class patchIntersection Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53 protected:
54 
55  // Protected static data
56 
57  //- Flag to set whether the faces of the intersection are oriented the
58  // same way as the source patch (true) or the target patch (false).
59  static const bool orientToSource_;
60 
61 
62  // Protected Data
63 
64  // Points
65 
66  //- The intersection points
68 
69  //- The source points' corresponding intersection points
71 
72  //- The target points' corresponding intersection points
74 
75  //- The intersection points' corresponding source points, or -1
76  // if the point does not correspond to a source point
78 
79  //- The intersection points' corresponding target points, or -1
80  // if the point does not correspond to a target point
82 
83  //- The source edges' intersection points. Ordered along the edge.
85 
86  //- The target edges' intersection points. Ordered along the edge.
88 
89  //- The intersection points' source edges, or -1 if the point
90  // is not on a source edge
92 
93  //- The intersection points' target edges, or -1 if the point
94  // is not on a target edge
96 
97  // !!! We don't store srcFacePoints and tgtFacePoints. These are
98  // not needed at present. They also don't have any ordering
99  // associated with them, so they don't need to be maintained by the
100  // intersection process. They could be generated on demand as a
101  // post-processing step from from pointSrcFaces and pointTgtFaces.
102 
103  //- The intersection points' source faces, or -1 if the point
104  // did not project into a source face
106 
107  //- The intersection points' target faces, or -1 if the point
108  // did not project into a target face
110 
111 
112  // Faces
113 
114  //- The intersection faces
116 
117  //- The source faces' intersection faces
119 
120  //- The target faces' intersection faces
122 
123  //- The intersection faces' corresponding source faces, or -1
124  // if the face does not correspond to source face
126 
127  //- The intersection faces' corresponding target faces, or -1
128  // if the face does not correspond to target face
130 
131 
132  // Protected Member Functions
133 
134  //- Report properties of the intersection process
135  void report(const word& writeSuffix=word::null);
136 
137 
138 public:
139 
140  // Runtime type information
141 
142  ClassName("patchIntersection");
143 
144  virtual word type() const = 0;
145 
146 
147  // Constructors
148 
149  //- Construct given sizes
151  (
152  const label srcNPoints,
153  const label tgtNPoints,
154  const label srcNEdges,
155  const label tgtNEdges,
156  const label srcNFaces,
157  const label tgtNFaces
158  );
159 
160 
161  //- Destructor
162  virtual ~patchIntersection();
163 
164 
165  // Member Functions
166 
167  // Points
168 
169  //- The intersection points
170  inline const pointField& points() const;
171 
172  //- The source points' corresponding intersection points
173  inline const labelList& srcPointPoints() const;
174 
175  //- The target points' corresponding intersection points
176  inline const labelList& tgtPointPoints() const;
177 
178  //- The intersection points' corresponding source points, or -1
179  // if the point does not correspond to a source point
180  inline const DynamicList<label>& pointSrcPoints() const;
181 
182  //- The intersection points' corresponding target points, or -1
183  // if the point does not correspond to a target point
184  inline const DynamicList<label>& pointTgtPoints() const;
185 
186  //- The source edges' intersection points. Ordered along the edge.
187  inline const List<DynamicList<label>>& srcEdgePoints() const;
188 
189  //- The target edges' intersection points. Ordered along the edge.
190  inline const List<DynamicList<label>>& tgtEdgePoints() const;
191 
192  //- The intersection points' source edges, or -1 if the point
193  // is not on a source edge
194  inline const DynamicList<label>& pointSrcEdges() const;
195 
196  //- The intersection points' target edges, or -1 if the point
197  // is not on a target edge
198  inline const DynamicList<label>& pointTgtEdges() const;
199 
200  //- The intersection points' source faces, or -1 if the point
201  // did not project into a source face
202  inline const DynamicList<label>& pointSrcFaces() const;
203 
204  //- The intersection points' target faces, or -1 if the point
205  // did not project into a target face
206  inline const DynamicList<label>& pointTgtFaces() const;
207 
208 
209  // Faces
210 
211  //- The intersection faces
212  inline const faceList& faces() const;
213 
214  //- The source faces' intersection faces
215  inline const List<DynamicList<label>>& srcFaceFaces() const;
216 
217  //- The target faces' intersection faces
218  inline const List<DynamicList<label>>& tgtFaceFaces() const;
219 
220  //- The intersection faces' corresponding source faces, or -1
221  // if the face does not correspond to source face
222  inline const DynamicList<label>& faceSrcFaces() const;
223 
224  //- The intersection faces' corresponding target faces, or -1
225  // if the face does not correspond to target face
226  inline const DynamicList<label>& faceTgtFaces() const;
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #include "patchIntersectionI.H"
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #endif
241 
242 // ************************************************************************* //
Dynamically sized Field.
Definition: DynamicField.H:72
Base class for patch intersections. Provides type name and debugging. See templated derivatives for a...
const DynamicList< label > & pointSrcFaces() const
The intersection points' source faces, or -1 if the point.
DynamicList< label > pointTgtFaces_
The intersection points' target faces, or -1 if the point.
virtual word type() const =0
List< DynamicList< label > > tgtFaceFaces_
The target faces' intersection faces.
const DynamicList< label > & pointSrcPoints() const
The intersection points' corresponding source points, or -1.
const DynamicList< label > & faceSrcFaces() const
The intersection faces' corresponding source faces, or -1.
const List< DynamicList< label > > & tgtEdgePoints() const
The target edges' intersection points. Ordered along the edge.
DynamicField< point > points_
The intersection points.
const faceList & faces() const
The intersection faces.
virtual ~patchIntersection()
Destructor.
DynamicList< label > pointTgtPoints_
The intersection points' corresponding target points, or -1.
List< DynamicList< label > > tgtEdgePoints_
The target edges' intersection points. Ordered along the edge.
const List< DynamicList< label > > & srcFaceFaces() const
The source faces' intersection faces.
void report(const word &writeSuffix=word::null)
Report properties of the intersection process.
ClassName("patchIntersection")
DynamicList< label > pointSrcPoints_
The intersection points' corresponding source points, or -1.
const labelList & srcPointPoints() const
The source points' corresponding intersection points.
const DynamicList< label > & pointSrcEdges() const
The intersection points' source edges, or -1 if the point.
const DynamicList< label > & faceTgtFaces() const
The intersection faces' corresponding target faces, or -1.
const DynamicList< label > & pointTgtFaces() const
The intersection points' target faces, or -1 if the point.
List< DynamicList< label > > srcEdgePoints_
The source edges' intersection points. Ordered along the edge.
labelList srcPointPoints_
The source points' corresponding intersection points.
DynamicList< label > pointSrcFaces_
The intersection points' source faces, or -1 if the point.
DynamicList< label > pointSrcEdges_
The intersection points' source edges, or -1 if the point.
const List< DynamicList< label > > & tgtFaceFaces() const
The target faces' intersection faces.
const DynamicList< label > & pointTgtEdges() const
The intersection points' target edges, or -1 if the point.
DynamicList< face > faces_
The intersection faces.
DynamicList< label > faceTgtFaces_
The intersection faces' corresponding target faces, or -1.
const labelList & tgtPointPoints() const
The target points' corresponding intersection points.
const pointField & points() const
The intersection points.
const List< DynamicList< label > > & srcEdgePoints() const
The source edges' intersection points. Ordered along the edge.
const DynamicList< label > & pointTgtPoints() const
The intersection points' corresponding target points, or -1.
labelList tgtPointPoints_
The target points' corresponding intersection points.
List< DynamicList< label > > srcFaceFaces_
The source faces' intersection faces.
patchIntersection(const label srcNPoints, const label tgtNPoints, const label srcNEdges, const label tgtNEdges, const label srcNFaces, const label tgtNFaces)
Construct given sizes.
static const bool orientToSource_
Flag to set whether the faces of the intersection are oriented the.
DynamicList< label > faceSrcFaces_
The intersection faces' corresponding source faces, or -1.
DynamicList< label > pointTgtEdges_
The intersection points' target edges, or -1 if the point.
A class for handling words, derived from string.
Definition: word.H:62
static const word null
An empty word.
Definition: word.H:77
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