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-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::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  //- Basic sanity check on zones
163  void checkZones();
164 
165  //- Non-const access to global points
167  {
168  return const_cast<pointField&>(MeshReference::points());
169  }
170 
171  //- Non-const access to the faces
173  {
174  return static_cast<List<Face>&>(*this);
175  }
176 
177  //- Non-const access to face ids
179  {
180  return faceIds_;
181  }
182 
183  //- Non-const access to the zones
185  {
186  return zones_;
187  }
188 
189  //- Sort faces by zones and store sorted faces
190  void sortFacesAndStore
191  (
192  DynamicList<Face>& unsortedFaces,
193  DynamicList<label>& zoneIds,
194  DynamicList<label>& elemIds,
195  bool sorted
196  );
197 
198  //- Set new zones from faceMap
199  virtual void remapFaces(const labelUList& faceMapNewToOld);
200 
201 
202 public:
203 
204  // Public Typedefs
205 
206  //- The face type (same as the underlying PrimitivePatch)
207  typedef Face face_type;
208 
209  //- The point type (same as the underlying PrimitivePatch)
210  typedef point point_type;
211 
212 
213  //- Declare type-name (with debug switch)
214  ClassName("MeshedSurface");
215 
216 
217  // Static Functions
218 
219  //- Known readable file-types, without friends or proxies
220  static wordHashSet readTypes();
221 
222  //- Known writable file-types, without friends or proxies
223  static wordHashSet writeTypes();
224 
225  //- Can we read this file format? Also checks friend types.
226  static bool canReadType(const word& fileType, bool verbose=false);
227 
228  //- Can we write this file format? Also checks proxy types.
229  static bool canWriteType(const word& fileType, bool verbose=false);
230 
231  //- Can we read this file format?
232  static bool canRead(const fileName& name, bool verbose=false);
233 
234 
235  // Constructors
236 
237  //- Default construct, an empty surface
238  MeshedSurface();
239 
240  //- Copy construct
241  MeshedSurface(const MeshedSurface& surf);
242 
243  //- Copy construct from an UnsortedMeshedSurface
245 
246  //- Move construct
248 
249  //- Move construct from an UnsortedMeshedSurface
251 
252  //- Copy construct from components (points, faces, zones).
254  (
255  const pointField& pointLst,
256  const UList<Face>& faceLst,
257  const UList<surfZone>& zoneLst
258  );
259 
260  //- Move construct from components (points, faces).
261  // Zone information is fairly lightweight and is copied.
263  (
264  pointField&& pointLst,
265  List<Face>&& faceLst,
266  const UList<surfZone>& zoneLst
267  );
268 
269  //- Copy construct from components (points, faces).
270  // Use zone information if available
272  (
273  const pointField& pointLst,
274  const UList<Face>& faceLst,
275  const labelUList& zoneSizes = labelUList(),
276  const UList<word>& zoneNames = UList<word>()
277  );
278 
279  //- Move construct from components (points, faces).
280  // Use zone information if available
282  (
283  pointField&& pointLst,
284  List<Face>&& faceLst,
285  const labelUList& zoneSizes = labelUList(),
286  const UList<word>& zoneNames = UList<word>()
287  );
288 
289  //- Construct from a boundary mesh with local points/faces
291  (
292  const polyBoundaryMesh& bMesh,
293  const bool globalPoints = false
294  );
295 
296  //- Construct from a surfMesh
297  explicit MeshedSurface(const surfMesh& mesh);
298 
299  //- Construct from file name (uses extension to determine type)
300  explicit MeshedSurface(const fileName& name);
301 
302  //- Construct from file name and given file type
303  // If the format type is "", uses the file extension.
304  explicit MeshedSurface(const fileName& name, const word& fileType);
305 
306  //- Construct from Istream
307  explicit MeshedSurface(Istream& is);
308 
309  //- Construct from database (as surfMesh) with default name
310  explicit MeshedSurface(const Time& runTime);
311 
312  //- Construct from database (as surfMesh) with given surface name
313  MeshedSurface(const Time& runTime, const word& surfName);
314 
315  //- Read construct using IO to find the file location.
316  // Dictionary may contain the following entries:
317  // - \c file = alternative file name (default is dictionary name)
318  // - \c fileType = file format (default is from file extension)
319  // - \c scale (eg, 0.001: mm to m)
320  // .
322  (
323  const IOobject& io,
324  const dictionary& dict,
325  const bool isGlobal = true
326  );
327 
328 
329  // Declare run-time constructor selection table
330 
332  (
333  autoPtr,
336  (
337  const fileName& name
338  ),
339  (name)
340  );
341 
342 
343  // Selectors
344 
345  //- Read construct from filename with given file type
346  //
347  // \note Use mandatory=false if support for the file type
348  // is optional (the file still needs to exist!).
350  (
351  const fileName& name,
352  const word& fileType,
353  bool mandatory = true
354  );
355 
356  //- Read construct from filename (file type implicit from extension)
357  static autoPtr<MeshedSurface> New(const fileName& name);
358 
359 
360  //- Destructor
361  virtual ~MeshedSurface();
362 
363 
364  // Member Function Selectors
365 
367  (
368  void,
370  write,
372  (
373  const fileName& name,
374  const MeshedSurface<Face>& surf,
375  IOstreamOption streamOpt,
376  const dictionary& options
377  ),
378  (name, surf, streamOpt, options)
379  );
380 
381  //- Write to file, selecting writer based on its extension
382  static void write
383  (
384  const fileName& name,
385  const MeshedSurface<Face>& surf,
386  IOstreamOption streamOpt = IOstreamOption(),
387  const dictionary& options = dictionary::null
388  );
389 
390  //- Write to file, selecting writer based on the given extension
391  static void write
392  (
393  const fileName& name,
394  const word& fileType,
395  const MeshedSurface<Face>& surf,
396  IOstreamOption streamOpt = IOstreamOption(),
397  const dictionary& options = dictionary::null
398  );
399 
400 
401  // Member Functions
402 
403  // Access
404 
405  //- The surface size is the number of faces
406  label size() const
407  {
408  return MeshReference::size();
409  }
410 
411  //- Return const access to the faces
412  const List<Face>& surfFaces() const
413  {
414  return static_cast<const List<Face>&>(*this);
415  }
416 
417  //- Return const access to faces ids
418  // If these exist, they are typically arise from reading a mesh
419  // format from another CAE software (eg, NASTRAN, STARCD, ...)
420  const labelList& faceIds() const
421  {
422  return faceIds_;
423  }
424 
425  //- Const access to the surface zones.
426  // If zones are defined, they must be contiguous and cover the
427  // entire surface
428  const surfZoneList& surfZones() const
429  {
430  return zones_;
431  }
432 
433  //- Face area vectors (normals)
434  const vectorField& Sf() const
435  {
436  return MeshReference::faceAreas();
437  }
438 
439  //- Face area magnitudes
440  const scalarField& magSf() const
441  {
443  }
444 
445  //- Face centres
446  const vectorField& Cf() const
447  {
449  }
450 
451 
452  // Edit
453 
454  //- Clear all storage
455  virtual void clear();
456 
457 
458  //- Add surface zones
459  virtual void addZones
460  (
461  const UList<surfZone>&,
462  const bool cullEmpty=false
463  );
464 
465  //- Add surface zones
466  virtual void addZones
467  (
468  const labelUList& sizes,
469  const UList<word>& names,
470  const bool cullEmpty=false
471  );
472 
473  //- Add surface zones
474  virtual void addZones
475  (
476  const labelUList& sizes,
477  const bool cullEmpty=false
478  );
479 
480  //- Propagate zone information on face regions.
481  // Normally a no-op, only used by the labelledTri specialization.
482  // Specializations return true, others return false.
483  bool addZonesToFaces();
484 
485 
486  //- Remove surface zones
487  virtual void removeZones();
488 
489 
490  //- Move points
491  virtual void movePoints(const pointField& newPoints);
492 
493  //- Scale points. A non-positive factor is ignored
494  virtual void scalePoints(const scalar scaleFactor);
495 
496  //- Remove invalid faces
497  virtual void cleanup(const bool verbose);
498 
499  virtual bool stitchFaces
500  (
501  const scalar tol=SMALL,
502  const bool verbose=false
503  );
504 
505  virtual bool checkFaces
506  (
507  const bool verbose=false
508  );
509 
510  //- Count number of triangles.
511  virtual label nTriangles() const;
512 
513  //- Count number of triangles, returning a face map of original ids.
514  // The faceMap is zero-sized when no triangulation would be needed.
515  virtual label nTriangles(labelList& faceMap) const;
516 
517  //- Triangulate in-place, returning the number of triangles added.
518  virtual label triangulate();
519 
520  //- Triangulate in-place, returning the number of triangles added
521  // and setting a map of original face Ids.
522  // The faceMap is zero-sized when no triangulation was done.
523  virtual label triangulate(labelList& faceMap);
524 
525  //- Create mappings for a sub-surface
526  //
527  // \param[in] include the faces to select
528  // \param[out] pointMap from new to old localPoints
529  // \param[out] faceMap from new to old localFaces
530  template<class BoolListType>
532  (
533  const BoolListType& include,
534  labelList& pointMap,
536  ) const
537  {
538  PatchTools::subsetMap(*this, include, pointMap, faceMap);
539  }
540 
541  //- Return a new surface subsetted on the selected faces.
542  //
543  // \param[in] include the faces to select
544  // \param[out] pointMap from new to old localPoints
545  // \param[out] faceMap from new to old localFaces
547  (
548  const UList<bool>& include,
549  labelList& pointMap,
551  ) const;
552 
553  //- Return a new surface subsetted on the selected faces.
554  //
555  // \param[in] include the faces to select
556  // \param[out] pointMap from new to old localPoints
557  // \param[out] faceMap from new to old localFaces
559  (
560  const bitSet& include,
561  labelList& pointMap,
563  ) const;
564 
565  //- Return a new surface subsetted on the selected faces.
566  //
567  // \param[in] include the faces to select
568  MeshedSurface subsetMesh(const UList<bool>& include) const;
569 
570  //- Return a new surface subsetted on the selected faces.
571  //
572  // \param[in] include the faces to select
573  MeshedSurface subsetMesh(const bitSet& include) const;
574 
575  //- Return a new surface subsetted on the selected zone names
576  //
577  // \param[in] includeNames surface zone names to include
578  // \param[in] excludeNames surface zone names to exclude
579  //
580  // \see Foam::stringListOps::findMatching for details about matching
582  (
583  const wordRes& includeNames,
584  const wordRes& excludeNames = wordRes()
585  ) const;
586 
587  //- Swap contents
588  void swap(MeshedSurface<Face>& surf);
589 
590  //- Transfer the components
591  void transfer(pointField& pointLst, List<Face>& faceLst);
592 
593  //- Transfer the contents of the argument and annul the argument
594  void transfer(MeshedSurface<Face>& surf);
595 
596  //- Transfer the contents of the argument and annul the argument
598 
599  //- Release (clear) geometry and return for reuse
601 
602  //- Swap the stored faces. Use with caution
603  void swapFaces(List<Face>& faces);
604 
605  //- Swap the stored points
607 
608 
609  // Read
610 
611  //- Read from file. Chooses reader based on explicit extension
612  bool read(const fileName& name, const word& fileType);
613 
614  //- Read from file. Chooses reader based on detected extension
615  virtual bool read(const fileName& name);
616 
617 
618  // Write
619 
620  void writeStats(Ostream& os) const;
621 
622  //- Generic write routine. Chooses writer based on extension.
623  virtual void write
624  (
625  const fileName& name,
626  IOstreamOption streamOpt = IOstreamOption(),
627  const dictionary& options = dictionary::null
628  ) const
629  {
630  write(name, *this, streamOpt, options);
631  }
632 
633  //- Generic write routine for given format type.
634  // If the format type is "", uses the file extension.
635  virtual void write
636  (
637  const fileName& name,
638  const word& fileType,
639  IOstreamOption streamOpt = IOstreamOption(),
640  const dictionary& options = dictionary::null
641  ) const
642  {
643  write(name, fileType, *this, streamOpt, options);
644  }
645 
646 
647  //- Write to database
648  void write
649  (
650  const Time& runTime,
651  const word& surfName = word::null
652  ) const;
653 
654 
655  // Member Operators
656 
657  //- Copy assignment
658  void operator=(const MeshedSurface<Face>& surf);
659 
660  //- Move assignment
661  void operator=(MeshedSurface<Face>&& surf);
662 
663  //- Conversion operator to MeshedSurfaceProxy
664  operator MeshedSurfaceProxy<Face>() const;
665 
666 
667  // IOstream Operators
668 
669  //- Read MeshedSurface from Istream.
670  // Avoid using to read/write file content (fragile).
671  friend Istream& operator>> <Face>
672  (
673  Istream& is,
674  MeshedSurface<Face>& surf
675  );
676 
677 
678  //- Write MeshedSurface to Ostream.
679  // Avoid using to read/write file content (fragile).
680  friend Ostream& operator<< <Face>
681  (
682  Ostream& os,
683  const MeshedSurface<Face>& surf
684  );
685 };
686 
687 
688 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
689 
690 //- Specialization for labelledTri.
691 template<>
693 
694 
695 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
696 
697 } // End namespace Foam
698 
699 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
700 
701 #ifdef NoRepository
702  #include "MeshedSurface.C"
703 #endif
704 
705 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
706 
707 #endif
708 
709 // ************************************************************************* //
Foam::MeshedSurface::faceIds
const labelList & faceIds() const
Return const access to faces ids.
Definition: MeshedSurface.H:419
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:209
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:104
Foam::MeshedSurface::surfZones
const surfZoneList & surfZones() const
Const access to the surface zones.
Definition: MeshedSurface.H:427
Foam::MeshedSurface::~MeshedSurface
virtual ~MeshedSurface()
Destructor.
Definition: MeshedSurface.C:535
MeshedSurface.C
Foam::MeshedSurface::checkZones
void checkZones()
Basic sanity check on zones.
Definition: MeshedSurfaceZones.C:35
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
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:62
Foam::MeshedSurface::storedFaces
List< Face > & storedFaces()
Non-const access to the faces.
Definition: MeshedSurface.H:171
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
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:62
Foam::MeshedSurface::storedFaceIds
labelList & storedFaceIds()
Non-const access to face ids.
Definition: MeshedSurface.H:177
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:972
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:1260
Foam::MeshedSurface::storedPoints
pointField & storedPoints()
Non-const access to global points.
Definition: MeshedSurface.H:165
Foam::MeshedSurface::stitchFaces
virtual bool stitchFaces(const scalar tol=SMALL, const bool verbose=false)
Definition: MeshedSurface.C:650
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:1421
Foam::MeshedSurface::Sf
const vectorField & Sf() const
Face area vectors (normals)
Definition: MeshedSurface.H:433
face.H
Foam::MeshedSurface::surfFaces
const List< Face > & surfFaces() const
Return const access to the faces.
Definition: MeshedSurface.H:411
Foam::MeshedSurface::scalePoints
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
Definition: MeshedSurface.C:619
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:594
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 >
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:223
Foam::MeshedSurface::checkFaces
virtual bool checkFaces(const bool verbose=false)
Definition: MeshedSurface.C:745
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:385
Foam::MeshedSurface::face_type
Face face_type
The face type (same as the underlying PrimitivePatch)
Definition: MeshedSurface.H:206
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:183
Foam::MeshedSurface::magSf
const scalarField & magSf() const
Face area magnitudes.
Definition: MeshedSurface.H:439
Foam::MeshedSurface::transfer
void transfer(pointField &pointLst, List< Face > &faceLst)
Transfer the components.
Definition: MeshedSurface.C:1281
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::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::PrimitivePatch::faceAreas
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
Definition: PrimitivePatch.C:396
Foam::MeshedSurface::addZones
virtual void addZones(const UList< surfZone > &, const bool cullEmpty=false)
Add surface zones.
Definition: MeshedSurfaceZones.C:132
Foam::MeshedSurface::removeZones
virtual void removeZones()
Remove surface zones.
Definition: MeshedSurfaceZones.C:231
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:912
Foam::blockMeshTools::read
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:33
HashSet.H
Foam::MeshedSurface::swapPoints
void swapPoints(pointField &points)
Swap the stored points.
Definition: MeshedSurface.C:1377
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::points
const Field< point_type > & points() const
Return reference to global points.
Definition: PrimitivePatch.H:305
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:606
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:71
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:531
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:77
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:35
surfZoneList.H
Foam::PrimitivePatch::magFaceAreas
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
Definition: PrimitivePatch.C:409
Foam::MeshedSurface::writeTypes
static wordHashSet writeTypes()
Known writable file-types, without friends or proxies.
Definition: MeshedSurface.C:52
memberFunctionSelectionTables.H
Macros to enable the easy declaration of member function selection tables.
Foam::MeshedSurface::Cf
const vectorField & Cf() const
Face centres.
Definition: MeshedSurface.H:445
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:80
Foam::MeshedSurface::swapFaces
void swapFaces(List< Face > &faces)
Swap the stored faces. Use with caution.
Definition: MeshedSurface.C:1366
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::MeshedSurface::size
label size() const
The surface size is the number of faces.
Definition: MeshedSurface.H:405
surfaceFormatsCore.H
Foam::PrimitivePatch::faceCentres
const Field< point_type > & faceCentres() const
Return face centres for patch.
Definition: PrimitivePatch.C:380
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:1182
Foam::MeshedSurface::remapFaces
virtual void remapFaces(const labelUList &faceMapNewToOld)
Set new zones from faceMap.
Definition: MeshedSurface.C:545
Foam::MeshedSurface::releaseGeom
autoPtr< MeshedSurface< Face > > releaseGeom()
Release (clear) geometry and return for reuse.
Definition: MeshedSurface.C:1359
Foam::MeshedSurface::cleanup
virtual void cleanup(const bool verbose)
Remove invalid faces.
Definition: MeshedSurface.C:638
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85