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 () |
bn * | root () |
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 () |
chP * | treeMin (bn *subTreeRoot) |
chP * | treeMin () |
chP * | treeSuccessor (chP *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 57 of file binaryTree.H.
typedef binaryNode<CompType, ThermoType> bn |
Definition at line 62 of file binaryTree.H.
typedef chemPointISAT<CompType, ThermoType> chP |
Definition at line 63 of file binaryTree.H.
binaryTree | ( | TDACChemistryModel< CompType, ThermoType > & | chemistry, |
dictionary | coeffsDict | ||
) |
Constructors.
Construct from dictionary and chemistryOnLineLibrary
Definition at line 345 of file binaryTree.C.
|
inline |
Member functions.
Definition at line 134 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::depth().
Referenced by ISAT< CompType, ThermoType >::size().
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().
|
inline |
Definition at line 142 of file binaryTree.H.
Referenced by binaryTree< CompType, ThermoType >::size().
|
inline |
Definition at line 147 of file binaryTree.H.
|
inline |
Definition at line 152 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::balance(), binaryTree< CompType, ThermoType >::binaryTreeSearch(), binaryTree< CompType, ThermoType >::deleteLeaf(), binaryTree< CompType, ThermoType >::insertNewLeaf(), Foam::constant::electromagnetic::phi0, binaryTree< CompType, ThermoType >::secondaryBTSearch(), and x.
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().
void binaryTreeSearch | ( | const scalarField & | phiq, |
bn * | node, | ||
chP *& | 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(), binaryTree< CompType, ThermoType >::secondaryBTSearch(), List< T >::size(), and binaryNode< CompType, ThermoType >::v().
Referenced by binaryTree< CompType, ThermoType >::insertNewLeaf(), and binaryTree< CompType, ThermoType >::maxNLeafs().
bool secondaryBTSearch | ( | const scalarField & | phiq, |
chP *& | x | ||
) |
Definition at line 521 of file binaryTree.C.
References chemPointISAT< CompType, ThermoType >::inEOA(), chemPointISAT< CompType, ThermoType >::node(), and binaryNode< CompType, ThermoType >::parent().
Referenced by binaryTree< CompType, ThermoType >::binaryTreeSearch(), and binaryTree< CompType, ThermoType >::maxNLeafs().
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().
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().
|
inline |
Definition at line 215 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::treeMin().
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().
|
inline |
Definition at line 222 of file binaryTree.H.
References binaryTree< CompType, ThermoType >::clear(), binaryTree< CompType, ThermoType >::isFull(), binaryTree< CompType, ThermoType >::resetNumRetrieve(), and binaryTree< CompType, ThermoType >::treeSuccessor().
Referenced by binaryTree< CompType, ThermoType >::deleteAllNode().
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().
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().
bool isFull | ( | ) |
ListFull.
Definition at line 817 of file binaryTree.C.
Referenced by binaryTree< CompType, ThermoType >::treeMin().
void resetNumRetrieve | ( | ) |
Definition at line 824 of file binaryTree.C.
References chemPointISAT< CompType, ThermoType >::resetNumRetrieve().
Referenced by binaryTree< CompType, ThermoType >::treeMin().