Skip to content
Snippets Groups Projects
Commit cc41c309 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Control damping through a parameter

parent c531499f
No related branches found
No related tags found
No related merge requests found
...@@ -392,6 +392,7 @@ int main(int argc, char *argv[]) { ...@@ -392,6 +392,7 @@ int main(int argc, char *argv[]) {
VectorType u_saved; VectorType u_saved;
double const fixedPointTolerance = double const fixedPointTolerance =
parset.get<double>("solver.tnnmg.fixed_point_tolerance"); parset.get<double>("solver.tnnmg.fixed_point_tolerance");
double const damping = parset.get<double>("solver.damping");
for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) { for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) {
stateUpdater->solve(ud); stateUpdater->solve(ud);
if (state_fpi == 1) if (state_fpi == 1)
...@@ -399,7 +400,6 @@ int main(int argc, char *argv[]) { ...@@ -399,7 +400,6 @@ int main(int argc, char *argv[]) {
else { else {
SingletonVectorType computed_state; SingletonVectorType computed_state;
stateUpdater->extractState(computed_state); stateUpdater->extractState(computed_state);
double const damping = 0.5;
alpha *= damping; alpha *= damping;
alpha.axpy(1.0 - damping, computed_state); alpha.axpy(1.0 - damping, computed_state);
} }
......
...@@ -23,6 +23,7 @@ width = 5 ...@@ -23,6 +23,7 @@ width = 5
[solver] [solver]
tolerance = 1e-10 tolerance = 1e-10
damping = 0.0
[solver.tnnmg] [solver.tnnmg]
maxiterations = 1000000 maxiterations = 1000000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment