From 9db5f37da2b3a5d3630d8c7d7d6ff2bf8aab7cb5 Mon Sep 17 00:00:00 2001 From: Kursat Yurt Date: Thu, 3 Nov 2022 22:50:59 +0100 Subject: [PATCH 1/6] Add C++ Implementation of aste-join --- CMakeLists.txt | 19 ++- src/precice-aste-join.cpp | 320 ++++++++++++++++++++++++++++++++++++++ src/precice-aste-join.hpp | 80 ++++++++++ 3 files changed, 418 insertions(+), 1 deletion(-) create mode 100644 src/precice-aste-join.cpp create mode 100644 src/precice-aste-join.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f969e0c6..ec7930d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,8 @@ endif() find_package(MPI REQUIRED) +option(ASTE_USE_ASTE_JOINER_CPP "Use C++ implementation of precice-aste-join" ON) + add_executable(precice-aste-run src/precice-aste-run.cpp src/common.cpp src/mesh.cpp src/configreader.cpp src/modes.cpp src/utilities.cpp src/logger.cpp) target_include_directories(precice-aste-run PRIVATE src thirdparty) target_link_libraries(precice-aste-run @@ -62,6 +64,14 @@ if(METIS_FOUND) target_link_libraries(precice-aste-run metisAPI) endif() +if(ASTE_USE_ASTE_JOINER_CPP) +add_executable(precice-aste-join src/precice-aste-join.cpp) +target_include_directories(precice-aste-join PRIVATE src thirdparty) +target_link_libraries(precice-aste-join + ${Boost_LIBRARIES} + ${VTK_LIBRARIES} +) +endif() add_executable(testing tests/testing.cpp tests/read_test.cpp tests/write_test.cpp src/mesh.cpp src/logger.cpp) target_include_directories(testing PRIVATE src thirdparty) @@ -77,13 +87,15 @@ if (VTK_VERSION VERSION_LESS "8.90.0") else () # vtk_module_autoinit is needed vtk_module_autoinit( - TARGETS precice-aste-run testing + TARGETS precice-aste-run testing precice-aste-join MODULES ${VTK_LIBRARIES} ) endif() file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-partition DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +if(NOT ASTE_USE_ASTE_JOINER_CPP) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-join DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif() file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-evaluate DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) include(GNUInstallDirs) @@ -91,7 +103,12 @@ install(TARGETS precice-aste-run DESTINATION ${CMAKE_INSTALL_BINDIR}) if(METIS_FOUND) install(TARGETS metisAPI DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() +if(ASTE_USE_ASTE_JOINER_CPP) +install(TARGETS precice-aste-join DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-partition ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-evaluate DESTINATION ${CMAKE_INSTALL_BINDIR}) +else() install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-partition ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-join ${CMAKE_CURRENT_SOURCE_DIR}/src/precice-aste-evaluate DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() enable_testing() diff --git a/src/precice-aste-join.cpp b/src/precice-aste-join.cpp new file mode 100644 index 00000000..d91f0914 --- /dev/null +++ b/src/precice-aste-join.cpp @@ -0,0 +1,320 @@ +#include "precice-aste-join.hpp" + +auto getOptions(int argc, char *argv[]) -> OptionMap +{ + namespace po = boost::program_options; + + // Declare the supported options. + po::options_description desc("Allowed options"); + desc.add_options()("help", "produce help message")("mesh,m", po::value(), "The partitioned mesh prefix used as input (only VTU format is accepted)(Looking for _<#filerank>.vtu).")("output,o", po::value(), "The output mesh. Can be VTK or VTU format. If it is not given _joined.vtk will be used.")("recovery,r", po::value(), "The path to the recovery file to fully recover it's state.")("numparts,n", po::value()->default_value(0), "The number of parts to read from the input mesh. By default the entire mesh is read.")("directory,dir", po::value()->default_value("."), "Directory for output files (optional)"); + + po::variables_map vm; + try { + po::store(parse_command_line(argc, argv, desc), vm); + + if (vm.count("help")) { + std::cout << desc << std::endl; + std::exit(EXIT_SUCCESS); + } + // Needs to be called + po::notify(vm); + + if (!vm.count("mesh")) { + std::cout << "You must specify a mesh file to read from." << std::endl; + std::exit(EXIT_SUCCESS); + } + + } catch (const std::exception &e) { + std::cerr << "ERROR: " << e.what() << "\n"; + std::cerr << desc << std::endl; + std::exit(EXIT_FAILURE); + } + return vm; +} + +void readRecoveryFile(const std::string &recoveryFile, int &size, std::vector &cellTypes, std::vector> &cells) +{ + // Parse the file + std::ifstream ifs(recoveryFile); + json recoveryData = json::parse(ifs); + // Get content + try { + size = recoveryData["size"].get(); + } catch (nlohmann::detail::parse_error &) { + std::cerr << "Error while parsing recovery file \"size\" is missing"; + std::exit(EXIT_FAILURE); + } catch (nlohmann::detail::type_error &) { + std::cerr << "Error while parsing recovery file \"size\" is missing"; + std::exit(EXIT_FAILURE); + } + + try { + cellTypes = recoveryData["cell_types"].get>(); + } catch (nlohmann::detail::parse_error &) { + std::cerr << "Error while parsing recovery file \"cell_types\" is missing"; + std::exit(EXIT_FAILURE); + } catch (nlohmann::detail::type_error &) { + std::cerr << "Error while parsing recovery file \"cell_types\" is missing"; + std::exit(EXIT_FAILURE); + } + + try { + cells = recoveryData["cells"].get>>(); + } catch (nlohmann::detail::parse_error &) { + std::cerr << "Error while parsing recovery file \"cells\" is missing"; + std::exit(EXIT_FAILURE); + } catch (nlohmann::detail::type_error &) { + std::cerr << "Error while parsing recovery file \"cells\" is missing"; + std::exit(EXIT_FAILURE); + } +} + +auto countPartitions(const std::string &prefix) -> size_t +{ + namespace fs = boost::filesystem; + + std::string filename; + size_t count = 0; + + while (true) { + filename = prefix + "_" + std::to_string(count) + ".vtu"; + if (!fs::exists(filename)) { + break; + } + ++count; + } + return count; +} + +void writeMesh(const std::string &filename, const std::string &directory, vtkSmartPointer mesh) +{ + namespace fs = boost::filesystem; + if (fs::exists(directory)) { + if (!fs::is_directory(directory)) { + std::cerr << "Error: " << directory << " is not a directory." << std::endl; + std::exit(EXIT_FAILURE); + } + } else { + if (!fs::create_directory(directory)) { + std::cerr << "Error: Could not create directory " << directory << std::endl; + std::exit(EXIT_FAILURE); + } + } + + auto output_path = fs::current_path() / fs::path(directory) / fs::path(filename); + auto output_filename = output_path.c_str(); + + if (fs::extension(output_filename) == ".vtu") { + vtkSmartPointer writer = vtkSmartPointer::New(); + writer->SetFileName(output_filename); + writer->SetInputData(mesh); + writer->Write(); + } else if (fs::extension(filename) == ".vtk") { + vtkSmartPointer writer = vtkSmartPointer::New(); + writer->SetFileName(output_filename); + writer->SetInputData(mesh); + writer->Write(); + } else { + std::cerr << "Error: " << filename << " is not a valid output file." << std::endl; + std::exit(EXIT_FAILURE); + } +} + +auto partitionwiseMerge(const std::string &prefix, size_t numparts) -> vtkSmartPointer +{ + auto joinedMesh = vtkSmartPointer::New(); + auto joinedPoints = vtkSmartPointer::New(); + auto joinedCells = vtkSmartPointer::New(); + std::vector joinedCellTypes; + + std::vector> joinedDataVec; + std::vector joinedDatanames; + + auto reader = vtkSmartPointer::New(); + for (size_t i = 0; i < numparts; ++i) { + // Read mesh + auto partname = prefix + "_" + std::to_string(i) + ".vtu"; + reader->SetFileName(partname.c_str()); + reader->Update(); + // Extract mesh + auto grid = reader->GetOutput(); + // Cells + const auto offset = joinedPoints->GetNumberOfPoints(); + auto numCells = grid->GetCells()->GetNumberOfCells(); + joinedCellTypes.reserve(joinedCellTypes.size() + numCells); + auto cellIds = vtkSmartPointer::New(); + for (int j = 0; j < numCells; ++j) { + cellIds->Reset(); + std::for_each(grid->GetCell(j)->GetPointIds()->begin(), grid->GetCell(j)->GetPointIds()->end(), [&cellIds, &offset](auto &pointId) { cellIds->InsertNextId(pointId + offset); }); + joinedCells->InsertNextCell(cellIds); + joinedCellTypes.push_back(grid->GetCellType(j)); + } + // Points + auto points = grid->GetPoints(); + joinedPoints->InsertPoints(joinedPoints->GetNumberOfPoints(), grid->GetNumberOfPoints(), 0, points); + // Point Data + auto partPointData = grid->GetPointData(); + auto numArrays = partPointData->GetNumberOfArrays(); + for (int j = 0; j < numArrays; ++j) { + auto partData = partPointData->GetArray(j); + auto name = partData->GetName(); + if (std::find(joinedDatanames.begin(), joinedDatanames.end(), name) == joinedDatanames.end()) { + joinedDatanames.emplace_back(name); + auto newJoinedData = vtkSmartPointer::New(); + newJoinedData->SetName(name); + newJoinedData->SetNumberOfComponents(partData->GetNumberOfComponents()); + joinedDataVec.push_back(newJoinedData); + } + auto joinedData = joinedDataVec[j]; + joinedData->InsertTuples(joinedData->GetNumberOfTuples(), partData->GetNumberOfTuples(), 0, partData); + } + } + + joinedMesh->SetPoints(joinedPoints); + for (const auto &data : joinedDataVec) { + joinedMesh->GetPointData()->AddArray(data); + } + joinedMesh->SetCells(joinedCellTypes.data(), joinedCells); + + return joinedMesh; +} + +auto recoveryMerge(const std::string &prefix, std::size_t numparts, int size, const std::vector &cellTypes, const std::vector> &cells) -> vtkSmartPointer +{ + auto joinedMesh = vtkSmartPointer::New(); + auto joinedPoints = vtkSmartPointer::New(); + auto joinedCells = vtkSmartPointer::New(); + std::vector joinedCellTypes; + + joinedPoints->SetNumberOfPoints(size); + + std::vector> joinedDataVec; + std::vector joinedDataNames; + + auto reader = vtkSmartPointer::New(); + auto globalIds = vtkSmartPointer::New(); + auto localIds = vtkSmartPointer::New(); + + for (size_t i = 0; i < numparts; ++i) { + globalIds->Reset(); + // Read mesh + auto partname = prefix + "_" + std::to_string(i) + ".vtu"; + reader->SetFileName(partname.c_str()); + reader->Update(); + // Extract mesh + auto grid = reader->GetOutput(); + // Points + auto points = grid->GetPoints(); + // Set local Ids + localIds->SetNumberOfIds(points->GetNumberOfPoints()); + std::iota(localIds->begin(), localIds->end(), 0); + // Extract Global Ids + auto partPointData = grid->GetPointData(); + auto globalIdsArray = partPointData->GetArray("GlobalIDs"); + if (globalIdsArray == nullptr) { + std::cerr << "GlobalIDs not found in " << partname << std::endl; + std::cout << " Fall back to partitionwise merge" << std::endl; + return partitionwiseMerge(prefix, numparts); + } else { + globalIds->Allocate(globalIdsArray->GetNumberOfTuples()); + for (vtkIdType j = 0; j < globalIdsArray->GetNumberOfTuples(); ++j) { + globalIds->InsertNextId(static_cast(globalIdsArray->GetTuple1(j))); + } + joinedPoints->InsertPoints(globalIds, localIds, points); + } + + // Cells + auto numCells = grid->GetCells()->GetNumberOfCells(); + joinedCellTypes.reserve(joinedCellTypes.size() + numCells); + auto cellIds = vtkSmartPointer::New(); + for (vtkIdType j = 0; j < numCells; ++j) { + cellIds->Reset(); + std::for_each(grid->GetCell(j)->GetPointIds()->begin(), grid->GetCell(j)->GetPointIds()->end(), [&cellIds, &globalIds](auto &localPointId) { cellIds->InsertNextId(globalIds->GetId(localPointId)); }); + joinedCells->InsertNextCell(cellIds); + joinedCellTypes.push_back(grid->GetCellType(j)); + } + + // Point Data + auto numArrays = partPointData->GetNumberOfArrays(); + for (int j = 0; j < numArrays; ++j) { + auto partData = partPointData->GetArray(j); + auto name = partData->GetName(); + if (std::find(joinedDataNames.begin(), joinedDataNames.end(), name) == joinedDataNames.end()) { + joinedDataNames.emplace_back(name); + auto newJoinedData = vtkSmartPointer::New(); + newJoinedData->SetName(name); + newJoinedData->SetNumberOfComponents(partData->GetNumberOfComponents()); + newJoinedData->Allocate(size); + joinedDataVec.push_back(newJoinedData); + } + auto joinedData = joinedDataVec[j]; + joinedData->InsertTuples(globalIds, localIds, partData); + } + } + + // Add Recovery cells + auto numCells = cells.size(); + joinedCellTypes.reserve(joinedCellTypes.size() + numCells); + auto cellIds = vtkSmartPointer::New(); + for (std::size_t i = 0; i < numCells; ++i) { + cellIds->Reset(); + std::for_each(cells[i].begin(), cells[i].end(), [&cellIds](auto &pointId) { cellIds->InsertNextId(pointId); }); + joinedCells->InsertNextCell(cellIds); + joinedCellTypes.push_back(cellTypes[i]); + } + + // Assembly final mesh + for (const auto &data : joinedDataVec) { + joinedMesh->GetPointData()->AddArray(data); + } + joinedMesh->SetPoints(joinedPoints); + joinedMesh->SetCells(joinedCellTypes.data(), joinedCells); + + return joinedMesh; +} + +void join(int argc, char *argv[]) +{ + namespace fs = boost::filesystem; + auto options = getOptions(argc, argv); + std::string prefix = options["mesh"].as(); + std::string output{}; + std::string recovery{}; + if (options.find("output") == options.end()) { + output = prefix + "_joined.vtk"; + } else { + output = options["output"].as(); + } + if (options.find("recovery") != options.end()) { + recovery = options["recovery"].as(); + } else { + recovery = prefix + "_recovery.json"; + } + std::string directory = options["directory"].as(); + size_t numparts = options["numparts"].as(); + + if (numparts == 0) { + numparts = countPartitions(prefix); + } + + vtkSmartPointer joinedMesh = nullptr; + if (fs::exists(recovery)) { + std::cout << "Recovery file found. Will try to recover the state." << std::endl; + int size; + std::vector cellTypes; + std::vector> cells; + readRecoveryFile(recovery, size, cellTypes, cells); + joinedMesh = recoveryMerge(prefix, numparts, size, cellTypes, cells); + } else { + std::cout << "Recovery file not found. Partition-wise merging will be done." << std::endl; + joinedMesh = partitionwiseMerge(prefix, numparts); + } + + writeMesh(output, options["directory"].as(), joinedMesh); +} + +auto main(int argc, char *argv[]) -> int +{ + join(argc, argv); + return EXIT_SUCCESS; +} diff --git a/src/precice-aste-join.hpp b/src/precice-aste-join.hpp new file mode 100644 index 00000000..58eee133 --- /dev/null +++ b/src/precice-aste-join.hpp @@ -0,0 +1,80 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "json.hpp" + +using OptionMap = boost::program_options::variables_map; +using json = nlohmann::json; + +/** + * @brief Get the Options object from command line arguments + * + * @param argc + * @param argv + * @return OptionMap + */ +auto getOptions(int argc, char *argv[]) -> OptionMap; + +void readRecoveryFile(const std::string &recoveryFile, int &size, std::vector &cellTypes, std::vector> &cells); + +/** + * @brief Count the number of partitioned mesh files for given prefix + * + * @param prefix + * @return size_t + */ +auto countPartitions(const std::string &prefix) -> size_t; + +/** + * @ brief Write the joined mesh to a VTK file + * + * @param filename + * @param directory + * @param mesh + */ +void writeMesh(const std::string &filename, const std::string &directory, vtkSmartPointer mesh); + +/** + * @brief Merge the meshes from the partitioned files + * @details The meshes are merged in the order of the partitioned files + * @details The cells betwen the meshes are not connected + * @details The point numbering is not preserved between unpartitioned mesh and the merged mesh + * + * @param prefix + * @param numparts + * @return vtkSmartPointer + */ +auto partitionwiseMerge(const std::string &prefix, size_t numparts) -> vtkSmartPointer; + +/** + * @brief Merge the meshes from the partitioned files + * @details The meshes are merged to recover the original mesh + * @details All the cells are preserved and connected + * @details The point numbering is preserved between unpartitioned mesh and the merged mesh + * + * @param prefix + * @param numparts + * @param size + * @param cellTypes + * @param cells + * @return vtkSmartPointer + */ +auto recoveryMerge(const std::string &prefix, std::size_t numparts, int size, const std::vector &cellTypes, const std::vector> &cells) -> vtkSmartPointer; + +/** + * @brief Read the commandline arguments and merge the meshes to a single mesh + */ +void join(int argc, char *argv[]); From 1be89ba0eeb1f4f31f8902399740f1febf3a2827 Mon Sep 17 00:00:00 2001 From: Kursat Yurt Date: Fri, 4 Nov 2022 14:12:29 +0100 Subject: [PATCH 2/6] Change default aste-join version to python --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec7930d0..c37da694 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ endif() find_package(MPI REQUIRED) -option(ASTE_USE_ASTE_JOINER_CPP "Use C++ implementation of precice-aste-join" ON) +option(ASTE_USE_ASTE_JOINER_CPP "Use C++ implementation of precice-aste-join" OFF) add_executable(precice-aste-run src/precice-aste-run.cpp src/common.cpp src/mesh.cpp src/configreader.cpp src/modes.cpp src/utilities.cpp src/logger.cpp) target_include_directories(precice-aste-run PRIVATE src thirdparty) From 09c398b7963528e00dbc7b9728c99efb706c7fe5 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Fri, 27 Oct 2023 15:51:44 +0200 Subject: [PATCH 3/6] Use double precision format where necessary --- src/precice-aste-join.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/precice-aste-join.cpp b/src/precice-aste-join.cpp index d91f0914..20ab4ea2 100644 --- a/src/precice-aste-join.cpp +++ b/src/precice-aste-join.cpp @@ -113,6 +113,7 @@ void writeMesh(const std::string &filename, const std::string &directory, vtkSma vtkSmartPointer writer = vtkSmartPointer::New(); writer->SetFileName(output_filename); writer->SetInputData(mesh); + writer->SetFileTypeToBinary(); writer->Write(); } else { std::cerr << "Error: " << filename << " is not a valid output file." << std::endl; @@ -122,9 +123,10 @@ void writeMesh(const std::string &filename, const std::string &directory, vtkSma auto partitionwiseMerge(const std::string &prefix, size_t numparts) -> vtkSmartPointer { - auto joinedMesh = vtkSmartPointer::New(); - auto joinedPoints = vtkSmartPointer::New(); - auto joinedCells = vtkSmartPointer::New(); + auto joinedMesh = vtkSmartPointer::New(); + auto joinedPoints = vtkSmartPointer::New(); + joinedPoints->SetDataTypeToDouble(); + auto joinedCells = vtkSmartPointer::New(); std::vector joinedCellTypes; std::vector> joinedDataVec; @@ -181,9 +183,10 @@ auto partitionwiseMerge(const std::string &prefix, size_t numparts) -> vtkSmartP auto recoveryMerge(const std::string &prefix, std::size_t numparts, int size, const std::vector &cellTypes, const std::vector> &cells) -> vtkSmartPointer { - auto joinedMesh = vtkSmartPointer::New(); - auto joinedPoints = vtkSmartPointer::New(); - auto joinedCells = vtkSmartPointer::New(); + auto joinedMesh = vtkSmartPointer::New(); + auto joinedPoints = vtkSmartPointer::New(); + joinedPoints->SetDataTypeToDouble(); + auto joinedCells = vtkSmartPointer::New(); std::vector joinedCellTypes; joinedPoints->SetNumberOfPoints(size); From fed846086d0e8c263d22264becadd1de6654ea91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCr=C5=9Fat=20Yurt?= <57598663+kursatyurt@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:33:52 +0100 Subject: [PATCH 4/6] Update src/precice-aste-join.cpp Co-authored-by: David Schneider --- src/precice-aste-join.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/precice-aste-join.cpp b/src/precice-aste-join.cpp index 20ab4ea2..e74cc697 100644 --- a/src/precice-aste-join.cpp +++ b/src/precice-aste-join.cpp @@ -41,7 +41,7 @@ void readRecoveryFile(const std::string &recoveryFile, int &size, std::vector(); } catch (nlohmann::detail::parse_error &) { - std::cerr << "Error while parsing recovery file \"size\" is missing"; + std::cerr << "Error while parsing the recovery file: \"size\" attribute is missing"; std::exit(EXIT_FAILURE); } catch (nlohmann::detail::type_error &) { std::cerr << "Error while parsing recovery file \"size\" is missing"; From c28ff64fb077f94c303db9f40be9b220847856e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCr=C5=9Fat=20Yurt?= <57598663+kursatyurt@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:34:37 +0100 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: David Schneider --- src/precice-aste-join.cpp | 4 ++-- src/precice-aste-join.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/precice-aste-join.cpp b/src/precice-aste-join.cpp index e74cc697..f7bf724f 100644 --- a/src/precice-aste-join.cpp +++ b/src/precice-aste-join.cpp @@ -266,7 +266,7 @@ auto recoveryMerge(const std::string &prefix, std::size_t numparts, int size, co joinedCellTypes.push_back(cellTypes[i]); } - // Assembly final mesh + // Assemble final mesh for (const auto &data : joinedDataVec) { joinedMesh->GetPointData()->AddArray(data); } @@ -302,7 +302,7 @@ void join(int argc, char *argv[]) vtkSmartPointer joinedMesh = nullptr; if (fs::exists(recovery)) { - std::cout << "Recovery file found. Will try to recover the state." << std::endl; + std::cout << "Recovery file found. Recovering the connectivity information of the mesh." << std::endl; int size; std::vector cellTypes; std::vector> cells; diff --git a/src/precice-aste-join.hpp b/src/precice-aste-join.hpp index 58eee133..0a21b0eb 100644 --- a/src/precice-aste-join.hpp +++ b/src/precice-aste-join.hpp @@ -39,7 +39,7 @@ void readRecoveryFile(const std::string &recoveryFile, int &size, std::vector size_t; /** - * @ brief Write the joined mesh to a VTK file + * @brief Write the joined mesh to a VTK file * * @param filename * @param directory From 69efe807a83a28af66622659aec97ff6d39dfc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=BCr=C5=9Fat=20Yurt?= <57598663+kursatyurt@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:43:46 +0100 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: David Schneider --- src/precice-aste-join.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/precice-aste-join.cpp b/src/precice-aste-join.cpp index f7bf724f..3fa0a4c8 100644 --- a/src/precice-aste-join.cpp +++ b/src/precice-aste-join.cpp @@ -51,7 +51,7 @@ void readRecoveryFile(const std::string &recoveryFile, int &size, std::vector>(); } catch (nlohmann::detail::parse_error &) { - std::cerr << "Error while parsing recovery file \"cell_types\" is missing"; + std::cerr << "Error while parsing the recovery file: \"cell_types\" attribute is missing"; std::exit(EXIT_FAILURE); } catch (nlohmann::detail::type_error &) { std::cerr << "Error while parsing recovery file \"cell_types\" is missing";