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 138 of file binaryTree.C.

References binaryTree::insertNewLeaf().

Here is the call graph for this function:

Member Function Documentation

◆ size()

Foam::label size ( ) const
inline

Member functions.

Definition at line 232 of file binaryTreeI.H.

Referenced by binaryTree::balance().

Here is the caller graph for this function:

◆ 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 binaryTree::depth(), 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.

Referenced by binaryTree::depth().

Here is the caller graph for this function:

◆ 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.

References binaryTree::binaryTreeSearch().

Here is the call graph for this function:

◆ 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 155 of file binaryTree.C.

References binaryTree::binaryTreeSearch(), Foam::deleteDemandDrivenData(), binaryNode::leafLeft(), chemPointISAT::node(), and binaryTree::secondaryBTSearch().

Referenced by binaryTree::binaryTree().

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

◆ binaryTreeSearch()

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

Definition at line 277 of file binaryTreeI.H.

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

Referenced by binaryTree::balance(), binaryTree::insertNewLeaf(), and binaryTree::maxNLeafs().

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

◆ secondaryBTSearch()

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

Definition at line 240 of file binaryTree.C.

References chemPointISAT::inEOA(), chemPointISAT::node(), and binaryNode::parent().

Referenced by binaryTree::insertNewLeaf().

Here is the call graph for this function:
Here is the caller 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(), 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 binaryTree::binaryTreeSearch(), binaryTree::deleteAllNode(), forAll, SortableList< T >::indices(), chemPointISAT::node(), phi, Foam::constant::electromagnetic::phi0, List< T >::size(), binaryTree::size(), SortableList< T >::sort(), Foam::sqr(), binaryTree::treeMin(), binaryTree::treeSuccessor(), x, and Foam::Zero.

Here is the call graph for this function:

◆ deleteAllNode()

void deleteAllNode ( )
inline

Definition at line 198 of file binaryTree.H.

References binaryTree::treeMin().

Referenced by binaryTree::balance().

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

◆ 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.

References binaryTree::clear(), binaryTree::isFull(), binaryTree::resetNumRetrieve(), and binaryTree::treeSuccessor().

Referenced by binaryTree::balance(), binaryTree::deleteAllNode(), binaryTree::resetNumRetrieve(), and binaryTree::treeSuccessor().

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

◆ treeSuccessor()

◆ clear()

void clear ( )
inline

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

Definition at line 346 of file binaryTreeI.H.

Referenced by binaryTree::treeMin().

Here is the caller graph for this function:

◆ isFull()

bool isFull ( )
inline

ListFull.

Definition at line 359 of file binaryTreeI.H.

Referenced by binaryTree::treeMin().

Here is the caller graph for this function:

◆ resetNumRetrieve()

void resetNumRetrieve ( )
inline

Definition at line 365 of file binaryTreeI.H.

References chemPointISAT::resetNumRetrieve(), binaryTree::treeMin(), and binaryTree::treeSuccessor().

Referenced by binaryTree::treeMin().

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

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