Skip to content

Commit

Permalink
Fix RBC cell output path construction bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertnash committed Sep 11, 2023
1 parent 1823f89 commit e4d8007
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions Code/redblood/CellControllerBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include "redblood/CellControllerBuilder.h"

#include <boost/uuid/uuid_io.hpp>

#include "io/PathManager.h"
#include "redblood/FaderCell.h"
#include "redblood/MeshIO.h"
Expand Down Expand Up @@ -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<redblood::CellBase> cell_base = [&cell]() {
if (auto fader = std::dynamic_pointer_cast<redblood::FaderCell>(cell)) {
return fader->GetWrapeeCell();
Expand All @@ -380,7 +384,7 @@ namespace hemelb::redblood {
auto cell_cast = std::dynamic_pointer_cast<redblood::Cell>(cell_base);
assert(cell_cast);
auto meshio = redblood::VTKMeshIO{};
meshio.writeFile(filename.str(), *cell_cast, *unitConverter);
meshio.writeFile(filename.native(), *cell_cast, *unitConverter);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions dependencies/Boost/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion dependencies/Boost/find.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit e4d8007

Please sign in to comment.