Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/output/xdmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
#include <vector>
#include <algorithm>
#include <iomanip>
#if __has_include(<filesystem>)
#include <filesystem>
namespace fs = std::filesystem;
#elif __has_include(<experimental/filesystem>)
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#error "Missing the <filesystem> header."
#endif

#include "xdmf.hpp"
#include "version.hpp"
#include "idefix.hpp"
Expand Down Expand Up @@ -39,9 +49,9 @@ Xdmf::Xdmf(Input &input, DataBlock *datain) {
}

if(idfx::prank==0) {
if(!std::filesystem::is_directory(outputDirectory)) {
if(!fs::is_directory(outputDirectory)) {
try {
if(!std::filesystem::create_directory(outputDirectory)) {
if(!fs::create_directory(outputDirectory)) {
std::stringstream msg;
msg << "Cannot create directory " << outputDirectory << std::endl;
IDEFIX_ERROR(msg);
Expand Down Expand Up @@ -165,7 +175,7 @@ Xdmf::Xdmf(Input &input, DataBlock *datain) {
cellsubsize[3]);
*/
// Temporary storage on host for 3D arrays
this->vect3D = new float[nx1loc*nx2loc*nx3loc];
this->vect3D = new DUMP_DATATYPE[nx1loc*nx2loc*nx3loc];

// fill the node_coord array
DUMP_DATATYPE x1 = 0.0;
Expand Down Expand Up @@ -274,8 +284,8 @@ Xdmf::Xdmf(Input &input, DataBlock *datain) {

int Xdmf::Write() {
idfx::pushRegion("Xdmf::Write");
std::filesystem::path filename;
std::filesystem::path filename_xmf;
fs::path filename;
fs::path filename_xmf;
hid_t err;
idfx::cout << "Xdmf: Write file n " << xdmfFileNumber << "..." << std::flush;
timer.reset();
Expand Down