Data storage of the chemistryOnLineLibrary according to a binary tree structure. More...
Public Member Functions | |
binaryTree (chemistryTabulationMethods::ISAT &table, dictionary coeffsDict) | |
Constructors. More... | |
label | size () const |
Member functions. More... | |
label | depth (binaryNode *subTreeRoot) const |
Computes iteratively the depth of the subTree. More... | |
label | depth () const |
binaryNode * | root () |
label | maxNLeafs () const |
void | insertNewLeaf (const scalarField &phiq, const scalarField &Rphiq, const scalarSquareMatrix &A, const scalarField &scaleFactor, const scalar &epsTol, const label nCols, const label nActive, chemPointISAT *&phi0) |
void | binaryTreeSearch (const scalarField &phiq, binaryNode *node, chemPointISAT *&nearest) |
bool | secondaryBTSearch (const scalarField &phiq, chemPointISAT *&x) |
void | deleteLeaf (chemPointISAT *&phi0) |
Delete a leaf from the binary tree and reshape the binary tree for. More... | |
void | balance () |
Cheap balance function. More... | |
void | deleteAllNode () |
chemPointISAT * | treeMin (binaryNode *subTreeRoot) |
chemPointISAT * | treeMin () |
chemPointISAT * | treeSuccessor (chemPointISAT *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.
binaryTree | ( | chemistryTabulationMethods::ISAT & | table, |
dictionary | coeffsDict | ||
) |
Constructors.
Construct from dictionary and chemistryOnLineLibrary
Definition at line 137 of file binaryTree.C.
|
inline |
Member functions.
Definition at line 232 of file binaryTreeI.H.
|
inline |
Computes iteratively the depth of the subTree.
Definition at line 238 of file binaryTreeI.H.
References Foam::max(), binaryNode::nodeLeft(), and binaryNode::nodeRight().
|
inline |
Definition at line 258 of file binaryTreeI.H.
|
inline |
Definition at line 264 of file binaryTreeI.H.
|
inline |
Definition at line 270 of file binaryTreeI.H.
void insertNewLeaf | ( | const scalarField & | phiq, |
const scalarField & | Rphiq, | ||
const scalarSquareMatrix & | A, | ||
const scalarField & | scaleFactor, | ||
const scalar & | epsTol, | ||
const label | nCols, | ||
const label | nActive, | ||
chemPointISAT *& | phi0 | ||
) |
Definition at line 154 of file binaryTree.C.
References A, Foam::deleteDemandDrivenData(), chemPointISAT::node(), and Foam::constant::electromagnetic::phi0.
|
inline |
Definition at line 276 of file binaryTreeI.H.
References binaryNode::a(), binaryNode::leafLeft(), binaryNode::leafRight(), binaryNode::nodeLeft(), binaryNode::nodeRight(), List< T >::size(), and binaryNode::v().
bool secondaryBTSearch | ( | const scalarField & | phiq, |
chemPointISAT *& | x | ||
) |
Definition at line 239 of file binaryTree.C.
References chemPointISAT::inEOA(), x, and y.
void deleteLeaf | ( | chemPointISAT *& | 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 296 of file binaryTree.C.
References Foam::deleteDemandDrivenData(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, binaryNode::leafLeft(), binaryNode::leafRight(), chemPointISAT::node(), binaryNode::nodeLeft(), binaryNode::nodeRight(), binaryNode::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 358 of file binaryTree.C.
References forAll, SortableList< T >::indices(), Foam::constant::electromagnetic::phi0, List< T >::size(), SortableList< T >::sort(), Foam::sqr(), x, and Foam::Zero.
|
inline |
Definition at line 198 of file binaryTree.H.
|
inline |
Definition at line 329 of file binaryTreeI.H.
References binaryNode::leafLeft(), and binaryNode::nodeLeft().
|
inline |
Definition at line 205 of file binaryTree.H.
Foam::chemPointISAT * treeSuccessor | ( | chemPointISAT * | x | ) |
Definition at line 456 of file binaryTree.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, x, and y.
|
inline |
Removes every entries of the tree and delete the associated objects.
Definition at line 346 of file binaryTreeI.H.
|
inline |
ListFull.
Definition at line 359 of file binaryTreeI.H.
|
inline |
Definition at line 365 of file binaryTreeI.H.
References chemPointISAT::resetNumRetrieve().