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 138 of file binaryTree.C.
References binaryTree::insertNewLeaf().
|
inline |
Member functions.
Definition at line 232 of file binaryTreeI.H.
Referenced by binaryTree::balance().
|
inline |
Computes iteratively the depth of the subTree.
Definition at line 238 of file binaryTreeI.H.
References binaryTree::depth(), Foam::max(), binaryNode::nodeLeft(), and binaryNode::nodeRight().
|
inline |
Definition at line 258 of file binaryTreeI.H.
Referenced by binaryTree::depth().
|
inline |
Definition at line 264 of file binaryTreeI.H.
|
inline |
Definition at line 270 of file binaryTreeI.H.
References binaryTree::binaryTreeSearch().
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 155 of file binaryTree.C.
References binaryTree::binaryTreeSearch(), Foam::deleteDemandDrivenData(), binaryNode::leafLeft(), chemPointISAT::node(), and binaryTree::secondaryBTSearch().
Referenced by binaryTree::binaryTree().
|
inline |
Definition at line 277 of file binaryTreeI.H.
References binaryNode::a(), binaryNode::leafLeft(), binaryNode::leafRight(), binaryNode::nodeLeft(), binaryNode::nodeRight(), List< T >::size(), and binaryNode::v().
Referenced by binaryTree::balance(), binaryTree::insertNewLeaf(), and binaryTree::maxNLeafs().
bool secondaryBTSearch | ( | const scalarField & | phiq, |
chemPointISAT *& | x | ||
) |
Definition at line 240 of file binaryTree.C.
References chemPointISAT::inEOA(), chemPointISAT::node(), and binaryNode::parent().
Referenced by binaryTree::insertNewLeaf().
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(), 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 binaryTree::binaryTreeSearch(), binaryTree::deleteAllNode(), forAll, SortableList< T >::indices(), chemPointISAT::node(), phi, Foam::constant::electromagnetic::phi0, List< T >::size(), binaryTree::size(), SortableList< T >::sort(), Foam::sqr(), binaryTree::treeMin(), binaryTree::treeSuccessor(), x, and Foam::Zero.
|
inline |
Definition at line 198 of file binaryTree.H.
References binaryTree::treeMin().
Referenced by binaryTree::balance().
|
inline |
Definition at line 329 of file binaryTreeI.H.
References binaryNode::leafLeft(), and binaryNode::nodeLeft().
|
inline |
Definition at line 205 of file binaryTree.H.
References binaryTree::clear(), binaryTree::isFull(), binaryTree::resetNumRetrieve(), and binaryTree::treeSuccessor().
Referenced by binaryTree::balance(), binaryTree::deleteAllNode(), binaryTree::resetNumRetrieve(), and binaryTree::treeSuccessor().
Foam::chemPointISAT * treeSuccessor | ( | chemPointISAT * | x | ) |
Definition at line 456 of file binaryTree.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, binaryNode::leafLeft(), binaryNode::leafRight(), chemPointISAT::node(), binaryNode::nodeLeft(), binaryNode::nodeRight(), binaryNode::parent(), and binaryTree::treeMin().
Referenced by binaryTree::balance(), binaryTree::resetNumRetrieve(), and binaryTree::treeMin().
|
inline |
Removes every entries of the tree and delete the associated objects.
Definition at line 346 of file binaryTreeI.H.
Referenced by binaryTree::treeMin().
|
inline |
ListFull.
Definition at line 359 of file binaryTreeI.H.
Referenced by binaryTree::treeMin().
|
inline |
Definition at line 365 of file binaryTreeI.H.
References chemPointISAT::resetNumRetrieve(), binaryTree::treeMin(), and binaryTree::treeSuccessor().
Referenced by binaryTree::treeMin().