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 59 of file binaryTree.H.
typedef binaryNode<CompType, ThermoType> node |
Definition at line 64 of file binaryTree.H.
typedef chemPointISAT<CompType, ThermoType> chemPoint |
Definition at line 65 of file binaryTree.H.
binaryTree | ( | TDACChemistryModel< CompType, ThermoType > & | chemistry, |
dictionary | coeffsDict | ||
) |
Construct from dictionary and chemistryOnLineLibrary.
Definition at line 343 of file binaryTree.C.
|
inline |
Definition at line 140 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 361 of file binaryTree.C.
References Foam::max(), binaryNode< CompType, ThermoType >::nodeLeft(), and binaryNode< CompType, ThermoType >::nodeRight().
|
inline |
Definition at line 148 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::depth().
Referenced by binaryTree< CompType, ThermoType >::depth().
|
inline |
Definition at line 153 of file binaryTree.H.
|
inline |
Definition at line 158 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 382 of file binaryTree.C.
References A, Foam::deleteDemandDrivenData(), and chemPointISAT< CompType, ThermoType >::node().
void binaryTreeSearch | ( | const scalarField & | phiq, |
node * | node, | ||
chemPoint *& | nearest | ||
) |
Definition at line 466 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 523 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 581 of file binaryTree.C.
References Foam::deleteDemandDrivenData(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, chemPointISAT< CompType, ThermoType >::node(), binaryNode< CompType, ThermoType >::parent(), 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 645 of file binaryTree.C.
References forAll, SortableList< T >::indices(), n, UList< T >::size(), SortableList< T >::sort(), Foam::sqr(), x, and Foam::Zero.
|
inline |
Definition at line 221 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::deleteAllNode().
Referenced by binaryTree< CompType, ThermoType >::deleteAllNode().
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().
|
inline |
Definition at line 228 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::treeMin().
Referenced by binaryTree< CompType, ThermoType >::treeMin().
Foam::chemPointISAT< CompType, ThermoType > * treeSuccessor | ( | chemPoint * | x | ) |
Definition at line 754 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 804 of file binaryTree.C.
bool isFull |
ListFull.
Definition at line 818 of file binaryTree.C.
void resetNumRetrieve |
Definition at line 825 of file binaryTree.C.
References chemPointISAT< CompType, ThermoType >::resetNumRetrieve().