diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-03 09:55:37 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-03 09:55:37 -0300 |
commit | 96709625acd58b2b472b9b697e3f04e8b2f28509 (patch) | |
tree | 1e8670a2b0c405fd338304b827933ac3956f69a8 /fourier_integrator.cpp | |
parent | aef5ae2acb8f34e0b18c46f2a24680e59158d6d1 (diff) | |
download | code-96709625acd58b2b472b9b697e3f04e8b2f28509.tar.gz code-96709625acd58b2b472b9b697e3f04e8b2f28509.tar.bz2 code-96709625acd58b2b472b9b697e3f04e8b2f28509.zip |
Save every correlation function.
Diffstat (limited to 'fourier_integrator.cpp')
-rw-r--r-- | fourier_integrator.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/fourier_integrator.cpp b/fourier_integrator.cpp index dd1b2d3..db5e07e 100644 --- a/fourier_integrator.cpp +++ b/fourier_integrator.cpp @@ -198,23 +198,29 @@ int main(int argc, char* argv[]) { z *= Cnew[0]; - Real energy = 0; - - for (unsigned i = 0; i < n; i++) { - energy += y * R[i] * df(λ, p, s, C[i]) * M_PI * Δτ; - } - - std::cerr << "y " << y << " iteration " << it << ": " << sqrt(ΔC / C.size()) << " " << pow(y, 2) / z << " " << energy << std::endl; if (it > maxIterations) { it = 0; γ /= 2; } } - } - for (unsigned i = 0; i < C.size(); i++) { - std::cout << i * Δτ * M_PI << " " << C[i] << std::endl; + Real energy = 0; + + for (unsigned i = 0; i < n; i++) { + energy += y * R[i] * df(λ, p, s, C[i]) * M_PI * Δτ; + } + + std::cerr << "y " << y << " " << energy << std::endl; + + for (unsigned i = 0; i < C.size(); i++) { + std::cout << i * Δτ * M_PI << " " << C[i] << " "; + } + std::cout << std::endl; + for (unsigned i = 0; i < R.size(); i++) { + std::cout << i * Δτ * M_PI << " " << R[i] << " "; + } + std::cout << std::endl; } return 0; |