Carmen Code
 All Classes Files Functions Variables Macros Pages
Functions
InitTree.cpp File Reference

Init graded tree (only for multiresolution solver) More...

#include "Carmen.h"
Include dependency graph for InitTree.cpp:

Functions

void InitTree (Node *Root)
 Inits tree structure from initial condition, starting form the node Root. Only for multiresolution computations. More...
 

Detailed Description

Init graded tree (only for multiresolution solver)

Function Documentation

void InitTree ( Node Root)

Inits tree structure from initial condition, starting form the node Root. Only for multiresolution computations.

Parameters
RootRoot
Returns
void
23 {
24  // --- Local variables ---
25 
26  int l; // Counter on levels
27 
28  // --- Init cell-average value in root and split it ---
29 
30  if (Recovery && UseBackup)
31 
32  Root->restore();
33 
34  else
35  {
36  Root->initValue();
37 
38  // --- Add and init nodes in different levels, when necessary ---
39 
40  for (l=1; l <= ScaleNb; l++)
41  Root->addLevel();
42  }
43 
44  // -- Check if tree is graded ---
45 
46  if (debug) Root->checkGradedTree();
47 
48 }
int ScaleNb
Definition: Parameters.cpp:87
void checkGradedTree()
Checks if the tree is graded. If not, an error is emitted. Only for debugging.
Definition: Node.cpp:2630
void initValue()
Computes the initial value.
Definition: Node.cpp:124
bool debug
Definition: Parameters.cpp:142
bool UseBackup
Definition: Parameters.cpp:58
bool Recovery
Definition: Parameters.cpp:59
void addLevel()
Adds levels when needed.
Definition: Node.cpp:191
void restore()
Restores the tree structure and the cell-averages from the file carmen.bak. This file was created by ...
Definition: Node.cpp:2761

Here is the caller graph for this function: