binaryTree Class Reference

Data storage of the chemistryOnLineLibrary according to a binary tree structure. More...

Public Member Functions

 binaryTree (chemistryTabulationMethods::ISAT &table, dictionary coeffsDict)
 Constructors. More...
 
label size () const
 Member functions. More...
 
label depth (binaryNode *subTreeRoot) const
 Computes iteratively the depth of the subTree. More...
 
label depth () const
 
binaryNoderoot ()
 
label maxNLeafs () const
 
void insertNewLeaf (const scalarField &phiq, const scalarField &Rphiq, const scalarSquareMatrix &A, const scalarField &scaleFactor, const scalar &epsTol, const label nCols, const label nActive, chemPointISAT *&phi0)
 
void binaryTreeSearch (const scalarField &phiq, binaryNode *node, chemPointISAT *&nearest)
 
bool secondaryBTSearch (const scalarField &phiq, chemPointISAT *&x)
 
void deleteLeaf (chemPointISAT *&phi0)
 Delete a leaf from the binary tree and reshape the binary tree for. More...
 
void balance ()
 Cheap balance function. More...
 
void deleteAllNode ()
 
chemPointISATtreeMin (binaryNode *subTreeRoot)
 
chemPointISATtreeMin ()
 
chemPointISATtreeSuccessor (chemPointISAT *x)
 
void clear ()
 Removes every entries of the tree and delete the associated objects. More...
 
bool isFull ()
 ListFull. More...
 
void resetNumRetrieve ()
 

Detailed Description

Data storage of the chemistryOnLineLibrary according to a binary tree structure.

0 (root node) / \ 0 0 / \ / \ L R L 0 / \ L R

L: leafLeft_ R: leafRight_

Definition at line 57 of file binaryTree.H.

Constructor & Destructor Documentation

◆ binaryTree()

Constructors.

Construct from dictionary and chemistryOnLineLibrary

Definition at line 137 of file binaryTree.C.

Member Function Documentation

◆ size()

Foam::label size ( ) const
inline

Member functions.

Definition at line 232 of file binaryTreeI.H.

◆ depth() [1/2]

Foam::label depth ( binaryNode subTreeRoot) const
inline

Computes iteratively the depth of the subTree.

Definition at line 238 of file binaryTreeI.H.

References Foam::max(), binaryNode::nodeLeft(), and binaryNode::nodeRight().

Here is the call graph for this function:

◆ depth() [2/2]

Foam::label depth ( ) const
inline

Definition at line 258 of file binaryTreeI.H.

◆ root()

Foam::binaryNode * root ( )
inline

Definition at line 264 of file binaryTreeI.H.

◆ maxNLeafs()

Foam::label maxNLeafs ( ) const
inline

Definition at line 270 of file binaryTreeI.H.

◆ insertNewLeaf()

void insertNewLeaf ( const scalarField phiq,
const scalarField Rphiq,
const scalarSquareMatrix A,
const scalarField scaleFactor,
const scalar &  epsTol,
const label  nCols,
const label  nActive,
chemPointISAT *&  phi0 
)

Definition at line 154 of file binaryTree.C.

References A, Foam::deleteDemandDrivenData(), chemPointISAT::node(), and Foam::constant::electromagnetic::phi0.

Here is the call graph for this function:

◆ binaryTreeSearch()

void binaryTreeSearch ( const scalarField phiq,
binaryNode node,
chemPointISAT *&  nearest 
)
inline

Definition at line 276 of file binaryTreeI.H.

References binaryNode::a(), binaryNode::leafLeft(), binaryNode::leafRight(), binaryNode::nodeLeft(), binaryNode::nodeRight(), List< T >::size(), and binaryNode::v().

Here is the call graph for this function:

◆ secondaryBTSearch()

bool secondaryBTSearch ( const scalarField phiq,
chemPointISAT *&  x 
)

Definition at line 239 of file binaryTree.C.

References chemPointISAT::inEOA(), x, and y.

Here is the call graph for this function:

◆ deleteLeaf()

void deleteLeaf ( chemPointISAT *&  phi0)

Delete a leaf from the binary tree and reshape the binary tree for.

the following binary tree search Return the index in the nodeList of the removed node (-1 when no node)

Definition at line 296 of file binaryTree.C.

References Foam::deleteDemandDrivenData(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, binaryNode::leafLeft(), binaryNode::leafRight(), chemPointISAT::node(), binaryNode::nodeLeft(), binaryNode::nodeRight(), binaryNode::parent(), Foam::constant::electromagnetic::phi0, and x.

Here is the call graph for this function:

◆ balance()

void balance ( )

Cheap balance function.

This function just roughly separate the space in two parts with a hyperplane which separate the two extreme chemPoint in the direction of the maximum the variance Then, it repopulate the tree with this hyperplane stored at the root and by inserting the chemPoint in increasing order of value in that direction

Definition at line 358 of file binaryTree.C.

References forAll, SortableList< T >::indices(), Foam::constant::electromagnetic::phi0, List< T >::size(), SortableList< T >::sort(), Foam::sqr(), x, and Foam::Zero.

Here is the call graph for this function:

◆ deleteAllNode()

void deleteAllNode ( )
inline

Definition at line 198 of file binaryTree.H.

◆ treeMin() [1/2]

Foam::chemPointISAT * treeMin ( binaryNode subTreeRoot)
inline

Definition at line 329 of file binaryTreeI.H.

References binaryNode::leafLeft(), and binaryNode::nodeLeft().

Here is the call graph for this function:

◆ treeMin() [2/2]

chemPointISAT* treeMin ( )
inline

Definition at line 205 of file binaryTree.H.

◆ treeSuccessor()

Foam::chemPointISAT * treeSuccessor ( chemPointISAT x)

Definition at line 456 of file binaryTree.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, x, and y.

Here is the call graph for this function:

◆ clear()

void clear ( )
inline

Removes every entries of the tree and delete the associated objects.

Definition at line 346 of file binaryTreeI.H.

◆ isFull()

bool isFull ( )
inline

ListFull.

Definition at line 359 of file binaryTreeI.H.

◆ resetNumRetrieve()

void resetNumRetrieve ( )
inline

Definition at line 365 of file binaryTreeI.H.

References chemPointISAT::resetNumRetrieve().

Here is the call graph for this function:

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