FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

octreeDataCell Class Reference

Encapsulation of data needed to search in/for cells. More...

#include <meshTools/octreeDataCell.H>


Detailed Description

Encapsulation of data needed to search in/for cells.

Used to find the cell containing a point (e.g. cell-cell mapping).

Source files

Definition at line 57 of file octreeDataCell.H.

Collaboration diagram for octreeDataCell:

List of all members.

Public Member Functions

 octreeDataCell (const polyMesh &, const labelList &cellLabels, const treeBoundBoxList &bbs)
 Construct from components.
 octreeDataCell (const polyMesh &)
 Construct from mesh. Uses all cells in mesh.
const labelList &  cellLabels () const
const polyMesh &  mesh () const
const treeBoundBoxList &  allBb () const
label  size () const
label  getSampleType (octree< octreeDataCell > &, 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 Foam::label index, const Foam::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

Constructor & Destructor Documentation

octreeDataCell ( const polyMesh &   mesh,
const labelList &   cellLabels,
const treeBoundBoxList &   bbs  
)

Construct from components.

Definition at line 37 of file octreeDataCell.C.

octreeDataCell ( const polyMesh &   mesh  )

Construct from mesh. Uses all cells in mesh.

Definition at line 51 of file octreeDataCell.C.

References cells, forAll, Foam::max(), Foam::min(), p, and points.


Member Function Documentation

const labelList& cellLabels (  ) const [inline]

Definition at line 88 of file octreeDataCell.H.

const polyMesh& mesh (  ) const [inline]

Definition at line 93 of file octreeDataCell.H.

const treeBoundBoxList& allBb (  ) const [inline]

Definition at line 98 of file octreeDataCell.H.

label size (  ) const [inline]

Definition at line 103 of file octreeDataCell.H.

References List< T >::size().

Foam::label getSampleType ( octree< octreeDataCell > &   ,
const point &    
) const

Get type of sample.

Definition at line 96 of file octreeDataCell.C.

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

Does (bb of) shape at index overlap bb.

Definition at line 106 of file octreeDataCell.C.

References treeBoundBox::overlaps().

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

Does shape at index contain sample.

Definition at line 116 of file octreeDataCell.C.

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 BUG: not yet done.

Definition at line 126 of file octreeDataCell.C.

References notImplemented.

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 146 of file octreeDataCell.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. Note: always returns GREAT since no inside/outside.

Definition at line 185 of file octreeDataCell.C.

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

Calculates nearest (to sample) point in shape.

Returns point and mag(nearest - sample)

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 213 of file octreeDataCell.C.

References notImplemented.

void write ( Ostream &   os,
const label   index  
) const

Definition at line 230 of file octreeDataCell.C.


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