diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-05-14 22:52:14 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-05-14 22:52:14 -0300 |
commit | 4c045af4a3d3a12b1e4e73bc9ab1789ceb7b4d7e (patch) | |
tree | 98ecbd90a29fb8a56270dcc4b5f959681b297d77 /log-fourier_integrator.cpp | |
parent | 800a3a73161af1ceb58feefc6e6808cbcfaf0c9a (diff) | |
download | code-4c045af4a3d3a12b1e4e73bc9ab1789ceb7b4d7e.tar.gz code-4c045af4a3d3a12b1e4e73bc9ab1789ceb7b4d7e.tar.bz2 code-4c045af4a3d3a12b1e4e73bc9ab1789ceb7b4d7e.zip |
Reintroduced smoothing
Diffstat (limited to 'log-fourier_integrator.cpp')
-rw-r--r-- | log-fourier_integrator.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp index b2a16af..b4b705f 100644 --- a/log-fourier_integrator.cpp +++ b/log-fourier_integrator.cpp @@ -23,12 +23,11 @@ int main(int argc, char* argv[]) { Real βₘₐₓ = 20; Real Δβ = 0.01; bool loadData = false; - unsigned stepsToRespond = 1e5; unsigned pad = 2; int opt; - while ((opt = getopt(argc, argv, "p:s:2:T:t:b:d:k:D:e:0:lg:S:x:P:h:")) != -1) { + while ((opt = getopt(argc, argv, "p:s:2:T:t:b:d:k:D:e:0:lg:x:P:h:")) != -1) { switch (opt) { case 'p': p = atoi(optarg); @@ -75,9 +74,6 @@ int main(int argc, char* argv[]) { case 'l': loadData = true; break; - case 'S': - stepsToRespond = atoi(optarg); - break; default: exit(1); } @@ -135,9 +131,7 @@ int main(int argc, char* argv[]) { Real β = β₀ + Δβ; while (β < βₘₐₓ) { Real γ = γ₀; - Real ΔCmin = 1000; Real ΔCₜ = 100; - unsigned stepsUp = 0; while (ΔCₜ > ε) { auto [RddfCt, dfCt] = RddfCtdfCt(fft, Cₜ, Rₜ, p, s, λ); @@ -179,21 +173,8 @@ int main(int argc, char* argv[]) { std::vector<Real> Cₜ₊₁ = fft.inverse(Ĉₜ₊₁); std::vector<Real> Rₜ₊₁ = fft.inverse(Ȓₜ₊₁); - if (ΔCₜ < 0.9 * ΔCmin) { - ΔCmin = ΔCₜ; - stepsUp = 0; - } else if (ΔCₜ > 10 * ΔCmin) { - ΔCmin = ΔCₜ; - stepsUp = 0; - } else { - stepsUp++; - } - - if (stepsUp > stepsToRespond) { - γ = std::max(γ/2, (Real)1e-3); - stepsUp = 0; - ΔCmin = ΔCₜ; - } + smooth(Cₜ₊₁, ε); + smooth(Rₜ₊₁, ε); for (unsigned i = 0; i < N; i++) { Cₜ[i] += γ * (Cₜ₊₁[i] - Cₜ[i]); |