diff --git a/expui/FieldGenerator.cc b/expui/FieldGenerator.cc index b12df7592..c79c180b9 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 395e56317..1c8f181f3 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 9cfca7e9d..0b68fb9b2 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 diff --git a/src/FlatDisk.cc b/src/FlatDisk.cc index 706bd95ba..ea3694182 100644 --- a/src/FlatDisk.cc +++ b/src/FlatDisk.cc @@ -109,7 +109,7 @@ void FlatDisk::initialize() if (dump_basis) ortho->dump_basis(runtag); // Set background model - if (conf["background"]) setBackground(); + if (M0_back) setBackground(); } FlatDisk::~FlatDisk(void) @@ -121,8 +121,17 @@ FlatDisk::~FlatDisk(void) void FlatDisk::setBackground() { try { - - YAML::Node Params = conf["background"]; + YAML::Node Params; + + if (conf["background"]) Params = conf["background"]; + else { + Params = conf["diskconf"]; + if (myid==0) // Log file message + std::cout << "---- FlatDisk::setBackground: " + << "M0_BACK set without a 'background' profile" << std::endl + << "---- FlatDisk::setBackground: " + << "using 'diskconf' for 'background' profile" << std::endl; + } std::string name = Params["name"].as(); auto params = Params["parameters"];