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