Skip to content

Commit

Permalink
Update kratos/utilities/variable_utils.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Rubén Zorrilla <rubenzorrillamartinez@hotmail.com>
  • Loading branch information
sunethwarna and rubenzorrilla authored Jun 27, 2020
1 parent e8af14e commit 328369e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kratos/utilities/variable_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,10 @@ void VariableUtils::DistributeVariable(
<< r_node << " is not initialized in " << rModelPart.Name()
<< ". Please initialize it first.";

const auto& r_current_value = r_node.GetValue(rVariable);
const double weight = r_weight_method(r_node);

r_node.SetLock();
r_node.SetValue(rVariable, r_current_value + r_value * weight);
r_node.GetValue(rVariable) += r_value * weight;
r_node.UnSetLock();
}
}
Expand Down

0 comments on commit 328369e

Please sign in to comment.