67template<
class Face>
class MeshedSurface;
70Ostream&
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
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of faces which address into the list of points.
const Field< point_type > & points() const noexcept
Return reference to global points.
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
const Field< point_type > & faceCentres() const
Return face centres for patch.
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
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...
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,...
A subset of mesh faces organised as a primitive patch.
A class for handling file names.
A triFace with additional (region) index.
Triangulated surface description with patch information.
geometricSurfacePatchList & patches() noexcept
static fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
triSurface()
Default construct.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
const vectorField & Sf() const
Face area vectors (normals)
List< surfZone > sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
pointField & storedPoints()
Non-const access to global points.
void transfer(triSurface &surf)
Alter contents by transferring (triangles, points) components.
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
label markZones(const boolList &borderEdge, labelList &faceZone) const
(size and) fills faceZone with zone of face. Zone is area
friend Istream & operator>>(Istream &is, triSurface &s)
const scalarField & magSf() const
Face area magnitudes.
void swap(triSurface &surf)
static autoPtr< triSurface > New(const fileName &name, const word &fileType)
Read construct from filename with given file type.
labelledTri face_type
The face type (same as the underlying PrimitivePatch)
void triFaceFaces(List< face > &plainFaceList) const
Create a list of faces from the triFaces.
triSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
void cleanup(const bool verbose)
Remove non-valid triangles.
const geometricSurfacePatchList & patches() const noexcept
void checkTriangles(const bool verbose)
Check/remove duplicate/degenerate triangles.
virtual void swapPoints(pointField &pts)
Swap points. Similar to movePoints, but returns the old points.
void checkEdges(const bool verbose)
Check triply (or more) connected edges.
List< labelledTri > & storedFaces()
Non-const access to the faces.
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.
void markZone(const boolList &borderEdge, const label facei, const label currentZone, labelList &faceZone) const
Fill faceZone with currentZone for every face reachable.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Return fileName.
friend Ostream & operator<<(Ostream &os, const triSurface &s)
const labelList & edgeOwner() const
If 2 face neighbours: label of face where ordering of edge.
void subsetMeshMap(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Create mappings for a sub-surface.
void writeStats(Ostream &os) const
Write some statistics.
virtual void movePoints(const pointField &pts)
Move points.
point point_type
The point type (same as the underlying PrimitivePatch)
void clearPatchMeshAddr()
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
const labelListList & sortedEdgeFaces() const
Return edge-face addressing sorted (for edges with more than.
const List< labelledTri > & surfFaces() const noexcept
Return const access to the faces.
void swapFaces(List< labelledTri > &faceLst)
Swap the list of faces being addressed.
void operator=(const triSurface &surf)
Copy assignment.
ClassName("triSurface")
Runtime type information.
bool BoundaryMesh
Placeholder only, but do not remove - it is needed for GeoMesh.
virtual ~triSurface()
Destructor.
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
OBJstream os(runTime.globalPath()/outputName)
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))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
static void check(const int retVal, const char *what)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)
void sort(UList< T > &list)
Sort the list.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.