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-2018 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 
75 class surfaceFeatures;
76 class searchableSurface;
77 class extendedEdgeMesh;
78 
79 Istream& operator>>(Istream&, extendedEdgeMesh&);
80 Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
81 
82 
83 /*---------------------------------------------------------------------------*\
84  Class extendedEdgeMesh Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class extendedEdgeMesh
88 :
89  public edgeMesh
90 {
91 public:
92 
93  //- Runtime type information
94  TypeName("extendedEdgeMesh");
95 
96  enum pointStatus
97  {
101  NONFEATURE
102  };
103 
105 
106  enum edgeStatus
107  {
113  NONE
114  };
115 
116  static const Enum<edgeStatus> edgeStatusNames_;
117 
118  //- Normals point to the outside
119  enum sideVolumeType
120  {
121  INSIDE = 0,
122  OUTSIDE = 1,
123  BOTH = 2,
124  NEITHER = 3
125  };
126 
128 
129  //- Angular closeness tolerance for treating normals as the same
130  static scalar cosNormalAngleTol_;
131 
132 
133 protected:
134 
135  // Static data
136 
137  //- Index of the start of the convex feature points - static as 0
138  static label convexStart_;
139 
140  //- Index of the start of the external feature edges - static as 0
141  static label externalStart_;
142 
143 
144  // Protected data
145 
146  //- Index of the start of the concave feature points
148 
149  //- Index of the start of the mixed type feature points
151 
152  //- Index of the start of the non-feature points
154 
155  //- Index of the start of the internal feature edges
157 
158  //- Index of the start of the flat feature edges
160 
161  //- Index of the start of the open feature edges
163 
164  //- Index of the start of the multiply-connected feature edges
166 
167  //- Normals of the features, to be referred to by index by both feature
168  // points and edges, unsorted
170 
171  //- Type per normal: which side of normal to mesh
173 
174  //- Flat and open edges require the direction of the edge
176 
177  //- Starting directions for the edges.
178  // This vector points to the half of the plane defined by the first
179  // edge normal.
181 
182  //- Indices of the normals that are adjacent to the feature edges
184 
185  //- Indices of the normals that are adjacent to the feature points
186  // (only valid for 0..nonFeatureStart_-1)
188 
189  //- Indices of feature edges attached to feature points. The edges are
190  // ordered so that they can be circulated.
192 
193  //- Feature edges which are on the boundary between regions
195 
196  //- Search tree for all feature points
198 
199  //- Search tree for all edges
201 
202  //- Individual search trees for each type of edge
204 
205 
206  // Protected Constructors
207 
208  //- Construct null, initializing start indices with -1
209  explicit extendedEdgeMesh(class one::minus);
210 
211 
212  // Protected Member Functions
213 
214  //- Classify the type of feature point. Requires valid stored member
215  // data for edges and normals.
217 
218  //- Cut edges with surface. Return map from cut points&edges back
219  // to original
220  void cut
221  (
222  const searchableSurface&,
223  labelList& pMap,
224  labelList& eMap,
225  labelList& pointsFromEdge, // new points created by cutting
226  labelList& oldEdge, // the original edge
227  labelList& surfTri // the surface triangle index
228  );
229 
230  //- Remove outside/inside edges. volType denotes which side to keep
231  void select
232  (
233  const searchableSurface& surf,
234  const volumeType volType,
235  labelList& pMap,
236  labelList& eMap
237  );
238 
239  template<class Patch>
240  void sortPointsAndEdges
241  (
242  const Patch&,
243  const labelUList& featureEdges,
244  const labelUList& regionFeatureEdges,
245  const labelUList& feaurePoints
246  );
247 
248 public:
249 
250  // Static data
251 
252  //- Number of possible point types (i.e. number of slices)
253  static label nPointTypes;
254 
255  //- Number of possible feature edge types (i.e. number of slices)
256  static label nEdgeTypes;
257 
258  //- Can we read this file format?
259  static bool canRead(const fileName& name, bool verbose=false);
260 
261  //- Can we read this file format?
262  static bool canReadType(const word& ext, bool verbose=false);
263 
264  //- Can we write this file format type?
265  static bool canWriteType(const word& ext, bool verbose=false);
266 
267  static wordHashSet readTypes();
268  static wordHashSet writeTypes();
269 
270 
271  // Constructors
272 
273  //- Construct null
275 
276  //- Construct as copy
277  explicit extendedEdgeMesh(const extendedEdgeMesh& fem);
278 
279  //- Construct from file name (uses extension to determine type)
280  extendedEdgeMesh(const fileName&);
281 
282  //- Construct from file name (uses extension to determine type)
283  extendedEdgeMesh(const fileName&, const word& ext);
284 
285  //- Construct from Istream
287 
288  //- Copy construct from components
290 
291  //- Move construct from components
293 
294  //- Construct given a surface with selected edges,points
295  // (surfaceFeatures)
296  // Extracts, classifies and reorders the data from surfaceFeatures.
298  (
299  const surfaceFeatures& sFeat,
300  const boolList& surfBaffleRegions
301  );
302 
303  //- Construct from PrimitivePatch
305  (
307  const labelUList& featureEdges,
308  const labelUList& regionFeatureEdges,
309  const labelUList& featurePoints
310  );
311 
312  //- Construct from all components
314  (
315  const pointField& pts,
316  const edgeList& eds,
324  const vectorField& normals,
328  const labelListList& edgeNormals,
331  const labelList& regionEdges
332  );
333 
334 
335  // Declare run-time constructor selection table
336 
338  (
339  autoPtr,
342  (
343  const fileName& name
344  ),
345  (name)
346  );
347 
348 
349  // Selectors
350 
351  //- Select constructed from filename (explicit extension)
353  (
354  const fileName& name,
355  const word& ext
356  );
357 
358  //- Select constructed from filename (implicit extension)
360 
361 
362  //- Destructor
364 
365 
366  // Member Functions
367 
368  // Find
369 
370  //- Find nearest surface edge for the sample point.
372  (
373  const point& sample,
374  scalar searchDistSqr,
375  pointIndexHit& info
376  ) const;
377 
378  //- Find nearest surface edge for the sample point.
379  void nearestFeatureEdge
380  (
381  const point& sample,
382  scalar searchDistSqr,
383  pointIndexHit& info
384  ) const;
385 
386  //- Find nearest surface edge for each sample point.
387  void nearestFeatureEdge
388  (
389  const pointField& samples,
390  const scalarField& searchDistSqr,
391  List<pointIndexHit>& info
392  ) const;
393 
394  //- Find the nearest point on each type of feature edge
396  (
397  const point& sample,
398  const scalarField& searchDistSqr,
399  List<pointIndexHit>& info
400  ) const;
401 
402  //- Find all the feature points within searchDistSqr of sample
404  (
405  const point& sample,
406  scalar searchRadiusSqr,
407  List<pointIndexHit>& info
408  ) const;
409 
410  //- Find all the feature edges within searchDistSqr of sample
412  (
413  const point& sample,
414  const scalar searchRadiusSqr,
415  List<pointIndexHit>& info
416  ) const;
417 
418 
419  // Access
420 
421  //- Return the index of the start of the convex feature points
422  inline label convexStart() const;
423 
424  //- Return the index of the start of the concave feature points
425  inline label concaveStart() const;
426 
427  //- Return the index of the start of the mixed type feature points
428  inline label mixedStart() const;
429 
430  //- Return the index of the start of the non-feature points
431  inline label nonFeatureStart() const;
432 
433  //- Return the index of the start of the external feature edges
434  inline label externalStart() const;
435 
436  //- Return the index of the start of the internal feature edges
437  inline label internalStart() const;
438 
439  //- Return the index of the start of the flat feature edges
440  inline label flatStart() const;
441 
442  //- Return the index of the start of the open feature edges
443  inline label openStart() const;
444 
445  //- Return the index of the start of the multiply-connected feature
446  // edges
447  inline label multipleStart() const;
448 
449  //- Return whether or not the point index is a feature point
450  inline bool featurePoint(label ptI) const;
451 
452  //- Return the normals of the surfaces adjacent to the feature edges
453  // and points
454  inline const vectorField& normals() const;
455 
456  //- Return
457  inline const List<sideVolumeType>& normalVolumeTypes() const;
458 
459  //- Return the edgeDirection vectors
460  inline const vectorField& edgeDirections() const;
461 
462  //-
463  inline const labelListList& normalDirections() const;
464 
465  //- Return the direction of edgeI, pointing away from ptI
466  inline vector edgeDirection(label edgeI, label ptI) const;
467 
468  //- Return the indices of the normals that are adjacent to the
469  // feature edges
470  inline const labelListList& edgeNormals() const;
471 
472  //- Return the normal vectors for a given set of normal indices
473  inline vectorField edgeNormals(const labelList& edgeNormIs) const;
474 
475  //- Return the normal vectors for a given edge
476  inline vectorField edgeNormals(label edgeI) const;
477 
478  //- Return the indices of the normals that are adjacent to the
479  // feature points
480  inline const labelListList& featurePointNormals() const;
481 
482  //- Return the normal vectors for a given feature point
483  inline vectorField featurePointNormals(label ptI) const;
484 
485  //- Return the edge labels for a given feature point. Edges are
486  // ordered by the faces that they share. The edge labels
487  // correspond to the entry in edges().
488  inline const labelListList& featurePointEdges() const;
489 
490  //- Return the feature edges which are on the boundary between
491  // regions
492  inline const labelList& regionEdges() const;
493 
494  //- Return the pointStatus of a specified point
495  inline pointStatus getPointStatus(label ptI) const;
496 
497  //- Return the edgeStatus of a specified edge
498  inline edgeStatus getEdgeStatus(label edgeI) const;
499 
500  //- Return the baffle faces of a specified edge
501  inline PackedList<2> edgeBaffles(label edgeI) const;
502 
503  //- Demand driven construction of octree for feature points
505 
506  //- Demand driven construction of octree for boundary edges
507  const indexedOctree<treeDataEdge>& edgeTree() const;
508 
509  //- Demand driven construction of octree for boundary edges by type
511  edgeTreesByType() const;
512 
513 
514  // Edit
515 
516  //- Transfer the contents of the argument and annul the argument
518 
519  //- Clear all storage
520  virtual void clear();
521 
522  //- Add extendedEdgeMesh. No filtering of duplicates.
523  void add(const extendedEdgeMesh& fem);
524 
525  //- Flip normals. All concave become convex, all internal external
526  // etc.
527  void flipNormals();
528 
529  //- Update with derived geometry
530  void autoMap
531  (
532  const pointField& subPoints,
533  const edgeList& subEdges,
534  const labelList& pointMap,
535  const labelList& edgeMap
536  );
537 
538  //- Trim to surface. Keep volType side. Return map from current back
539  // to original points (-1 for newly introduced points), edges
540  void trim
541  (
542  const searchableSurface& surf,
543  const volumeType volType,
544  labelList& pointMap,
545  labelList& edgeMap
546  );
547 
548  //- Order according to point and edge status
549  void setFromStatus
550  (
551  const List<extendedEdgeMesh::pointStatus>& pointStat,
552  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
553  labelList& sortedToOriginalPoint,
554  labelList& sortedToOriginalEdge
555  );
556 
557  //- Geometric merge points. Returns true if any points merged.
558  // Return maps from new back to original points/edges.
559  bool mergePointsAndSort
560  (
561  const scalar mergeDist,
562  labelList& pointMap,
563  labelList& edgeMap
564  );
565 
566 
567  // Read
568 
569  //- Read from file. Chooses reader based on explicit extension
570  bool read(const fileName& name, const word& ext);
571 
572  //- Read from file. Chooses reader based on detected extension
573  virtual bool read(const fileName& name);
574 
575 
576  // Write
577 
578  //- Write all components of the extendedEdgeMesh as obj files
579  void writeObj(const fileName& prefix) const;
580 
581  //- Dump some information
582  virtual void writeStats(Ostream& os) const;
583 
584  friend Istream& operator>>(Istream& is, sideVolumeType& vt);
585  friend Ostream& operator<<(Ostream& os, const sideVolumeType& vt);
586 
587 
588  //- Classify the type of feature edge. Requires face centre 0 to face
589  // centre 1 vector to distinguish internal from external
590  static edgeStatus classifyEdge
591  (
592  const List<vector>& norms,
593  const labelList& edNorms,
594  const vector& fC0tofC1
595  );
596 
597  //- Determine the ordering
598  static void sortedOrder
599  (
600  const List<extendedEdgeMesh::pointStatus>& pointStat,
601  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
602  labelList& sortedToOriginalPoint,
603  labelList& sortedToOriginalEdge,
604 
605  label& pointConcaveStart,
606  label& pointMixedStart,
607  label& pointNonFeatStart,
608 
609  label& edgeInternalStart,
610  label& edgeFlatStart,
611  label& edgeOpenStart,
612  label& edgeMultipleStart
613  );
614 
615 
616  // Ostream Operator
617 
618  friend Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
620 };
621 
622 
625 
626 
627 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
628 
629 } // End namespace Foam
630 
631 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
632 
633 #include "extendedEdgeMeshI.H"
634 
635 #ifdef NoRepository
636  #include "extendedEdgeMeshTemplates.C"
637 #endif
638 
639 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
640 
641 #endif
642 
643 // ************************************************************************* //
Foam::extendedEdgeMesh::NONE
Unclassified (consistency with surfaceFeatures)
Definition: extendedEdgeMesh.H:112
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:193
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:105
Foam::extendedEdgeMesh::New
static autoPtr< extendedEdgeMesh > New(const fileName &name, const word &ext)
Select constructed from filename (explicit extension)
Definition: extendedEdgeMeshNew.C:42
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:2144
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:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
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:782
Foam::extendedEdgeMesh::NEITHER
not sure when this may be used
Definition: extendedEdgeMesh.H:123
Foam::extendedEdgeMesh::FLAT
Neither concave or convex, on a flat surface.
Definition: extendedEdgeMesh.H:109
Foam::extendedEdgeMesh::edgeTreesByType
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
Definition: extendedEdgeMesh.C:920
Foam::vtk::fileExtension
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
Foam::extendedEdgeMesh::canReadType
static bool canReadType(const word &ext, bool verbose=false)
Can we read this file format?
Definition: extendedEdgeMesh.C:117
Foam::extendedEdgeMesh::concaveStart_
label concaveStart_
Index of the start of the concave feature points.
Definition: extendedEdgeMesh.H:146
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:715
indexedOctree.H
Foam::extendedEdgeMesh::edgeTreesByType_
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
Definition: extendedEdgeMesh.H:202
Foam::extendedEdgeMesh::mergePointsAndSort
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
Definition: extendedEdgeMesh.C:1808
Foam::extendedEdgeMesh::autoMap
void autoMap(const pointField &subPoints, const edgeList &subEdges, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
Definition: extendedEdgeMesh.C:1417
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:878
Foam::extendedEdgeMesh::NONFEATURE
Not a feature point.
Definition: extendedEdgeMesh.H:100
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:228
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:149
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 >
Foam::extendedEdgeMesh::normalVolumeTypes_
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
Definition: extendedEdgeMesh.H:171
Foam::extendedEdgeMesh::pointTree_
autoPtr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
Definition: extendedEdgeMesh.H:196
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:126
Foam::extendedEdgeMesh::INTERNAL
"Concave" edge
Definition: extendedEdgeMesh.H:108
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:2103
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:55
Foam::extendedEdgeMesh::readTypes
static wordHashSet readTypes()
Definition: extendedEdgeMesh.C:103
Foam::label
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:62
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::extendedEdgeMesh::~extendedEdgeMesh
~extendedEdgeMesh()
Destructor.
Definition: extendedEdgeMesh.C:631
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::edgeDirections_
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
Definition: extendedEdgeMesh.H:174
Foam::extendedEdgeMesh::MIXED
A point surrounded by both convex and concave edges.
Definition: extendedEdgeMesh.H:99
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:1740
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::extendedEdgeMesh::sideVolumeType
sideVolumeType
Normals point to the outside.
Definition: extendedEdgeMesh.H:118
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
Foam::edgeMesh::points
const pointField & points() const
Return points.
Definition: edgeMeshI.H:99
Foam::surfaceFeatures
Holds feature edges/points of surface.
Definition: surfaceFeatures.H:73
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition: treeDataEdge.H:50
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:65
Foam::extendedEdgeMesh::multipleStart_
label multipleStart_
Index of the start of the multiply-connected feature edges.
Definition: extendedEdgeMesh.H:164
Foam::extendedEdgeMesh::clear
virtual void clear()
Clear all storage.
Definition: extendedEdgeMesh.C:1011
Foam::extendedEdgeMesh::cosNormalAngleTol_
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
Definition: extendedEdgeMesh.H:129
Foam::extendedEdgeMesh::edgeTree_
autoPtr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
Definition: extendedEdgeMesh.H:199
Foam::extendedEdgeMesh::nearestFeaturePoint
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:664
Foam::extendedEdgeMesh::nPointTypes
static label nPointTypes
Number of possible point types (i.e. number of slices)
Definition: extendedEdgeMesh.H:252
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:302
Foam::edgeMesh::edges
const edgeList & edges() const
Return edges.
Definition: edgeMeshI.H:105
Foam::extendedEdgeMesh::pointStatusNames_
static const Enum< pointStatus > pointStatusNames_
Definition: extendedEdgeMesh.H:103
Foam::extendedEdgeMesh::OUTSIDE
mesh outside
Definition: extendedEdgeMesh.H:121
Foam::extendedEdgeMesh::INSIDE
mesh inside
Definition: extendedEdgeMesh.H:120
Foam::extendedEdgeMesh::externalStart_
static label externalStart_
Index of the start of the external feature edges - static as 0.
Definition: extendedEdgeMesh.H:140
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
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:111
Foam::extendedEdgeMesh::edgeNormals_
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Definition: extendedEdgeMesh.H:182
Foam::extendedEdgeMesh::CONVEX
Fully convex point (w.r.t normals)
Definition: extendedEdgeMesh.H:97
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::extendedEdgeMesh::pointStatus
pointStatus
Definition: extendedEdgeMesh.H:95
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:115
Foam::extendedEdgeMesh::normals_
vectorField normals_
Normals of the features, to be referred to by index by both feature.
Definition: extendedEdgeMesh.H:168
Foam::extendedEdgeMesh::transfer
void transfer(extendedEdgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
Definition: extendedEdgeMesh.C:984
Foam::extendedEdgeMesh::internalStart_
label internalStart_
Index of the start of the internal feature edges.
Definition: extendedEdgeMesh.H:155
Foam::extendedEdgeMesh::convexStart_
static label convexStart_
Index of the start of the convex feature points - static as 0.
Definition: extendedEdgeMesh.H:137
Foam::extendedEdgeMesh::normalDirections_
labelListList normalDirections_
Starting directions for the edges.
Definition: extendedEdgeMesh.H:179
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::extendedEdgeMesh
Description of feature edges and points.
Definition: extendedEdgeMesh.H:86
Foam::extendedEdgeMesh::pointTree
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
Definition: extendedEdgeMesh.C:838
Foam::extendedEdgeMesh::operator>>
friend Istream & operator>>(Istream &is, sideVolumeType &vt)
Foam::extendedEdgeMesh::extendedEdgeMesh
extendedEdgeMesh()
Construct null.
Definition: extendedEdgeMesh.C:381
Foam::extendedEdgeMesh::OPEN
Only connected to a single face.
Definition: extendedEdgeMesh.H:110
Foam::extendedEdgeMesh::nEdgeTypes
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
Definition: extendedEdgeMesh.H:255
Foam::extendedEdgeMesh::add
void add(const extendedEdgeMesh &fem)
Add extendedEdgeMesh. No filtering of duplicates.
Definition: extendedEdgeMesh.C:1035
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:1657
Foam::List< sideVolumeType >
Foam::extendedEdgeMesh::writeStats
virtual void writeStats(Ostream &os) const
Dump some information.
Definition: extendedEdgeMesh.C:2051
Foam::PackedList< 2 >
Foam::extendedEdgeMesh::EXTERNAL
"Convex" edge
Definition: extendedEdgeMesh.H:107
Foam::extendedEdgeMesh::BOTH
e.g. a baffle
Definition: extendedEdgeMesh.H:122
Foam::extendedEdgeMesh::externalStart
label externalStart() const
Return the index of the start of the external feature edges.
Definition: extendedEdgeMeshI.H:54
Foam::extendedEdgeMesh::canWriteType
static bool canWriteType(const word &ext, bool verbose=false)
Can we write this file format type?
Definition: extendedEdgeMesh.C:129
Foam::UList< label >
Foam::extendedEdgeMesh::flipNormals
void flipNormals()
Flip normals. All concave become convex, all internal external.
Definition: extendedEdgeMesh.C:1305
Foam::extendedEdgeMesh::nearestFeatureEdge
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:679
Foam::extendedEdgeMesh::classifyFeaturePoint
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
Definition: extendedEdgeMesh.C:156
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:200
Foam::extendedEdgeMesh::featurePointEdges_
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Definition: extendedEdgeMesh.H:190
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()
Definition: extendedEdgeMesh.C:109
Foam::extendedEdgeMesh::flatStart_
label flatStart_
Index of the start of the flat feature edges.
Definition: extendedEdgeMesh.H:158
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:103
Foam::extendedEdgeMesh::nonFeatureStart_
label nonFeatureStart_
Index of the start of the non-feature points.
Definition: extendedEdgeMesh.H:152
Foam::extendedEdgeMesh::read
bool read(const fileName &name, const word &ext)
Read from file. Chooses reader based on explicit extension.
Definition: extendedEdgeMesh.C:652
Foam::extendedEdgeMesh::writeObj
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
Definition: extendedEdgeMesh.C:1896
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:751
Foam::extendedEdgeMesh::openStart_
label openStart_
Index of the start of the open feature edges.
Definition: extendedEdgeMesh.H:161
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102
Foam::extendedEdgeMesh::flatStart
label flatStart() const
Return the index of the start of the flat feature edges.
Definition: extendedEdgeMeshI.H:66
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:186
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:141
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:90
Foam::extendedEdgeMesh::CONCAVE
Fully concave point.
Definition: extendedEdgeMesh.H:98