64 Node(
const int l=0,
const int i=0,
const int j=0,
const int k=0);
86 inline int cells()
const;
230 void writeTree(
const char* FileName)
const;
247 void writeMesh(
const char* FileName)
const;
324 void split(
const bool init=
false);
353 Vector predictTempAverage()
const;
360 Matrix predictGradient()
const;
367 inline void computeTimeInterpolation();
374 inline void computeTimeExtrapolation();
381 inline void storeTimeEvolution();
388 inline void setInternalNode();
395 inline void setSimpleLeaf();
402 inline void setLeafWithVirtualChildren();
409 inline void setVirtualLeaf();
416 inline bool isInternalNode()
const;
423 inline bool isLeaf()
const;
430 inline bool isSimpleLeaf()
const;
437 inline bool isLeafWithVirtualChildren()
const;
444 inline bool isVirtualLeaf()
const;
451 inline bool hasChildren()
const;
458 inline bool isParentOfLeaf()
const;
465 bool isInsideBoundary()
const;
472 bool isInFluid()
const;
479 bool isOnBoundary()
const;
487 inline bool isBeginTimeCycle()
const;
495 inline bool isEndTimeCycle()
const;
502 inline bool requiresTimeEvolution()
const;
509 inline bool requiresTimeInterpolation()
const;
516 inline bool requiresDivergenceComputation()
const;
523 inline bool detailIsSmall()
const;
543 Node* node(
int l,
int i,
int j = 0,
int k = 0)
const;
554 Cell* cell(
int l,
int i,
int j = 0,
int k = 0)
const;
561 inline Node* parent()
const;
568 inline Cell* parentCell()
const;
578 inline Node* uncle(
const int i,
const int j=0,
const int k=0)
const;
588 inline Cell* uncleCell(
const int i,
const int j=0,
const int k=0)
const;
598 inline Node* cousin(
const int i,
const int j=0,
const int k=0)
const;
608 inline Cell* cousinCell(
const int i,
const int j=0,
const int k=0)
const;
618 inline Node* child(
const int i,
const int j=0,
const int k=0)
const;
628 inline Cell* childCell(
const int i,
const int j=0,
const int k=0)
const;
643 void deleteVirtualChildren();
653 void makeVirtualChildren(
bool init=
false);
708 inline Cell* Node::childCell(
const int i,
const int j,
const int k)
const
710 return cell(Nl+1, 2*Ni+i, 2*Nj+j, 2*Nk+k);
721 inline Node* Node::child(
const int i,
const int j,
const int k)
const
723 return node(Nl+1, 2*Ni+i, 2*Nj+j, 2*Nk+k);
733 inline void Node::computeTimeInterpolation()
746 inline Cell* Node::cousinCell(
const int i,
const int j,
const int k)
const
748 return cell(Nl, Ni+i, Nj+j, Nk+k);
759 inline Node* Node::cousin(
const int i,
const int j,
const int k)
const
761 return node(Nl, Ni+i, Nj+j, Nk+k);
771 inline bool Node::hasChildren()
const
773 return (Flag==0 || Flag==2);
783 inline void Node::setInternalNode()
796 inline void Node::setSimpleLeaf()
808 inline void Node::setLeafWithVirtualChildren()
820 inline void Node::setVirtualLeaf()
833 inline bool Node::isBeginTimeCycle()
const
846 inline bool Node::isEndTimeCycle()
const
858 inline Node* Node::parent()
const
860 return node(Nl-1, (Ni+4)/2-2, (Nj+4)/2-2, (Nk+4)/2-2);
870 inline Cell* Node::parentCell()
const
872 return cell(Nl-1, (Ni+4)/2-2, (Nj+4)/2-2, (Nk+4)/2-2);
882 inline Node* Node::uncle(
const int i,
const int j,
const int k)
const
884 return node(Nl-1, (Ni+4)/2-2 + i, (Nj+4)/2-2 + j, (Nk+4)/2-2 + k);
894 inline Cell* Node::uncleCell(
const int i,
const int j,
const int k)
const
896 return cell(Nl-1, (Ni+4)/2-2 + i, (Nj+4)/2-2 + j, (Nk+4)/2-2 + k);
906 inline bool Node::isInternalNode()
const
918 inline bool Node::isLeaf()
const
920 return (Flag==1 || Flag==2);
930 inline bool Node::isSimpleLeaf()
const
942 inline bool Node::isLeafWithVirtualChildren()
const
954 inline bool Node::isVirtualLeaf()
const
968 inline void Node::storeTimeEvolution()
986 inline void Node::computeTimeExtrapolation()
1003 inline bool Node::requiresDivergenceComputation()
const
1006 if (isInsideBoundary())
return false;
1010 return (isLeaf() && (isBeginTimeCycle()|| isEndTimeCycle()) );
1023 inline bool Node::requiresTimeEvolution()
const
1026 if (isInsideBoundary())
return false;
1030 return (isLeaf() && isBeginTimeCycle());
1043 inline bool Node::requiresTimeInterpolation()
const
1046 if (isInsideBoundary())
return false;
1052 return (isLeaf() && isEndTimeCycle());
void storeGrad()
Stores gradient values into temporary gradient values.
Definition: Node.cpp:1950
void writeTree(const char *FileName) const
Writes tree structure into file FileName. Only for debugging.
Definition: Node.cpp:955
bool TimeAdaptivity
Definition: Parameters.cpp:85
An object Cell contains all the informations of a cell for both multiresolution and finite volume com...
Definition: Cell.h:41
int ScaleNb
Definition: Parameters.cpp:87
An object Node is an element of a graded tree structure, used for multiresolution computations...
Definition: Node.h:38
int QuantityNb
Definition: Parameters.cpp:171
void computeGradient()
Computes velocity gradient (only for Navier-Stokes).
Definition: Node.cpp:2266
Standard class for every vector in Carmen.
Definition: Vector.h:29
void writeFineGrid(const char *FileName, const int L=ScaleNb) const
Writes cell-average values on a regular grid of level L into file FileName.
Definition: Node.cpp:1174
void RungeKutta()
Computes one Runge-Kutta step.
Definition: Node.cpp:2345
int LeafNb
Definition: Parameters.cpp:175
int leaves() const
Returns the number of leaves in the tree.
Definition: Node.h:695
void backup()
Backs up the tree structure and the cell-averages into a file carmen.bak. In further computations...
Definition: Node.cpp:2716
void restoreFineMesh()
Restores the tree structure and the cell-averages from the file carmen.bak in FineMesh format...
Definition: Node.cpp:2821
void checkGradedTree()
Checks if the tree is graded. If not, an error is emitted. Only for debugging.
Definition: Node.cpp:2630
int IterationNo
Definition: Parameters.cpp:168
void computeCorrection()
Computes velocity gradient (only for Navier-Stokes).
Definition: Node.cpp:2188
#define byte
Definition: PreProcessor.h:45
void writeMesh(const char *FileName) const
Writes mesh data for Gnuplot into file FileName.
Definition: Node.cpp:1819
void initValue()
Computes the initial value.
Definition: Node.cpp:124
void fillVirtualChildren()
Fills the cell-average values of every virtual leaf with values predicted from its parent and uncles...
Definition: Node.cpp:624
int adapt()
Computes the details in the leaves and its parent nodes and, in function of the threshold Tolerance...
Definition: Node.cpp:691
int CellNb
Definition: Parameters.cpp:174
void setTempAverage(const int QuantityNo, const real UserAverage)
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the temporary cell-...
Definition: Cell.h:945
void writeAverage(const char *FileName)
Writes cell-average values in multiresolution representation and the corresponding mesh into file Fil...
Definition: Node.cpp:1089
real average(const int QuantityNo) const
Returns the component no. QuantityNo of the cell-average value.
Definition: Cell.h:1128
Standard class for every matrix in Carmen.
Definition: Matrix.h:28
void setLowAverage(const int QuantityNo, const real UserAverage)
Identical to setAverage (int QuantityNo, real UserAverage), but for the vector of the cell-average va...
Definition: Cell.h:969
real tempAverage(const int QuantityNo) const
Returns the component no. QuantityNo of the temporary cell-average value.
Definition: Cell.h:1144
void checkStability()
Checks if the computation is numerically unstable, i.e. if one of the cell-averages is overflow...
Definition: Node.cpp:2430
void computeIntegral()
Computes integral values like e.g. flame velocity, global error, etc.
Definition: Node.cpp:2470
int cells() const
Returns the number of cells in the tree.
Definition: Node.h:684
~Node()
Distructor of Node class. Removes the node from the tree structure. If the node is not a leaf...
Definition: Node.cpp:95
void computeDivergence()
Computes the divergence vector with the space discretization scheme.
Definition: Node.cpp:1977
bool UseBoundaryRegions
Definition: Parameters.cpp:80
int TimeAdaptivityFactor
Definition: Parameters.cpp:86
void writeHeader(const char *FileName) const
Writes header for Data Explorer into file FileName.
Definition: Node.cpp:1028
void addLevel()
Adds levels when needed.
Definition: Node.cpp:191
void smooth()
Deletes the details in the highest level.
Definition: Node.cpp:2874
Node(const int l=0, const int i=0, const int j=0, const int k=0)
Constructor of Node class. Generates a new node at the position (l, i, j, k) in the tree structure...
Definition: Node.cpp:38
void restore()
Restores the tree structure and the cell-averages from the file carmen.bak. This file was created by ...
Definition: Node.cpp:2761
void setAverage(const int QuantityNo, const real UserAverage)
Sets the cell-average of the quantity QuantityNo to UserAverage. Example:
Definition: Cell.h:921
Cell * project()
Computes the cell-average values of all nodes that are not leaves by projection from the cell-average...
Definition: Node.cpp:661
void store()
Stores cell-average values into temporary cell-average values.
Definition: Node.cpp:1913