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 () |
node * | root () |
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 () |
chemPoint * | treeMin (node *subTreeRoot) |
chemPoint * | treeMin () |
chemPoint * | treeSuccessor (chemPoint *x) |
void | clear () |
Removes every entries of the tree and delete the associated objects. More... | |
bool | isFull () |
ListFull. More... | |
void | resetNumRetrieve () |
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 53 of file binaryTree.H.
typedef binaryNode<CompType, ThermoType> node |
Definition at line 58 of file binaryTree.H.
typedef chemPointISAT<CompType, ThermoType> chemPoint |
Definition at line 59 of file binaryTree.H.
binaryTree | ( | TDACChemistryModel< CompType, ThermoType > & | chemistry, |
dictionary | coeffsDict | ||
) |
Construct from dictionary and chemistryOnLineLibrary.
Definition at line 337 of file binaryTree.C.
|
inline |
Definition at line 154 of file binaryTree.H.
Referenced by ISAT< CompType, ThermoType >::size().
Foam::label depth | ( | node * | subTreeRoot | ) |
Computes iteratively the depth of the subTree.
Definition at line 354 of file binaryTree.C.
References Foam::max(), binaryNode< CompType, ThermoType >::nodeLeft(), and binaryNode< CompType, ThermoType >::nodeRight().
|
inline |
Definition at line 164 of file binaryTree.H.
|
inline |
Definition at line 169 of file binaryTree.H.
|
inline |
Definition at line 174 of file binaryTree.H.
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 376 of file binaryTree.C.
References A, Foam::deleteDemandDrivenData(), chemPointISAT< CompType, ThermoType >::node(), and Foam::constant::electromagnetic::phi0.
void binaryTreeSearch | ( | const scalarField & | phiq, |
node * | node, | ||
chemPoint *& | nearest | ||
) |
Definition at line 460 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(), UList< T >::size(), and binaryNode< CompType, ThermoType >::v().
bool secondaryBTSearch | ( | const scalarField & | phiq, |
chemPoint *& | x | ||
) |
Definition at line 517 of file binaryTree.C.
References chemPointISAT< CompType, ThermoType >::inEOA(), x, and y.
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 574 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.
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 638 of file binaryTree.C.
References forAll, n, Foam::constant::electromagnetic::phi0, UList< T >::size(), Foam::sqr(), x, and Foam::Zero.
|
inline |
Definition at line 243 of file binaryTree.H.
Foam::chemPointISAT< CompType, ThermoType > * treeMin | ( | node * | subTreeRoot | ) |
Definition at line 730 of file binaryTree.C.
References binaryNode< CompType, ThermoType >::leafLeft(), and binaryNode< CompType, ThermoType >::nodeLeft().
|
inline |
Definition at line 250 of file binaryTree.H.
Foam::chemPointISAT< CompType, ThermoType > * treeSuccessor | ( | chemPoint * | x | ) |
Definition at line 747 of file binaryTree.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, x, and y.
void clear | ( | ) |
Removes every entries of the tree and delete the associated objects.
Definition at line 797 of file binaryTree.C.
bool isFull | ( | ) |
ListFull.
Definition at line 811 of file binaryTree.C.
void resetNumRetrieve | ( | ) |
Definition at line 818 of file binaryTree.C.
References chemPointISAT< CompType, ThermoType >::resetNumRetrieve().