MeshedSurface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::MeshedSurface
29 
30 Description
31  A surface geometry mesh with zone information, not to be confused with
32  the similarly named surfaceMesh, which actually refers to the cell faces
33  of a volume mesh.
34 
35  A MeshedSurface can have zero or more surface zones (roughly equivalent
36  to faceZones for a polyMesh). If surface zones are defined, they must
37  be contiguous and cover all of the faces.
38 
39  The MeshedSurface is intended for surfaces from a variety of sources.
40  - A set of points and faces without any surface zone information.
41  - A set of points and faces with randomly ordered zone information.
42  This could arise, for example, from reading external file formats
43  such as STL, etc.
44 
45 SourceFiles
46  MeshedSurface.C
47  MeshedSurfaceCore.C
48  MeshedSurfaceIO.C
49  MeshedSurfaceNew.C
50  MeshedSurfaceZones.C
51  MeshedSurfaces.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef Foam_MeshedSurface_H
56 #define Foam_MeshedSurface_H
57 
58 #include "primitivePatch.H"
59 #include "PatchTools.H"
60 #include "face.H"
61 #include "labelledTri.H"
62 #include "bitSet.H"
63 #include "HashSet.H"
64 #include "surfZoneList.H"
65 #include "surfaceFormatsCore.H"
66 #include "runTimeSelectionTables.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 // Forward Declarations
75 class Time;
76 class surfMesh;
77 class polyBoundaryMesh;
78 
79 template<class Face> class MeshedSurface;
80 template<class Face> class MeshedSurfaceProxy;
81 template<class Face> class UnsortedMeshedSurface;
82 
83 template<class Face>
85 template<class Face>
86 Ostream& operator<<(Ostream&, const MeshedSurface<Face>&);
87 
88 /*---------------------------------------------------------------------------*\
89  Class MeshedSurface Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 template<class Face>
93 class MeshedSurface
94 :
95  public PrimitivePatch<::Foam::List<Face>, pointField>,
97 {
98  // Friends, regardless of face representations
99  template<class Face2> friend class MeshedSurface;
100  template<class Face2> friend class UnsortedMeshedSurface;
101 
102  // Friendship with surfMesh is needed for transferring
103  friend class surfMesh;
104 
105 
106 private:
107 
108  // Private Typedefs (convenience)
109 
110  //- Internal mesh storage type
113 
116 
117 
118  // Private Data
119 
120  //- Face ids.
121  // If these exist, they are typically arise from reading a mesh
122  // format from another CAE software (eg, NASTRAN, STARCD, ...)
123  labelList faceIds_;
124 
125  //- Zone information
126  // (face ordering nFaces/startFace only used during reading/writing)
127  surfZoneList zones_;
128 
129 
130  // Private Member Functions
131 
132  //- Read/construct from Istream
133  Istream& read(Istream& is);
134 
135  //- Write to Ostream
136  Ostream& write(Ostream& os) const;
137 
138  //- Return a new surface using specified pointMap and faceMap
139  //
140  // \param[in] pointMap from subsetMeshMap
141  // \param[in] faceMap from subsetMeshMap
142  MeshedSurface subsetMeshImpl
143  (
144  const labelList& pointMap,
145  const labelList& faceMap
146  ) const;
147 
148 
149 protected:
150 
151  // Protected Member Functions
152 
153  //- Transfer points/zones from 'face' to other other shapes.
154  // Eg, transcribe face to triFace, or face -> labelledTri, including
155  // any addZonesToFaces adjustment.
156  // No general form, only specializations.
157  void transcribe(MeshedSurface<face>& surf);
158 
159  //- Sanity check/resizing on zones.
160  // Adjust zones so that they cover the number of faces
161  // The last zone will be extended as needed
162  void checkZones(const bool verbose = true);
163 
164  //- Non-const access to global points
166  {
167  return const_cast<pointField&>(MeshReference::points());
168  }
169 
170  //- Non-const access to the faces
172  {
173  return static_cast<List<Face>&>(*this);
174  }
175 
176  //- Non-const access to face ids
178  {
179  return faceIds_;
180  }
181 
182  //- Non-const access to the zones
184  {
185  return zones_;
186  }
187 
188  //- Sort faces by zones and store sorted faces
189  void sortFacesAndStore
190  (
191  DynamicList<Face>& unsortedFaces,
192  DynamicList<label>& zoneIds,
193  DynamicList<label>& elemIds,
194  bool sorted
195  );
196 
197  //- Set new zones from faceMap
198  virtual void remapFaces(const labelUList& faceMapNewToOld);
200 
201 public:
202 
203  // Public Typedefs
204 
205  //- The face type (same as the underlying PrimitivePatch)
206  typedef Face face_type;
208  //- The point type (same as the underlying PrimitivePatch)
209  typedef point point_type;
210 
211 
212  //- Declare type-name (with debug switch)
213  ClassName("MeshedSurface");
214 
215 
216  // Static Functions
217 
218  //- Known readable file-types, without friends or proxies
219  static wordHashSet readTypes();
220 
221  //- Known writable file-types, without friends or proxies
222  static wordHashSet writeTypes();
223 
224  //- Can we read this file format? Also checks friend types.
225  static bool canReadType(const word& fileType, bool verbose=false);
226 
227  //- Can we write this file format? Also checks proxy types.
228  static bool canWriteType(const word& fileType, bool verbose=false);
229 
230  //- Can we read this file format?
231  static bool canRead(const fileName& name, bool verbose=false);
232 
233 
234  // Constructors
235 
236  //- Default construct, an empty surface
237  MeshedSurface();
238 
239  //- Copy construct
240  MeshedSurface(const MeshedSurface& surf);
242  //- Copy construct from an UnsortedMeshedSurface
244 
245  //- Move construct
247 
248  //- Move construct from an UnsortedMeshedSurface
250 
251  //- Copy construct from components (points, faces, zones).
253  (
254  const pointField& pointLst,
255  const UList<Face>& faceLst,
256  const UList<surfZone>& zoneLst
257  );
258 
259  //- Move construct from components (points, faces).
260  // Zone information is fairly lightweight and is copied.
262  (
263  pointField&& pointLst,
264  List<Face>&& faceLst,
265  const UList<surfZone>& zoneLst
266  );
267 
268  //- Copy construct from components (points, faces).
269  // Use zone information if available
271  (
272  const pointField& pointLst,
273  const UList<Face>& faceLst,
274  const labelUList& zoneSizes = labelUList(),
275  const UList<word>& zoneNames = UList<word>()
276  );
277 
278  //- Move construct from components (points, faces).
279  // Use zone information if available
281  (
282  pointField&& pointLst,
283  List<Face>&& faceLst,
284  const labelUList& zoneSizes = labelUList(),
285  const UList<word>& zoneNames = UList<word>()
286  );
287 
288  //- Construct from a boundary mesh with local points/faces
290  (
291  const polyBoundaryMesh& bMesh,
292  const bool globalPoints = false
293  );
294 
295  //- Construct from a surfMesh
296  explicit MeshedSurface(const surfMesh& mesh);
297 
298  //- Construct from file name (uses extension to determine type)
299  explicit MeshedSurface(const fileName& name);
300 
301  //- Construct from file name and given file type
302  // If the format type is "", uses the file extension.
303  explicit MeshedSurface(const fileName& name, const word& fileType);
304 
305  //- Construct from Istream
306  explicit MeshedSurface(Istream& is);
307 
308  //- Construct from database (as surfMesh) with default name
309  explicit MeshedSurface(const Time& runTime);
310 
311  //- Construct from database (as surfMesh) with given surface name
312  MeshedSurface(const Time& runTime, const word& surfName);
313 
314  //- Read construct using IO to find the file location.
315  // Dictionary may contain the following entries:
316  // - \c file = alternative file name (default is dictionary name)
317  // - \c fileType = file format (default is from file extension)
318  // - \c scale (eg, 0.001: mm to m)
319  // .
321  (
322  const IOobject& io,
323  const dictionary& dict,
324  const bool isGlobal = true
325  );
326 
327 
328  // Declare run-time constructor selection table
329 
331  (
332  autoPtr,
335  (
336  const fileName& name
337  ),
338  (name)
339  );
340 
341 
342  // Selectors
343 
344  //- Read construct from filename with given file type
345  //
346  // \note Use mandatory=false if support for the file type
347  // is optional (the file still needs to exist!).
349  (
350  const fileName& name,
351  const word& fileType,
352  bool mandatory = true
353  );
354 
355  //- Read construct from filename (file type implicit from extension)
356  static autoPtr<MeshedSurface> New(const fileName& name);
357 
358 
359  //- Destructor
360  virtual ~MeshedSurface();
361 
362 
363  // Member Function Selectors
364 
366  (
367  void,
369  write,
371  (
372  const fileName& name,
373  const MeshedSurface<Face>& surf,
374  IOstreamOption streamOpt,
375  const dictionary& options
376  ),
377  (name, surf, streamOpt, options)
378  );
379 
380  //- Write to file, selecting writer based on its extension
381  static void write
382  (
383  const fileName& name,
384  const MeshedSurface<Face>& surf,
385  IOstreamOption streamOpt = IOstreamOption(),
386  const dictionary& options = dictionary::null
387  );
388 
389  //- Write to file, selecting writer based on the given extension
390  static void write
391  (
392  const fileName& name,
393  const word& fileType,
394  const MeshedSurface<Face>& surf,
395  IOstreamOption streamOpt = IOstreamOption(),
396  const dictionary& options = dictionary::null
397  );
398 
399 
400  // Member Functions
401 
402  // Access
403 
404  //- The surface size is the number of faces
405  label size() const
406  {
407  return MeshReference::size();
408  }
409 
410  //- Return const access to the faces
411  const List<Face>& surfFaces() const
412  {
413  return static_cast<const List<Face>&>(*this);
414  }
415 
416  //- Return const access to faces ids
417  // If these exist, they are typically arise from reading a mesh
418  // format from another CAE software (eg, NASTRAN, STARCD, ...)
419  const labelList& faceIds() const
420  {
421  return faceIds_;
422  }
423 
424  //- Const access to the surface zones.
425  // If zones are defined, they must be contiguous and cover the
426  // entire surface
427  const surfZoneList& surfZones() const
428  {
429  return zones_;
430  }
431 
432  //- Face area vectors (normals)
433  const vectorField& Sf() const
434  {
435  return MeshReference::faceAreas();
436  }
437 
438  //- Face area magnitudes
439  const scalarField& magSf() const
440  {
442  }
443 
444  //- Face centres
445  const vectorField& Cf() const
446  {
448  }
449 
450 
451  // Edit
452 
453  //- Clear all storage
454  virtual void clear();
455 
456 
457  //- Add surface zones
458  virtual void addZones
459  (
460  const UList<surfZone>&,
461  const bool cullEmpty=false
462  );
463 
464  //- Add surface zones
465  virtual void addZones
466  (
467  const labelUList& sizes,
468  const UList<word>& names,
469  const bool cullEmpty=false
470  );
471 
472  //- Add surface zones
473  virtual void addZones
474  (
475  const labelUList& sizes,
476  const bool cullEmpty=false
477  );
478 
479  //- Propagate zone information on face regions.
480  // Normally a no-op, only used by the labelledTri specialization.
481  // Specializations return true, others return false.
482  bool addZonesToFaces();
483 
484 
485  //- Remove surface zones
486  virtual void removeZones();
487 
488 
489  //- Move points
490  virtual void movePoints(const pointField& newPoints);
491 
492  //- Scale points. A non-positive factor is ignored
493  virtual void scalePoints(const scalar scaleFactor);
494 
495  //- Remove invalid faces
496  virtual void cleanup(const bool verbose);
497 
498  //- Remove unused points and renumber faces in local visit order
499  //
500  // \param[out] pointMap from new to old points (optional)
501  virtual void compactPoints
502  (
503  labelList& pointMap = const_cast<labelList&>(labelList::null())
504  );
505 
506  virtual bool stitchFaces
507  (
508  const scalar tol=SMALL,
509  const bool verbose=false
510  );
511 
512  virtual bool checkFaces
513  (
514  const bool verbose=false
515  );
516 
517  //- Count number of triangles.
518  virtual label nTriangles() const;
519 
520  //- Count number of triangles, returning a face map of original ids.
521  // The faceMap is zero-sized when no triangulation would be needed.
522  virtual label nTriangles(labelList& faceMap) const;
523 
524  //- Triangulate in-place, returning the number of triangles added.
525  virtual label triangulate();
526 
527  //- Triangulate in-place, returning the number of triangles added
528  // and setting a map of original face Ids.
529  // The faceMap is zero-sized when no triangulation was done.
530  virtual label triangulate(labelList& faceMap);
532  //- Create mappings for a sub-surface
533  //
534  // \param[in] include the faces to select
535  // \param[out] pointMap from new to old localPoints
536  // \param[out] faceMap from new to old localFaces
537  template<class BoolListType>
538  void subsetMeshMap
539  (
540  const BoolListType& include,
541  labelList& pointMap,
543  ) const
544  {
545  PatchTools::subsetMap(*this, include, pointMap, faceMap);
546  }
548  //- Return a new surface subsetted on the selected faces.
549  //
550  // \param[in] include the faces to select
551  // \param[out] pointMap from new to old localPoints
552  // \param[out] faceMap from new to old localFaces
554  (
555  const UList<bool>& include,
556  labelList& pointMap,
558  ) const;
559 
560  //- Return a new surface subsetted on the selected faces.
561  //
562  // \param[in] include the faces to select
563  // \param[out] pointMap from new to old localPoints
564  // \param[out] faceMap from new to old localFaces
566  (
567  const bitSet& include,
568  labelList& pointMap,
570  ) const;
571 
572  //- Return a new surface subsetted on the selected faces.
573  //
574  // \param[in] include the faces to select
575  MeshedSurface subsetMesh(const UList<bool>& include) const;
576 
577  //- Return a new surface subsetted on the selected faces.
578  //
579  // \param[in] include the faces to select
580  MeshedSurface subsetMesh(const bitSet& include) const;
581 
582  //- Return a new surface subsetted on the selected zone names
583  //
584  // \param[in] includeNames surface zone names to include
585  // \param[in] excludeNames surface zone names to exclude
586  //
587  // \see Foam::stringListOps::findMatching for details about matching
589  (
590  const wordRes& includeNames,
591  const wordRes& excludeNames = wordRes()
592  ) const;
593 
594  //- Swap contents
595  void swap(MeshedSurface<Face>& surf);
596 
597  //- Transfer the components
598  void transfer(pointField& pointLst, List<Face>& faceLst);
599 
600  //- Transfer the contents of the argument and annul the argument
601  void transfer(MeshedSurface<Face>& surf);
602 
603  //- Transfer the contents of the argument and annul the argument
605 
606  //- Release (clear) geometry and return for reuse
608 
609  //- Swap the stored faces. Use with caution
610  void swapFaces(List<Face>& faces);
611 
612  //- Swap the stored points
614 
615 
616  // Read
617 
618  //- Read from file. Chooses reader based on explicit extension
619  bool read(const fileName& name, const word& fileType);
620 
621  //- Read from file. Chooses reader based on detected extension
622  virtual bool read(const fileName& name);
623 
624 
625  // Write
626 
627  void writeStats(Ostream& os) const;
628 
629  //- Generic write routine. Chooses writer based on extension.
630  virtual void write
631  (
632  const fileName& name,
633  IOstreamOption streamOpt = IOstreamOption(),
634  const dictionary& options = dictionary::null
635  ) const
636  {
637  write(name, *this, streamOpt, options);
638  }
639 
640  //- Generic write routine for given format type.
641  // If the format type is "", uses the file extension.
642  virtual void write
643  (
644  const fileName& name,
645  const word& fileType,
646  IOstreamOption streamOpt = IOstreamOption(),
647  const dictionary& options = dictionary::null
648  ) const
649  {
650  write(name, fileType, *this, streamOpt, options);
651  }
652 
653 
654  //- Write to database
655  void write
656  (
657  const Time& runTime,
658  const word& surfName = word::null
659  ) const;
660 
661 
662  // Member Operators
663 
664  //- Copy assignment
665  void operator=(const MeshedSurface<Face>& surf);
666 
667  //- Move assignment
668  void operator=(MeshedSurface<Face>&& surf);
669 
670  //- Conversion operator to MeshedSurfaceProxy
671  operator MeshedSurfaceProxy<Face>() const;
672 
673 
674  // IOstream Operators
675 
676  //- Read MeshedSurface from Istream.
677  // Avoid using to read/write file content (fragile).
678  friend Istream& operator>> <Face>
679  (
680  Istream& is,
681  MeshedSurface<Face>& surf
682  );
683 
685  //- Write MeshedSurface to Ostream.
686  // Avoid using to read/write file content (fragile).
687  friend Ostream& operator<< <Face>
688  (
689  Ostream& os,
690  const MeshedSurface<Face>& surf
691  );
692 };
693 
694 
695 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
696 
697 //- Specialization for labelledTri.
698 template<>
700 
701 
702 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
703 
704 } // End namespace Foam
705 
706 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
707 
708 #ifdef NoRepository
709  #include "MeshedSurface.C"
710 #endif
711 
712 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
713 
714 #endif
715 
716 // ************************************************************************* //
A surface geometry mesh, in which the surface zone information is conveyed by the &#39;zoneId&#39; associated...
Definition: MeshedSurface.H:76
Face face_type
The face type (same as the underlying PrimitivePatch)
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
dictionary dict
virtual void compactPoints(labelList &pointMap=const_cast< labelList &>(labelList::null()))
Remove unused points and renumber faces in local visit order.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
A class for handling file names.
Definition: fileName.H:72
void transcribe(MeshedSurface< face > &surf)
Transfer points/zones from &#39;face&#39; to other other shapes.
declareMemberFunctionSelectionTable(void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const MeshedSurface< Face > &surf, IOstreamOption streamOpt, const dictionary &options),(name, surf, streamOpt, options))
point point_type
The point type (same as the underlying PrimitivePatch)
virtual ~MeshedSurface()
Destructor.
autoPtr< MeshedSurface< Face > > releaseGeom()
Release (clear) geometry and return for reuse.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const vectorField & Sf() const
Face area vectors (normals)
static autoPtr< MeshedSurface > New(const fileName &name, const word &fileType, bool mandatory=true)
Read construct from filename with given file type.
bool addZonesToFaces()
Propagate zone information on face regions.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
void writeStats(Ostream &os) const
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
Definition: MeshedSurface.C:87
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static wordHashSet writeTypes()
Known writable file-types, without friends or proxies.
Definition: MeshedSurface.C:45
virtual void clear()
Clear all storage.
engineTime & runTime
A simple container for options an IOstream can normally have.
static const List< label > & null()
Return a null List.
Definition: ListI.H:130
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
virtual void removeZones()
Remove surface zones.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
surfZoneList & storedZones()
Non-const access to the zones.
ClassName("MeshedSurface")
Declare type-name (with debug switch)
UList< label > labelUList
A UList of labels.
Definition: UList.H:78
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
declareRunTimeSelectionTable(autoPtr, MeshedSurface, fileExtension,(const fileName &name),(name))
void swapPoints(pointField &points)
Swap the stored points.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
A list of faces which address into the list of points.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
dynamicFvMesh & mesh
static wordHashSet readTypes()
Known readable file-types, without friends or proxies.
Definition: MeshedSurface.C:38
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
List< Face > & storedFaces()
Non-const access to the faces.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const scalarField & magSf() const
Face area magnitudes.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Istream & operator>>(Istream &, directionInfo &)
void swap(MeshedSurface< Face > &surf)
Swap contents.
const Field< point_type > & faceCentres() const
Return face centres for patch.
pointField & storedPoints()
Non-const access to global points.
virtual void cleanup(const bool verbose)
Remove invalid faces.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:474
virtual void movePoints(const pointField &newPoints)
Move points.
static const word null
An empty word.
Definition: word.H:84
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
MeshedSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
void operator=(const MeshedSurface< Face > &surf)
Copy assignment.
const Field< point_type > & points() const noexcept
Return reference to global points.
labelList & storedFaceIds()
Non-const access to face ids.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const labelList & faceIds() const
Return const access to faces ids.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
Definition: surfMesh.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label size() const noexcept
The number of elements in the container.
Definition: UList.H:671
const List< Face > & surfFaces() const
Return const access to the faces.
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
OBJstream os(runTime.globalPath()/outputName)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format? Also checks proxy types.
Definition: MeshedSurface.C:70
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:75
void sortFacesAndStore(DynamicList< Face > &unsortedFaces, DynamicList< label > &zoneIds, DynamicList< label > &elemIds, bool sorted)
Sort faces by zones and store sorted faces.
virtual label nTriangles() const
Count number of triangles.
Macros to ease declaration of member function selection tables.
Calculates points shared by more than two processor patches or cyclic patches.
Definition: globalPoints.H:98
label size() const
The surface size is the number of faces.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
void checkZones(const bool verbose=true)
Sanity check/resizing on zones.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format? Also checks friend types.
Definition: MeshedSurface.C:53
virtual bool checkFaces(const bool verbose=false)
const vectorField & Cf() const
Face centres.
List< surfZone > surfZoneList
List of surfZone.
Definition: surfZoneList.H:32
void transfer(pointField &pointLst, List< Face > &faceLst)
Transfer the components.
virtual void remapFaces(const labelUList &faceMapNewToOld)
Set new zones from faceMap.
static void subsetMap(const PrimitivePatch< FaceList, PointField > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap)
Determine the mapping for a sub-patch.
void swapFaces(List< Face > &faces)
Swap the stored faces. Use with caution.
virtual void addZones(const UList< surfZone > &, const bool cullEmpty=false)
Add surface zones.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
void subsetMeshMap(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Create mappings for a sub-surface.
Macros to ease declaration of run-time selection tables.
List< label > labelList
A List of labels.
Definition: List.H:62
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
const surfZoneList & surfZones() const
Const access to the surface zones.
A collection of helper functions for reading/writing surface formats.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Namespace for OpenFOAM.
MeshedSurface()
Default construct, an empty surface.
virtual bool stitchFaces(const scalar tol=SMALL, const bool verbose=false)