mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
Fix variable time steps in AdvectionModule.cpp
This commit is contained in:
parent
b3e879635a
commit
e3b7824dd4
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "../Base/Macros.hpp"
|
#include "../Base/Macros.hpp"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -88,12 +89,9 @@ AdvectionModule::CFLTimeVec(double req_dt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (max_dt < req_dt) {
|
if (max_dt < req_dt) {
|
||||||
std::uint32_t min_floor = static_cast<std::uint32_t>(req_dt / max_dt);
|
const std::uint32_t steps = std::ceil(req_dt / max_dt);
|
||||||
std::vector<double> time_vec(min_floor, max_dt);
|
const double step_dt = req_dt / steps;
|
||||||
|
return std::vector<double>(steps, step_dt);
|
||||||
double diff = req_dt - (max_dt * min_floor);
|
|
||||||
time_vec.push_back(req_dt);
|
|
||||||
return time_vec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::vector<double>(1, req_dt);
|
return std::vector<double>(1, req_dt);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user