41#ifndef Foam_triSurface_H
42#define Foam_triSurface_H
97 mutable std::unique_ptr<labelListList> sortedEdgeFacesPtr_;
101 mutable std::unique_ptr<labelList> edgeOwnerPtr_;
107 void calcSortedEdgeFaces()
const;
110 void calcEdgeOwner()
const;
118 void setDefaultPatches();
124 const scalar tol = SMALL,
125 const bool verbose =
false
135 bool readSTL(
const fileName& filename,
bool forceBinary=
false);
142 const word& fileType,
143 const bool check =
true
148 void writeSTLASCII(
const fileName& filename,
const bool sort)
const;
151 void writeSTLBINARY(
const fileName& filename)
const;
154 void writeGTS(
const fileName& filename,
const bool sort)
const;
163 const label defaultRegion = 0
170 const label defaultRegion = 0
248 const bool isGlobal =
true
256 const bool isGlobal =
true
266 const bool isGlobal =
true
274 const bool isGlobal =
true
284 const bool isGlobal =
true
337 const scalar scaleFactor = -1
345 const word& fileType,
346 const scalar scaleFactor = -1
365 const bool isGlobal =
true
412 return static_cast<const List<labelledTri>&
>(*this);
467 virtual void scalePoints(
const scalar scaleFactor);
476 void cleanup(
const bool verbose);
493 const label currentZone,
511 template<
class BoolListType>
514 const BoolListType& include,
587 void write(
const fileName&,
const bool sortByRegion =
false)
const;
595 const word& fileType,
596 const bool sortByRegion =
false
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
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 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 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,...
PrimitivePatch(const ::Foam::List< labelledTri > &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...
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.
A surface zone on a MeshedSurface.
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)
Use IOobject information to resolve file to load from, or empty if the file does not exist.
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))
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< surfacePatch > surfacePatchList
List of surfacePatch.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
static void check(const int retVal, const char *what)
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 &)
void sort(UList< T > &list)
Sort the list.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
List< geometricSurfacePatch > geometricSurfacePatchList
List of geometricSurfacePatch.
List< bool > boolList
A List of bools.
List< triFace > triFaceList
List of triFace.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
std::vector< Triangle > triangles