diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-05 11:08:50 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-05 11:08:50 -0300 |
commit | 44ed3056e815910b7f61c62a9b71976a3c47f4b3 (patch) | |
tree | 196b8588e20d6b2f1f17962888c7c07b51227cbe /get_energy.cpp | |
parent | 69d33f4cc316dd47404f1bcf0178e59fe8d2c076 (diff) | |
download | code-44ed3056e815910b7f61c62a9b71976a3c47f4b3.tar.gz code-44ed3056e815910b7f61c62a9b71976a3c47f4b3.tar.bz2 code-44ed3056e815910b7f61c62a9b71976a3c47f4b3.zip |
Save half the data to the disk
Diffstat (limited to 'get_energy.cpp')
-rw-r--r-- | get_energy.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/get_energy.cpp b/get_energy.cpp index 6e14d9b..ae77595 100644 --- a/get_energy.cpp +++ b/get_energy.cpp @@ -63,11 +63,14 @@ int main(int argc, char* argv[]) { while (y += Δy, y <= yₘₐₓ) { std::ifstream cfile(fourierFile("C", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::binary); if (cfile.is_open()) { - cfile.read((char*)(C.data()), C.size() * sizeof(Real)); + cfile.read((char*)(C.data()), (C.size() / 2) * sizeof(Real)); cfile.close(); + for (unsigned i = 1; i < n; i++) { + C[2 * n - i] = C[i]; + } std::ifstream rfile(fourierFile("R", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::binary); - rfile.read((char*)(R.data()), R.size() * sizeof(Real)); + rfile.read((char*)(R.data()), (R.size() / 2) * sizeof(Real)); rfile.close(); Real e = energy(C, R, p, s, λ, y, Δτ); |