diff options
author | 2022-11-12 08:54:50 -0800 | |
---|---|---|
committer | 2022-11-12 08:54:50 -0800 | |
commit | 5d635b996feff9fac6065930df7b87b83cceb311 (patch) | |
tree | 6c7e1eff348541ebc8ab7bed2d058712815a28fe /Source/Diagnostics/BTDiagnostics.cpp | |
parent | 3afb1f6488ded17912fa80f389f0c6f0f8a62b2a (diff) | |
download | WarpX-5d635b996feff9fac6065930df7b87b83cceb311.tar.gz WarpX-5d635b996feff9fac6065930df7b87b83cceb311.tar.zst WarpX-5d635b996feff9fac6065930df7b87b83cceb311.zip |
Fix warnings with ceil in BTD code (#3518)
* Added static_cast to some real to int conversions
* Fixed typo
Diffstat (limited to 'Source/Diagnostics/BTDiagnostics.cpp')
-rw-r--r-- | Source/Diagnostics/BTDiagnostics.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Diagnostics/BTDiagnostics.cpp b/Source/Diagnostics/BTDiagnostics.cpp index 510c1b946..90b00a24a 100644 --- a/Source/Diagnostics/BTDiagnostics.cpp +++ b/Source/Diagnostics/BTDiagnostics.cpp @@ -135,7 +135,7 @@ void BTDiagnostics::DerivedInitData () const amrex::Real dz_snapshot_grid = dz_lab(dt_boosted_frame, ref_ratio); // Need enough buffers so the snapshot length is longer than the lab frame length // num_buffers * m_buffer_size * dz_snapshot_grid >= Lz - const int num_buffers = ceil(Lz_lab / m_buffer_size / dz_snapshot_grid); + const int num_buffers = static_cast<int>(std::ceil(Lz_lab / m_buffer_size / dz_snapshot_grid)); const int final_snapshot_iteration = m_intervals.GetFinalIteration(); // the final snapshot starts filling when the @@ -156,7 +156,7 @@ void BTDiagnostics::DerivedInitData () // if j = final snapshot starting step, then we want to solve // j dt_boosted_frame >= t_intersect_boost = i * dt_snapshot / gamma / (1+beta) // j >= i / gamma / (1+beta) * dt_snapshot / dt_boosted_frame - const int final_snapshot_starting_step = ceil(final_snapshot_iteration / warpx.gamma_boost / (1._rt+warpx.beta_boost) * m_dt_snapshots_lab / dt_boosted_frame); + const int final_snapshot_starting_step = static_cast<int>(std::ceil(final_snapshot_iteration / warpx.gamma_boost / (1._rt+warpx.beta_boost) * m_dt_snapshots_lab / dt_boosted_frame)); const int final_snapshot_fill_iteration = final_snapshot_starting_step + num_buffers * m_buffer_size - 1; if (final_snapshot_fill_iteration > warpx.maxStep()) { std::string warn_string = |