Skip to content
Snippets Groups Projects
Commit f78423b4 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[NL] INBTS; Add strict constructor checks.

Check vector sizes.
parent bd4d2843
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,21 @@ IterationNumberBasedTimeStepping::IterationNumberBasedTimeStepping(
_initial_dt(initial_dt),
_max_iter(_iter_times_vector.empty() ? 0 : _iter_times_vector.back())
{
assert(iter_times_vector.size() == multiplier_vector.size());
if (_iter_times_vector.empty())
{
OGS_FATAL("Vector of iteration numbers must not be empty.");
}
if (_iter_times_vector.size() != _multiplier_vector.size())
{
OGS_FATAL(
"Vector of iteration numbers must be of the same size as the "
"vector of multipliers.");
}
if (!std::is_sorted(std::begin(_iter_times_vector),
std::end(_iter_times_vector)))
{
OGS_FATAL("Vector of iteration numbers must be sorted.");
}
}
bool IterationNumberBasedTimeStepping::next(double const /*solution_error*/,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment