55#ifndef Foam_MeshedSurface_H
56#define Foam_MeshedSurface_H
324 const bool isGlobal =
true
351 const word& fileType,
352 bool mandatory =
true
377 (
name, surf, streamOpt, options)
393 const word& fileType,
454 virtual void clear();
461 const bool cullEmpty=
false
469 const bool cullEmpty=
false
476 const bool cullEmpty=
false
493 virtual void scalePoints(
const scalar scaleFactor);
496 virtual void cleanup(
const bool verbose);
508 const scalar tol=SMALL,
509 const bool verbose=
false
514 const bool verbose=
false
537 template<
class BoolListType>
540 const BoolListType& include,
645 const word& fileType,
650 write(
name, fileType, *
this, streamOpt, options);
678 friend Istream&
operator>> <Face>
687 friend Ostream& operator<< <Face>
const polyBoundaryMesh & pbm
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
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)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static const List< label > & null() noexcept
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 UnsortedMeshedSurface
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,...
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
const Field< scalar > & magFaceAreas() const
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
The number of elements in the container.
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.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
A class for handling file names.
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...
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
OBJstream os(runTime.globalPath()/outputName)
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).
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.
List< label > labelList
A List of labels.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
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).