Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
isoSurface Class Reference

A surface formed by the iso value. After "Regularised Marching Tetrahedra: improved iso-surface extraction", G.M. Treece, R.W. Prager and A.H. Gee. More...

Inheritance diagram for isoSurface:
Inheritance graph
[legend]
Collaboration diagram for isoSurface:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("isoSurface")
 Runtime type information. More...
 
 isoSurface (const volScalarField &cellIsoVals, const scalarField &pointIsoVals, const scalar iso, const bool regularise, const boundBox &bounds=boundBox::greatBox, const scalar mergeTol=1e-6)
 Construct from cell values and point values. Uses boundaryField. More...
 
const labelListmeshCells () const
 For every triangle the original cell in mesh. More...
 
template<class Type >
tmp< Field< Type > > interpolate (const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords) const
 Interpolates cCoords,pCoords. Uses the references to the original. More...
 
template<class Type >
Foam::tmp< Foam::SlicedGeometricField< Type, Foam::fvPatchField, Foam::slicedFvPatchField, Foam::volMesh > > adaptPatchFields (const GeometricField< Type, fvPatchField, volMesh > &fld) const
 
template<class Type >
Foam::label generateFaceTriPoints (const volScalarField &cVals, const scalarField &pVals, const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords, const DynamicList< Type > &snappedPoints, const labelList &snappedCc, const labelList &snappedPoint, const label faceI, const scalar neiVal, const Type &neiPt, const bool hasNeiSnap, const Type &neiSnapPt, DynamicList< Type > &triPoints, DynamicList< label > &triMeshCells) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolate (const label nPoints, const labelList &triPointMergeMap, const labelList &interpolatedPoints, const List< FixedList< label, 3 > > &interpolatedOldPoints, const List< FixedList< scalar, 3 > > &interpolationWeights, const DynamicList< Type > &unmergedValues)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolate (const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords) const
 
- Public Member Functions inherited from triSurface
 ClassName ("triSurface")
 Runtime type information. More...
 
 triSurface ()
 Construct null. More...
 
 triSurface (const List< labelledTri > &, const geometricSurfacePatchList &, const pointField &)
 Construct from triangles, patches, points. More...
 
 triSurface (List< labelledTri > &, const geometricSurfacePatchList &, pointField &, const bool reUse)
 Construct from triangles, patches, points. Reuse storage. More...
 
 triSurface (const List< labelledTri > &, const pointField &)
 Construct from triangles, points. Set patchnames to default. More...
 
 triSurface (const triFaceList &, const pointField &)
 Construct from triangles, points. Set region to 0 and default. More...
 
 triSurface (const fileName &)
 Construct from file name (uses extension to determine type) More...
 
 triSurface (Istream &)
 Construct from Istream. More...
 
 triSurface (const Time &d)
 Construct from objectRegistry. More...
 
 triSurface (const triSurface &)
 Construct as copy. More...
 
 ~triSurface ()
 
void clearOut ()
 Clear all data. More...
 
void clearTopology ()
 Clear topology. More...
 
void clearPatchMeshAddr ()
 Clear patch addressing. More...
 
const geometricSurfacePatchListpatches () const
 
geometricSurfacePatchListpatches ()
 
