binaryTree< CompType, ThermoType > Class Template Reference

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

Public Types

typedef binaryNode< CompType, ThermoType > node
 
typedef chemPointISAT< CompType, ThermoType > chemPoint
 

Public Member Functions

 binaryTree (TDACChemistryModel< CompType, ThermoType > &chemistry, dictionary coeffsDict)
 Construct from dictionary and chemistryOnLineLibrary. More...
 
label size ()
 
label depth (node *subTreeRoot)
 Computes iteratively the depth of the subTree. More...
 
label depth ()
 
noderoot ()
 
label maxNLeafs ()
 
void insertNewLeaf (const scalarField &phiq, const scalarField &Rphiq, const scalarSquareMatrix &A, const scalarField &scaleFactor, const scalar &epsTol, const label nCols, chemPoint *&phi0)
 
void binaryTreeSearch (const scalarField &phiq, node *node, chemPoint *&nearest)
 
bool secondaryBTSearch (const scalarField &phiq, chemPoint *&x)
 
void deleteLeaf (chemPoint *&phi0)
 Delete a leaf from the binary tree and reshape the binary tree for. More...
 
void balance ()
 Cheap balance function. More...
 
void deleteAllNode ()
 
chemPointtreeMin (node *subTreeRoot)
 
chemPointtreeMin ()
 
chemPointtreeSuccessor (chemPoint *x)
 
void clear ()
 Removes every entries of the tree and delete the associated objects. More...
 
bool isFull ()
 ListFull. More...
 
void resetNumRetrieve ()
 

Detailed Description

template<class CompType, class ThermoType>
class Foam::binaryTree< CompType, ThermoType >

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 59 of file binaryTree.H.

Member Typedef Documentation

◆ node

typedef binaryNode<CompType, ThermoType> node

Definition at line 64 of file binaryTree.H.

◆ chemPoint

typedef chemPointISAT<CompType, ThermoType> chemPoint

Definition at line 65 of file binaryTree.H.

Constructor & Destructor Documentation

◆ binaryTree()

binaryTree ( TDACChemistryModel< CompType, ThermoType > &  chemistry,
dictionary  coeffsDict 
)

Construct from dictionary and chemistryOnLineLibrary.

Definition at line 344 of file binaryTree.C.

Member Function Documentation

◆ size()

label size ( )
inline

Definition at line 140 of file binaryTree.H.

Referenced by ISAT< CompType, ThermoType >::size().

Here is the caller graph for this function:

◆ depth() [1/2]

Foam::label depth ( node subTreeRoot)

Computes iteratively the depth of the subTree.

Definition at line 361 of file binaryTree.C.

References Foam::max(), binaryNode< CompType, ThermoType >::nodeLeft(), and binaryNode< CompType, ThermoType >::nodeRight().

Here is the call graph for this function:

◆ depth() [2/2]

label depth ( )
inline

Definition at line 148 of file binaryTree.H.

◆ root()

node* root ( )
inline

Definition at line 153 of file binaryTree.H.

◆ maxNLeafs()

label maxNLeafs ( )
inline

Definition at line 158 of file binaryTree.H.

◆ insertNewLeaf()

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

Definition at line 383 of file binaryTree.C.

References A, Foam::deleteDemandDrivenData(), chemPointISAT< CompType, ThermoType >::node(), and Foam::constant::electromagnetic::phi0.

Here is the call graph for this function:

◆ binaryTreeSearch()

void binaryTreeSearch ( const scalarField phiq,
node node,
chemPoint *&  nearest 
)

Definition at line 467 of file binaryTree.C.

References binaryNode< CompType, ThermoType >::a(), binaryNode< CompType, ThermoType >::leafLeft(), binaryNode< CompType, ThermoType >::leafRight(), binaryNode< CompType, ThermoType >::nodeLeft(), binaryNode< CompType, ThermoType >::nodeRight(), and binaryNode< CompType, ThermoType >::v().

Here is the call graph for this function:

◆ secondaryBTSearch()

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

Definition at line 524 of file binaryTree.C.

References chemPointISAT< CompType, ThermoType >::inEOA(), x, and y.

Here is the call graph for this function:

◆ deleteLeaf()

void deleteLeaf ( chemPoint *&  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 581 of file binaryTree.C.

References Foam::deleteDemandDrivenData(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, chemPointISAT< CompType, ThermoType >::node(), binaryNode< CompType, ThermoType >::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 645 of file binaryTree.C.

References forAll, n, Foam::constant::electromagnetic::phi0, Foam::sqr(), x, and Foam::Zero.

Here is the call graph for this function:

◆ deleteAllNode()

void deleteAllNode ( )
inline

Definition at line 221 of file binaryTree.H.

◆ treeMin() [1/2]

Foam::chemPointISAT< CompType, ThermoType > * treeMin ( node subTreeRoot)

Definition at line 737 of file binaryTree.C.

References binaryNode< CompType, ThermoType >::leafLeft(), and binaryNode< CompType, ThermoType >::nodeLeft().

Here is the call graph for this function:

◆ treeMin() [2/2]

chemPoint* treeMin ( )
inline

Definition at line 228 of file binaryTree.H.

◆ treeSuccessor()

Foam::chemPointISAT< CompType, ThermoType > * treeSuccessor ( chemPoint x)

Definition at line 754 of file binaryTree.C.

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

Here is the call graph for this function:

◆ clear()

void clear ( )

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

Definition at line 804 of file binaryTree.C.

◆ isFull()

bool isFull ( )

ListFull.

Definition at line 818 of file binaryTree.C.

◆ resetNumRetrieve()

void resetNumRetrieve ( )

Definition at line 825 of file binaryTree.C.

References chemPointISAT< CompType, ThermoType >::resetNumRetrieve().

Here is the call graph for this function:

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