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 | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::extendedEdgeMesh
26 
27 Description
28 
29  Description of feature edges and points.
30 
31  Feature points are a sorted subset at the start of the overall points list:
32  0 .. concaveStart_-1 : convex points (w.r.t normals)
33  concaveStart_ .. mixedStart_-1 : concave points
34  mixedStart_ .. nonFeatureStart_-1 : mixed internal/external points
35  nonFeatureStart_ .. size-1 : non-feature points
36 
37  Feature edges are the edgeList of the edgeMesh and are sorted:
38  0 .. internalStart_-1 : external edges (convex w.r.t normals)
39  internalStart_ .. flatStart_-1 : internal edges (concave)
40  flatStart_ .. openStart_-1 : flat edges (neither concave or convex)
41  can arise from region interfaces on
42  flat surfaces
43  openStart_ .. multipleStart_-1 : open edges (e.g. from baffle surfaces)
44  multipleStart_ .. size-1 : multiply connected edges
45 
46  The edge direction and feature edge and feature point adjacent normals
47  are stored.
48 
49 SourceFiles
50  extendedEdgeMeshI.H
51  extendedEdgeMesh.C
52  extendedEdgeMeshNew.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef extendedEdgeMesh_H
57 #define extendedEdgeMesh_H
58 
59 #include "edgeMesh.H"
60 #include "indexedOctree.H"
61 #include "treeDataEdge.H"
62 #include "treeDataPoint.H"
63 #include "PrimitivePatch.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 class surfaceFeatures;
71 class searchableSurface;
72 
73 // Forward declaration of friend functions and operators
74 class extendedEdgeMesh;
75 Istream& operator>>(Istream&, extendedEdgeMesh&);
76 Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
77 
78 /*---------------------------------------------------------------------------*\
79  Class extendedEdgeMesh Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class extendedEdgeMesh
83 :
84  public edgeMesh
85 {
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("extendedEdgeMesh");
91 
92  enum pointStatus
93  {
94  CONVEX, // Fully convex point (w.r.t normals)
95  CONCAVE, // Fully concave point
96  MIXED, // A point surrounded by both convex and concave edges
97  NONFEATURE // Not a feature point
98  };
99 
101 
102  enum edgeStatus
103  {
104  EXTERNAL, // "Convex" edge
105  INTERNAL, // "Concave" edge
106  FLAT, // Neither concave or convex, on a flat surface
107  OPEN, // i.e. only connected to one face
108  MULTIPLE, // Multiply connected (connected to more than two faces)
109  NONE // Not a classified feature edge (consistency with
110  // surfaceFeatures)
111  };
112 
114 
115  //- Normals point to the outside
116  enum sideVolumeType
117  {
118  INSIDE = 0, // mesh inside
119  OUTSIDE = 1, // mesh outside
120  BOTH = 2, // e.g. a baffle
121  NEITHER = 3 // not sure when this may be used
122  };
123 
125 
126  //- Angular closeness tolerance for treating normals as the same
127  static scalar cosNormalAngleTol_;
128 
129 
130 protected:
131 
132  // Static data
133 
134  //- Index of the start of the convex feature points - static as 0
135  static label convexStart_;
136 
137  //- Index of the start of the external feature edges - static as 0
138  static label externalStart_;
139 
140 
141  // Protected data
142 
143  //- Index of the start of the concave feature points
145 
146  //- Index of the start of the mixed type feature points
148 
149  //- Index of the start of the non-feature points
151 
152  //- Index of the start of the internal feature edges
154 
155  //- Index of the start of the flat feature edges
157 
158  //- Index of the start of the open feature edges
160 
161  //- Index of the start of the multiply-connected feature edges
163 
164  //- Normals of the features, to be referred to by index by both feature
165  // points and edges, unsorted
167 
168  //- Type per normal: which side of normal to mesh
170 
171  //- Flat and open edges require the direction of the edge
173 
174  //- Starting directions for the edges.
175  // This vector points to the half of the plane defined by the first
176  // edge normal.
178 
179  //- Indices of the normals that are adjacent to the feature edges
181 
182  //- Indices of the normals that are adjacent to the feature points
183  // (only valid for 0..nonFeatureStart_-1)
185 
186  //- Indices of feature edges attached to feature points. The edges are
187  // ordered so that they can be circulated.
189 
190  //- Feature edges which are on the boundary between regions
192 
193  //- Search tree for all feature points
195 
196  //- Search tree for all edges
198 
199  //- Individual search trees for each type of edge
201 
202 
203  // Protected Member Functions
204 
205  //- Classify the type of feature point. Requires valid stored member
206  // data for edges and normals.
208 
209  //- Cut edges with surface. Return map from cut points&edges back
210  // to original
211  void cut
212  (
213  const searchableSurface&,
214  labelList& pMap,
215  labelList& eMap,
216  labelList& pointsFromEdge, // new points created by cutting
217  labelList& oldEdge, // the orginal edge
218  labelList& surfTri // the surface triangle index
219  );
220 
221  //- Remove outside/inside edges. volType denotes which side to keep
222  void select
223  (
224  const searchableSurface& surf,
225  const volumeType volType,
226  labelList& pMap,
227  labelList& eMap
228  );
229 
230  template<class Patch>
231  void sortPointsAndEdges
232  (
233  const Patch&,
234  const labelList& featureEdges,
235  const labelList& regionFeatureEdges,
236  const labelList& feaurePoints
237  );
238 
239 public:
240 
241  // Static data
242 
243  //- Number of possible point types (i.e. number of slices)
244  static label nPointTypes;
245 
246  //- Number of possible feature edge types (i.e. number of slices)
247  static label nEdgeTypes;
248 
249  //- Can we read this file format?
250  static bool canRead(const fileName&, const bool verbose=false);
251 
252  //- Can we read this file format?
253  static bool canReadType(const word& ext, const bool verbose=false);
254 
255  //- Can we write this file format type?
256  static bool canWriteType(const word& ext, const bool verbose=false);
257 
258  static wordHashSet readTypes();
259  static wordHashSet writeTypes();
260 
261 
262  // Constructors
263 
264  //- Construct null
266 
267  //- Construct as copy
268  explicit extendedEdgeMesh(const extendedEdgeMesh&);
269 
270  //- Construct from file name (uses extension to determine type)
271  extendedEdgeMesh(const fileName&);
272 
273  //- Construct from file name (uses extension to determine type)
274  extendedEdgeMesh(const fileName&, const word& ext);
275 
276  //- Construct from Istream
278 
279  //- Construct by transferring components (points, edges)
281  (
282  const Xfer<pointField>&,
283  const Xfer<edgeList>&
284  );
285 
286  //- Construct given a surface with selected edges,points
287  // (surfaceFeatures)
288  // Extracts, classifies and reorders the data from surfaceFeatures.
290  (
291  const surfaceFeatures& sFeat,
292  const boolList& surfBaffleRegions
293  );
294 
295  //- Construct from PrimitivePatch
297  (
299  const labelList& featureEdges,
300  const labelList& regionFeatureEdges,
301  const labelList& featurePoints
302  );
303 
304  //- Construct from all components
306  (
307  const pointField& pts,
308  const edgeList& eds,
316  const vectorField& normals,
320  const labelListList& edgeNormals,
323  const labelList& regionEdges
324  );
325 
326 
327  // Declare run-time constructor selection table
328 
330  (
331  autoPtr,
333  fileExtension,
334  (
335  const fileName& name
336  ),
337  (name)
338  );
339 
340 
341  // Selectors
342 
343  //- Select constructed from filename (explicit extension)
345  (
346  const fileName&,
347  const word& ext
348  );
349 
350  //- Select constructed from filename (implicit extension)
351  static autoPtr<extendedEdgeMesh> New(const fileName&);
352 
353 
354  //- Destructor
356 
357 
358  // Member Functions
359 
360  // Find
361 
362  //- Find nearest surface edge for the sample point.
364  (
365  const point& sample,
366  scalar searchDistSqr,
367  pointIndexHit& info
368  ) const;
369 
370  //- Find nearest surface edge for the sample point.
371  void nearestFeatureEdge
372  (
373  const point& sample,
374  scalar searchDistSqr,
375  pointIndexHit& info
376  ) const;
377 
378  //- Find nearest surface edge for each sample point.
379  void nearestFeatureEdge
380  (
381  const pointField& samples,
382  const scalarField& searchDistSqr,
383  List<pointIndexHit>& info
384  ) const;
385 
386  //- Find the nearest point on each type of feature edge
388  (
389  const point& sample,
390  const scalarField& searchDistSqr,
391  List<pointIndexHit>& info
392  ) const;
393 
394  //- Find all the feature points within searchDistSqr of sample
396  (
397  const point& sample,
398  scalar searchRadiusSqr,
399  List<pointIndexHit>& info
400  ) const;
401 
402  //- Find all the feature edges within searchDistSqr of sample
404  (
405  const point& sample,
406  const scalar searchRadiusSqr,
407  List<pointIndexHit>& info
408  ) const;
409 
410 
411  // Access
412 
413  //- Return the index of the start of the convex feature points
414  inline label convexStart() const;
415 
416  //- Return the index of the start of the concave feature points
417  inline label concaveStart() const;
418 
419  //- Return the index of the start of the mixed type feature points
420  inline label mixedStart() const;
421 
422  //- Return the index of the start of the non-feature points
423  inline label nonFeatureStart() const;
424 
425  //- Return the index of the start of the external feature edges
426  inline label externalStart() const;
427 
428  //- Return the index of the start of the internal feature edges
429  inline label internalStart() const;
430 
431  //- Return the index of the start of the flat feature edges
432  inline label flatStart() const;
433 
434  //- Return the index of the start of the open feature edges
435  inline label openStart() const;
436 
437  //- Return the index of the start of the multiply-connected feature
438  // edges
439  inline label multipleStart() const;
440 
441  //- Return whether or not the point index is a feature point
442  inline bool featurePoint(label ptI) const;
443 
444  //- Return the normals of the surfaces adjacent to the feature edges
445  // and points
446  inline const vectorField& normals() const;
447 
448  //- Return
449  inline const List<sideVolumeType>& normalVolumeTypes() const;
450 
451  //- Return the edgeDirection vectors
452  inline const vectorField& edgeDirections() const;
453 
454  //-
455  inline const labelListList& normalDirections() const;
456 
457  //- Return the direction of edgeI, pointing away from ptI
458  inline vector edgeDirection(label edgeI, label ptI) const;
459 
460  //- Return the indices of the normals that are adjacent to the
461  // feature edges
462  inline const labelListList& edgeNormals() const;
463 
464  //- Return the normal vectors for a given set of normal indices
465  inline vectorField edgeNormals(const labelList& edgeNormIs) const;
466 
467  //- Return the normal vectors for a given edge
468  inline vectorField edgeNormals(label edgeI) const;
469 
470  //- Return the indices of the normals that are adjacent to the
471  // feature points
472  inline const labelListList& featurePointNormals() const;
473 
474  //- Return the normal vectors for a given feature point
475  inline vectorField featurePointNormals(label ptI) const;
476 
477  //- Return the edge labels for a given feature point. Edges are
478  // ordered by the faces that they share. The edge labels
479  // correspond to the entry in edges().
480  inline const labelListList& featurePointEdges() const;
481 
482  //- Return the feature edges which are on the boundary between
483  // regions
484  inline const labelList& regionEdges() const;
485 
486  //- Return the pointStatus of a specified point
487  inline pointStatus getPointStatus(label ptI) const;
488 
489  //- Return the edgeStatus of a specified edge
490  inline edgeStatus getEdgeStatus(label edgeI) const;
491 
492  //- Return the baffle faces of a specified edge
493  inline PackedList<2> edgeBaffles(label edgeI) const;
494 
495  //- Demand driven construction of octree for feature points
497 
498  //- Demand driven construction of octree for boundary edges
499  const indexedOctree<treeDataEdge>& edgeTree() const;
500 
501  //- Demand driven construction of octree for boundary edges by type
503  edgeTreesByType() const;
504 
505 
506  // Edit
507 
508  //- Transfer the contents of the argument and annul the argument
509  void transfer(extendedEdgeMesh&);
510 
511  //- Transfer contents to the Xfer container
513 
514  //- Clear all storage
515  virtual void clear();
516 
517  //- Add extendedEdgeMesh. No filtering of duplicates.
518  void add(const extendedEdgeMesh&);
519 
520  //- Flip normals. All concave become convex, all internal external
521  // etc.
522  void flipNormals();
523 
524  //- Update with derived geometry
525  void autoMap
526  (
527  const pointField&,
528  const edgeList&,
529  const labelList& pointMap,
530  const labelList& edgeMap
531  );
532 
533  //- Trim to surface. Keep volType side. Return map from current back
534  // to original points (-1 for newly introduced points), edges
535  void trim
536  (
537  const searchableSurface& surf,
538  const volumeType volType,
539  labelList& pointMap,
540  labelList& edgeMap
541  );
542 
543  //- Order according to point and edge status
544  void setFromStatus
545  (
546  const List<extendedEdgeMesh::pointStatus>& pointStat,
547  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
548  labelList& sortedToOriginalPoint,
549  labelList& sortedToOriginalEdge
550  );
551 
552  //- Geometric merge points. Returns true if any points merged.
553  // Return maps from new back to original points/edges.
554  bool mergePointsAndSort
555  (
556  const scalar mergeDist,
557  labelList& pointMap,
558  labelList& edgeMap
559  );
560 
561 
562  // Read
563 
564  //- Read from file. Chooses reader based on explicit extension
565  bool read(const fileName&, const word& ext);
566 
567  //- Read from file. Chooses reader based on detected extension
568  virtual bool read(const fileName&);
569 
570 
571  // Write
572 
573  //- Write all components of the extendedEdgeMesh as obj files
574  void writeObj(const fileName& prefix) const;
575 
576  //- Dump some information
577  virtual void writeStats(Ostream& os) const;
578 
579  friend Istream& operator>>(Istream& is, sideVolumeType& vt);
580  friend Ostream& operator<<(Ostream& os, const sideVolumeType& vt);
581 
582 
583  //- Classify the type of feature edge. Requires face centre 0 to face
584  // centre 1 vector to distinguish internal from external
585  static edgeStatus classifyEdge
586  (
587  const List<vector>& norms,
588  const labelList& edNorms,
589  const vector& fC0tofC1
590  );
591 
592  //- Determine the ordering
593  static void sortedOrder
594  (
595  const List<extendedEdgeMesh::pointStatus>& pointStat,
596  const List<extendedEdgeMesh::edgeStatus>& edgeStat,
597  labelList& sortedToOriginalPoint,
598  labelList& sortedToOriginalEdge,
599 
600  label& pointConcaveStart,
601  label& pointMixedStart,
602  label& pointNonFeatStart,
603 
604  label& edgeInternalStart,
605  label& edgeFlatStart,
606  label& edgeOpenStart,
607  label& edgeMultipleStart
608  );
609 
610 
611  // Ostream Operator
612 
613  friend Ostream& operator<<(Ostream&, const extendedEdgeMesh&);
615 };
616 
617 
618 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
619 
620 } // End namespace Foam
621 
622 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
623 
624 #include "extendedEdgeMeshI.H"
625 
626 #ifdef NoRepository
627 # include "extendedEdgeMeshTemplates.C"
628 #endif
629 
630 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
631 
632 #endif
633 
634 // ************************************************************************* //
Foam::extendedEdgeMesh::add
void add(const extendedEdgeMesh &)
Add extendedEdgeMesh. No filtering of duplicates.
Definition: extendedEdgeMesh.C:1113
Foam::extendedEdgeMesh::NONE
@ NONE
Definition: extendedEdgeMesh.H:108
Foam::extendedEdgeMesh::normalDirections
const labelListList & normalDirections() const
Definition: extendedEdgeMeshI.H:109
Foam::extendedEdgeMesh::regionEdges_
labelList regionEdges_
Feature edges which are on the boundary between regions.
Definition: extendedEdgeMesh.H:190
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:101
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:2211
Foam::extendedEdgeMesh::featurePointNormals
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
Definition: extendedEdgeMeshI.H:175
Foam::extendedEdgeMesh::New
static autoPtr< extendedEdgeMesh > New(const fileName &, const word &ext)
Select constructed from filename (explicit extension)
Definition: extendedEdgeMeshNew.C:40
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
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:856
Foam::extendedEdgeMesh::NEITHER
@ NEITHER
Definition: extendedEdgeMesh.H:120
Foam::extendedEdgeMesh::FLAT
@ FLAT
Definition: extendedEdgeMesh.H:105
Foam::extendedEdgeMesh::edgeTreesByType
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
Definition: extendedEdgeMesh.C:994
Foam::extendedEdgeMesh::concaveStart_
label concaveStart_
Index of the start of the concave feature points.
Definition: extendedEdgeMesh.H:143
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:789
indexedOctree.H
Foam::extendedEdgeMesh::edgeTreesByType_
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
Definition: extendedEdgeMesh.H:199
Foam::extendedEdgeMesh::mergePointsAndSort
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
Definition: extendedEdgeMesh.C:1873
Foam::extendedEdgeMesh::regionEdges
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
Definition: extendedEdgeMeshI.H:216
Foam::extendedEdgeMesh::edgeStatusNames_
static const Foam::NamedEnum< edgeStatus, 6 > edgeStatusNames_
Definition: extendedEdgeMesh.H:112
Foam::extendedEdgeMesh::normals
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
Definition: extendedEdgeMeshI.H:88
extendedEdgeMeshTemplates.C
Foam::extendedEdgeMesh::featurePointEdges
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
Definition: extendedEdgeMeshI.H:210
Foam::extendedEdgeMesh::edgeTree
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
Definition: extendedEdgeMesh.C:952
Foam::extendedEdgeMesh::NONFEATURE
@ NONFEATURE
Definition: extendedEdgeMesh.H:96
Foam::extendedEdgeMesh::multipleStart
label multipleStart() const
Return the index of the start of the multiply-connected feature.
Definition: extendedEdgeMeshI.H:76
Foam::extendedEdgeMesh::mixedStart_
label mixedStart_
Index of the start of the mixed type feature points.
Definition: extendedEdgeMesh.H:146
Foam::extendedEdgeMesh::normalVolumeTypes
const List< sideVolumeType > & normalVolumeTypes() const
Return.
Definition: extendedEdgeMeshI.H:95
Foam::extendedEdgeMesh::featurePoint
bool featurePoint(label ptI) const
Return whether or not the point index is a feature point.
Definition: extendedEdgeMeshI.H:82
Foam::extendedEdgeMesh::edgeBaffles
PackedList< 2 > edgeBaffles(label edgeI) const
Return the baffle faces of a specified edge.
Definition: extendedEdgeMeshI.H:271
extendedEdgeMeshI.H
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::extendedEdgeMesh::normalVolumeTypes_
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
Definition: extendedEdgeMesh.H:168
Foam::extendedEdgeMesh::pointTree_
autoPtr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
Definition: extendedEdgeMesh.H:193
Foam::Xfer
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
Foam::extendedEdgeMesh::canRead
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
Definition: extendedEdgeMesh.C:158
Foam::extendedEdgeMesh::pointStatusNames_
static const Foam::NamedEnum< pointStatus, 4 > pointStatusNames_
Definition: extendedEdgeMesh.H:99
Foam::extendedEdgeMesh::getPointStatus
pointStatus getPointStatus(label ptI) const
Return the pointStatus of a specified point.
Definition: extendedEdgeMeshI.H:223
Foam::extendedEdgeMesh::INTERNAL
@ INTERNAL
Definition: extendedEdgeMesh.H:104
Foam::extendedEdgeMesh::edgeDirections
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
Definition: extendedEdgeMeshI.H:101
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:2168
samples
scalarField samples(nIntervals, 0)
Foam::extendedEdgeMesh::nonFeatureStart
label nonFeatureStart() const
Return the index of the start of the non-feature points.
Definition: extendedEdgeMeshI.H:46
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:34
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:53
Foam::extendedEdgeMesh::readTypes
static wordHashSet readTypes()
Definition: extendedEdgeMesh.C:111
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:59
Foam::volumeType
Definition: volumeType.H:54
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
treeDataPoint.H
PrimitivePatch.H
Foam::extendedEdgeMesh::~extendedEdgeMesh
~extendedEdgeMesh()
Destructor.
Definition: extendedEdgeMesh.C:703
Foam::extendedEdgeMesh::canReadType
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
Definition: extendedEdgeMesh.C:126
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
edgeMesh.H
Foam::extendedEdgeMesh::edgeDirections_
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
Definition: extendedEdgeMesh.H:171
Foam::extendedEdgeMesh::MIXED
@ MIXED
Definition: extendedEdgeMesh.H:95
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:1805
Foam::extendedEdgeMesh::sideVolumeType
sideVolumeType
Normals point to the outside.
Definition: extendedEdgeMesh.H:115
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:66
Foam::surfaceFeatures
Holds feature edges/points of surface.
Definition: surfaceFeatures.H:68
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition: treeDataTriSurface.H:47
Foam::extendedEdgeMesh::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, extendedEdgeMesh, fileExtension,(const fileName &name),(name))
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::extendedEdgeMesh::multipleStart_
label multipleStart_
Index of the start of the multiply-connected feature edges.
Definition: extendedEdgeMesh.H:161
Foam::extendedEdgeMesh::clear
virtual void clear()
Clear all storage.
Definition: extendedEdgeMesh.C:1089
Foam::extendedEdgeMesh::cosNormalAngleTol_
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
Definition: extendedEdgeMesh.H:126
Foam::extendedEdgeMesh::edgeTree_
autoPtr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
Definition: extendedEdgeMesh.H:196
Foam::extendedEdgeMesh::nearestFeaturePoint
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:738
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::extendedEdgeMesh::nPointTypes
static label nPointTypes
Number of possible point types (i.e. number of slices)
Definition: extendedEdgeMesh.H:243
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:324
Foam::extendedEdgeMesh::OUTSIDE
@ OUTSIDE
Definition: extendedEdgeMesh.H:118
Foam::extendedEdgeMesh::INSIDE
@ INSIDE
Definition: extendedEdgeMesh.H:117
Foam::extendedEdgeMesh::externalStart_
static label externalStart_
Index of the start of the external feature edges - static as 0.
Definition: extendedEdgeMesh.H:137
Foam::extendedEdgeMesh::internalStart
label internalStart() const
Return the index of the start of the internal feature edges.
Definition: extendedEdgeMeshI.H:58
Foam::extendedEdgeMesh::edgeNormals
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
Definition: extendedEdgeMeshI.H:144
Foam::extendedEdgeMesh::edgeDirection
vector edgeDirection(label edgeI, label ptI) const
Return the direction of edgeI, pointing away from ptI.
Definition: extendedEdgeMeshI.H:116
treeDataEdge.H
Foam::extendedEdgeMesh::MULTIPLE
@ MULTIPLE
Definition: extendedEdgeMesh.H:107
Foam::extendedEdgeMesh::edgeNormals_
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Definition: extendedEdgeMesh.H:179
Foam::extendedEdgeMesh::CONVEX
@ CONVEX
Definition: extendedEdgeMesh.H:93
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::extendedEdgeMesh::sideVolumeTypeNames_
static const Foam::NamedEnum< sideVolumeType, 4 > sideVolumeTypeNames_
Definition: extendedEdgeMesh.H:123
Foam::extendedEdgeMesh::pointStatus
pointStatus
Definition: extendedEdgeMesh.H:91
Foam::extendedEdgeMesh::mixedStart
label mixedStart() const
Return the index of the start of the mixed type feature points.
Definition: extendedEdgeMeshI.H:40
Foam::extendedEdgeMesh::normals_
vectorField normals_
Normals of the features, to be referred to by index by both feature.
Definition: extendedEdgeMesh.H:165
Foam::extendedEdgeMesh::internalStart_
label internalStart_
Index of the start of the internal feature edges.
Definition: extendedEdgeMesh.H:152
Foam::extendedEdgeMesh::convexStart_
static label convexStart_
Index of the start of the convex feature points - static as 0.
Definition: extendedEdgeMesh.H:134
Foam::extendedEdgeMesh::normalDirections_
labelListList normalDirections_
Starting directions for the edges.
Definition: extendedEdgeMesh.H:176
Foam::extendedEdgeMesh::openStart
label openStart() const
Return the index of the start of the open feature edges.
Definition: extendedEdgeMeshI.H:70
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::extendedEdgeMesh::xfer
Xfer< extendedEdgeMesh > xfer()
Transfer contents to the Xfer container.
Definition: extendedEdgeMesh.C:1083
Foam::extendedEdgeMesh
Description of feature edges and points.
Definition: extendedEdgeMesh.H:81
Foam::extendedEdgeMesh::canWriteType
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
Definition: extendedEdgeMesh.C:142
Foam::extendedEdgeMesh::pointTree
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
Definition: extendedEdgeMesh.C:912
Foam::extendedEdgeMesh::operator>>
friend Istream & operator>>(Istream &is, sideVolumeType &vt)
Foam::extendedEdgeMesh::sortPointsAndEdges
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList &regionFeatureEdges, const labelList &feaurePoints)
Definition: extendedEdgeMeshTemplates.C:37
Foam::extendedEdgeMesh::extendedEdgeMesh
extendedEdgeMesh()
Construct null.
Definition: extendedEdgeMesh.C:403
Foam::extendedEdgeMesh::OPEN
@ OPEN
Definition: extendedEdgeMesh.H:106
Foam::extendedEdgeMesh::nEdgeTypes
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
Definition: extendedEdgeMesh.H:246
Foam::extendedEdgeMesh::autoMap
void autoMap(const pointField &, const edgeList &, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
Definition: extendedEdgeMesh.C:1470
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:1722
Foam::List< sideVolumeType >
Foam::extendedEdgeMesh::writeStats
virtual void writeStats(Ostream &os) const
Dump some information.
Definition: extendedEdgeMesh.C:2116
Foam::PackedList< 2 >
Foam::extendedEdgeMesh::EXTERNAL
@ EXTERNAL
Definition: extendedEdgeMesh.H:103
Foam::extendedEdgeMesh::BOTH
@ BOTH
Definition: extendedEdgeMesh.H:119
Foam::extendedEdgeMesh::externalStart
label externalStart() const
Return the index of the start of the external feature edges.
Definition: extendedEdgeMeshI.H:52
Foam::operator>>
Istream & operator>>(Istream &, edgeMesh &)
Definition: edgeMeshIO.C:141
Foam::extendedEdgeMesh::flipNormals
void flipNormals()
Flip normals. All concave become convex, all internal external.
Definition: extendedEdgeMesh.C:1361
Foam::extendedEdgeMesh::nearestFeatureEdge
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Definition: extendedEdgeMesh.C:753
Foam::extendedEdgeMesh::classifyFeaturePoint
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
Definition: extendedEdgeMesh.C:176
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:222
Foam::extendedEdgeMesh::featurePointEdges_
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Definition: extendedEdgeMesh.H:187
Foam::extendedEdgeMesh::writeTypes
static wordHashSet writeTypes()
Definition: extendedEdgeMesh.C:117
Foam::extendedEdgeMesh::flatStart_
label flatStart_
Index of the start of the flat feature edges.
Definition: extendedEdgeMesh.H:155
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::extendedEdgeMesh::nonFeatureStart_
label nonFeatureStart_
Index of the start of the non-feature points.
Definition: extendedEdgeMesh.H:149
Foam::extendedEdgeMesh::writeObj
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
Definition: extendedEdgeMesh.C:1961
Foam::extendedEdgeMesh::convexStart
label convexStart() const
Return the index of the start of the convex feature points.
Definition: extendedEdgeMeshI.H:28
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:825
Foam::extendedEdgeMesh::openStart_
label openStart_
Index of the start of the open feature edges.
Definition: extendedEdgeMesh.H:158
Foam::edgeMesh
Points connected by edges.
Definition: edgeMesh.H:69
Foam::extendedEdgeMesh::transfer
void transfer(extendedEdgeMesh &)
Transfer the contents of the argument and annul the argument.
Definition: extendedEdgeMesh.C:1058
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::extendedEdgeMesh::flatStart
label flatStart() const
Return the index of the start of the flat feature edges.
Definition: extendedEdgeMeshI.H:64
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:183
Foam::extendedEdgeMesh::getEdgeStatus
edgeStatus getEdgeStatus(label edgeI) const
Return the edgeStatus of a specified edge.
Definition: extendedEdgeMeshI.H:245
Foam::NamedEnum< pointStatus, 4 >
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88
Foam::extendedEdgeMesh::CONCAVE
@ CONCAVE
Definition: extendedEdgeMesh.H:94
Foam::extendedEdgeMesh::read
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
Definition: extendedEdgeMesh.C:726