From e4d8007d2184f2caa583089e3049f9ddf9fe97bb Mon Sep 17 00:00:00 2001 From: Rupert Nash Date: Mon, 11 Sep 2023 09:28:38 +0100 Subject: [PATCH] Fix RBC cell output path construction bug --- Code/redblood/CellControllerBuilder.cc | 12 ++++++++---- dependencies/Boost/build.cmake | 4 ++-- dependencies/Boost/find.cmake | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Code/redblood/CellControllerBuilder.cc b/Code/redblood/CellControllerBuilder.cc index c65d4263a..27400405a 100644 --- a/Code/redblood/CellControllerBuilder.cc +++ b/Code/redblood/CellControllerBuilder.cc @@ -5,6 +5,8 @@ #include "redblood/CellControllerBuilder.h" +#include + #include "io/PathManager.h" #include "redblood/FaderCell.h" #include "redblood/MeshIO.h" @@ -366,9 +368,11 @@ namespace hemelb::redblood { ioComms.Barrier(); for (auto& cell : cells) { - std::stringstream filename; - filename << rbcOutputDir << cell->GetTag() << "_t_" << timestep << ".vtp"; - + // to_chars guarantees to write exactly 36 chars, also need .vtp\0 + char name[41]; + boost::uuids::to_chars(cell->GetTag(), name); + std::strncpy(name + 36, ".vtp", 5); + auto filename = rbcOutputDir / name; std::shared_ptr cell_base = [&cell]() { if (auto fader = std::dynamic_pointer_cast(cell)) { return fader->GetWrapeeCell(); @@ -380,7 +384,7 @@ namespace hemelb::redblood { auto cell_cast = std::dynamic_pointer_cast(cell_base); assert(cell_cast); auto meshio = redblood::VTKMeshIO{}; - meshio.writeFile(filename.str(), *cell_cast, *unitConverter); + meshio.writeFile(filename.native(), *cell_cast, *unitConverter); } } }; diff --git a/dependencies/Boost/build.cmake b/dependencies/Boost/build.cmake index ad392e36d..80d30d81e 100644 --- a/dependencies/Boost/build.cmake +++ b/dependencies/Boost/build.cmake @@ -4,13 +4,13 @@ # license in the file LICENSE. include_guard() -find_file(BOOST_TARBALL boost_1_75_0.tar.gz +find_file(BOOST_TARBALL boost_1_77_0.tar.gz DOC "Path to download BOOST (can be url http://)" PATHS ${HEMELB_DEPENDENCIES_PATH}/distributions ) if(NOT BOOST_TARBALL) message("No boost source found, will download.") - set(BOOST_TARBALL https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz + set(BOOST_TARBALL https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz CACHE STRING "Path to download BOOST (can be local file://)" FORCE) endif() ExternalProject_Add( diff --git a/dependencies/Boost/find.cmake b/dependencies/Boost/find.cmake index efa0bef6a..dc17f89ad 100644 --- a/dependencies/Boost/find.cmake +++ b/dependencies/Boost/find.cmake @@ -4,4 +4,4 @@ # license in the file LICENSE. include_guard() -find_package(Boost 1.75 ${DEPS_FIND_MODE_Boost}) +find_package(Boost 1.77 ${DEPS_FIND_MODE_Boost})