FreeFOAM The Cross-Platform CFD Toolkit
octreeDataFace Class Reference

Holds data for octree to work on mesh faces. More...

#include <meshTools/octreeDataFace.H>


Detailed Description

Holds data for octree to work on mesh faces.

For example, calculate (in calcNearest) the correct intersection point with a face.

Source files

Definition at line 61 of file octreeDataFace.H.

List of all members.

Public Member Functions

 ClassName ("octreeDataFace")
 octreeDataFace (const primitiveMesh &, const labelList &meshFaces, const treeBoundBoxList &)
 Construct from selected mesh faces.
 octreeDataFace (const primitiveMesh &, const labelList &meshFaces)
 Construct from selected mesh faces. Tight fitting bounding boxes.
 octreeDataFace (const primitiveMesh &, const UList< const labelList * > &, const UList< const treeBoundBoxList * > &)
 Construct from selected mesh faces.
 octreeDataFace (const primitiveMesh &, const UList< const labelList * > &)
 Construct from selected mesh faces.
 octreeDataFace (const polyPatch &)
 Construct from all faces in patch.
 octreeDataFace (const primitiveMesh &)
 Construct from all boundary faces.
 octreeDataFace (const octreeDataFace &)
 Construct as copy.
 ~octreeDataFace ()
const primitiveMeshmesh () const
const labelListmeshFaces () const
const treeBoundBoxListallBb () const
label size () const
label getSampleType (const octree< octreeDataFace > &, const point &) const
 Get type of sample.
bool overlaps (const label index, const treeBoundBox &sampleBb) const
 Does (bb of) shape at index overlap bb.
bool contains (const label index, const point &sample) const
 Does shape at index contain sample.
bool intersects (const label index, const point &start, const point &end, point &intersectionPoint) const
 Segment (from start to end) intersection with shape.
bool findTightest (const label index, const point &sample, treeBoundBox &tightest) const
 Sets newTightest to bounding box (and returns true) if.
scalar calcSign (const label index, const point &sample, vector &n) const
 Given index get unit normal and calculate (numerical) sign.
scalar calcNearest (const label index, const point &sample, point &nearest) const
 Calculates nearest (to sample) point in shape.
scalar calcNearest (const label index, const linePointRef &ln, point &linePt, point &shapePt) const
 Calculates nearest (to line segment) point in shape.
void write (Ostream &os, const label index) const
 Write shape at index.

Constructor & Destructor Documentation

octreeDataFace ( const primitiveMesh mesh,
const labelList meshFaces,
const treeBoundBoxList allBb 
)

Construct from selected mesh faces.

Definition at line 70 of file octreeDataFace.C.

octreeDataFace ( const primitiveMesh mesh,
const labelList meshFaces 
)

Construct from selected mesh faces. Tight fitting bounding boxes.

generated internally.

Definition at line 84 of file octreeDataFace.C.

octreeDataFace ( const primitiveMesh mesh,
const UList< const labelList * > &  meshFaceListPtrs,
const UList< const treeBoundBoxList * > &  bbListPtrs 
)

Construct from selected mesh faces.

Definition at line 100 of file octreeDataFace.C.

References forAll, and UList< T >::size().

octreeDataFace ( const primitiveMesh mesh,
const UList< const labelList * > &  meshFaceListPtrs 
)

Construct from selected mesh faces.

Tight-fitting bounding boxes generated internally.

Definition at line 139 of file octreeDataFace.C.

References forAll, and UList< T >::size().

octreeDataFace ( const polyPatch patch)

Construct from all faces in patch.

Tight-fitting bounding boxes generated internally.

Definition at line 174 of file octreeDataFace.C.

References forAll, and polyPatch::start().

octreeDataFace ( const primitiveMesh mesh)

Construct from all boundary faces.

Tight-fitting bounding boxes generated internally.

Definition at line 190 of file octreeDataFace.C.

References primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), and List< T >::setSize().

octreeDataFace ( const octreeDataFace shapes)

Construct as copy.

Definition at line 213 of file octreeDataFace.C.

Definition at line 223 of file octreeDataFace.C.


Member Function Documentation

ClassName ( "octreeDataFace"  )
const primitiveMesh& mesh ( ) const
inline

Definition at line 142 of file octreeDataFace.H.

const labelList& meshFaces ( ) const
inline

Definition at line 147 of file octreeDataFace.H.

const treeBoundBoxList& allBb ( ) const
inline

Definition at line 152 of file octreeDataFace.H.

label size ( ) const
inline

Definition at line 157 of file octreeDataFace.H.

References List< T >::size().

bool overlaps ( const label  index,
const treeBoundBox sampleBb 
) const

Does (bb of) shape at index overlap bb.

Exact test of face intersecting bb

Definition at line 496 of file octreeDataFace.C.

References treeBoundBox::contains(), UList< T >::fcIndex(), forAll, triangleFuncs::intersectBb(), treeBoundBox::overlaps(), and points.

bool contains ( const label  index,
const point sample 
) const

Does shape at index contain sample.

Definition at line 551 of file octreeDataFace.C.

References notImplemented.

bool intersects ( const label  index,
const point start,
const point end,
point intersectionPoint 
) const

Segment (from start to end) intersection with shape.

at index. If intersects returns true and sets intersectionPoint

Definition at line 562 of file octreeDataFace.C.

References PointHit< Point >::distance(), intersection::HALF_RAY, PointHit< Point >::hit(), PointHit< Point >::hitPoint(), Foam::mag(), face::ray(), intersection::setPlanarTol(), and intersection::VECTOR.

bool findTightest ( const label  index,
const point sample,
treeBoundBox tightest 
) const

Sets newTightest to bounding box (and returns true) if.

nearer to sample than tightest bounding box. Otherwise returns false.

Definition at line 603 of file octreeDataFace.C.

References treeBoundBox::calcExtremities(), dist, Foam::mag(), boundBox::max(), boundBox::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Foam::scalar calcSign ( const label  index,
const point sample,
vector n 
) const

Given index get unit normal and calculate (numerical) sign.

of sample. Used to determine accuracy of calcNearest or inside/outside.

Definition at line 641 of file octreeDataFace.C.

References Foam::mag().

Foam::scalar calcNearest ( const label  index,
const point sample,
point nearest 
) const

Calculates nearest (to sample) point in shape.

Returns point and mag(nearest - sample). Returns GREAT if sample does not project onto (triangle decomposition) of face.

Definition at line 663 of file octreeDataFace.C.

References PointHit< Point >::distance(), Foam::endl(), face::nearestPoint(), Foam::Pout, PointHit< Point >::rawPoint(), and Foam::sign().

Foam::scalar calcNearest ( const label  index,
const linePointRef ln,
point linePt,
point shapePt 
) const

Calculates nearest (to line segment) point in shape.

Returns distance and both point.

Definition at line 699 of file octreeDataFace.C.

References notImplemented.

void write ( Ostream os,
const label  index 
) const

Write shape at index.

Definition at line 715 of file octreeDataFace.C.


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