triSurface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-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::triSurface
29 
30 Description
31  Triangulated surface description with patch information.
32 
33 SourceFiles
34  triSurface.C
35  triSurfaceAddressing.C
36  triSurfaceIO.C
37  triSurfaceStitch.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef triSurface_H
42 #define triSurface_H
43 
44 #include "PrimitivePatch.H"
45 #include "PatchTools.H"
46 #include "pointField.H"
47 #include "labelledTri.H"
48 #include "boolList.H"
49 #include "bitSet.H"
50 #include "HashSet.H"
52 #include "surfacePatchList.H"
53 #include "triFaceList.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 // Forward Declarations
61 class Time;
62 class IOobject;
63 class IFstream;
64 class surfZone;
65 class triSurface;
66 
67 template<class Face> class MeshedSurface;
68 
69 Istream& operator>>(Istream&, triSurface&);
70 Ostream& operator<<(Ostream&, const triSurface&);
71 
72 
73 /*---------------------------------------------------------------------------*\
74  Class triSurface Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class triSurface
78 :
79  public PrimitivePatch<::Foam::List<labelledTri>, pointField>
80 {
81  // Private Typedefs
82 
83  //- Internal mesh storage type
86 
87 
88  // Private Data
89 
90  //- Patch information
91  // (face ordering nFaces/startFace only used during reading, writing)
93 
94 
95  // Demand Driven
96 
97  //- Edge-face addressing (sorted)
98  mutable unique_ptr<labelListList> sortedEdgeFacesPtr_;
99 
100  //- Label of face that 'owns' edge
101  //- i.e. e.vec() is righthanded walk along face
102  mutable unique_ptr<labelList> edgeOwnerPtr_;
103 
104 
105  // Private Member Functions
106 
107  //- Calculate sorted edgeFaces
108  void calcSortedEdgeFaces() const;
109 
110  //- Calculate owner
111  void calcEdgeOwner() const;
112 
113  //- Sort faces according to region.
114  // Returns patch list and sets faceMap to index of labelledTri
115  // inside *this.
116  surfacePatchList calcPatches(labelList& faceMap) const;
117 
118  //- Sets default values for patches
119  void setDefaultPatches();
120 
121  //- Function to stitch the triangles by removing duplicate points.
122  // Returns true if any points merged
123  bool stitchTriangles
124  (
125  const scalar tol = SMALL,
126  const bool verbose = false
127  );
128 
129  //- Read in OpenFOAM format
130  bool readNative(Istream& is);
131 
132  //- Write in OpenFOAM format
133  void writeNative(Ostream& os) const;
134 
135  //- Read in STL format
136  bool readSTL(const fileName& filename, bool forceBinary=false);
137 
138  //- Generic read routine for given format type.
139  // If the format type is "", uses the file extension.
140  bool read
141  (
142  const fileName& filename,
143  const word& fileType,
144  const bool check = true
145  );
146 
147  //- Write STL ASCII format.
148  // Each region becomes a 'solid' 'endsolid' block.
149  void writeSTLASCII(const fileName& filename, const bool sort) const;
150 
151  //- Write STL BINARY format
152  void writeSTLBINARY(const fileName& filename) const;
153 
154  //- Write GTS (Gnu Tri Surface library) format.
155  void writeGTS(const fileName& filename, const bool sort) const;
156 
157 
158  // Static Private Functions
159 
160  //- Convert faces to labelledTri. All get same region.
161  static List<labelledTri> convertToTri
162  (
163  const faceList& faces,
164  const label defaultRegion = 0
165  );
166 
167  //- Convert triFaces to labelledTri. All get same region.
168  static List<labelledTri> convertToTri
169  (
170  const triFaceList& faces,
171  const label defaultRegion = 0
172  );
173 
174  //- Return a new surface using specified pointMap and faceMap
175  //
176  // \param[in] pointMap from subsetMeshMap
177  // \param[in] faceMap from subsetMeshMap
178  triSurface subsetMeshImpl
179  (
180  const labelList& pointMap,
181  const labelList& faceMap
182  ) const;
183 
184 
185 protected:
186 
187  // Protected Member Functions
188 
189  //- Non-const access to global points
191  {
192  return const_cast<pointField&>(MeshReference::points());
193  }
194 
195  //- Non-const access to the faces
197  {
198  return static_cast<List<labelledTri>&>(*this);
199  }
200 
201 
202 public:
203 
204  // Public Typedefs
205 
206  //- Placeholder only, but do not remove - it is needed for GeoMesh
207  typedef bool BoundaryMesh;
208 
209  //- The face type (same as the underlying PrimitivePatch)
210  typedef labelledTri face_type;
211 
212  //- The point type (same as the underlying PrimitivePatch)
213  typedef point point_type;
214 
215 
216  //- Runtime type information
217  ClassName("triSurface");
218 
219 
220  // Static
221 
222  //- Name of triSurface directory to use.
223  static fileName triSurfInstance(const Time&);
224 
225  //- Known readable file-types, including via friends or proxies
226  static wordHashSet readTypes();
227 
228  //- Known writable file-types, including via friends or proxies
229  static wordHashSet writeTypes();
230 
231  //- Can we read this file format?
232  static bool canReadType(const word& fileType, bool verbose=false);
233 
234  //- Can we write this file format?
235  static bool canWriteType(const word& fileType, bool verbose=false);
236 
237  //- Can we read this file format?
238  static bool canRead(const fileName& name, bool verbose=false);
239 
240 
241  // IO helpers
242 
243  //- Return fileName.
244  // If fileName is relative gets treated as local to IOobject.
246  (
247  const IOobject& io,
248  const fileName& f,
249  const bool isGlobal = true
250  );
251 
252  //- Return fileName to load IOobject from.
253  // Fatal if the file does not exist
254  static fileName checkFile
255  (
256  const IOobject& io,
257  const bool isGlobal = true
258  );
259 
260  //- Return fileName to load IOobject from.
261  // Supports optional override of fileName with "file" entry
262  // Fatal if the file does not exist
263  static fileName checkFile
264  (
265  const IOobject& io,
266  const dictionary& dict,
267  const bool isGlobal = true
268  );
269 
270  //- Use IOobject information to resolve file to load from,
271  //- or empty if the file does not exist.
272  static fileName findFile
273  (
274  const IOobject& io,
275  const bool isGlobal = true
276  );
277 
278  //- Use IOobject information to resolve file to load from,
279  //- or empty if the file does not exist.
280  // Supports optional override of fileName with "file" entry
281  static fileName findFile
282  (
283  const IOobject& io,
284  const dictionary& dict,
285  const bool isGlobal = true
286  );
287 
288 
289  // Constructors
290 
291  //- Default construct
292  triSurface();
293 
294  //- Copy construct
295  triSurface(const triSurface& surf);
296 
297  //- Move construct
298  triSurface(triSurface&& surf);
299 
300  //- Construct from triangles, patches, points.
301  triSurface
302  (
303  const List<labelledTri>& triangles,
305  const pointField& pts
306  );
307 
308  //- Construct from triangles, patches, points. Reuse storage.
309  triSurface
310  (
311  List<labelledTri>& triangles,
313  pointField& pts,
314  const bool reuse
315  );
316 
317  //- Construct from triangles, points.
318  //- Set patch names to default.
319  triSurface
320  (
321  const List<labelledTri>& triangles,
322  const pointField& pts
323  );
324 
325  //- Construct from triangles, points.
326  //- Set region to 0 and default patchName.
327  triSurface
328  (
329  const triFaceList& triangles,
330  const pointField& pts
331  );
332 
333  //- Construct from file name (uses extension to determine type).
334  // Optional (positive, non-zero) point scaling is possible.
335  explicit triSurface
336  (
337  const fileName& name,
338  const scalar scaleFactor = -1
339  );
340 
341  //- Construct from file name with given format type.
342  // If the format type is "", uses the file extension.
343  triSurface
344  (
345  const fileName& name,
346  const word& fileType,
347  const scalar scaleFactor = -1
348  );
349 
350  //- Construct from Istream
351  explicit triSurface(Istream& is);
352 
353  //- Construct from objectRegistry by reading an ".ftr" file
354  explicit triSurface(const Time& d);
355 
356  //- Read construct using IO to find the file location.
357  // Dictionary may contain the following entries:
358  // - \c file = alternative file name (default is dictionary name)
359  // - \c fileType = file format (default is from file extension)
360  // - \c scale (eg, 0.001: mm to m)
361  // .
362  triSurface
363  (
364  const IOobject& io,
365  const dictionary& dict,
366  const bool isGlobal = true
367  );
368 
369 
370  // Selectors
371 
372  //- Read construct from filename with given file type
373  static autoPtr<triSurface> New
374  (
375  const fileName& name,
376  const word& fileType
377  );
378 
379  //- Read construct from filename (file type implicit from extension)
380  static autoPtr<triSurface> New(const fileName& name);
381 
382 
383  //- Destructor
384  virtual ~triSurface();
385 
386 
387  // Member Functions
388 
389  void clearOut();
390 
391  void clearTopology();
392 
393  void clearPatchMeshAddr();
394 
395  void swap(triSurface& surf);
396 
397 
398  // Access
399 
400  const geometricSurfacePatchList& patches() const
401  {
402  return patches_;
403  }
404 
406  {
407  return patches_;
408  }
409 
410  //- Return const access to the faces
411  inline const List<labelledTri>& surfFaces() const
412  {
413  return static_cast<const List<labelledTri>&>(*this);
414  }
415 
416  //- Return edge-face addressing sorted (for edges with more than
417  // 2 faces) according to the angle around the edge.
418  // Orientation is anticlockwise looking from
419  // edge.vec(localPoints())
420  const labelListList& sortedEdgeFaces() const;
421 
422  //- If 2 face neighbours: label of face where ordering of edge
423  // is consistent with righthand walk.
424  // If 1 neighbour: label of only face.
425  // If >2 neighbours: undetermined.
426  const labelList& edgeOwner() const;
427 
428 
429  //- Face area vectors (normals)
430  inline const vectorField& Sf() const
431  {
432  return MeshReference::faceAreas();
433  }
434 
435  //- Face area magnitudes
436  inline const scalarField& magSf() const
437  {
439  }
440 
441  //- Face centres
442  inline const vectorField& Cf() const
443  {
445  }
446 
447 
448  // Interoperability with other surface mesh classes
449 
450  //- Sort faces according to zoneIds
451  // Returns a surfZoneList and sets faceMap to index within faces()
452  // (i.e. map from original,unsorted to sorted)
454 
455  //- Create a list of faces from the triFaces
456  void triFaceFaces(List<face>& plainFaceList) const;
457 
458 
459  // Edit
460 
461  //- Move points
462  virtual void movePoints(const pointField& pts);
463 
464  //- Swap points. Similar to movePoints, but returns the old points
465  virtual void swapPoints(pointField& pts);
466 
467  //- Scale points. A non-positive factor is ignored.
468  virtual void scalePoints(const scalar scaleFactor);
469 
470  //- Check/remove duplicate/degenerate triangles
471  void checkTriangles(const bool verbose);
472 
473  //- Check triply (or more) connected edges.
474  void checkEdges(const bool verbose);
475 
476  //- Remove non-valid triangles
477  void cleanup(const bool verbose);
478 
479  //- Fill faceZone with currentZone for every face reachable
480  // from facei without crossing edge marked in borderEdge.
481  // Note: faceZone has to be sized nFaces before calling this fun.
482  void markZone
483  (
484  const boolList& borderEdge,
485  const label facei,
486  const label currentZone,
488  ) const;
489 
490  //- (size and) fills faceZone with zone of face. Zone is area
491  // reachable by edge crossing without crossing borderEdge
492  // (bool for every edge in surface). Returns number of zones.
493  label markZones
494  (
495  const boolList& borderEdge,
497  ) const;
498 
499  //- Create mappings for a sub-surface
500  //
501  // \param[in] include the faces to select
502  // \param[out] pointMap from new to old localPoints
503  // \param[out] faceMap from new to old localFaces
504  template<class BoolListType>
506  (
507  const BoolListType& include,
508  labelList& pointMap,
510  ) const
511  {
512  PatchTools::subsetMap(*this, include, pointMap, faceMap);
513  }
514 
515  //- Return a new surface subsetted on the selected faces.
516  //
517  // \param[in] include the faces to select
518  // \param[out] pointMap from new to old localPoints
519  // \param[out] faceMap from new to old localFaces
521  (
522  const UList<bool>& include,
523  labelList& pointMap,
525  ) const;
526 
527  //- Return a new surface subsetted on the selected faces.
528  //
529  // \param[in] include the faces to select
530  // \param[out] pointMap from subsetMeshMap
531  // \param[out] faceMap from subsetMeshMap
533  (
534  const bitSet& include,
535  labelList& pointMap,
537  ) const;
538 
539  //- Return a new surface subsetted on the selected faces.
540  //
541  // \param[in] include the faces to select
542  triSurface subsetMesh(const UList<bool>& include) const;
543 
544  //- Return a new surface subsetted on the selected faces.
545  //
546  // \param[in] include the faces to select
547  triSurface subsetMesh(const bitSet& include) const;
548 
549  //- Return a new surface subsetted on the selected patch names
550  //
551  // \param[in] includeNames surface patch names to include
552  // \param[in] excludeNames surface patch names to exclude
553  //
554  // \see Foam::stringListOps::findMatching for details about matching
556  (
557  const wordRes& includeNames,
558  const wordRes& excludeNames = wordRes()
559  ) const;
560 
561  //- Swap the list of faces being addressed
562  void swapFaces(List<labelledTri>& faceLst);
563 
564  //- Alter contents by transferring (triangles, points) components.
565  // Patch information is small and therefore just copied.
566  void transfer(triSurface& surf);
567 
568  //- Alter contents by transferring (triangles, points) components.
569  // Patch information is small and therefore just copied.
571 
572 
573  // Write
574 
575  //- Write to Ostream in simple OpenFOAM format
576  void write(Ostream& os) const;
577 
578  //- Generic write routine (uses extension to determine type).
579  // The sort option may not have an effect.
580  void write(const fileName&, const bool sortByRegion = false) const;
581 
582  //- Generic write routine for given format type.
583  // If the format type is "", uses the file extension.
584  // The sort option may not have an effect.
585  void write
586  (
587  const fileName& filename,
588  const word& fileType,
589  const bool sortByRegion = false
590  ) const;
591 
592  //- Write to database
593  void write(const Time& d) const;
594 
595  //- Write some statistics
596  void writeStats(Ostream& os) const;
597 
598 
599  // Member Operators
600 
601  //- Copy assignment
602  void operator=(const triSurface& surf);
603 
604  //- Move assignment
605  void operator=(triSurface&& surf);
606 
607  //- Move assignment
609 
610 
611  // IOstream Operators
612 
613  friend Istream& operator>>(Istream& is, triSurface& s);
614  friend Ostream& operator<<(Ostream& os, const triSurface& s);
615 };
616 
617 
618 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
619 
620 } // End namespace Foam
621 
622 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
623 
624 #endif
625 
626 // ************************************************************************* //
Foam::triSurface::writeStats
void writeStats(Ostream &os) const
Write some statistics.
Definition: triSurfaceIO.C:353
Foam::triSurface::operator<<
friend Ostream & operator<<(Ostream &os, const triSurface &s)
Foam::triSurface::operator>>
friend Istream & operator>>(Istream &is, triSurface &s)
Foam::triSurface::subsetMesh
triSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
Definition: triSurface.C:840
surfacePatchList.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::triSurface::ClassName
ClassName("triSurface")
Runtime type information.
geometricSurfacePatchList.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::faceMap
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Definition: blockMeshMergeTopological.C:94
boolList.H
Foam::triSurface::clearOut
void clearOut()
Definition: triSurface.C:566
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::triSurface::Sf
const vectorField & Sf() const
Face area vectors (normals)
Definition: triSurface.H:429
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::triSurface::markZone
void markZone(const boolList &borderEdge, const label facei, const label currentZone, labelList &faceZone) const
Fill faceZone with currentZone for every face reachable.
Definition: triSurface.C:698
PatchTools.H
Foam::triSurface::relativeFilePath
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Return fileName.
Definition: triSurfaceIO.C:111
Foam::triSurface::triFaceFaces
void triFaceFaces(List< face > &plainFaceList) const
Create a list of faces from the triFaces.
Definition: triSurface.C:684
Foam::triSurface::subsetMeshMap
void subsetMeshMap(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Create mappings for a sub-surface.
Definition: triSurface.H:505
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::triSurface::canReadType
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
Definition: triSurfaceIO.C:75
Foam::triSurface::clearPatchMeshAddr
void clearPatchMeshAddr()
Definition: triSurface.C:560
Foam::triSurface::patches
const geometricSurfacePatchList & patches() const
Definition: triSurface.H:399
Foam::HashSet< word >
bitSet.H
Foam::triSurface::~triSurface
virtual ~triSurface()
Destructor.
Definition: triSurface.C:544
Foam::triSurface::patches
geometricSurfacePatchList & patches()
Definition: triSurface.H:404
Foam::triSurface::Cf
const vectorField & Cf() const
Face centres.
Definition: triSurface.H:441
Foam::triSurface::swapFaces
void swapFaces(List< labelledTri > &faceLst)
Swap the list of faces being addressed.
Definition: triSurface.C:914
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::triSurface::checkFile
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
Definition: triSurfaceIO.C:122
Foam::triSurface::writeTypes
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
Definition: triSurfaceIO.C:58
Foam::triSurface::scalePoints
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
Definition: triSurface.C:638
Foam::triSurface::checkTriangles
void checkTriangles(const bool verbose)
Check/remove duplicate/degenerate triangles.
Definition: triSurface.C:182
Foam::triSurface::movePoints
virtual void movePoints(const pointField &pts)
Move points.
Definition: triSurface.C:612
Foam::Field< vector >
PrimitivePatch.H
Foam::triSurface::write
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
Definition: triSurfaceIO.C:336
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:76
Foam::triSurface::swapPoints
virtual void swapPoints(pointField &pts)
Swap points. Similar to movePoints, but returns the old points.
Definition: triSurface.C:625
Foam::faceZone
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:65
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::PrimitivePatch<::Foam::List< labelledTri >, pointField >::faceAreas
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
Definition: PrimitivePatch.C:396
Foam::sort
void sort(UList< T > &a)
Definition: UList.C:254
Foam::triSurface::transfer
void transfer(triSurface &surf)
Alter contents by transferring (triangles, points) components.
Definition: triSurface.C:922
Foam::triSurface::triSurface
triSurface()
Default construct.
Definition: triSurface.C:432
Foam::triSurface::New
static autoPtr< triSurface > New(const fileName &name, const word &fileType)
Read construct from filename with given file type.
Definition: triSurfaceNew.C:37
Foam::triSurface::storedPoints
pointField & storedPoints()
Non-const access to global points.
Definition: triSurface.H:189
Foam::triSurface::sortedZones
List< surfZone > sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
Definition: triSurface.C:670
HashSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::PrimitivePatch<::Foam::List< labelledTri >, pointField >::points
const Field< point_type > & points() const
Return reference to global points.
Definition: PrimitivePatch.H:305
Foam::triSurface::clearTopology
void clearTopology()
Definition: triSurface.C:552
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::triSurface::point_type
point point_type
The point type (same as the underlying PrimitivePatch)
Definition: triSurface.H:212
Foam::triSurface::canWriteType
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
Definition: triSurfaceIO.C:87
Foam::triSurface::edgeOwner
const labelList & edgeOwner() const
If 2 face neighbours: label of face where ordering of edge.
Definition: triSurface.C:601
Foam::triSurface::cleanup
void cleanup(const bool verbose)
Remove non-valid triangles.
Definition: triSurface.C:655
pointField.H
Foam::triSurface::surfFaces
const List< labelledTri > & surfFaces() const
Return const access to the faces.
Definition: triSurface.H:410
Foam::triSurface::findFile
static fileName findFile(const IOobject &io, const bool isGlobal=true)
Definition: triSurfaceIO.C:143
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::triSurface::markZones
label markZones(const boolList &borderEdge, labelList &faceZone) const
(size and) fills faceZone with zone of face. Zone is area
Definition: triSurface.C:757
Foam::triSurface::magSf
const scalarField & magSf() const
Face area magnitudes.
Definition: triSurface.H:435
Foam::triSurface::swap
void swap(triSurface &surf)
Definition: triSurface.C:574
Foam::triSurface::BoundaryMesh
bool BoundaryMesh
Placeholder only, but do not remove - it is needed for GeoMesh.
Definition: triSurface.H:206
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::List< geometricSurfacePatch >
Foam::triSurface::storedFaces
List< labelledTri > & storedFaces()
Non-const access to the faces.
Definition: triSurface.H:195
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::labelledTri
Triangle with additional region number.
Definition: labelledTri.H:57
Foam::triSurface::readTypes
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
Definition: triSurfaceIO.C:40
Foam::PrimitivePatch<::Foam::List< labelledTri >, pointField >::magFaceAreas
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
Definition: PrimitivePatch.C:409
Foam::triSurface::face_type
labelledTri face_type
The face type (same as the underlying PrimitivePatch)
Definition: triSurface.H:209
Foam::triSurface::sortedEdgeFaces
const labelListList & sortedEdgeFaces() const
Return edge-face addressing sorted (for edges with more than.
Definition: triSurface.C:590
labelledTri.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::PatchTools::subsetMap
static void subsetMap(const PrimitivePatch< FaceList, PointField > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap)
Determine the mapping for a sub-patch.
Definition: PatchToolsSearch.C:142
Foam::triSurface::operator=
void operator=(const triSurface &surf)
Copy assignment.
Definition: triSurface.C:960
triFaceList.H
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
Foam::PrimitivePatch<::Foam::List< labelledTri >, pointField >::faceCentres
const Field< point_type > & faceCentres() const
Return face centres for patch.
Definition: PrimitivePatch.C:380
Foam::triSurface::triSurfInstance
static fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
Definition: triSurface.C:73
Foam::triSurface::canRead
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
Definition: triSurfaceIO.C:99
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85
Foam::triSurface::checkEdges
void checkEdges(const bool verbose)
Check triply (or more) connected edges.
Definition: triSurface.C:301