Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::MeshedSurface
29
30Description
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
45SourceFiles
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"
68
69// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70
71namespace Foam
72{
73
74// Forward Declarations
75class Time;
76class surfMesh;
78
79template<class Face> class MeshedSurface;
80template<class Face> class MeshedSurfaceProxy;
81template<class Face> class UnsortedMeshedSurface;
82
83template<class Face>
85template<class Face>
87
88/*---------------------------------------------------------------------------*\
89 Class MeshedSurface Declaration
90\*---------------------------------------------------------------------------*/
91
92template<class Face>
93class MeshedSurface
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
106private:
107
108 // Private Typedefs (convenience)
109
110 //- Internal mesh storage type
112 MeshReference;
113
114 typedef UnsortedMeshedSurface<Face> FriendType;
115 typedef MeshedSurfaceProxy<Face> ProxyType;
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
149protected:
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.
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
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
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
201public:
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
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);
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
238
239 //- Copy construct
240 MeshedSurface(const MeshedSurface& surf);
242 //- Copy construct from an UnsortedMeshedSurface
244
245 //- Move construct
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& pbm,
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 (
334 fileExtension,
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)
357
358
359 //- Destructor
360 virtual ~MeshedSurface();
361
362
363 // Member Function Selectors
364
366 (
367 void,
369 write,
370 fileExtension,
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
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 (
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
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
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
451 // Edit
452
453 //- Clear all storage
454 virtual void clear();
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
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
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
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;
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
616 // Read
617
618 //- Read from file. Chooses reader based on explicit extension
619 bool read(const fileName& name, const word& fileType);
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,
634 const dictionary& options = dictionary::null
635 ) const
636 {
637 write(name, *this, streamOpt, options);
639
640 //- Generic write routine for given format type.
641 // If the format type is "", uses the file extension.
642 virtual void write
643 (
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 }
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;
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,
682 );
684
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.
698template<>
700
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// ************************************************************************* //
const polyBoundaryMesh & pbm
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A simple container for options an IOstream can normally have.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
static const List< label > & null() noexcept
Definition List.H:138
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
MeshedSurface(UnsortedMeshedSurface< Face > &&surf)
Move construct from an UnsortedMeshedSurface.
Face face_type
The face type (same as the underlying PrimitivePatch).
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Generic write routine. Chooses writer based on extension.
MeshedSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
virtual void movePoints(const pointField &newPoints)
Move points.
surfZoneList & storedZones()
Non-const access to the zones.
MeshedSurface(pointField &&pointLst, List< Face > &&faceLst, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >())
Move construct from components (points, faces).
void transfer(MeshedSurface< Face > &surf)
Transfer the contents of the argument and annul the argument.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format? Also checks proxy types.
labelList & storedFaceIds()
Non-const access to face ids.
MeshedSurface subsetMesh(const bitSet &include) const
Return a new surface subsetted on the selected faces.
virtual void addZones(const labelUList &sizes, const bool cullEmpty=false)
Add surface zones.
const surfZoneList & surfZones() const
Const access to the surface zones.
MeshedSurface subsetMesh(const wordRes &includeNames, const wordRes &excludeNames=wordRes()) const
Return a new surface subsetted on the selected zone names.
MeshedSurface()
Default construct, an empty surface.
const vectorField & Sf() const
Face area vectors (normals).
MeshedSurface(const pointField &pointLst, const UList< Face > &faceLst, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >())
Copy construct from components (points, faces).
pointField & storedPoints()
Non-const access to global points.
virtual void addZones(const UList< surfZone > &, const bool cullEmpty=false)
Add surface zones.
static wordHashSet writeTypes()
Known writable file-types, without friends or proxies.
void operator=(MeshedSurface< Face > &&surf)
Move assignment.
const scalarField & magSf() const
Face area magnitudes.
static autoPtr< MeshedSurface > New(const fileName &name, const word &fileType, bool mandatory=true)
Read construct from filename with given file type.
MeshedSurface subsetMesh(const bitSet &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
MeshedSurface(MeshedSurface &&surf)
Move construct.
MeshedSurface(const fileName &name, const word &fileType)
Construct from file name and given file type.
virtual bool read(const fileName &name)
Read from file. Chooses reader based on detected extension.
MeshedSurface(const Time &runTime, const word &surfName)
Construct from database (as surfMesh) with given surface name.
virtual void remapFaces(const labelUList &faceMapNewToOld)
Set new zones from faceMap.
MeshedSurface subsetMesh(const UList< bool > &include) const
Return a new surface subsetted on the selected faces.
declareMemberFunctionSelectionTable(void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const MeshedSurface< Face > &surf, IOstreamOption streamOpt, const dictionary &options),(name, surf, streamOpt, options))
void transfer(pointField &pointLst, List< Face > &faceLst)
Transfer the components.
virtual void write(const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Generic write routine for given format type.
MeshedSurface(const Time &runTime)
Construct from database (as surfMesh) with default name.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format? Also checks friend types.
ClassName("MeshedSurface")
Declare type-name (with debug switch).
MeshedSurface(const fileName &name)
Construct from file name (uses extension to determine type).
MeshedSurface(const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst)
Copy construct from components (points, faces, zones).
void transfer(UnsortedMeshedSurface< Face > &surf)
Transfer the contents of the argument and annul the argument.
virtual void cleanup(const bool verbose)
Remove invalid faces.
bool read(const fileName &name, const word &fileType)
Read from file. Chooses reader based on explicit extension.
void write(const Time &runTime, const word &surfName=word::null) const
Write to database.
virtual ~MeshedSurface()
Destructor.
declareRunTimeSelectionTable(autoPtr, MeshedSurface, fileExtension,(const fileName &name),(name))
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
void swapPoints(pointField &points)
Swap the stored points.
MeshedSurface(const IOobject &io, const dictionary &dict, const bool isGlobal=true)
Read construct using IO to find the file location.
virtual void compactPoints(labelList &pointMap=const_cast< labelList & >(labelList::null()))
Remove unused points and renumber faces in local visit order.
const vectorField & Cf() const
Face centres.
MeshedSurface(const MeshedSurface &surf)
Copy construct.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
void checkZones(const bool verbose=true)
Sanity check/resizing on zones.
label size() const
The surface size is the number of faces.
const labelList & faceIds() const
Return const access to faces ids.
void sortFacesAndStore(DynamicList< Face > &unsortedFaces, DynamicList< label > &zoneIds, DynamicList< label > &elemIds, bool sorted)
Sort faces by zones and store sorted faces.
const List< Face > & surfFaces() const
Return const access to the faces.
MeshedSurface(const UnsortedMeshedSurface< Face > &surf)
Copy construct from an UnsortedMeshedSurface.
MeshedSurface(const polyBoundaryMesh &pbm, const bool globalPoints=false)
Construct from a boundary mesh with local points/faces.
MeshedSurface(Istream &is)
Construct from Istream.
virtual label triangulate(labelList &faceMap)
Triangulate in-place, returning the number of triangles added.
virtual void addZones(const labelUList &sizes, const UList< word > &names, const bool cullEmpty=false)
Add surface zones.
void subsetMeshMap(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Create mappings for a sub-surface.
autoPtr< MeshedSurface< Face > > releaseGeom()
Release (clear) geometry and return for reuse.
virtual label nTriangles() const
Count number of triangles.
List< Face > & storedFaces()
Non-const access to the faces.
void writeStats(Ostream &os) const
void transcribe(MeshedSurface< face > &surf)
Transfer points/zones from 'face' to other other shapes.
void swap(MeshedSurface< Face > &surf)
Swap contents.
virtual void clear()
Clear all storage.
static void write(const fileName &name, const word &fileType, const MeshedSurface< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, selecting writer based on the given extension.
static void write(const fileName &name, const MeshedSurface< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, selecting writer based on its extension.
static autoPtr< MeshedSurface > New(const fileName &name)
Read construct from filename (file type implicit from extension).
point point_type
The point type (same as the underlying PrimitivePatch).
virtual bool stitchFaces(const scalar tol=SMALL, const bool verbose=false)
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
friend class MeshedSurface
virtual bool checkFaces(const bool verbose=false)
virtual label nTriangles(labelList &faceMap) const
Count number of triangles, returning a face map of original ids.
void operator=(const MeshedSurface< Face > &surf)
Copy assignment.
MeshedSurface(pointField &&pointLst, List< Face > &&faceLst, const UList< surfZone > &zoneLst)
Move construct from components (points, faces).
virtual void removeZones()
Remove surface zones.
void swapFaces(List< Face > &faces)
Swap the stored faces. Use with caution.
MeshedSurface(const surfMesh &mesh)
Construct from a surfMesh.
static wordHashSet readTypes()
Known readable file-types, without friends or proxies.
bool addZonesToFaces()
Propagate zone information on face regions.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
static void subsetMap(const PrimitivePatch< FaceList, PointField > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap)
Determine the mapping for a sub-patch.
PrimitivePatch(const ::Foam::List< Face > &faces, const pointField &points)
const Field< point_type > & points() const noexcept
const Field< point_type > & faceAreas() const
const Field< point_type > & faceCentres() const
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
label size() const noexcept
The number of elements in the container.
Definition UList.H:706
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition dictionary.H:487
A collection of helper functions for reading/writing surface formats.
A class for handling file names.
Definition fileName.H:75
Calculates points shared by more than two processor patches or cyclic patches.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
Definition surfMesh.H:67
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
A class for handling words, derived from Foam::string.
Definition word.H:66
static const word null
An empty word.
Definition word.H:84
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
dynamicFvMesh & mesh
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
const auto & io
auto & names
Macros to ease declaration of member function selection tables.
#define declareMemberFunctionSelectionTable(returnType, baseType, funcName, argNames, argList, parListUnused)
Declare a run-time member-function selection (variables and adder classes).
Namespace for OpenFOAM.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition HashSet.H:80
List< label > labelList
A List of labels.
Definition List.H:62
List< surfZone > surfZoneList
List of surfZone.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
Definition point.H:37
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
runTime write()
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict