All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
binaryTree< CompType, ThermoType > Class Template Reference

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

Public Types

typedef binaryNode< CompType, ThermoType > bn
 
typedef chemPointISAT< CompType, ThermoType > chP
 

Public Member Functions

 binaryTree (TDACChemistryModel< CompType, ThermoType > &chemistry, dictionary coeffsDict)
 Constructors. More...
 
label size ()
 Member functions. More...
 
label depth (bn *subTreeRoot)
 Computes iteratively the depth of the subTree. More...
 
label depth ()
 
bnroot ()
 
label maxNLeafs ()
 
void insertNewLeaf (const scalarField &phiq, const scalarField &Rphiq, const scalarSquareMatrix &A, const scalarField &scaleFactor, const scalar &epsTol, const label nCols, chP *&phi0)
 
void binaryTreeSearch (const scalarField &phiq, bn *node, chP *&nearest)
 
bool secondaryBTSearch (const scalarField &phiq, chP *&x)
 
void deleteLeaf (chP *&phi0)
 Delete a leaf from the binary tree and reshape the binary tree for. More...
 
void balance ()
 Cheap balance function. More...
 
void deleteAllNode ()
 
chPtreeMin (bn *subTreeRoot)
 
chPtreeMin ()
 
chPtreeSuccessor (chP *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 57 of file binaryTree.H.

Member Typedef Documentation

◆ bn

typedef binaryNode<CompType, ThermoType> bn

Definition at line 62 of file binaryTree.H.

◆ chP

typedef chemPointISAT<CompType, ThermoType> chP

Definition at line 63 of file binaryTree.H.

Constructor & Destructor Documentation

◆ binaryTree()

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

Constructors.

Construct from dictionary and chemistryOnLineLibrary

Definition at line 345 of file binaryTree.C.

Member Function Documentation

◆ size()

label size ( )
inline

Member functions.

Definition at line 134 of file binaryTree.H.

References binaryTree< CompType, ThermoType >::depth().

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

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

◆ depth() [1/2]

Foam::label depth ( bn subTreeRoot)

Computes iteratively the depth of the subTree.

Definition at line 362 of file binaryTree.C.

References binaryTree< CompType, ThermoType >::insertNewLeaf(), 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 142 of file binaryTree.H.

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

Here is the caller graph for this function:

◆ root()

bn* root ( )
inline

Definition at line 147 of file binaryTree.H.

◆ maxNLeafs()

◆ insertNewLeaf()

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

Definition at line 384 of file binaryTree.C.

References binaryTree< CompType, ThermoType >::binaryTreeSearch(), Foam::deleteDemandDrivenData(), and chemPointISAT< CompType, ThermoType >::node().

Referenced by binaryTree< CompType, ThermoType >::depth(), and binaryTree< CompType, ThermoType >::maxNLeafs().

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

◆ binaryTreeSearch()

◆ secondaryBTSearch()

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

◆ deleteLeaf()

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

References Foam::deleteDemandDrivenData(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, chemPointISAT< CompType, ThermoType >::node(), binaryNode< CompType, ThermoType >::parent(), and x.

Referenced by binaryTree< CompType, ThermoType >::maxNLeafs().

Here is the call graph for this function:
Here is the caller 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 641 of file binaryTree.C.

References forAll, SortableList< T >::indices(), chemPointISAT< CompType, ThermoType >::node(), chemPointISAT< CompType, ThermoType >::phi(), Foam::constant::electromagnetic::phi0, List< T >::size(), SortableList< T >::sort(), Foam::sqr(), and x.

Referenced by binaryTree< CompType, ThermoType >::maxNLeafs().

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

◆ deleteAllNode()

void deleteAllNode ( )
inline

Definition at line 215 of file binaryTree.H.

References binaryTree< CompType, ThermoType >::treeMin().

Here is the call graph for this function:

◆ treeMin() [1/2]

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

Definition at line 732 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]

chP* treeMin ( )
inline

◆ treeSuccessor()

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

Definition at line 751 of file binaryTree.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, chemPointISAT< CompType, ThermoType >::node(), and binaryNode< CompType, ThermoType >::parent().

Referenced by binaryTree< CompType, ThermoType >::treeMin().

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

◆ clear()

void clear ( )

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

Definition at line 803 of file binaryTree.C.

Referenced by binaryTree< CompType, ThermoType >::treeMin().

Here is the caller graph for this function:

◆ isFull()

bool isFull ( )

ListFull.

Definition at line 817 of file binaryTree.C.

Referenced by binaryTree< CompType, ThermoType >::treeMin().

Here is the caller graph for this function:

◆ resetNumRetrieve()

void resetNumRetrieve ( )

Definition at line 824 of file binaryTree.C.

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

Referenced by binaryTree< CompType, ThermoType >::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: