From bc87f7748016f28e555a53f8815e300bac87459a Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Thu, 29 Oct 2020 17:42:39 +0100
Subject: [PATCH] [io][partialassembler] Use format for output

---
 dumux/assembly/partialreassembler.hh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dumux/assembly/partialreassembler.hh b/dumux/assembly/partialreassembler.hh
index 52defa5d3c..88c436fa7d 100644
--- a/dumux/assembly/partialreassembler.hh
+++ b/dumux/assembly/partialreassembler.hh
@@ -30,6 +30,7 @@
 #include <dune/grid/common/gridenums.hh>
 #include <dune/istl/multitypeblockvector.hh>
 
+#include <dumux/io/format.hh>
 #include <dumux/common/typetraits/isvalid.hh>
 #include <dumux/discretization/method.hh>
 #include <dumux/parallel/vectorcommdatahandle.hh>
@@ -486,11 +487,10 @@ public:
         if (comm.size() > 1)
             greenElems_ = comm.sum(greenElems_);
 
-        auto reassembledElems = totalElems_ - greenElems_;
-        auto width = std::to_string(totalElems_).size();
-        outStream << ", reassembled " << std::setw(width)
-            << reassembledElems << " (" << std::setw(3)
-            << 100*reassembledElems/totalElems_ << "%) elements";
+        const auto reassembledElems = totalElems_ - greenElems_;
+        const auto width = Fmt::formatted_size("{}", totalElems_);
+        outStream << Fmt::format(", reassembled {:{}} ({:3}%) elements",
+                                 reassembledElems, width, 100*reassembledElems/totalElems_);
     }
 
     EntityColor elementColor(size_t idx) const
-- 
GitLab