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