55
66#include " redblood/CellControllerBuilder.h"
77
8+ #include < boost/uuid/uuid_io.hpp>
9+
810#include " io/PathManager.h"
911#include " redblood/FaderCell.h"
1012#include " redblood/MeshIO.h"
@@ -366,9 +368,11 @@ namespace hemelb::redblood {
366368 ioComms.Barrier ();
367369
368370 for (auto & cell : cells) {
369- std::stringstream filename;
370- filename << rbcOutputDir << cell->GetTag () << " _t_" << timestep << " .vtp" ;
371-
371+ // to_chars guarantees to write exactly 36 chars, also need .vtp\0
372+ char name[41 ];
373+ boost::uuids::to_chars (cell->GetTag (), name);
374+ std::strncpy (name + 36 , " .vtp" , 5 );
375+ auto filename = rbcOutputDir / name;
372376 std::shared_ptr<redblood::CellBase> cell_base = [&cell]() {
373377 if (auto fader = std::dynamic_pointer_cast<redblood::FaderCell>(cell)) {
374378 return fader->GetWrapeeCell ();
@@ -380,7 +384,7 @@ namespace hemelb::redblood {
380384 auto cell_cast = std::dynamic_pointer_cast<redblood::Cell>(cell_base);
381385 assert (cell_cast);
382386 auto meshio = redblood::VTKMeshIO{};
383- meshio.writeFile (filename.str (), *cell_cast, *unitConverter);
387+ meshio.writeFile (filename.native (), *cell_cast, *unitConverter);
384388 }
385389 }
386390 };
0 commit comments