extendedEdgeMesh.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-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2020 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::extendedEdgeMesh
29 
30 Description
31 
32  Description of feature edges and points.
33 
34  Feature points are a sorted subset at the start of the overall points list:
35  0 .. concaveStart_-1 : convex points (w.r.t normals)
36  concaveStart_ .. mixedStart_-1 : concave points
37  mixedStart_ .. nonFeatureStart_-1 : mixed internal/external points
38  nonFeatureStart_ .. size-1 : non-feature points
39 
40  Feature edges are the edgeList of the edgeMesh and are sorted:
41  0 .. internalStart_-1 : external edges (convex w.r.t normals)
42  internalStart_ .. flatStart_-1 : internal edges (concave)
43  flatStart_ .. openStart_-1 : flat edges (neither concave or convex)
44  can arise from region interfaces on
45  flat surfaces
46  openStart_ .. multipleStart_-1 : open edges (e.g. from baffle surfaces)
47  multipleStart_ .. size-1 : multiply connected edges
48 
49  The edge direction and feature edge and feature point adjacent normals
50  are stored.
51 
52 SourceFiles
53  extendedEdgeMeshI.H
54  extendedEdgeMesh.C
55  extendedEdgeMeshNew.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef extendedEdgeMesh_H
60 #define extendedEdgeMesh_H
61 
62 #include "edgeMesh.H"
63 #include "indexedOctree.H"
64 #include "treeDataEdge.H"
65 #include "treeDataPoint.H"
66 #include "PrimitivePatch.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 // Forward Declarations
74 class surfaceFeatures;
75 class searchableSurface;
76 class extendedEdgeMesh;
77 
78 Istream& operator>>(Istream&, extendedEdgeMesh&);
79 Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
80 
81 
82 /*---------------------------------------------------------------------------*\
83  Class extendedEdgeMesh Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class extendedEdgeMesh
87 :
88  public edgeMesh
89 {
90 public:
91 
92  //- Runtime type information
93  TypeName("extendedEdgeMesh");
94 
95  enum pointStatus
96  {
100  NONFEATURE
101  };
102 
104 
105  enum edgeStatus
106  {
112  NONE
113  };
114 
115  static const Enum<edgeStatus> edgeStatusNames_;
116 
117  //- Normals point to the outside
118  enum sideVolumeType
119  {
120  INSIDE = 0,
121  OUTSIDE = 1,
122  BOTH = 2,
123  NEITHER = 3
124  };
125 
127 
128  //- Angular closeness tolerance for treating normals as the same
129  static scalar cosNormalAngleTol_;
130 
131 
132 protected:
133 
134  // Static Data
135 
136  //- Index of the start of the convex feature points - static as 0
137  static label convexStart_;
138 
139  //- Index of the start of the external feature edges - static as 0
140  static label externalStart_;
141 
142 
143  // Protected Data
144 
145  //- Index of the start of the concave feature points
146  label concaveStart_;
147 
148  //- Index of the start of the mixed type feature points
149  label mixedStart_;
150 
151  //- Index of the start of the non-feature points
152  label nonFeatureStart_;
153 
154  //- Index of the start of the internal feature edges
155  label internalStart_;
156 
157  //- Index of the start of the flat feature edges
158  label flatStart_;
159 
160  //- Index of the start of the open feature edges
161  label openStart_;
162 
163  //- Index of the start of the multiply-connected feature edges
164  label multipleStart_;
165 
166  //- Normals of the features, to be referred to by index by both feature
167  // points and edges, unsorted
169 
170  //- Type per normal: which side of normal to mesh
172 
173  //- Flat and open edges require the direction of the edge
175 
176  //- Starting directions for the edges.
177  // This vector points to the half of the plane defined by the first
178  // edge normal.
180 
181  //- Indices of the normals that are adjacent to the feature edges
183 
184  //- Indices of the normals that are adjacent to the feature points
185  // (only valid for 0..nonFeatureStart_-1)
187 
188  //- Indices of feature edges attached to feature points. The edges are
189  // ordered so that they can be circulated.
191 
192  //- Feature edges which are on the boundary between regions
194 
195  //- Search tree for all feature points
196  mutable unique_ptr<indexedOctree<treeDataPoint>> pointTree_;
197 
198  //- Search tree for all edges
199  mutable unique_ptr<indexedOctree<treeDataEdge>> edgeTree_;
200 
201  //- Individual search trees for each type of edge
203 
204 
205  // Protected Constructors
206 
207  //- Construct null, initializing start indices with -1
208  explicit extendedEdgeMesh(class one::minus);
209 
210 
211  // Protected Member Functions
212 
213  //- Classify the type of feature point. Requires valid stored member
214  // data for edges and normals.
215  pointStatus classifyFeaturePoint(label ptI) const;
216 
217  //- Cut edges with surface. Return map from cut points&edges back
218  // to original
219  void cut
220  (
221  const searchableSurface&,
222  labelList& pMap,
223  labelList& eMap,
224  labelList& pointsFromEdge, // new points created by cutting
225  labelList& oldEdge, // the original edge
226  labelList& surfTri // the surface triangle index
227  );
228 
229  //- Remove outside/inside edges. volType denotes which side to keep
230  void select
231  (
232  const searchableSurface& surf,
233  const volumeType volType,
234  labelList& pMap,
235  labelList& eMap
236  );
237 
238  template<class Patch>
239  void sortPointsAndEdges
240  (
241  const Patch&,
242  const labelUList& featureEdges,
243  const labelUList& regionFeatureEdges,
244  const labelUList& feaurePoints
245  );
246 
247 public:
248 
249  // Static Data
250 
251  //- Number of possible point types (i.e. number of slices)
252  static constexpr label nPointTypes = 4;
253 
254  //- Number of possible feature edge types (i.e. number of slices)
255  static constexpr label nEdgeTypes = 5;
256 
257 
258  // Static Member Functions
259 
260  //- Summary of supported read file types.
261  static wordHashSet readTypes();
262 
263  //- Summary of supported write file types.
264  static wordHashSet writeTypes();
265 
266  //- Can we read this file format?
267  static bool canReadType(const word& fileType, bool verbose=false);
268 
269  //- Can we write this file format type?
270  static bool canWriteType(const word& fileType, bool verbose=false);
271 
272  //- Can we read this file format?
273  static bool canRead(const fileName& name, bool verbose=false);
274 
275 
276  // Constructors
277 
278  //- Default construct
280 
281  //- Copy construct
282  explicit extendedEdgeMesh(const extendedEdgeMesh& fem);
283 
284  //- Construct from file name (uses extension to determine type)
285  explicit extendedEdgeMesh(const fileName& name);
286 
287  //- Construct from file name with given format type
288  extendedEdgeMesh(const fileName& name, const word& fileType);
289 
290  //- Construct from Istream
291  explicit extendedEdgeMesh(Istream& is);
292 
293  //- Copy construct from components
295 
296  //- Move construct from components
298 
299  //- Construct given a surface with selected edges,points
300  // (surfaceFeatures)
301  // Extracts, classifies and reorders the data from surfaceFeatures.
303  (
304  const surfaceFeatures& sFeat,
305  const boolList& surfBaffleRegions
306  );
307 
308  //- Construct from PrimitivePatch
310  (
312  const labelUList& featureEdges,
313  const labelUList& regionFeatureEdges,
314  const labelUList& featurePoints
315  );
316 
317  //- Construct from all components
319  (
320  const pointField& pts,
321  const edgeList& eds,
322  label concaveStart,
323  label mixedStart,
324  label nonFeatureStart,
325  label internalStart,
326  label flatStart,
327  label openStart,
328  label multipleStart,
329  const vectorField& normals,
333  const labelListList& edgeNormals,
336  const labelList& regionEdges
337  );
338 
339 
340  // Declare run-time constructor selection table
341 
343  (
344  autoPtr,
347  (
348  const fileName& name
349  ),
350  (name)
351  );
352 
353 
354  // Selectors
355 
356  //- Select constructed from filename with given file format
358  (
359  const fileName& name,
360  const word& fileType
361  );
362 
363  //- Select constructed from filename (implicit extension)
365 
366 
367  //- Destructor
368  ~extendedEdgeMesh() = default;
369 
370 
371  // Member Functions
372 
373  // Find
374 
375  //- Find nearest surface edge for the sample point.
377  (
378  const point& sample,
379  scalar searchDistSqr,
380  pointIndexHit& info
381  ) const;
382 
383  //- Find nearest surface edge for the sample point.
384  void nearestFeatureEdge
385  (
386  const point& sample,
387  scalar searchDistSqr,
388  pointIndexHit& info
389  ) const;
390 
391  //- Find nearest surface edge for each sample point.
392  void nearestFeatureEdge
393  (
394  const pointField& samples,
395  const scalarField& searchDistSqr,
396  List<pointIndexHit>& info
397  ) const;
398 
399  //- Find the nearest point on each type of feature edge
401  (
402  const point& sample,
403  const scalarField& searchDistSqr,
404  List<pointIndexHit>& info
405  ) const;
406 
407  //- Find all the feature points within searchDistSqr of sample
409  (
410  const point& sample,
411  scalar searchRadiusSqr,
412  List<pointIndexHit>& info
413  ) const;
414 
415  //- Find all the feature edges within searchDistSqr of sample
417  (
418  const point& sample,
419  const scalar searchRadiusSqr,
420  List<pointIndexHit>& info
421  ) const;
422 
423 
424  // Access
425 
426  //- Return the index of the start of the convex feature points
427  inline label convexStart() const;
428 
429  //- Return the index of the start of the concave feature points
430  inline label concaveStart() const;
431 
432  //- Return the index of the start of the mixed type feature points
433  inline label mixedStart() const;
434 
435  //- Return the index of the start of the non-feature points
436  inline label nonFeatureStart() const;
437 
438  //- Return the index of the start of the external feature edges
439  inline label externalStart() const;
440 
441  //- Return the index of the start of the internal feature edges
442  inline label internalStart() const;
443 
444  //- Return the index of the start of the flat feature edges
445  inline label flatStart() const;
446 
447  //- Return the index of the start of the open feature edges
448  inline label openStart() const;
449 
450  //- Return the index of the start of the multiply-connected feature
451  // edges
452  inline label multipleStart() const;
453 
454  //- Return whether or not the point index is a feature point
455  inline bool featurePoint(label ptI) const;
456 
457  //- Return the normals of the surfaces adjacent to the feature edges
458  // and points
459  inline const vectorField& normals() const;
460 
461  //- Return
462  inline const List<sideVolumeType>& normalVolumeTypes() const;
463 
464  //- Return the edgeDirection vectors
465  inline const vectorField& edgeDirections() const;
466 
467  //-
468  inline const labelListList& normalDirections() const;
469 
470  //- Return the direction of edgeI, pointing away from ptI
471  inline vector edgeDirection(label edgeI, label ptI) const;
472 
473  //- Return the indices of the normals that are adjacent to the
474  // feature edges
475  inline const labelListList& edgeNormals() const;
476 
477  //- Return the normal vectors for a given set of normal indices
478  inline vectorField edgeNormals(const labelList& edgeNormIs) const;
479 
480  //- Return the normal vectors for a given edge
481  inline vectorField edgeNormals(label edgeI) const;
482 
483  //- Return the indices of the normals that are adjacent to the
484  // feature points
485  inline const labelListList& featurePointNormals() const;
486 
487  //- Return the normal vectors for a given feature point
488  inline vectorField featurePointNormals(label ptI) const;
489 
490  //- Return the edge labels for a given feature point. Edges are
491  // ordered by the faces that they share. The edge labels
492  // correspond to the entry in edges().
493  inline const labelListList& featurePointEdges() const;
494 
495  //- Return the feature edges which are on the boundary between
496  // regions
497  inline const labelList& regionEdges() const;
498 
499  //- Return the pointStatus of a specified point
500  inline pointStatus getPointStatus(label ptI) const;
501 
502  //- Return the edgeStatus of a specified edge
503  inline edgeStatus getEdgeStatus(label edgeI) const;
504 
505  //- Return the baffle faces of a specified edge
506  inline PackedList<2> edgeBaffles(label edgeI) const;
507 
508  //- Demand driven construction of octree for feature points
510 
511  //- Demand driven construction of octree for boundary edges
512  const indexedOctree<treeDataEdge>& edgeTree() const;
513 
514  //- Demand driven construction of octree for boundary edges by type
516  edgeTreesByType() const;
517 
518 
519  // Edit
520 
521  //- Transfer the contents of the argument and annul the argument
523 
524  //- Clear all storage
525  virtual void clear();
526 
527  //- Add extendedEdgeMesh. No filtering of duplicates.
528  void add(const extendedEdgeMesh& fem);
529 
530  //- Flip normals. All concave become convex, all internal external
531  // etc.
532  void flipNormals();
533 
534  //- Update with derived geometry
535  void autoMap
536  (
537  const pointField& subPoints,
538  const edgeList& subEdges,
539  const labelList& pointMap,
540  const labelList& edgeMap
541  );
542 
543  //- Trim to surface. Keep volType side. Return map from current back
544  // to original points (-1 for newly introduced points), edges
545  void trim
546  (
547  const searchableSurface& surf,
548  const volumeType volType,
549  labelList& pointMap,
550  labelList& edgeMap
551  );
552 
553  //- Order according to point and edge status
554  void setFromStatus
555  (
556  const List<extendedEdgeMesh::pointStatus>& pointStat,
557  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
558  labelList& sortedToOriginalPoint,
559  labelList& sortedToOriginalEdge
560  );
561 
562  //- Geometric merge points. Returns true if any points merged.
563  // Return maps from new back to original points/edges.
564  bool mergePointsAndSort
565  (
566  const scalar mergeDist,
567  labelList& pointMap,
568  labelList& edgeMap
569  );
570 
571 
572  // Read
573 
574  //- Read from file. Chooses reader based on explicit extension
575  bool read(const fileName& name, const word& ext);
576 
577  //- Read from file. Chooses reader based on detected extension
578  virtual bool read(const fileName& name);
579 
580 
581  // Write
582 
583  //- Write all components of the extendedEdgeMesh as obj files
584  void writeObj(const fileName& prefix) const;
585 
586  //- Dump some information
587  virtual void writeStats(Ostream& os) const;
588 
589  friend Istream& operator>>(Istream& is, sideVolumeType& vt);
590  friend Ostream& operator<<(Ostream& os, const sideVolumeType& vt);
591 
592 
593  //- Classify the type of feature edge. Requires face centre 0 to face
594  // centre 1 vector to distinguish internal from external
595  static edgeStatus classifyEdge
596  (
597  const List<vector>& norms,
598  const labelList& edNorms,
599  const vector& fC0tofC1
600  );
601 
602  //- Determine the ordering
603  static void sortedOrder
604  (
605  const List<extendedEdgeMesh::pointStatus>& pointStat,
606  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
607  labelList& sortedToOriginalPoint,
608  labelList& sortedToOriginalEdge,
609 
610  label& pointConcaveStart,
611  label& pointMixedStart,
612  label& pointNonFeatStart,
613 
614  label& edgeInternalStart,
615  label& edgeFlatStart,
616  label& edgeOpenStart,
617  label& edgeMultipleStart
618  );
619 
620 
621  // Ostream Operator
622 
623  friend Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
625 };
626 
627 
630 
631 
632 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
633 
634 } // End namespace Foam
635 
636 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
637 
638 #include "extendedEdgeMeshI.H"
639 
640 #ifdef NoRepository
641  #include "extendedEdgeMeshTemplates.C"
642 #endif
643 
644 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
645 
646 #endif
647 
648 // ************************************************************************* //
Foam::extendedEdgeMesh::NONE
Unclassified (consistency with surfaceFeatures)
Definition: extendedEdgeMesh.H:111
Foam::extendedEdgeMesh::normalDirections
const labelListList & normalDirections() const
Definition: extendedEdgeMeshI.H:111
Foam::extendedEdgeMesh::regionEdges_
labelList regionEdges_
Feature edges which are on the boundary between regions.
Definition: extendedEdgeMesh.H:192
Foam::edgeMesh::points
const pointField & points() const noexcept
Return points.
Definition: edgeMeshI.H:99
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:104
Foam::extendedEdgeMesh::sortedOrder
static void sortedOrder(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge, label &pointConcaveStart, label &pointMixedStart, label &pointNonFeatStart, label &edgeInternalStart, label &edgeFlatStart, label &edgeOpenStart, label &edgeMultipleStart)
Determine the ordering.
Definition: extendedEdgeMesh.C:2139
Foam::extendedEdgeMesh::featurePointNormals
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
Definition: extendedEdgeMeshI.H:177
Foam::Enum< pointStatus >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::extendedEdgeMesh::allNearestFeatureEdges
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
Definition: extendedEdgeMesh.C:771
Foam::extendedEdgeMesh::canReadType
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
Definition: extendedEdgeMesh.C:113
Foam::extendedEdgeMesh::NEITHER
not sure when this may be used
Definition: extendedEdgeMesh.H:122
Foam::extendedEdgeMesh::FLAT
Neither concave or convex, on a flat surface.
Definition: extendedEdgeMesh.H:108
Foam::extendedEdgeMesh::edgeTreesByType
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
Definition: extendedEdgeMesh.C:909
Foam::vtk::fileExtension
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
Foam::extendedEdgeMesh::concaveStart_
label concaveStart_
Index of the start of the concave feature points.
Definition: extendedEdgeMesh.H:145
Foam::extendedEdgeMesh::edgeTree_
unique_ptr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
Definition: extendedEdgeMesh.H:198
Foam::extendedEdgeMesh::nearestFeatureEdgeByType
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
Definition: extendedEdgeMesh.C:704
indexedOctree.H
Foam::extendedEdgeMesh::edgeTreesByType_
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
Definition: extendedEdgeMesh.H:201
Foam::extendedEdgeMesh::mergePointsAndSort
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
Definition: extendedEdgeMesh.C:1803
Foam::extendedEdgeMesh::autoMap
void autoMap(const pointField &subPoints, const edgeList &subEdges, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
Definition: extendedEdgeMesh.C:1412
Foam::extendedEdgeMesh::regionEdges
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
Definition: extendedEdgeMeshI.H:218
Foam::extendedEdgeMesh::normals
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
Definition: extendedEdgeMeshI.H:90
extendedEdgeMeshTemplates.C
Foam::extendedEdgeMesh::featurePointEdges
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
Definition: extendedEdgeMeshI.H:212
Foam::extendedEdgeMesh::edgeTree
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
Definition: extendedEdgeMesh.C:867
Foam::extendedEdgeMesh::NONFEATURE
Not a feature point.
Definition: extendedEdgeMesh.H:99
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::extendedEdgeMesh::multipleStart
label multipleStart() const
Return the index of the start of the multiply-connected feature.
Definition: extendedEdgeMeshI.H:78
Foam::extendedEdgeMesh::mixedStart_
label mixedStart_
Index of the start of the mixed type feature points.
Definition: extendedEdgeMesh.H:148
Foam::extendedEdgeMesh::normalVolumeTypes
const List< sideVolumeType > & normalVolumeTypes() const
Return.
Definition: extendedEdgeMeshI.H:97
Foam::extendedEdgeMesh::featurePoint
bool featurePoint(label ptI) const
Return whether or not the point index is a feature point.
Definition: extendedEdgeMeshI.H:84
Foam::extendedEdgeMesh::edgeBaffles
PackedList< 2 > edgeBaffles(label edgeI) const
Return the baffle faces of a specified edge.
Definition: extendedEdgeMeshI.H:269
extendedEdgeMeshI.H
Foam::HashSet< word, Hash< word > >
Foam::extendedEdgeMesh::normalVolumeTypes_
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
Definition: extendedEdgeMesh.H:170
Foam::extendedEdgeMesh::getPointStatus
pointStatus getPointStatus(label ptI) const
Return the pointStatus of a specified point.
Definition: extendedEdgeMeshI.H:225
Foam::extendedEdgeMesh::sideVolumeTypeNames_
static const Enum< sideVolumeType > sideVolumeTypeNames_
Definition: extendedEdgeMesh.H:125
Foam::extendedEdgeMesh::INTERNAL
"Concave" edge
Definition: extendedEdgeMesh.H:107
Foam::extendedEdgeMesh::edgeDirections
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
Definition: extendedEdgeMeshI.H:103
Foam::extendedEdgeMesh::classifyEdge
static edgeStatus classifyEdge(const List< vector > &norms, const labelList &edNorms, const vector &fC0tofC1)
Classify the type of feature edge. Requires face centre 0 to face.
Definition: extendedEdgeMesh.C:2098
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::extendedEdgeMesh::canWriteType
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
Definition: extendedEdgeMesh.C:125
Foam::extendedEdgeMesh::nonFeatureStart
label nonFeatureStart() const
Return the index of the start of the non-feature points.
Definition: extendedEdgeMeshI.H:48
Foam::extendedEdgeMesh::TypeName
TypeName("extendedEdgeMesh")
Runtime type information.
Foam::extendedEdgeMesh::concaveStart
label concaveStart() const
Return the index of the start of the concave feature points.
Definition: extendedEdgeMeshI.H:36
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:52
Foam::extendedEdgeMesh::readTypes
static wordHashSet readTypes()
Summary of supported read file types.
Definition: extendedEdgeMesh.C:101
Foam::volumeType
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Definition: volumeType.H:60
Foam::Field< vector >
treeDataPoint.H
PrimitivePatch.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
edgeMesh.H
Foam::extendedEdgeMesh::nEdgeTypes
static constexpr label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
Definition: extendedEdgeMesh.H:254
Foam::extendedEdgeMesh::edgeDirections_
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
Definition: extendedEdgeMesh.H:173
Foam::extendedEdgeMesh::MIXED
A point surrounded by both convex and concave edges.
Definition: extendedEdgeMesh.H:98
Foam::extendedEdgeMesh::setFromStatus
void setFromStatus(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge)
Order according to point and edge status.
Definition: extendedEdgeMesh.C:1735
Foam::extendedEdgeMesh::sideVolumeType
sideVolumeType
Normals point to the outside.
Definition: extendedEdgeMesh.H:117
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
Foam::surfaceFeatures
Holds feature edges/points of surface.
Definition: surfaceFeatures.H:73
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition: treeDataEdge.H:50
Foam::extendedEdgeMesh::New
static autoPtr< extendedEdgeMesh > New(const fileName &name, const word &fileType)
Select constructed from filename with given file format.
Definition: extendedEdgeMeshNew.C:42
samples
scalarField samples(nIntervals, Zero)
Foam::extendedEdgeMesh::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, extendedEdgeMesh, fileExtension,(const fileName &name),(name))
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::extendedEdgeMesh::multipleStart_
label multipleStart_
Index of the start of the multiply-connected feature edges.
Definition: extendedEdgeMesh.H:163
Foam::extendedEdgeMesh::clear
virtual void clear()
Clear all storage.
Definition: extendedEdgeMesh.C:1006
Foam::extendedEdgeMesh::cosNormalAngleTol_
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
Definition: extendedEdgeMesh.H:128
Foam::extendedEdgeMesh::nearestFeaturePoint
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:653
Foam::extendedEdgeMesh::nPointTypes
static constexpr label nPointTypes
Number of possible point types (i.e. number of slices)
Definition: extendedEdgeMesh.H:251
Foam::extendedEdgeMesh::select
void select(const searchableSurface &surf, const volumeType volType, labelList &pMap, labelList &eMap)
Remove outside/inside edges. volType denotes which side to keep.
Definition: extendedEdgeMesh.C:298
Foam::extendedEdgeMesh::pointStatusNames_
static const Enum< pointStatus > pointStatusNames_
Definition: extendedEdgeMesh.H:102
Foam::extendedEdgeMesh::OUTSIDE
mesh outside
Definition: extendedEdgeMesh.H:120
Foam::extendedEdgeMesh::INSIDE
mesh inside
Definition: extendedEdgeMesh.H:119
Foam::extendedEdgeMesh::externalStart_
static label externalStart_
Index of the start of the external feature edges - static as 0.
Definition: extendedEdgeMesh.H:139
Foam::extendedEdgeMesh::internalStart
label internalStart() const
Return the index of the start of the internal feature edges.
Definition: extendedEdgeMeshI.H:60
Foam::extendedEdgeMesh::edgeNormals
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
Definition: extendedEdgeMeshI.H:146
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::extendedEdgeMesh::edgeDirection
vector edgeDirection(label edgeI, label ptI) const
Return the direction of edgeI, pointing away from ptI.
Definition: extendedEdgeMeshI.H:118
treeDataEdge.H
Foam::extendedEdgeMesh::MULTIPLE
Multiply connected (connected to more than two faces)
Definition: extendedEdgeMesh.H:110
Foam::extendedEdgeMesh::edgeNormals_
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Definition: extendedEdgeMesh.H:181
Foam::extendedEdgeMesh::CONVEX
Fully convex point (w.r.t normals)
Definition: extendedEdgeMesh.H:96
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::extendedEdgeMesh::pointStatus
pointStatus
Definition: extendedEdgeMesh.H:94
Foam::extendedEdgeMesh::mixedStart
label mixedStart() const
Return the index of the start of the mixed type feature points.
Definition: extendedEdgeMeshI.H:42
Foam::extendedEdgeMesh::edgeStatusNames_
static const Enum< edgeStatus > edgeStatusNames_
Definition: extendedEdgeMesh.H:114
Foam::extendedEdgeMesh::normals_
vectorField normals_
Normals of the features, to be referred to by index by both feature.
Definition: extendedEdgeMesh.H:167
Foam::extendedEdgeMesh::transfer
void transfer(extendedEdgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
Definition: extendedEdgeMesh.C:974
Foam::extendedEdgeMesh::internalStart_
label internalStart_
Index of the start of the internal feature edges.
Definition: extendedEdgeMesh.H:154
Foam::extendedEdgeMesh::convexStart_
static label convexStart_
Index of the start of the convex feature points - static as 0.
Definition: extendedEdgeMesh.H:136
Foam::extendedEdgeMesh::normalDirections_
labelListList normalDirections_
Starting directions for the edges.
Definition: extendedEdgeMesh.H:178
Foam::extendedEdgeMesh::openStart
label openStart() const
Return the index of the start of the open feature edges.
Definition: extendedEdgeMeshI.H:72
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::edgeMesh::edges
const edgeList & edges() const noexcept
Return edges.
Definition: edgeMeshI.H:105
Foam::extendedEdgeMesh
Description of feature edges and points.
Definition: extendedEdgeMesh.H:85
Foam::extendedEdgeMesh::pointTree
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
Definition: extendedEdgeMesh.C:827
Foam::extendedEdgeMesh::operator>>
friend Istream & operator>>(Istream &is, sideVolumeType &vt)
Foam::extendedEdgeMesh::extendedEdgeMesh
extendedEdgeMesh()
Default construct.
Definition: extendedEdgeMesh.C:377
Foam::extendedEdgeMesh::OPEN
Only connected to a single face.
Definition: extendedEdgeMesh.H:109
Foam::extendedEdgeMesh::add
void add(const extendedEdgeMesh &fem)
Add extendedEdgeMesh. No filtering of duplicates.
Definition: extendedEdgeMesh.C:1030
Foam::Vector< scalar >
Foam::extendedEdgeMesh::trim
void trim(const searchableSurface &surf, const volumeType volType, labelList &pointMap, labelList &edgeMap)
Trim to surface. Keep volType side. Return map from current back.
Definition: extendedEdgeMesh.C:1652
Foam::List< sideVolumeType >
Foam::extendedEdgeMesh::writeStats
virtual void writeStats(Ostream &os) const
Dump some information.
Definition: extendedEdgeMesh.C:2046
Foam::extendedEdgeMesh::pointTree_
unique_ptr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
Definition: extendedEdgeMesh.H:195
Foam::PackedList< 2 >
Foam::extendedEdgeMesh::EXTERNAL
"Convex" edge
Definition: extendedEdgeMesh.H:106
Foam::extendedEdgeMesh::BOTH
e.g. a baffle
Definition: extendedEdgeMesh.H:121
Foam::extendedEdgeMesh::externalStart
label externalStart() const
Return the index of the start of the external feature edges.
Definition: extendedEdgeMeshI.H:54
Foam::UList< label >
Foam::extendedEdgeMesh::flipNormals
void flipNormals()
Flip normals. All concave become convex, all internal external.
Definition: extendedEdgeMesh.C:1300
Foam::extendedEdgeMesh::nearestFeatureEdge
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:668
Foam::extendedEdgeMesh::classifyFeaturePoint
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
Definition: extendedEdgeMesh.C:152
Foam::extendedEdgeMesh::cut
void cut(const searchableSurface &, labelList &pMap, labelList &eMap, labelList &pointsFromEdge, labelList &oldEdge, labelList &surfTri)
Cut edges with surface. Return map from cut points&edges back.
Definition: extendedEdgeMesh.C:196
Foam::extendedEdgeMesh::featurePointEdges_
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Definition: extendedEdgeMesh.H:189
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::extendedEdgeMesh::sortPointsAndEdges
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList &regionFeatureEdges, const labelUList &feaurePoints)
Definition: extendedEdgeMeshTemplates.C:40
Foam::extendedEdgeMesh::writeTypes
static wordHashSet writeTypes()
Summary of supported write file types.
Definition: extendedEdgeMesh.C:107
Foam::extendedEdgeMesh::flatStart_
label flatStart_
Index of the start of the flat feature edges.
Definition: extendedEdgeMesh.H:157
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::one::minus
A class representing the concept of -1.
Definition: one.H:105
Foam::extendedEdgeMesh::nonFeatureStart_
label nonFeatureStart_
Index of the start of the non-feature points.
Definition: extendedEdgeMesh.H:151
Foam::extendedEdgeMesh::read
bool read(const fileName &name, const word &ext)
Read from file. Chooses reader based on explicit extension.
Definition: extendedEdgeMesh.C:641
Foam::extendedEdgeMesh::writeObj
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
Definition: extendedEdgeMesh.C:1891
Foam::extendedEdgeMesh::convexStart
label convexStart() const
Return the index of the start of the convex feature points.
Definition: extendedEdgeMeshI.H:30
Foam::extendedEdgeMesh::allNearestFeaturePoints
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
Definition: extendedEdgeMesh.C:740
Foam::extendedEdgeMesh::openStart_
label openStart_
Index of the start of the open feature edges.
Definition: extendedEdgeMesh.H:160
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:53
Foam::extendedEdgeMesh::flatStart
label flatStart() const
Return the index of the start of the flat feature edges.
Definition: extendedEdgeMeshI.H:66
Foam::extendedEdgeMesh::~extendedEdgeMesh
~extendedEdgeMesh()=default
Destructor.
Foam::extendedEdgeMesh::operator<<
friend Ostream & operator<<(Ostream &os, const sideVolumeType &vt)
Foam::extendedEdgeMesh::featurePointNormals_
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
Definition: extendedEdgeMesh.H:185
Foam::extendedEdgeMesh::getEdgeStatus
edgeStatus getEdgeStatus(label edgeI) const
Return the edgeStatus of a specified edge.
Definition: extendedEdgeMeshI.H:245
Foam::extendedEdgeMesh::canRead
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
Definition: extendedEdgeMesh.C:137
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
sample
Minimal example by using system/controlDict.functions:
Foam::extendedEdgeMesh::CONCAVE
Fully concave point.
Definition: extendedEdgeMesh.H:97