Verified Commit dcf34b01 authored by Lars Bilke's avatar Lars Bilke
Browse files

[insitu] Fix cwd in Adaptor.

parent e2fbc057
# .git
Tests/Data
_out/images
......@@ -18,8 +18,7 @@
#include "MeshLib/Mesh.h"
#include "MeshLib/Vtk/VtkMappedMeshSource.h"
#include <filesystem>
#include "filesystem.h"
namespace InSituLib
{
......@@ -41,12 +40,19 @@ void Initialize(BaseLib::ConfigTree const& scripts_config,
for (auto script_config : scripts_config.getConfigSubtreeList("script"))
{
//! \ogs_file_param{prj__insitu__scripts__script__name}
auto scriptName = script_config.getConfigParameter<std::string>("name");
INFO("Initializing in-situ script: {:s}", scriptName);
std::stringstream ss;
ss << path << scriptName;
auto scriptPath =
fs::path(script_config.getConfigParameter<std::string>("name"));
if (scriptPath.is_relative())
{
scriptPath = fs::path(path) / scriptPath;
}
if (!fs::exists(scriptPath))
{
ERR("In-situ script {:s} does not exist!", scriptPath.string());
}
INFO("Initializing in-situ script: {:s}", scriptPath.string());
vtkNew<vtkCPPythonScriptPipeline> pipeline;
pipeline->Initialize(ss.str().c_str());
pipeline->Initialize(scriptPath.c_str());
Processor->AddPipeline(pipeline.GetPointer());
}
}
......@@ -83,11 +89,11 @@ void CoProcess(MeshLib::Mesh const& mesh, double const time,
vtkSource->Update();
dataDescription->GetInputDescriptionByName("input")->SetGrid(
vtkSource->GetOutput());
auto cwd = std::filesystem::current_path();
std::filesystem::current_path(output_directory);
auto cwd = fs::current_path();
fs::current_path(output_directory);
Processor->CoProcess(dataDescription.GetPointer());
std::filesystem::current_path(cwd);
fs::current_path(cwd);
INFO("End InSitu process.");
}
}
} // namespace
} // namespace InSituLib
......@@ -72,7 +72,7 @@ compiler:
libcxx: [libstdc++, libstdc++11, libc++, c++_shared, c++_static]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
apple-clang:
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0", "11.0"]
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0", "11.0", "12.0"]
libcxx: [libstdc++, libc++]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
intel:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment