Public Member Functions | Protected Member Functions | List of all members
cuttingPlane Class Reference

Constructs cutting plane through a mesh. More...

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

Public Member Functions

 cuttingPlane (const plane &pln, const primitiveMesh &mesh, const bool triangulate, const bitSet &cellIdLabels=bitSet())
 
 cuttingPlane (const plane &pln, const primitiveMesh &mesh, const bool triangulate, bitSet &&cellIdLabels)
 
 cuttingPlane (const plane &pln, const primitiveMesh &mesh, const bool triangulate, const labelUList &cellIdLabels)
 
const planeplaneDesc () const
 
planeplaneDesc ()
 
void operator= (const cuttingPlane &rhs)
 
- Public Member Functions inherited from plane
 plane ()
 
 plane (const vector &normalVector)
 
 plane (const point &originPoint, const vector &normalVector, const bool doNormalise=true)
 
 plane (const point &point1, const point &point2, const point &point3)
 
 plane (const scalarList &coeffs)
 
 plane (const FixedList< scalar, 4 > &coeffs)
 
 plane (const dictionary &dict)
 
 plane (Istream &is)
 
const vectornormal () const
 
const pointorigin () const
 
pointorigin ()
 
const pointrefPoint () const
 
void flip ()
 
FixedList< scalar, 4 > planeCoeffs () const
 
point nearestPoint (const point &p) const
 
scalar distance (const point &p) const
 
scalar signedDistance (const point &p) const
 
scalar normalIntersect (const point &pnt0, const vector &dir) const
 
scalar normalIntersect (const ray &r) const
 
template<class Point , class PointRef >
scalar lineIntersect (const line< Point, PointRef > &l) const
 
ray planeIntersect (const plane &plane2) const
 
point planePlaneIntersect (const plane &plane2, const plane &plane3) const
 
point somePointInPlane (const scalar dist=1e-3) const
 
side sideOfPlane (const point &p) const
 
int sign (const point &p, const scalar tol=SMALL) const
 
point mirror (const point &p) const
 
void writeDict (Ostream &os) const
 
- Public Member Functions inherited from cuttingSurfaceBase
 cuttingSurfaceBase ()=default
 
virtual ~cuttingSurfaceBase ()=default
 
const labelListmeshCells () const
 
labelListmeshCells ()
 
bool cut () const
 
void operator= (const cuttingSurfaceBase &rhs)
 
- Public Member Functions inherited from MeshedSurface
 ClassName ("MeshedSurface")
 
 MeshedSurface ()
 
 MeshedSurface (const MeshedSurface &surf)
 
 MeshedSurface (const UnsortedMeshedSurface< Face > &surf)
 
 MeshedSurface (MeshedSurface &&surf)
 
 MeshedSurface (UnsortedMeshedSurface< Face > &&surf)
 
 MeshedSurface (const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst)
 
 MeshedSurface (pointField &&pointLst, List< Face > &&faceLst, const UList< surfZone > &zoneLst)
 
 MeshedSurface (const pointField &pointLst, const UList< Face > &faceLst, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >())
 
 MeshedSurface (pointField &&pointLst, List< Face > &&faceLst, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >())
 
 MeshedSurface (const polyBoundaryMesh &bMesh, const bool globalPoints=false)
 
 MeshedSurface (const surfMesh &mesh)
 
 MeshedSurface (const fileName &name)
 
 MeshedSurface (const fileName &name, const word &fileType)
 
 MeshedSurface (Istream &is)
 
 MeshedSurface (const Time &runTime)
 
 MeshedSurface (const Time &runTime, const word &surfName)
 
 MeshedSurface (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 
 declareRunTimeSelectionTable (autoPtr, MeshedSurface, fileExtension,(const fileName &name),(name))
 
virtual ~MeshedSurface ()
 
 declareMemberFunctionSelectionTable (void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const MeshedSurface< Face > &surf, IOstreamOption streamOpt, const dictionary &options),(name, surf, streamOpt, options))
 
label size () const
 
const List< Face > & surfFaces () const
 
const labelListfaceIds () const
 
const surfZoneListsurfZones () const
 
const vectorFieldSf () const
 
const scalarFieldmagSf () const
 
const vectorFieldCf () const
 
virtual void clear ()
 
virtual void addZones (const UList< surfZone > &, const bool cullEmpty=false)
 
virtual void addZones (const labelUList &sizes, const UList< word > &names, const bool cullEmpty=false)
 
virtual void addZones (const labelUList &sizes, const bool cullEmpty=false)
 
bool addZonesToFaces ()
 
virtual void removeZones ()
 
virtual void movePoints (const pointField &newPoints)
 
virtual void scalePoints (const scalar scaleFactor)
 
virtual void cleanup (const bool verbose)
 
virtual void compactPoints (labelList &pointMap=const_cast< labelList & >(labelList::null()))
 
virtual bool stitchFaces (const scalar tol=SMALL, const bool verbose=false)
 
virtual bool checkFaces (const bool verbose=false)
 
virtual label nTriangles () const
 
virtual label nTriangles (labelList &faceMap) const
 
virtual label triangulate ()
 
virtual label triangulate (labelList &faceMap)
 
template<class BoolListType >
void subsetMeshMap (const BoolListType &include, labelList &pointMap, labelList &faceMap) const
 
MeshedSurface subsetMesh (const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
 
MeshedSurface subsetMesh (const bitSet &include, labelList &pointMap, labelList &faceMap) const
 
MeshedSurface subsetMesh (const UList< bool > &include) const
 
MeshedSurface subsetMesh (const bitSet &include) const
 
MeshedSurface subsetMesh (const wordRes &includeNames, const wordRes &excludeNames=wordRes()) const
 
void swap (MeshedSurface< Face > &surf)
 
void transfer (pointField &pointLst, List< Face > &faceLst)
 
void transfer (MeshedSurface< Face > &surf)
 
void transfer (UnsortedMeshedSurface< Face > &surf)
 
autoPtr< MeshedSurface< Face > > releaseGeom ()
 
void swapFaces (List< Face > &faces)
 
void swapPoints (pointField &points)
 
bool read (const fileName &name, const word &fileType)
 
virtual bool read (const fileName &name)
 
void writeStats (Ostream &os) const
 
virtual void write (const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
 
virtual void write (const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
 
void write (const Time &runTime, const word &surfName=word::null) const
 
void operator= (const MeshedSurface< Face > &surf)
 
void operator= (MeshedSurface< Face > &&surf)
 
 operator MeshedSurfaceProxy< Face > () const
 
template<class Face >
 MeshedSurface ()
 
template<class Face >
 MeshedSurface (const MeshedSurface< Face > &surf)
 
template<class Face >
 MeshedSurface (const UnsortedMeshedSurface< Face > &surf)
 
template<class Face >
 MeshedSurface (MeshedSurface< Face > &&surf)
 
template<class Face >
 MeshedSurface (UnsortedMeshedSurface< Face > &&surf)
 
template<class Face >
 MeshedSurface (const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst)
 
template<class Face >
 MeshedSurface (pointField &&pointLst, List< Face > &&faceLst, const UList< surfZone > &zoneLst)
 
template<class Face >
 MeshedSurface (const pointField &pointLst, const UList< Face > &faceLst, const labelUList &zoneSizes, const UList< word > &zoneNames)
 
template<class Face >
 MeshedSurface (pointField &&pointLst, List< Face > &&faceLst, const labelUList &zoneSizes, const UList< word > &zoneNames)
 
template<class Face >
 MeshedSurface (const surfMesh &mesh)
 
template<class Face >
 MeshedSurface (const polyBoundaryMesh &bMesh, const bool useGlobalPoints)
 
template<class Face >
 MeshedSurface (const fileName &name, const word &fileType)
 
template<class Face >
 MeshedSurface (const fileName &name)
 
template<class Face >
 MeshedSurface (Istream &is)
 
template<class Face >
 MeshedSurface (const Time &runTime)
 
template<class Face >
 MeshedSurface (const Time &runTime, const word &surfName)
 
template<class Face >
 MeshedSurface (const IOobject &io, const dictionary &dict, const bool isGlobal)
 
bool addZonesToFaces ()
 
bool addZonesToFaces ()
 

Protected Member Functions

 cuttingPlane (const plane &pln)
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, bitSet &&cellIdLabels)
 
void checkOverlap (const word callerName, const boundBox &meshBounds, const boundBox &userBounds) const
 
bitSet cellSelection (const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, const word callerName, const bool warn) const
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, const labelUList &cellIdLabels)
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, const bitSet &cellSelectionMask=bitSet())
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, bitSet &&cellSelectionMask)=0
 
- Protected Member Functions inherited from cuttingSurfaceBase
template<class EdgeOrientIntersect , class EdgeAlphaIntersect >
void walkCellCuts (const primitiveMesh &mesh, const bitSet &cellCuts, const EdgeOrientIntersect &edgeOrientIntersect, const EdgeAlphaIntersect &edgeAlphaIntersect, const bool triangulate, label nFaceCuts=0)
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, const labelUList &cellIdLabels)
 
virtual void performCut (const primitiveMesh &mesh, const bool triangulate, const bitSet &cellSelectionMask=bitSet())
 
virtual void remapFaces (const labelUList &faceMap)
 
- Protected Member Functions inherited from MeshedSurface
void transcribe (MeshedSurface< face > &surf)
 
void checkZones (const bool verbose=true)
 
pointFieldstoredPoints ()
 
List< Face > & storedFaces ()
 
labelListstoredFaceIds ()
 
surfZoneListstoredZones ()
 
void sortFacesAndStore (DynamicList< Face > &unsortedFaces, DynamicList< label > &zoneIds, DynamicList< label > &elemIds, bool sorted)
 
void transcribe (MeshedSurface< face > &surf)
 
void transcribe (MeshedSurface< face > &surf)
 
void transcribe (MeshedSurface< face > &surf)
 

Additional Inherited Members

- Public Types inherited from plane
enum  side { FRONT = 1, BACK = -1, NORMAL = 1, FLIP = -1 }
 
- Public Types inherited from MeshedSurface
typedef Face face_type
 
typedef point point_type
 
- Static Public Member Functions inherited from MeshedSurface
static wordHashSet readTypes ()
 
static wordHashSet writeTypes ()
 
static bool canReadType (const word &fileType, bool verbose=false)
 
static bool canWriteType (const word &fileType, bool verbose=false)
 
static bool canRead (const fileName &name, bool verbose=false)
 
static autoPtr< MeshedSurfaceNew (const fileName &name, const word &fileType, bool mandatory=true)
 
static autoPtr< MeshedSurfaceNew (const fileName &name)
 
static void write (const fileName &name, const MeshedSurface< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 
static void write (const fileName &name, const word &fileType, const MeshedSurface< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 
- Static Public Attributes inherited from cuttingSurfaceBase
static int debug
 
- Protected Types inherited from cuttingSurfaceBase
typedef meshedSurface Mesh
 
- Static Protected Member Functions inherited from cuttingSurfaceBase
static void checkOverlap (const word callerName, const boundBox &meshBounds, const boundBox &userBounds)
 
static bitSet cellSelection (const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, boundBox &meshBounds)
 
static bitSet cellSelection (const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, const word callerName, const bool warn)
 
- Protected Attributes inherited from cuttingSurfaceBase
labelList meshCells_
 

Detailed Description

Constructs cutting plane through a mesh.

No attempt at resolving degenerate cases. Since the cut faces can be quite ugly, they will often be triangulated.

Source files

Definition at line 54 of file cuttingPlane.H.

Constructor & Destructor Documentation

◆ cuttingPlane() [1/4]

cuttingPlane ( const plane pln)
protected

Definition at line 25 of file cuttingPlane.C.

◆ cuttingPlane() [2/4]

cuttingPlane ( const plane pln,
const primitiveMesh mesh,
const bool  triangulate,
const bitSet cellIdLabels = bitSet() 
)

Definition at line 32 of file cuttingPlane.C.

References mesh.

◆ cuttingPlane() [3/4]

cuttingPlane ( const plane pln,
const primitiveMesh mesh,
const bool  triangulate,
bitSet &&  cellIdLabels 
)

Definition at line 46 of file cuttingPlane.C.

References mesh.

◆ cuttingPlane() [4/4]

cuttingPlane ( const plane pln,
const primitiveMesh mesh,
const bool  triangulate,
const labelUList cellIdLabels 
)

Definition at line 60 of file cuttingPlane.C.

References mesh.

Member Function Documentation

◆ performCut() [1/4]

void performCut ( const primitiveMesh mesh,
const bool  triangulate,
bitSet &&  cellIdLabels 
)
protectedvirtual

Implements cuttingSurfaceBase.

Definition at line 76 of file cuttingPlane.C.

References clear(), Foam::constant::electromagnetic::e, plane::lineIntersect(), mesh, primitiveMesh::nCells(), and polyMesh::points().

Here is the call graph for this function:

◆ checkOverlap()

void checkOverlap ( const word  callerName,
const boundBox meshBounds,
const boundBox userBounds 
) const
protected

Definition at line 27 of file cuttingPlaneSelection.C.

References Foam::endl(), boundBox::intersects(), Foam::nl, boundBox::valid(), and WarningInFunction.

Here is the call graph for this function:

◆ cellSelection()

Foam::bitSet cellSelection ( const polyMesh mesh,
const boundBox userBounds,
const wordRes zoneNames,
const word  callerName,
const bool  warn 
) const
protected

Definition at line 60 of file cuttingPlaneSelection.C.

References mesh.

◆ planeDesc() [1/2]

const plane& planeDesc ( ) const
inline

Definition at line 168 of file cuttingPlane.H.

◆ planeDesc() [2/2]

plane& planeDesc ( )
inline

Definition at line 174 of file cuttingPlane.H.

◆ operator=()

void operator= ( const cuttingPlane rhs)

Definition at line 142 of file cuttingPlane.C.

References cuttingSurfaceBase::meshCells().

Here is the call graph for this function:

◆ performCut() [2/4]

void performCut
protected

Definition at line 47 of file cuttingSurfaceBase.C.

◆ performCut() [3/4]

void performCut
protected

Definition at line 34 of file cuttingSurfaceBase.C.

◆ performCut() [4/4]

virtual void performCut
protected

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