diff --git a/expui/FieldGenerator.cc b/expui/FieldGenerator.cc index b12df759..c79c180b 100644 --- a/expui/FieldGenerator.cc +++ b/expui/FieldGenerator.cc @@ -1,3 +1,4 @@ +#include #include #include #include @@ -259,6 +260,14 @@ namespace Field const std::string prefix, const std::string outdir) { + if (myid==0) { + // Verify existence of directory + bool filepathExists = std::filesystem::is_directory(outdir); + if (not filepathExists) + throw std::runtime_error("FieldGenerator::file_lines: directory <" + + outdir + "> does not exist"); + } + auto db = lines(basis, coefs, beg, end, num); if (myid==0) { @@ -505,6 +514,14 @@ namespace Field const std::string prefix, const std::string outdir) { + if (myid==0) { + // Verify existence of directory + bool filepathExists = std::filesystem::is_directory(outdir); + if (not filepathExists) + throw std::runtime_error("FieldGenerator::file_slices: directory <" + + outdir + "> does not exist"); + } + auto db = slices(basis, coefs); if (myid==0) { @@ -710,6 +727,14 @@ namespace Field const std::string prefix, const std::string outdir) { + if (myid==0) { + // Verify existence of directory + bool filepathExists = std::filesystem::is_directory(outdir); + if (not filepathExists) + throw std::runtime_error("FieldGenerator::file_volumes: directory <" + + outdir + "> does not exist"); + } + auto db = volumes(basis, coefs); int bunch = db.size()/numprocs; diff --git a/exputil/VtkGrid.cc b/exputil/VtkGrid.cc index 395e5631..1c8f181f 100644 --- a/exputil/VtkGrid.cc +++ b/exputil/VtkGrid.cc @@ -182,9 +182,9 @@ void VtkGrid::Add(const std::vector& data, const std::string& name) // int I = 0; - for (int i=0; i(data[(k*ny + j)*nx + i]); } } diff --git a/pyEXP/FieldWrappers.cc b/pyEXP/FieldWrappers.cc index 9cfca7e9..0b68fb9b 100644 --- a/pyEXP/FieldWrappers.cc +++ b/pyEXP/FieldWrappers.cc @@ -399,10 +399,7 @@ void FieldGeneratorClasses(py::module &m) { See also -------- -<<<<<<< HEAD -======= points : generate fields at an array of mesh points ->>>>>>> pointMesh slices : generate fields in a surface slice given by the initializtion grid volumes : generate fields in volume given by the initializtion grid