Skip to content
Snippets Groups Projects
Verified Commit 503b3160 authored by Tobias Meisel's avatar Tobias Meisel Committed by Lars Bilke
Browse files

[Me/P] Parallel XDMF is not supported msg

Stub for parallel xdmf implementation is removed
parent 9290ff86
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment