From 4a0675acafb0f30e456f2069804ed9a2d77da263 Mon Sep 17 00:00:00 2001 From: Sebastian Grimberg Date: Tue, 23 Apr 2024 12:22:10 -0700 Subject: [PATCH] Fix time stamp for values < 1.0 --- palace/models/postoperator.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/palace/models/postoperator.cpp b/palace/models/postoperator.cpp index dc7bb65da..7781a27ad 100644 --- a/palace/models/postoperator.cpp +++ b/palace/models/postoperator.cpp @@ -747,8 +747,16 @@ void PostOperator::WriteFieldsFinal(const ErrorIndicator *indicator) const HasE() ? *E->ParFESpace()->GetParMesh() : *B->ParFESpace()->GetParMesh(); mesh::DimensionalizeMesh(mesh, mesh_Lc0); paraview.SetCycle(paraview.GetCycle() + 1); - paraview.SetTime(std::pow(10.0, 2.0 + static_cast(std::log10(paraview.GetTime()))) - - 1.0); + if (paraview.GetTime() < 1.0) + { + paraview.SetTime(99.0); + } + else + { + // 1 -> 99, 10 -> 999, etc. + paraview.SetTime( + std::pow(10.0, 2.0 + static_cast(std::log10(paraview.GetTime()))) - 1.0); + } mfem::DataCollection::FieldMapType field_map(paraview.GetFieldMap()); // Copy for (const auto &[name, gf] : field_map) {