diff --git a/MeshLib/IO/XDMF/writeXdmf.cpp b/MeshLib/IO/XDMF/writeXdmf.cpp index f7f1ba601ae402f2efa178abc2c7ea5dc6c8020c..1cde24e76acb68c24c8cc73eb309249f3112b3f7 100644 --- a/MeshLib/IO/XDMF/writeXdmf.cpp +++ b/MeshLib/IO/XDMF/writeXdmf.cpp @@ -14,7 +14,6 @@ #include "writeXdmf.h" #include <vtkNew.h> -#include <vtkPXdmf3Writer.h> #include <vtkSmartPointer.h> #include <vtkXdmf3Writer.h> @@ -26,33 +25,15 @@ namespace IO { bool writeXdmf3(const MeshLib::Mesh& mesh, std::string const& file_name) { -#ifdef USE_PETSC - int rank; - MPI_Comm_rank(PETSC_COMM_WORLD, &rank); - int mpi_size; - MPI_Comm_size(PETSC_COMM_WORLD, &mpi_size); - vtkSmartPointer<vtkPXdmf3Writer> writer = - vtkSmartPointer<vtkPXdmf3Writer>::New(); // open file handle - -#else vtkSmartPointer<vtkXdmf3Writer> writer = vtkSmartPointer<vtkXdmf3Writer>::New(); // open file handle -#endif writer->SetFileName(file_name.c_str()); vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; vtkSource->SetMesh(&mesh); vtkSource->Update(); writer->SetInputData(vtkSource->GetOutput()); - -#ifdef USE_PETSC - writer->SetGhostLevel(1); - writer->SetNumberOfPieces(num_partitions); - writer->SetStartPiece(rank); - writer->SetEndPiece(rank); -#endif writer->Write(); - // close file handle return 0; } } // end namespace IO diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index c8723549fddf59f7c4ca2429fe601dac176774cd..54fde42a56b488b124f5f68411db89ba27dd7bda 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -31,20 +31,28 @@ std::unique_ptr<Output> createOutput( { DBUG("Parse output configuration:"); - OutputTypes const output_type = [](auto type) + OutputTypes const output_type = [](auto output_type) { try { - - const std::map<std::string, OutputTypes> outputType_to_enum= - {{"VTK",OutputTypes::vtk}, {"XDMF", OutputTypes::xdmf}}; - return outputType_to_enum.at(type); + const std::map<std::string, OutputTypes> outputType_to_enum = { + {"VTK", OutputTypes::vtk}, {"XDMF", OutputTypes::xdmf}}; + auto type = outputType_to_enum.at(output_type); + +#ifdef USE_PETSC + if (type == ProcessLib::OutputTypes::xdmf) + { + OGS_FATAL("Parallel XDMF output is not supported (yet)."); + } +#endif + + return type; } catch (std::out_of_range& e) { OGS_FATAL("No supported file type provided. Read `{:s}' from <output><type> \ in prj File. Supported: VTK, XDMF.", - type); + output_type); } //! \ogs_file_param{prj__time_loop__output__type} }(config.getConfigParameter<std::string>("type"));