const labelListListsortedEdgeFaces () const
 Return edge-face addressing sorted (for edges with more than. More...
 
const labelListedgeOwner () const
 If 2 face neighbours: label of face where ordering of edge. More...
 
virtual void movePoints (const pointField &)
 Move points. More...
 
virtual void scalePoints (const scalar &)
 Scale points. A non-positive factor is ignored. More...
 
void checkTriangles (const bool verbose=false)
 Check/remove duplicate/degenerate triangles. More...
 
void checkEdges (const bool verbose=false)
 Check triply (or more) connected edges. More...
 
void cleanup (const bool verbose=false)
 Remove non-valid triangles. More...
 
void markZone (const boolList &borderEdge, const label faceI, const label currentZone, labelList &faceZone) const
 Fill faceZone with currentZone for every face reachable. More...
 
label markZones (const boolList &borderEdge, labelList &faceZone) const
 (size and) fills faceZone with zone of face. Zone is area More...
 
void subsetMeshMap (const boolList &include, labelList &pointMap, labelList &faceMap) const
 'Create' sub mesh, including only faces for which More...
 
triSurface subsetMesh (const boolList &include, labelList &pointMap, labelList &faceMap) const
 Return new surface. Returns pointMap, faceMap from. More...
 
void write (Ostream &) const
 Write to Ostream in simple FOAM format. More...
 
void write (const fileName &, const bool sortByRegion=false) const
 Generic write routine. Chooses writer based on extension. More...
 
void write (const Time &) const
 Write to database. More...
 
void writeDX (const scalarField &, Ostream &) const
 Write to Ostream in OpenDX format. More...
 
void writeDX (const vectorField &, Ostream &) const
 
void writeStats (Ostream &) const
 Write some statistics. More...
 
void operator= (const triSurface &)
 
 ClassName ("triSurface")
 Runtime type information. More...
 
 triSurface ()
 Construct null. More...
 
 triSurface (const List< labelledTri > &, const geometricSurfacePatchList &, const pointField &)
 Construct from triangles, patches, points. More...
 
 triSurface (List< labelledTri > &, const geometricSurfacePatchList &, pointField &, const bool reUse)
 Construct from triangles, patches, points. Reuse storage. More...
 
 triSurface (const Xfer< List< labelledTri > > &, const geometricSurfacePatchList &, const Xfer< List< point > > &)
 Construct from triangles, patches, points. More...
 
 triSurface (const List< labelledTri > &, const pointField &)
 Construct from triangles, points. Set patchnames to default. More...
 
 triSurface (const triFaceList &, const pointField &)
 Construct from triangles, points. Set region to 0 and default. More...
 
 triSurface (const fileName &)
 Construct from file name (uses extension to determine type) More...
 
 triSurface (Istream &)
 Construct from Istream. More...
 
 triSurface (const Time &d)
 Construct from objectRegistry. More...
 
 triSurface (const triSurface &)
 Construct as copy. More...
 
 ~triSurface ()
 Destructor. More...
 
void clearOut ()
 
void clearTopology ()
 
void clearPatchMeshAddr ()
 
const geometricSurfacePatchListpatches () const
 
geometricSurfacePatchListpatches ()
 
const labelListListsortedEdgeFaces () const
 Return edge-face addressing sorted (for edges with more than. More...
 
const labelListedgeOwner () const
 If 2 face neighbours: label of face where ordering of edge. More...
 
virtual void movePoints (const pointField &)
 Move points. More...
 
virtual void scalePoints (const scalar)
 Scale points. A non-positive factor is ignored. More...
 
void checkTriangles (const bool verbose)
 Check/remove duplicate/degenerate triangles. More...
 
void checkEdges (const bool verbose)
 Check triply (or more) connected edges. More...
 
void cleanup (const bool verbose)
 Remove non-valid triangles. More...
 
void markZone (const boolList &borderEdge, const label faceI, const label currentZone, labelList &faceZone) const
 Fill faceZone with currentZone for every face reachable. More...
 
label markZones (const boolList &borderEdge, labelList &faceZone) const
 (size and) fills faceZone with zone of face. Zone is area More...
 
void subsetMeshMap (const boolList &include, labelList &pointMap, labelList &faceMap) const
 'Create' sub mesh, including only faces for which More...
 
triSurface subsetMesh (const boolList &include, labelList &pointMap, labelList &faceMap) const
 Return new surface. Returns pointMap, faceMap from. More...
 
void write (Ostream &) const
 Write to Ostream in simple FOAM format. More...
 
void write (const fileName &, const bool sortByRegion=false) const
 Generic write routine. Chooses writer based on extension. More...
 
void write (const Time &) const
 Write to database. More...
 
void writeDX (const scalarField &, Ostream &) const
 Write to Ostream in OpenDX format. More...
 
void writeDX (const vectorField &, Ostream &) const
 
void writeStats (Ostream &) const
 Write some statistics. More...
 
void operator= (const triSurface &)
 
- Public Member Functions inherited from PrimitivePatch< labelledTri, List, pointField, point >
 PrimitivePatch (const List< labelledTri > &faces, const Field< point > &points)
 Construct from components. More...
 
 PrimitivePatch (List< labelledTri > &faces, Field< point > &points, const bool reUse)
 Construct from components, reuse storage. More...
 
 PrimitivePatch (const PrimitivePatch< labelledTri, List, pointField, point > &)
 Construct as copy. More...
 
 PrimitivePatch (const List< labelledTri > &faces, const Field< point > &points)
 Construct from components. More...
 
 PrimitivePatch (const Xfer< List< labelledTri > > &faces, const Xfer< List< point > > &points)
 Construct from components. More...
 
 PrimitivePatch (List< labelledTri > &faces, Field< point > &points, const bool reUse)
 Construct from components, reuse storage. More...
 
 PrimitivePatch (const PrimitivePatch< labelledTri, List, pointField, point > &)
 Construct as copy. More...
 
virtual ~PrimitivePatch ()
 
virtual ~PrimitivePatch ()
 Destructor. More...
 
void clearOut ()
 
void clearOut ()
 
void clearGeom ()
 
void clearGeom ()
 
void clearTopology ()
 
void clearTopology ()
 
void clearPatchMeshAddr ()
 
void clearPatchMeshAddr ()
 
const Field< point > & points () const
 Return reference to global points. More...
 
const Field< point > & points () const
 Return reference to global points. More...
 
label nPoints () const
 Return number of points supporting patch faces. More...
 
label nPoints () const
 Return number of points supporting patch faces. More...
 
label nEdges () const
 Return number of edges in patch. More...
 
label nEdges () const
 Return number of edges in patch. More...
 
const edgeListedges () const
 Return list of edges, address into LOCAL point list. More...
 
const edgeListedges () const
 Return list of edges, address into LOCAL point list. More...
 
label nInternalEdges () const
 Number of internal edges. More...
 
label nInternalEdges () const
 Number of internal edges. More...
 
bool isInternalEdge (const label edgeI) const
 Is internal edge? More...
 
bool isInternalEdge (const label edgeI) const
 Is internal edge? More...
 
const labelListboundaryPoints () const
 Return list of boundary points,. More...
 
const labelListboundaryPoints () const
 Return list of boundary points,. More...
 
const labelListListfaceFaces () const
 Return face-face addressing. More...
 
const labelListListfaceFaces () const
 Return face-face addressing. More...
 
const labelListListedgeFaces () const
 Return edge-face addressing. More...
 
const labelListListedgeFaces () const
 Return edge-face addressing. More...
 
const labelListListfaceEdges () const
 Return face-edge addressing. More...
 
const labelListListfaceEdges () const
 Return face-edge addressing. More...
 
const labelListListpointEdges () const
 Return point-edge addressing. More...
 
const labelListListpointEdges () const
 Return point-edge addressing. More...
 
const labelListListpointFaces () const
 Return point-face addressing. More...
 
const labelListListpointFaces () const
 Return point-face addressing. More...
 
const List< labelledTri > & localFaces () const
 Return patch faces addressing into local point list. More...
 
const List< labelledTri > & localFaces () const
 Return patch faces addressing into local point list. More...
 
const labelListmeshPoints () const
 Return labelList of mesh points in patch. More...
 
const labelListmeshPoints () const
 Return labelList of mesh points in patch. They are constructed. More...
 
const Map< label > & meshPointMap () const
 Mesh point map. Given the global point index find its. More...
 
const Map< label > & meshPointMap () const
 Mesh point map. Given the global point index find its. More...
 
const Field< point > & localPoints () const
 Return pointField of points in patch. More...
 
const Field< point > & localPoints () const
 Return pointField of points in patch. More...
 
const labelListlocalPointOrder () const
 Return orders the local points for most efficient search. More...
 
const labelListlocalPointOrder () const
 Return orders the local points for most efficient search. More...
 
label whichPoint (const label gp) const
 Given a global point index, return the local point. More...
 
label whichPoint (const label gp) const
 Given a global point index, return the local point index. More...
 
label whichEdge (const edge &e) const
 Given an edge in local point labels, return its index. More...
 
label whichEdge (const edge &) const
 Given an edge in local point labels, return its. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
 Return labels of patch edges in the global edge list using. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const
 Return labels of patch edges in the global edge list using. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
 Return labels of patch edges in the global edge list using. More...
 
labelList meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const
 Return labels of patch edges in the global edge list using. More...
 
const Field< point > & faceCentres () const
 Return face centres for patch. More...
 
const Field< point > & faceCentres () const
 Return face centres for patch. More...
 
const Field< point > & faceNormals () const
 Return face normals for patch. More...
 
const Field< point > & faceNormals () const
 Return face normals for patch. More...
 
const Field< point > & pointNormals () const
 Return point normals for patch. More...
 
const Field< point > & pointNormals () const
 Return point normals for patch. More...
 
List< objectHitprojectPoints (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
List< objectHitprojectPoints (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
Foam::List< Foam::objectHitprojectPoints (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
 
List< objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
List< objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch. More...
 
Foam::List< Foam::objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< point > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
 
const labelListListedgeLoops () const
 Return list of closed loops of boundary vertices. More...
 
const labelListListedgeLoops () const
 Return list of closed loops of boundary vertices. More...
 
surfaceTopo surfaceType () const
 Calculate surface type formed by patch. More...
 
surfaceTopo surfaceType () const
 Calculate surface type formed by patch. More...
 
bool checkTopology (const bool report=false, labelHashSet *setPtr=NULL) const
 Check surface formed by patch for manifoldness (see above). More...
 
bool checkTopology (const bool report=false, labelHashSet *setPtr=NULL) const
 Check surface formed by patch for manifoldness (see above). More...
 
bool checkPointManifold (const bool report=false, labelHashSet *setPtr=NULL) const
 Checks primitivePatch for faces sharing point but not edge. More...
 
bool checkPointManifold (const bool report=false, labelHashSet *setPtr=NULL) const
 Checks primitivePatch for faces sharing point but not edge. More...
 
void writeVTK (const fileName &name) const
 Write VTK patch. More...
 
void writeVTKNormals (const fileName &name) const
 Write VTK patch normals. More...
 
virtual void movePoints (const Field< point > &)
 Correct patch after moving points. More...
 
virtual void movePoints (const Field< point > &)
 Correct patch after moving points. More...
 
void operator= (const PrimitivePatch< labelledTri, List, pointField, point > &)
 Assignment. More...
 
void operator= (const PrimitivePatch< labelledTri, List, pointField, point > &)
 Assignment. More...
 
- Public Member Functions inherited from List< labelledTri >
label size () const
 Return the number of elements in the UList. More...
 
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
 List (const label s)
 
 List (const label s, const T &a)
 
 List (const List< T > &a)
 
 List (const Xfer< List< T > > &lst)
 
 List (List< T > &a, bool reUse)
 
 List (const UList< T > &a, const labelUList &map)
 
 List (const PtrList< T > &lst)
 
 List (const SLList< T > &lst)
 
 List (const UIndirectList< T > &lst)
 
 List (const BiIndirectList< T > &lst)
 
 List ()
 
 List (Istream &is)
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (List< T > &a)
 
void transfer (SortableList< T > &a)
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 

Private Types

enum  segmentCutType { NEARFIRST, NEARSECOND, NOTNEAR }
 
enum  cellCutType { NOTCUT, SPHERE, CUT }
 

Private Member Functions

bool noTransform (const tensor &tt) const
 Does tensor differ (to within mergeTolerance) from identity. More...
 
PackedBoolList collocatedFaces (const coupledPolyPatch &) const
 Per face whether is collocated. More...
 
void syncUnseparatedPoints (pointField &collapsedPoint, const point &nullValue) const
 Synchonise points on all non-separated coupled patches. More...
 
scalar isoFraction (const scalar s0, const scalar s1) const
 Get location of iso value as fraction inbetween s0,s1. More...
 
bool isEdgeOfFaceCut (const scalarField &pVals, const face &f, const bool ownLower, const bool neiLower) const
 Check if any edge of a face is cut. More...
 
void getNeighbour (const labelList &boundaryRegion, const volVectorField &meshC, const volScalarField &cVals, const label cellI, const label faceI, scalar &nbrValue, point &nbrPoint) const
 
void calcCutTypes (const labelList &boundaryRegion, const volVectorField &meshC, const volScalarField &cVals, const scalarField &pVals)
 Set faceCutType,cellCutType. More...
 
void calcSnappedCc (const labelList &boundaryRegion, const volVectorField &meshC, const volScalarField &cVals, const scalarField &pVals, DynamicList< point > &snappedPoints, labelList &snappedCc) const
 Determine per cc whether all near cuts can be snapped to single. More...
 
void calcSnappedPoint (const PackedBoolList &isBoundaryPoint, const labelList &boundaryRegion, const volVectorField &meshC, const volScalarField &cVals, const scalarField &pVals, DynamicList< point > &snappedPoints, labelList &snappedPoint) const
 Determine per point whether all near cuts can be snapped to single. More...
 
template<class Type >
tmp< SlicedGeometricField< Type, fvPatchField, slicedFvPatchField, volMesh > > adaptPatchFields (const GeometricField< Type, fvPatchField, volMesh > &fld) const
 Return input field with coupled (and empty) patch values rewritten. More...
 
template<class Type >
Type generatePoint (const scalar s0, const Type &p0, const bool hasSnap0, const Type &snapP0, const scalar s1, const Type &p1, const bool hasSnap1, const Type &snapP1) const
 Generate single point by interpolation or snapping. More...
 
template<class Type >
void generateTriPoints (const scalar s0, const Type &p0, const bool hasSnap0, const Type &snapP0, const scalar s1, const Type &p1, const bool hasSnap1, const Type &snapP1, const scalar s2, const Type &p2, const bool hasSnap2, const Type &snapP2, const scalar s3, const Type &p3, const bool hasSnap3, const Type &snapP3, DynamicList< Type > &points) const
 
template<class Type >
label generateFaceTriPoints (const volScalarField &cVals, const scalarField &pVals, const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords, const DynamicList< Type > &snappedPoints, const labelList &snappedCc, const labelList &snappedPoint, const label faceI, const scalar neiVal, const Type &neiPt, const bool hasNeiSnap, const Type &neiSnapPt, DynamicList< Type > &triPoints, DynamicList< label > &triMeshCells) const
 
template<class Type >
void generateTriPoints (const volScalarField &cVals, const scalarField &pVals, const GeometricField< Type, fvPatchField, volMesh > &cCoords, const Field< Type > &pCoords, const DynamicList< Type > &snappedPoints, const labelList &snappedCc, const labelList &snappedPoint, DynamicList< Type > &triPoints, DynamicList< label > &triMeshCells) const
 
triSurface stitchTriPoints (const bool checkDuplicates, const List< point > &triPoints, labelList &triPointReverseMap, labelList &triMap) const
 

Static Private Member Functions

static bool collocatedPatch (const polyPatch &)
 Is patch a collocated (i.e. non-separated) coupled patch? More...
 
static point calcCentre (const triSurface &)
 
template<class Type >
static tmp< Field< Type > > interpolate (const label nPoints, const labelList &triPointMergeMap, const labelList &interpolatedPoints, const List< FixedList< label, 3 > > &interpolatedOldPoints, const List< FixedList< scalar, 3 > > &interpolationWeights, const DynamicList< Type > &unmergedValues)
 
static void trimToPlanes (const PtrList< plane > &planes, const triPointRef &tri, DynamicList< point > &newTriPoints)
 Trim triangle to planes. More...
 
static void trimToBox (const treeBoundBox &bb, DynamicList< point > &triPoints, DynamicList< label > &triMeshCells)
 Trim all triangles to box. More...
 
static void trimToBox (const treeBoundBox &bb, DynamicList< point > &triPoints, DynamicList< label > &triMap, labelList &triPointMap, labelList &interpolatedPoints, List< FixedList< label, 3 > > &interpolatedOldPoints, List< FixedList< scalar, 3 > > &interpolationWeights)
 Trim all triangles to box. Determine interpolation. More...
 
static bool validTri (const triSurface &, const label)
 Check single triangle for (topological) validity. More...
 
static triSurface subsetMesh (const triSurface &s, const labelList &newToOldFaces, labelList &oldToNewPoints, labelList &newToOldPoints)
 

Private Attributes

const fvMeshmesh_
 Reference to mesh. More...
 
const scalarFieldpVals_
 
autoPtr< slicedVolScalarFieldcValsPtr_
 Input volScalarField with separated coupled patches rewritten. More...
 
const scalar iso_
 Isosurface value. More...
 
const Switch regularise_
 Regularise? More...
 
const boundBox bounds_
 Optional bounds. More...
 
const scalar mergeDistance_
 When to merge points. More...
 
List< cellCutTypefaceCutType_
 Whether face might be cut. More...
 
List< cellCutTypecellCutType_
 Whether cell might be cut. More...
 
label nCutCells_
 Estimated number of cut cells. More...
 
labelList meshCells_
 For every triangle the original cell in mesh. More...
 
labelList triPointMergeMap_
 For every unmerged triangle point the point in the triSurface. More...
 
DynamicList< labelinterpolatedPoints_
 triSurface points that have weighted interpolation More...
 
DynamicList< FixedList< label, 3 > > interpolatedOldPoints_
 corresponding original, unmerged points More...
 
DynamicList< FixedList< scalar, 3 > > interpolationWeights_
 corresponding weights More...
 

Friends

class isoSurfaceCell
 Declare friendship with isoSurfaceCell to share some functionality. More...
 

Additional Inherited Members

- Public Types inherited from triSurface
typedef bool BoundaryMesh
 Placeholder only, but do not remove - it is needed for GeoMesh. More...
 
typedef bool BoundaryMesh
 Placeholder only, but do not remove - it is needed for GeoMesh. More...
 
- Public Types inherited from PrimitivePatch< labelledTri, List, pointField, point >
enum  surfaceTopo
 Enumeration defining the surface type. Used in check routines. More...
 
enum  surfaceTopo
 Enumeration defining the surface type. Used in check routines. More...
 
typedef labelledTri FaceType
 
typedef labelledTri FaceType
 
typedef List< labelledTriFaceListType
 
typedef List< labelledTriFaceListType
 
typedef pointField PointFieldType
 
typedef pointField PointFieldType
 
- Public Types inherited from List< labelledTri >
typedef SubList< TsubList
 Declare type of subList. More...
 
- Static Public Member Functions inherited from triSurface
static fileName triSurfInstance (const Time &)
 Name of triSurface directory to use. More...
 
static fileName triSurfInstance (const Time &)
 Name of triSurface directory to use. More...
 
- Static Public Member Functions inherited from PrimitivePatch< labelledTri, List, pointField, point >
static void writeVTK (const fileName &name, const FaceListType &faces, const Field< point > &points)
 Write generic VTK patch, HJ, 14/Jan/2009. More...
 
static void writeVTKNormals (const fileName &name, const FaceListType &faces, const Field< point > &points)
 Write generic VTK patch normals, HJ, 14/Jan/2009. More...
 
- Static Public Member Functions inherited from List< labelledTri >
static const List< T > & null ()
 Return a null List. More...
 
- Protected Member Functions inherited from triSurface
pointFieldstoredPoints ()
 Non-const access to global points. More...
 
List< Face > & storedFaces ()
 Non-const access to the faces. More...
 
pointFieldstoredPoints ()
 Non-const access to global points. More...
 
List< Face > & storedFaces ()
 Non-const access to the faces. More...
 
- Protected Member Functions inherited from List< labelledTri >
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Detailed Description

A surface formed by the iso value. After "Regularised Marching Tetrahedra: improved iso-surface extraction", G.M. Treece, R.W. Prager and A.H. Gee.

Note:

The handling on coupled patches is a bit complex. All fields (values and coordinates) get rewritten so

Now the triangle generation on non-separated processor patch faces can use the neighbouring value. Any separated processor face or cyclic face gets handled just like any boundary face.

Source files

Definition at line 85 of file isoSurface.H.

Member Enumeration Documentation

◆ segmentCutType

enum segmentCutType
private
Enumerator
NEARFIRST 
NEARSECOND 
NOTNEAR 

Definition at line 91 of file isoSurface.H.

◆ cellCutType

enum cellCutType
private
Enumerator
NOTCUT 
SPHERE 
CUT 

Definition at line 98 of file isoSurface.H.

Constructor & Destructor Documentation

◆ isoSurface()

isoSurface ( const volScalarField cellIsoVals,
const scalarField pointIsoVals,
const scalar  iso,
const bool  regularise,
const boundBox bounds = boundBox::greatBox,
const scalar  mergeTol = 1e-6 
)

Construct from cell values and point values. Uses boundaryField.

for boundary values. Holds reference to cellIsoVals and pointIsoVals.

Definition at line 1414 of file isoSurface.C.

References polyPatch::coupled(), Foam::dimLength, Foam::endl(), f(), forAll, boundBox::greatBox, Foam::inplaceRenumber(), GeometricField::internalField(), Foam::max(), Foam::min(), Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, patches, polyPatch::patchSlice(), fileName::path(), Foam::Pout, PackedBoolList::set(), List::setSize(), List::size(), FixedList::size(), polyPatch::start(), List::transfer(), and triSurface::write().

Here is the call graph for this function:

Member Function Documentation

◆ noTransform()

bool noTransform ( const tensor tt) const
private

Does tensor differ (to within mergeTolerance) from identity.

Definition at line 70 of file isoSurface.C.

References Foam::mag(), isoSurface::mergeDistance_, Tensor::xx(), Tensor::xy(), Tensor::xz(), Tensor::yx(), Tensor::yy(), Tensor::yz(), Tensor::zx(), Tensor::zy(), and Tensor::zz().

Here is the call graph for this function:

◆ collocatedPatch()

bool collocatedPatch ( const polyPatch pp)
staticprivate

Is patch a collocated (i.e. non-separated) coupled patch?

Definition at line 86 of file isoSurface.C.

References coupledPolyPatch::parallel(), and coupledPolyPatch::separated().

Here is the call graph for this function:

◆ collocatedFaces()

Foam::PackedBoolList collocatedFaces ( const coupledPolyPatch pp) const
private

Per face whether is collocated.

Definition at line 95 of file isoSurface.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and forAll.

Here is the call graph for this function:

◆ syncUnseparatedPoints()

void syncUnseparatedPoints ( pointField collapsedPoint,
const point nullValue 
) const
private

◆ isoFraction()

Foam::scalar isoFraction ( const scalar  s0,
const scalar  s1 
) const
private

Get location of iso value as fraction inbetween s0,s1.

Definition at line 281 of file isoSurface.C.

References Foam::mag().

Here is the call graph for this function:

◆ isEdgeOfFaceCut()

bool isEdgeOfFaceCut ( const scalarField pVals,
const face f,
const bool  ownLower,
const bool  neiLower 
) const
private

Check if any edge of a face is cut.

Definition at line 300 of file isoSurface.C.

References f(), and forAll.

Here is the call graph for this function:

◆ getNeighbour()

void getNeighbour ( const labelList boundaryRegion,
const volVectorField meshC,
const volScalarField cVals,
const label  cellI,
const label  faceI,
scalar &  nbrValue,
point nbrPoint 
) const
private

Definition at line 326 of file isoSurface.C.

References GeometricField::boundaryField(), polyPatch::boundaryMesh(), and polyPatch::start().

Here is the call graph for this function:

◆ calcCutTypes()

void calcCutTypes ( const labelList boundaryRegion,
const volVectorField meshC,
const volScalarField cVals,
const scalarField pVals 
)
private

Set faceCutType,cellCutType.

Definition at line 360 of file isoSurface.C.

References Foam::endl(), f(), forAll, patches, Foam::Pout, List::setSize(), and polyPatch::start().

Here is the call graph for this function:

◆ calcCentre()

Foam::point calcCentre ( const triSurface s)
staticprivate

Definition at line 499 of file isoSurface.C.

References forAll, s(), Foam::sum(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ calcSnappedCc()

void calcSnappedCc ( const labelList boundaryRegion,
const volVectorField meshC,
const volScalarField cVals,
const scalarField pVals,
DynamicList< point > &  snappedPoints,
labelList snappedCc 
) const
private

Determine per cc whether all near cuts can be snapped to single.

point.

Definition at line 514 of file isoSurface.C.

References DynamicList::append(), DynamicList::clear(), f(), forAll, triSurface::markZones(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), points, s(), List::setSize(), Foam::sum(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ calcSnappedPoint()

void calcSnappedPoint ( const PackedBoolList isBoundaryPoint,
const labelList boundaryRegion,
const volVectorField meshC,
const volScalarField cVals,
const scalarField pVals,
DynamicList< point > &  snappedPoints,
labelList snappedPoint 
) const
private

Determine per point whether all near cuts can be snapped to single.

point.

Definition at line 681 of file isoSurface.C.

References DynamicList::append(), DynamicList::clear(), f(), Foam::findIndex(), forAll, PackedList::get(), triSurface::markZones(), Vector< scalar >::max, PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), pFaces, points, s(), List::setSize(), Foam::sum(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ adaptPatchFields() [1/2]

tmp<SlicedGeometricField <Type, fvPatchField, slicedFvPatchField, volMesh> > adaptPatchFields ( const GeometricField< Type, fvPatchField, volMesh > &  fld) const
private

Return input field with coupled (and empty) patch values rewritten.

◆ generatePoint()

Type generatePoint ( const scalar  s0,
const Type &  p0,
const bool  hasSnap0,
const Type &  snapP0,
const scalar  s1,
const Type &  p1,
const bool  hasSnap1,
const Type &  snapP1 
) const
private

Generate single point by interpolation or snapping.

Definition at line 152 of file isoSurfaceTemplates.C.

References Foam::mag(), and s().

Here is the call graph for this function:

◆ generateTriPoints() [1/2]

void generateTriPoints ( const scalar  s0,
const Type &  p0,
const bool  hasSnap0,
const Type &  snapP0,
const scalar  s1,
const Type &  p1,
const bool  hasSnap1,
const Type &  snapP1,
const scalar  s2,
const Type &  p2,
const bool  hasSnap2,
const Type &  snapP2,
const scalar  s3,
const Type &  p3,
const bool  hasSnap3,
const Type &  snapP3,
DynamicList< Type > &  points 
) const
private

Definition at line 196 of file isoSurfaceTemplates.C.

References points, and Foam::Swap().

Here is the call graph for this function:

◆ generateFaceTriPoints() [1/2]

label generateFaceTriPoints ( const volScalarField cVals,
const scalarField pVals,
const GeometricField< Type, fvPatchField, volMesh > &  cCoords,
const Field< Type > &  pCoords,
const DynamicList< Type > &  snappedPoints,
const labelList snappedCc,
const labelList snappedPoint,
const label  faceI,
const scalar  neiVal,
const Type &  neiPt,
const bool  hasNeiSnap,
const Type &  neiSnapPt,
DynamicList< Type > &  triPoints,
DynamicList< label > &  triMeshCells 
) const
private

◆ generateTriPoints() [2/2]

void generateTriPoints ( const volScalarField cVals,
const scalarField pVals,
const GeometricField< Type, fvPatchField, volMesh > &  cCoords,
const Field< Type > &  pCoords,
const DynamicList< Type > &  snappedPoints,
const labelList snappedCc,
const labelList snappedPoint,
DynamicList< Type > &  triPoints,
DynamicList< label > &  triMeshCells 
) const
private

◆ interpolate() [1/4]

static tmp<Field<Type> > interpolate ( const label  nPoints,
const labelList triPointMergeMap,
const labelList interpolatedPoints,
const List< FixedList< label, 3 > > &  interpolatedOldPoints,
const List< FixedList< scalar, 3 > > &  interpolationWeights,
const DynamicList< Type > &  unmergedValues 
)
staticprivate

◆ stitchTriPoints()

Foam::triSurface stitchTriPoints ( const bool  checkDuplicates,
const List< point > &  triPoints,
labelList triPointReverseMap,
labelList triMap 
) const
private

◆ trimToPlanes()

void trimToPlanes ( const PtrList< plane > &  planes,
const triPointRef tri,
DynamicList< point > &  newTriPoints 
)
staticprivate

Trim triangle to planes.

Definition at line 1055 of file isoSurface.C.

References triangle::a(), DynamicList::append(), triangle::b(), triangle::c(), forAll, and storeOp::tris_.

Here is the call graph for this function:

◆ trimToBox() [1/2]

void trimToBox ( const treeBoundBox bb,
DynamicList< point > &  triPoints,
DynamicList< label > &  triMeshCells 
)
staticprivate

Trim all triangles to box.

Definition at line 1128 of file isoSurface.C.

References DynamicList::append(), Foam::endl(), f(), treeBoundBox::faceNormals, treeBoundBox::faces, forAll, n, Foam::Pout, PtrList::set(), DynamicList::setCapacity(), FixedList::size(), and FixedList::transfer().

Referenced by isoSurfaceCell::isoSurfaceCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trimToBox() [2/2]

void trimToBox ( const treeBoundBox bb,
DynamicList< point > &  triPoints,
DynamicList< label > &  triMap,
labelList triPointMap,
labelList interpolatedPoints,
List< FixedList< label, 3 > > &  interpolatedOldPoints,
List< FixedList< scalar, 3 > > &  interpolationWeights 
)
staticprivate

Trim all triangles to box. Determine interpolation.

for existing and new points

Definition at line 1188 of file isoSurface.C.

References DynamicList::append(), triangle::barycentric(), forAll, List::setSize(), List::size(), FixedList::size(), and List::transfer().

Here is the call graph for this function:

◆ validTri()

bool validTri ( const triSurface surf,
const label  faceI 
)
staticprivate

Check single triangle for (topological) validity.

Definition at line 1269 of file isoSurface.C.

References triFace::centre(), Foam::endl(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceFaces(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and WarningInFunction.

Here is the call graph for this function:

◆ subsetMesh()

Foam::triSurface subsetMesh ( const triSurface s,
const labelList newToOldFaces,
labelList oldToNewPoints,
labelList newToOldPoints 
)
staticprivate

Definition at line 1340 of file isoSurface.C.

References forAll, s(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "isoSurface"  )

Runtime type information.

◆ meshCells()

const labelList& meshCells ( ) const
inline

For every triangle the original cell in mesh.

Definition at line 414 of file isoSurface.H.

References isoSurface::meshCells_.

◆ interpolate() [2/4]

tmp<Field<Type> > interpolate ( const GeometricField< Type, fvPatchField, volMesh > &  cCoords,
const Field< Type > &  pCoords 
) const

Interpolates cCoords,pCoords. Uses the references to the original.

fields used to create the iso surface.

◆ adaptPatchFields() [2/2]

Definition at line 44 of file isoSurfaceTemplates.C.

References f(), fld(), forAll, mesh, patches, fvPatchField::patchInternalField(), fvPatchField::patchNeighbourField(), UList::size(), and w().

Here is the call graph for this function:

◆ generateFaceTriPoints() [2/2]

Foam::label generateFaceTriPoints ( const volScalarField cVals,
const scalarField pVals,
const GeometricField< Type, fvPatchField, volMesh > &  cCoords,
const Field< Type > &  pCoords,
const DynamicList< Type > &  snappedPoints,
const labelList snappedCc,
const labelList snappedPoint,
const label  faceI,
const scalar  neiVal,
const Type &  neiPt,
const bool  hasNeiSnap,
const Type &  neiSnapPt,
DynamicList< Type > &  triPoints,
DynamicList< label > &  triMeshCells 
) const

Definition at line 433 of file isoSurfaceTemplates.C.

References DynamicList::append(), f(), forAll, and FixedList::size().

Here is the call graph for this function:

◆ interpolate() [3/4]

Foam::tmp<Foam::Field<Type> > interpolate ( const label  nPoints,
const labelList triPointMergeMap,
const labelList interpolatedPoints,
const List< FixedList< label, 3 > > &  interpolatedOldPoints,
const List< FixedList< scalar, 3 > > &  interpolationWeights,
const DynamicList< Type > &  unmergedValues 
)

Definition at line 745 of file isoSurfaceTemplates.C.

References forAll, nPoints, and w().

Here is the call graph for this function:

◆ interpolate() [4/4]

Foam::tmp<Foam::Field<Type> > interpolate ( const GeometricField< Type, fvPatchField, volMesh > &  cCoords,
const Field< Type > &  pCoords 
) const

Definition at line 808 of file isoSurfaceTemplates.C.

References Foam::constant::physicoChemical::c2, Foam::MULES::interpolate(), and points.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ isoSurfaceCell

friend class isoSurfaceCell
friend

Declare friendship with isoSurfaceCell to share some functionality.

Definition at line 388 of file isoSurface.H.

Field Documentation

◆ mesh_

const fvMesh& mesh_
private

Reference to mesh.

Definition at line 107 of file isoSurface.H.

◆ pVals_

const scalarField& pVals_
private

Definition at line 109 of file isoSurface.H.

◆ cValsPtr_

autoPtr<slicedVolScalarField> cValsPtr_
private

Input volScalarField with separated coupled patches rewritten.

Definition at line 112 of file isoSurface.H.

◆ iso_

const scalar iso_
private

Isosurface value.

Definition at line 115 of file isoSurface.H.

◆ regularise_

const Switch regularise_
private

Regularise?

Definition at line 118 of file isoSurface.H.

◆ bounds_

const boundBox bounds_
private

Optional bounds.

Definition at line 121 of file isoSurface.H.

◆ mergeDistance_

const scalar mergeDistance_
private

When to merge points.

Definition at line 124 of file isoSurface.H.

Referenced by isoSurface::noTransform().

◆ faceCutType_

List<cellCutType> faceCutType_
private

Whether face might be cut.

Definition at line 127 of file isoSurface.H.

◆ cellCutType_

List<cellCutType> cellCutType_
private

Whether cell might be cut.

Definition at line 130 of file isoSurface.H.

◆ nCutCells_

label nCutCells_
private

Estimated number of cut cells.

Definition at line 133 of file isoSurface.H.

◆ meshCells_

labelList meshCells_
private

For every triangle the original cell in mesh.

Definition at line 136 of file isoSurface.H.

Referenced by isoSurface::meshCells().

◆ triPointMergeMap_

labelList triPointMergeMap_
private

For every unmerged triangle point the point in the triSurface.

Definition at line 139 of file isoSurface.H.

◆ interpolatedPoints_

DynamicList<label> interpolatedPoints_
private

triSurface points that have weighted interpolation

Definition at line 142 of file isoSurface.H.

◆ interpolatedOldPoints_

DynamicList<FixedList<label, 3> > interpolatedOldPoints_
private

corresponding original, unmerged points

Definition at line 145 of file isoSurface.H.

◆ interpolationWeights_

DynamicList<FixedList<scalar, 3> > interpolationWeights_
private

corresponding weights

Definition at line 148 of file isoSurface.H.


The documentation for this class was generated from the following files: