diff --git a/NonLinearSolver/modelReduction/Tree.cpp b/NonLinearSolver/modelReduction/Tree.cpp index 185581bb43f57cfa230ca5739b0517fd8828f4ca..5eb583083f44fbe092e107cc817f898d36512a1f 100644 --- a/NonLinearSolver/modelReduction/Tree.cpp +++ b/NonLinearSolver/modelReduction/Tree.cpp @@ -2138,7 +2138,7 @@ void Tree::clear() _root = NULL; }; -void Tree::initialize(bool rand, bool normalizedWeight) +void Tree::initialize(bool rand, bool normalizedWeight, bool type) { // random weight for leaves unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); @@ -2174,7 +2174,14 @@ void Tree::initialize(bool rand, bool normalizedWeight) if (normalizedWeight) { double vv = (n->af->getVal(n->weight))/toltalWeightLeaves; - n->weight = n->af->getReciprocalVal(vv); + if (type) + { + n->weight = n->af->getReciprocalVal(vv); + } + else + { + n->weight = vv; + } } // propagate data double w = n->weight; diff --git a/NonLinearSolver/modelReduction/Tree.h b/NonLinearSolver/modelReduction/Tree.h index 2f775afd5068e61beaa40ecd4409930e1fae1493..afa913b7fa07e48ad83d02ca5284bdb5dc1794eb 100644 --- a/NonLinearSolver/modelReduction/Tree.h +++ b/NonLinearSolver/modelReduction/Tree.h @@ -59,7 +59,7 @@ class Tree void printTree() const; void printTreeInteraction(const std::string fname="treeInteraction.txt", bool colorMat = true, int dir=1) const; void clear(); - void initialize(bool rand=true, bool normalizedWeight=true); + void initialize(bool rand=true, bool normalizedWeight=true, bool type = true); const TreeNode* getRootNode() const {return _root;}; void assignMaterialLaws(int numPhases);