PrimitivePatch.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) 2016-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::PrimitivePatch
29 
30 Description
31  A list of faces which address into the list of points.
32 
33  The class is templated on the face type (e.g. triangle, polygon etc.)
34  and on the list type of faces and points so that it can refer to
35  existing lists using UList and const pointField& or hold the storage
36  using List and pointField.
37 
38 SourceFiles
39  PrimitivePatch.C
40  PrimitivePatchAddressing.C
41  PrimitivePatchBdryFaces.C
42  PrimitivePatchBdryPoints.C
43  PrimitivePatchCheck.C
44  PrimitivePatchClear.C
45  PrimitivePatchEdgeLoops.C
46  PrimitivePatchLocalPointOrder.C
47  PrimitivePatchMeshData.C
48  PrimitivePatchMeshEdges.C
49  PrimitivePatchPointAddressing.C
50  PrimitivePatchProjectPoints.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef PrimitivePatch_H
55 #define PrimitivePatch_H
56 
57 #include "boolList.H"
58 #include "labelList.H"
59 #include "edgeList.H"
60 #include "point.H"
61 #include "intersection.H"
62 #include "HashSet.H"
63 #include "objectHit.H"
64 #include "PrimitivePatchBase.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 // Forward Declarations
72 class face;
73 template<class T> class Map;
74 
75 /*---------------------------------------------------------------------------*\
76  Class PrimitivePatch Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<class FaceList, class PointField>
80 class PrimitivePatch
81 :
82  public PrimitivePatchBase,
83  public FaceList
84 {
85 public:
86 
87  // Public Typedefs
88 
89  //- The face type
90  typedef typename
91  std::remove_reference<FaceList>::type::value_type face_type;
92 
93  //- The point type
94  typedef typename
95  std::remove_reference<PointField>::type::value_type point_type;
96 
97  //- The face list type
98  typedef FaceList FaceListType;
99 
100  //- The point field type
101  typedef PointField PointFieldType;
102 
103  //- Deprecated(2020-03) prefer face_type typedef
104  // \deprecated(2020-03) prefer face_type typedef
105  typedef face_type FaceType;
106 
107 
108  // Public Data Types
109 
110  //- Enumeration defining the surface type. Used in check routines.
111  enum surfaceTopo
112  {
115  ILLEGAL
116  };
117 
118 private:
119 
120  // Private Data
121 
122  //- Reference to global list of points
123  PointField points_;
124 
125 
126  // Demand-driven Private Data
127 
128  //- Edges of the patch; address into local point list;
129  // sorted with internal edges first in upper-triangular order
130  // and external edges last.
131  mutable unique_ptr<edgeList> edgesPtr_;
132 
133  //- Which part of edgesPtr_ is internal edges.
134  mutable label nInternalEdges_;
135 
136  //- Boundary point labels, addressing into local point list
137  mutable unique_ptr<labelList> boundaryPointsPtr_;
138 
139  //- Face-face addressing
140  mutable unique_ptr<labelListList> faceFacesPtr_;
141 
142  //- Edge-face addressing
143  mutable unique_ptr<labelListList> edgeFacesPtr_;
144 
145  //- Face-edge addressing
146  mutable unique_ptr<labelListList> faceEdgesPtr_;
147 
148  //- Point-edge addressing
149  mutable unique_ptr<labelListList> pointEdgesPtr_;
150 
151  //- Point-face addressing
152  mutable unique_ptr<labelListList> pointFacesPtr_;
153 
154  //- Faces addressing into local point list
155  mutable unique_ptr<List<face_type>> localFacesPtr_;
156 
157  //- Labels of mesh points
158  mutable unique_ptr<labelList> meshPointsPtr_;
159 
160  //- Mesh point map. Given the global point index find its
161  //- location in the patch
162  mutable unique_ptr<Map<label>> meshPointMapPtr_;
163 
164  //- Outside edge loops
165  mutable unique_ptr<labelListList> edgeLoopsPtr_;
166 
167  //- Points local to patch
168  mutable unique_ptr<Field<point_type>> localPointsPtr_;
169 
170  //- Local point order for most efficient search
171  mutable unique_ptr<labelList> localPointOrderPtr_;
172 
173  //- Face centres
174  mutable unique_ptr<Field<point_type>> faceCentresPtr_;
175 
176  //- Face area vectors
177  mutable unique_ptr<Field<point_type>> faceAreasPtr_;
178 
179  //- Mag face area
180  mutable unique_ptr<Field<scalar>> magFaceAreasPtr_;
181 
182  //- Face unit normals
183  mutable unique_ptr<Field<point_type>> faceNormalsPtr_;
184 
185  //- Point unit normals
186  mutable unique_ptr<Field<point_type>> pointNormalsPtr_;
187 
188 
189  // Private Member Functions
190 
191  //- Calculate internal points on a patch
192  void calcInternPoints() const;
193 
194  //- Calculate boundary points on a patch
195  void calcBdryPoints() const;
196 
197  //- Calculate addressing
198  void calcAddressing() const;
199 
200  //- Calculate point-edge addressing
201  void calcPointEdges() const;
202 
203  //- Calculate point-face addressing
204  void calcPointFaces() const;
205 
206  //- Calculate mesh addressing
207  void calcMeshData() const;
208 
209  //- Calculate mesh point map
210  void calcMeshPointMap() const;
211 
212  //- Calculate outside edge loops
213  void calcEdgeLoops() const;
214 
215  //- Calculate local points
216  void calcLocalPoints() const;
217 
218  //- Calculate local point order
219  void calcLocalPointOrder() const;
220 
221  //- Calculate face centres
222  void calcFaceCentres() const;
223 
224  //- Calculate face area vectors
225  void calcFaceAreas() const;
226 
227  //- Calculate face area magnitudes
228  void calcMagFaceAreas() const;
229 
230  //- Calculate unit face normals
231  void calcFaceNormals() const;
232 
233  //- Calculate unit point normals
234  void calcPointNormals() const;
235 
236 
237  //- Face-edge-face walk while remaining on a patch point.
238  // Used to determine if surface multiply connected through point.
239  void visitPointRegion
240  (
241  const label pointi,
242  const labelList& pFaces,
243  const label startFacei,
244  const label startEdgeI,
245  boolList& pFacesHad
246  ) const;
247 
248 
249 public:
250 
251  // Constructors
252 
253  //- Construct from components
255  (
256  const FaceList& faces,
257  const PointField& points
258  );
259 
260  //- Construct from components, transferring faces
262  (
263  FaceList&& faces,
264  const PointField& points
265  );
266 
267  //- Construct from components, reuse storage
269  (
270  FaceList& faces,
271  PointField& points,
272  const bool reuse
273  );
274 
275  //- Copy construct
277 
278 
279  //- Destructor
280  virtual ~PrimitivePatch();
281 
282  void clearOut();
283 
284  void clearGeom();
285 
286  void clearTopology();
287 
288  void clearPatchMeshAddr();
289 
290 
291  // Member Functions
292 
293  //- Suppress direct swapping, since storage containers may be const
294  void swap(PrimitivePatch&) = delete;
295 
296 
297  // Access
298 
299  //- Return reference to global points
300  const Field<point_type>& points() const noexcept
301  {
302  return points_;
303  }
304 
305  //- Number of faces in the patch
306  label nFaces() const noexcept
307  {
308  return FaceList::size();
309  }
310 
311 
312  // Access functions for demand-driven data
313 
314  // Topological data; no mesh required.
315 
316  //- Number of points supporting patch faces
317  label nPoints() const
318  {
319  return meshPoints().size();
320  }
321 
322  //- Number of edges in patch
323  label nEdges() const
324  {
325  return edges().size();
326  }
327 
328  //- Return list of edges, address into LOCAL point list
329  const edgeList& edges() const;
330 
331  //- Return sub-list of internal edges, address into LOCAL point list
332  const edgeList::subList internalEdges() const;
333 
334  //- Return sub-list of boundary edges, address into LOCAL point list
335  const edgeList::subList boundaryEdges() const;
336 
337  //- Number of internal edges
338  label nInternalEdges() const;
339 
340  //- Number of boundary edges == (nEdges() - nInternalEdges())
341  label nBoundaryEdges() const;
342 
343  //- Is internal edge?
344  bool isInternalEdge(const label edgei) const
345  {
346  return edgei < nInternalEdges();
347  }
348 
349  //- Return list of boundary points, address into LOCAL point list
350  const labelList& boundaryPoints() const;
351 
352  //- Return face-face addressing
353  const labelListList& faceFaces() const;
354 
355  //- Return edge-face addressing
356  const labelListList& edgeFaces() const;
357 
358  //- Return face-edge addressing
359  const labelListList& faceEdges() const;
360 
361  //- Return point-edge addressing
362  const labelListList& pointEdges() const;
363 
364  //- Return point-face addressing
365  const labelListList& pointFaces() const;
366 
367  //- Return patch faces addressing into local point list
368  const List<face_type>& localFaces() const;
369 
370  //- Extract list of local faces corresponding to
371  //- the boundary edges.
372  labelList boundaryFaces() const;
373 
374  //- Extract sorted list of unique local faces associated with
375  //- the boundary edges.
377 
378 
379  // Addressing into mesh
380 
381  //- Return labelList of mesh points in patch.
382  // They are constructed by walking through the faces in
383  // incremental order and not sorted anymore.
384  const labelList& meshPoints() const;
385 
386  //- Mesh point map.
387  // Given the global point index find its location in the patch
388  const Map<label>& meshPointMap() const;
389 
390  //- Return pointField of points in patch
391  const Field<point_type>& localPoints() const;
392 
393  //- Return orders the local points for most efficient search
394  const labelList& localPointOrder() const;
395 
396  //- Given a global point index, return the local point index.
397  // If the point is not found, return -1
398  label whichPoint(const label gp) const;
399 
400  //- From patch edge to global edge using meshPoints.
401  edge meshEdge(const label edgei) const;
402 
403  //- From patch edge to global edge using meshPoints.
404  edge meshEdge(const edge& e) const;
405 
406  //- Search for edge (local point labels) and return its
407  //- index in the edge list or -1 if not found.
408  // Ignores invalid or out-of-range edges
409  label findEdge(const edge& e) const;
410 
411  //- Return labels of patch edges in the global edge list using
412  //- cell addressing
414  (
415  const edgeList& allEdges,
416  const labelListList& cellEdges,
417  const labelList& faceCells
418  ) const;
419 
420  //- Return labels of patch edges into the global edge list using
421  //- basic edge addressing.
423  (
424  const edgeList& allEdges,
426  ) const;
427 
428  //- Return label of the local patch edge
429  //- into the global edge list using basic edge addressing.
430  label meshEdge
431  (
432  const label edgei,
433  const edgeList& allEdges,
435  ) const;
436 
437  //- Return labels of specified patch edges
438  //- into the global edge list using basic edge addressing.
440  (
441  const labelUList& edgeLabels,
442  const edgeList& allEdges,
444  ) const;
445 
446 
447  //- Return face centres for patch
448  const Field<point_type>& faceCentres() const;
449 
450  //- Return face area vectors for patch
451  const Field<point_type>& faceAreas() const;
452 
453  //- Return face area magnitudes for patch
454  const Field<scalar>& magFaceAreas() const;
455 
456  //- Return face unit normals for patch
457  const Field<point_type>& faceNormals() const;
458 
459  //- Return point normals for patch
460  const Field<point_type>& pointNormals() const;
461 
462 
463  // Storage Management
464 
465  bool hasFaceAreas() const { return bool(faceAreasPtr_); }
466  bool hasFaceCentres() const { return bool(faceCentresPtr_); }
467  bool hasFaceNormals() const { return bool(faceNormalsPtr_); }
468  bool hasPointNormals() const { return bool(pointNormalsPtr_); }
469 
470  bool hasBoundaryPoints() const { return bool(boundaryPointsPtr_); }
471  bool hasFaceFaces() const { return bool(faceFacesPtr_); }
472  bool hasEdgeFaces() const { return bool(edgeFacesPtr_); }
473  bool hasFaceEdges() const { return bool(faceEdgesPtr_); }
474  bool hasPointEdges() const { return bool(pointEdgesPtr_); }
475  bool hasPointFaces() const { return bool(pointFacesPtr_); }
476 
477  bool hasMeshPointMap() const { return bool(meshPointMapPtr_); }
478 
479 
480  // Other patch operations
481 
482  //- Project vertices of patch onto another patch
483  template<class ToPatch>
485  (
486  const ToPatch& targetPatch,
487  const Field<point_type>& projectionDirection,
490  ) const;
491 
492  //- Project vertices of patch onto another patch
493  template<class ToPatch>
495  (
496  const ToPatch& targetPatch,
497  const Field<point_type>& projectionDirection,
500  ) const;
501 
502  //- Return list of closed loops of boundary vertices.
503  // Edge loops are given as ordered lists of vertices
504  // in local addressing
505  const labelListList& edgeLoops() const;
506 
507 
508  // Check
509 
510  //- Calculate surface type formed by patch.
511  // Types:
512  // - all edges have two neighbours (manifold)
513  // - some edges have more than two neighbours (illegal)
514  // - other (open)
515  surfaceTopo surfaceType() const;
516 
517  //- Check surface formed by patch for manifoldness (see above).
518  // Return true if any incorrect edges are found.
519  // Insert vertices of incorrect edges into set.
520  bool checkTopology
521  (
522  const bool report = false,
523  labelHashSet* setPtr = nullptr
524  ) const;
525 
526  //- Checks primitivePatch for faces sharing point but not edge.
527  // This denotes a surface that is pinched at a single point
528  // (test for pinched at single edge is already in PrimitivePatch)
529  // Returns true if this situation found and puts conflicting
530  // (mesh)point in set. Based on all the checking routines in
531  // primitiveMesh.
532  bool checkPointManifold
533  (
534  const bool report = false,
535  labelHashSet* setPtr = nullptr
536  ) const;
537 
538 
539  // Edit
540 
541  //- Correct patch after moving points
542  virtual void movePoints(const Field<point_type>&);
543 
544 
545  // Member Operators
546 
547  //- Copy assign faces. Leave points alone (could be a reference).
549 
550  //- Move assign faces. Leave points alone (could be a reference).
552 
553 
554  // Housekeeping
555 
556  //- Identical to findEdge
557  label whichEdge(const edge& e) const { return this->findEdge(e); }
558 };
559 
560 
561 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
562 
563 } // End namespace Foam
564 
565 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
566 
567 #ifdef NoRepository
568  #include "PrimitivePatch.C"
569 #endif
570 
571 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
572 
573 #endif
574 
575 // ************************************************************************* //
Foam::PrimitivePatch::points
const Field< point_type > & points() const noexcept
Return reference to global points.
Definition: PrimitivePatch.H:299
Foam::intersection::direction
direction
Definition: intersection.H:66
Foam::PrimitivePatch::internalEdges
const edgeList::subList internalEdges() const
Return sub-list of internal edges, address into LOCAL point list.
Definition: PrimitivePatch.C:196
Foam::PrimitivePatch::nBoundaryEdges
label nBoundaryEdges() const
Number of boundary edges == (nEdges() - nInternalEdges())
Definition: PrimitivePatch.C:227
Foam::PrimitivePatch::pointFaces
const labelListList & pointFaces() const
Return point-face addressing.
Definition: PrimitivePatch.C:301
Foam::PrimitivePatch::whichPoint
label whichPoint(const label gp) const
Given a global point index, return the local point index.
Definition: PrimitivePatch.C:386
Foam::PrimitivePatch::edgeFaces
const labelListList & edgeFaces() const
Return edge-face addressing.
Definition: PrimitivePatch.C:262
boolList.H
intersection.H
Foam::PrimitivePatch::edges
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
Definition: PrimitivePatch.C:183
Foam::PrimitivePatch::FaceListType
FaceList FaceListType
The face list type.
Definition: PrimitivePatch.H:97
Foam::PrimitivePatch::hasBoundaryPoints
bool hasBoundaryPoints() const
Definition: PrimitivePatch.H:469
Foam::PrimitivePatch::hasPointEdges
bool hasPointEdges() const
Definition: PrimitivePatch.H:473
point.H
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:54
Foam::PrimitivePatch::pointNormals
const Field< point_type > & pointNormals() const
Return point normals for patch.
Definition: PrimitivePatch.C:461
Foam::PrimitivePatch::uniqBoundaryFaces
labelList uniqBoundaryFaces() const
Definition: PrimitivePatchBdryFaces.C:58
Foam::PrimitivePatch::nEdges
label nEdges() const
Number of edges in patch.
Definition: PrimitivePatch.H:322
Foam::PrimitivePatch::hasFaceCentres
bool hasFaceCentres() const
Definition: PrimitivePatch.H:465
Foam::PrimitivePatch::boundaryFaces
labelList boundaryFaces() const
Definition: PrimitivePatchBdryFaces.C:34
Foam::PrimitivePatch::meshEdges
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Definition: PrimitivePatchMeshEdges.C:53
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
Foam::PrimitivePatch::~PrimitivePatch
virtual ~PrimitivePatch()
Destructor.
Foam::intersection::FULL_RAY
Definition: intersection.H:74
Foam::PrimitivePatchBase
Non-templated base elements for PrimitivePatch.
Definition: PrimitivePatchBase.H:50
Foam::Map< label >
Foam::PrimitivePatch::hasEdgeFaces
bool hasEdgeFaces() const
Definition: PrimitivePatch.H:471
Foam::PrimitivePatch::faceEdges
const labelListList & faceEdges() const
Return face-edge addressing.
Definition: PrimitivePatch.C:275
Foam::HashSet< label, Hash< label > >
Foam::PrimitivePatch::hasPointNormals
bool hasPointNormals() const
Definition: PrimitivePatch.H:467
Foam::PrimitivePatch::meshEdge
edge meshEdge(const label edgei) const
From patch edge to global edge using meshPoints.
Definition: PrimitivePatchMeshEdges.C:35
Foam::PrimitivePatch::MANIFOLD
Definition: PrimitivePatch.H:112
Foam::PrimitivePatch::hasFaceEdges
bool hasFaceEdges() const
Definition: PrimitivePatch.H:472
objectHit.H
labelList.H
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::PrimitivePatch::faceAreas
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
Definition: PrimitivePatch.C:416
Foam::PrimitivePatch::PointFieldType
PointField PointFieldType
The point field type.
Definition: PrimitivePatch.H:100
Foam::PrimitivePatch::point_type
std::remove_reference< PointField >::type::value_type point_type
The point type.
Definition: PrimitivePatch.H:94
Foam::PrimitivePatch::nFaces
label nFaces() const noexcept
Number of faces in the patch.
Definition: PrimitivePatch.H:305
Foam::PrimitivePatch::pointEdges
const labelListList & pointEdges() const
Return point-edge addressing.
Definition: PrimitivePatch.C:288
Foam::intersection::algorithm
algorithm
Definition: intersection.H:72
Foam::PrimitivePatch::hasMeshPointMap
bool hasMeshPointMap() const
Definition: PrimitivePatch.H:476
Foam::PrimitivePatch::clearGeom
void clearGeom()
Definition: PrimitivePatchClear.C:35
HashSet.H
Foam::PrimitivePatch::nPoints
label nPoints() const
Number of points supporting patch faces.
Definition: PrimitivePatch.H:316
Foam::PrimitivePatch::projectFaceCentres
List< objectHit > projectFaceCentres(const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
Project vertices of patch onto another patch.
edgeList.H
Foam::PrimitivePatch::localFaces
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
Definition: PrimitivePatch.C:317
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::intersection::VECTOR
Definition: intersection.H:68
Foam::PrimitivePatch::clearTopology
void clearTopology()
Definition: PrimitivePatchClear.C:50
Foam::PrimitivePatch<::Foam::List< labelledTri >, pointField >::surfaceTopo
surfaceTopo
Enumeration defining the surface type. Used in check routines.
Definition: PrimitivePatch.H:110
Foam::PrimitivePatch::localPoints
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Definition: PrimitivePatch.C:359
Foam::PrimitivePatch::hasPointFaces
bool hasPointFaces() const
Definition: PrimitivePatch.H:474
Foam::PrimitivePatch::boundaryPoints
const labelList & boundaryPoints() const
Return list of boundary points, address into LOCAL point list.
Definition: PrimitivePatch.C:236
Foam::PrimitivePatch::nInternalEdges
label nInternalEdges() const
Number of internal edges.
Definition: PrimitivePatch.C:214
Foam::PrimitivePatch::projectPoints
List< objectHit > projectPoints(const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
Project vertices of patch onto another patch.
Foam::PrimitivePatch::checkPointManifold
bool checkPointManifold(const bool report=false, labelHashSet *setPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
Definition: PrimitivePatchCheck.C:190
Foam::PrimitivePatch::hasFaceAreas
bool hasFaceAreas() const
Definition: PrimitivePatch.H:464
Foam::PrimitivePatch::isInternalEdge
bool isInternalEdge(const label edgei) const
Is internal edge?
Definition: PrimitivePatch.H:343
Foam::PrimitivePatch::edgeLoops
const labelListList & edgeLoops() const
Return list of closed loops of boundary vertices.
Definition: PrimitivePatchEdgeLoops.C:146
Foam::List< label >
Foam::PrimitivePatch::whichEdge
label whichEdge(const edge &e) const
Identical to findEdge.
Definition: PrimitivePatch.H:556
Foam::PrimitivePatch::clearOut
void clearOut()
Definition: PrimitivePatchClear.C:85
Foam::UList< label >
PrimitivePatch.C
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::PrimitivePatch::localPointOrder
const labelList & localPointOrder() const
Return orders the local points for most efficient search.
Definition: PrimitivePatch.C:372
Foam::PrimitivePatch::boundaryEdges
const edgeList::subList boundaryEdges() const
Return sub-list of boundary edges, address into LOCAL point list.
Definition: PrimitivePatch.C:205
bool
bool
Definition: EEqn.H:20
Foam::PrimitivePatch::faceNormals
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
Definition: PrimitivePatch.C:445
Foam::PrimitivePatch::OPEN
Definition: PrimitivePatch.H:113
Foam::PrimitivePatch::magFaceAreas
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
Definition: PrimitivePatch.C:429
Foam::PrimitivePatch::hasFaceFaces
bool hasFaceFaces() const
Definition: PrimitivePatch.H:470
Foam::PrimitivePatch::clearPatchMeshAddr
void clearPatchMeshAddr()
Definition: PrimitivePatchClear.C:73
Foam::PrimitivePatch::face_type
std::remove_reference< FaceList >::type::value_type face_type
The face type.
Definition: PrimitivePatch.H:90
Foam::PrimitivePatch::hasFaceNormals
bool hasFaceNormals() const
Definition: PrimitivePatch.H:466
Foam::PrimitivePatch::movePoints
virtual void movePoints(const Field< point_type > &)
Correct patch after moving points.
Definition: PrimitivePatch.C:171
Foam::PrimitivePatch::FaceType
face_type FaceType
Deprecated(2020-03) prefer face_type typedef.
Definition: PrimitivePatch.H:104
Foam::PrimitivePatch::operator=
void operator=(const PrimitivePatch< FaceList, PointField > &rhs)
Copy assign faces. Leave points alone (could be a reference).
Definition: PrimitivePatch.C:477
Foam::PrimitivePatch::ILLEGAL
Definition: PrimitivePatch.H:114
Foam::PrimitivePatch::meshPointMap
const Map< label > & meshPointMap() const
Mesh point map.
Definition: PrimitivePatch.C:343
Foam::PrimitivePatch::faceFaces
const labelListList & faceFaces() const
Return face-face addressing.
Definition: PrimitivePatch.C:249
Foam::PrimitivePatch::meshPoints
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Definition: PrimitivePatch.C:330
Foam::PrimitivePatch::checkTopology
bool checkTopology(const bool report=false, labelHashSet *setPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
Definition: PrimitivePatchCheck.C:143
Foam::PrimitivePatch::swap
void swap(PrimitivePatch &)=delete
Suppress direct swapping, since storage containers may be const.
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::PrimitivePatch::surfaceType
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
Definition: PrimitivePatchCheck.C:108
Foam::PrimitivePatch::faceCentres
const Field< point_type > & faceCentres() const
Return face centres for patch.
Definition: PrimitivePatch.C:400
PrimitivePatchBase.H
pFaces
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
Definition: readKivaGrid.H:235
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
Foam::PrimitivePatch::PrimitivePatch
PrimitivePatch(const FaceList &faces, const PointField &points)
Construct from components.
Definition: PrimitivePatch.C:35
Foam::PrimitivePatch::findEdge
label findEdge(const edge &e) const
Definition: PrimitivePatchMeshEdges.C:183