Go to the documentation of this file.
67 template<
class Face>
class MeshedSurface;
70 Ostream&
operator<<(Ostream&,
const triSurface&);
98 mutable unique_ptr<labelListList> sortedEdgeFacesPtr_;
102 mutable unique_ptr<labelList> edgeOwnerPtr_;
108 void calcSortedEdgeFaces()
const;
111 void calcEdgeOwner()
const;
119 void setDefaultPatches();
125 const scalar tol = SMALL,
126 const bool verbose =
false
136 bool readSTL(
const fileName& filename,
bool forceBinary=
false);
143 const word& fileType,
144 const bool check =
true
149 void writeSTLASCII(
const fileName& filename,
const bool sort)
const;
152 void writeSTLBINARY(
const fileName& filename)
const;
155 void writeGTS(
const fileName& filename,
const bool sort)
const;
164 const label defaultRegion = 0
171 const label defaultRegion = 0
249 const bool isGlobal =
true
257 const bool isGlobal =
true
267 const bool isGlobal =
true
275 const bool isGlobal =
true
285 const bool isGlobal =
true
338 const scalar scaleFactor = -1
346 const word& fileType,
347 const scalar scaleFactor = -1
366 const bool isGlobal =
true
468 virtual void scalePoints(
const scalar scaleFactor);
477 void cleanup(
const bool verbose);
494 const label currentZone,
512 template<
class BoolListType>
515 const BoolListType& include,
588 void write(
const fileName&,
const bool sortByRegion =
false)
const;
596 const word& fileType,
597 const bool sortByRegion =
false
void writeStats(Ostream &os) const
Write some statistics.
friend Ostream & operator<<(Ostream &os, const triSurface &s)
const Field< point_type > & points() const noexcept
Return reference to global points.
friend Istream & operator>>(Istream &is, triSurface &s)
triSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
ClassName("triSurface")
Runtime type information.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static const List< T > & null()
Return a null List.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from Foam::string.
A class for handling file names.
const vectorField & Sf() const
Face area vectors (normals)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void markZone(const boolList &borderEdge, const label facei, const label currentZone, labelList &faceZone) const
Fill faceZone with currentZone for every face reachable.
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Return fileName.
void triFaceFaces(List< face > &plainFaceList) const
Create a list of faces from the triFaces.
void subsetMeshMap(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Create mappings for a sub-surface.
Istream & operator>>(Istream &, directionInfo &)
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
void clearPatchMeshAddr()
const geometricSurfacePatchList & patches() const noexcept
virtual ~triSurface()
Destructor.
const vectorField & Cf() const
Face centres.
void swapFaces(List< labelledTri > &faceLst)
Swap the list of faces being addressed.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
void checkTriangles(const bool verbose)
Check/remove duplicate/degenerate triangles.
static void check(const int retVal, const char *what)
virtual void movePoints(const pointField &pts)
Move points.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
Triangulated surface description with patch information.
virtual void swapPoints(pointField &pts)
Swap points. Similar to movePoints, but returns the old points.
A subset of mesh faces organised as a primitive patch.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
geometricSurfacePatchList & patches() noexcept
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
void transfer(triSurface &surf)
Alter contents by transferring (triangles, points) components.
triSurface()
Default construct.
static autoPtr< triSurface > New(const fileName &name, const word &fileType)
Read construct from filename with given file type.
pointField & storedPoints()
Non-const access to global points.
List< surfZone > sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
point point_type
The point type (same as the underlying PrimitivePatch)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
const labelList & edgeOwner() const
If 2 face neighbours: label of face where ordering of edge.
void cleanup(const bool verbose)
Remove non-valid triangles.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
label markZones(const boolList &borderEdge, labelList &faceZone) const
(size and) fills faceZone with zone of face. Zone is area
const scalarField & magSf() const
Face area magnitudes.
void swap(triSurface &surf)
bool BoundaryMesh
Placeholder only, but do not remove - it is needed for GeoMesh.
List< labelledTri > & storedFaces()
Non-const access to the faces.
const List< labelledTri > & surfFaces() const noexcept
Return const access to the faces.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A List of wordRe with additional matching capabilities.
A triFace with additional (region) index.
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
labelledTri face_type
The face type (same as the underlying PrimitivePatch)
const labelListList & sortedEdgeFaces() const
Return edge-face addressing sorted (for edges with more than.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void operator=(const triSurface &surf)
Copy assignment.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
void compactPoints(labelList &pointMap=const_cast< labelList & >(labelList::null()))
Remove unused points and renumber faces in local visit order.
const Field< point_type > & faceCentres() const
Return face centres for patch.
static fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
A list of faces which address into the list of points.
void checkEdges(const bool verbose)
Check triply (or more) connected edges.