Skip to content

Commit

Permalink
Do not report invalid_unsigned_int for valid output
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Feb 28, 2025
1 parent 813e955 commit 5f8d6c2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions source/postprocess/global_statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,19 @@ namespace aspect
if (column_name == advection_iterations[i].first)
column_position = i;

// If the solver was not called (e.g. the field
// was computed by the material model), then the solver control
// object stores an invalid number of iterations. However, it
// is equally true and more intuitive to say that in this case
// the solver did not need to do any iterations.
unsigned int n_iterations = solver_control.last_step();
if (n_iterations == numbers::invalid_unsigned_int)
n_iterations = 0;

if (column_position == numbers::invalid_unsigned_int)
advection_iterations.emplace_back(column_name,std::vector<unsigned int>(1,solver_control.last_step()));
advection_iterations.emplace_back(column_name,std::vector<unsigned int>(n_iterations));
else
advection_iterations[column_position].second.push_back(solver_control.last_step());
advection_iterations[column_position].second.push_back(n_iterations);
}


Expand Down

0 comments on commit 5f8d6c2

Please sign in to comment.