Skip to content
Snippets Groups Projects
Commit dc16b31c authored by Lars Bilke's avatar Lars Bilke
Browse files

Revert "[cli] Removed vtkMPIController dependency in cli."

This reverts commit 325168f0.
parent 039a5acc
No related branches found
No related tags found
No related merge requests found
...@@ -25,9 +25,16 @@ ...@@ -25,9 +25,16 @@
#include "ProcessLib/TimeLoop.h" #include "ProcessLib/TimeLoop.h"
Simulation::Simulation(int argc, char* argv[]) Simulation::Simulation(int argc, char* argv[])
: linear_solver_library_setup(argc, argv), test_definition{std::nullopt} : linear_solver_library_setup(argc, argv),
#if defined(USE_PETSC)
controller(vtkSmartPointer<vtkMPIController>::New()),
#endif
test_definition{std::nullopt}
{ {
#if defined(USE_PETSC) #if defined(USE_PETSC)
controller->Initialize(&argc, &argv, 1);
vtkMPIController::SetGlobalController(controller);
{ // Can be called only after MPI_INIT. { // Can be called only after MPI_INIT.
int mpi_rank; int mpi_rank;
MPI_Comm_rank(PETSC_COMM_WORLD, &mpi_rank); MPI_Comm_rank(PETSC_COMM_WORLD, &mpi_rank);
...@@ -161,4 +168,7 @@ Simulation::~Simulation() ...@@ -161,4 +168,7 @@ Simulation::~Simulation()
InSituLib::Finalize(); InSituLib::Finalize();
} }
#endif #endif
#if defined(USE_PETSC)
controller->Finalize(1);
#endif
} }
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
* *
*/ */
#ifdef USE_PETSC
#include <vtkMPIController.h>
#include <vtkSmartPointer.h>
#endif
#include "Applications/ApplicationsLib/LinearSolverLibrarySetup.h" #include "Applications/ApplicationsLib/LinearSolverLibrarySetup.h"
#include "Applications/ApplicationsLib/TestDefinition.h" #include "Applications/ApplicationsLib/TestDefinition.h"
...@@ -39,6 +44,9 @@ public: ...@@ -39,6 +44,9 @@ public:
private: private:
ApplicationsLib::LinearSolverLibrarySetup linear_solver_library_setup; ApplicationsLib::LinearSolverLibrarySetup linear_solver_library_setup;
#if defined(USE_PETSC)
vtkSmartPointer<vtkMPIController> controller;
#endif
std::unique_ptr<ProjectData> project_data; std::unique_ptr<ProjectData> project_data;
std::optional<ApplicationsLib::TestDefinition> test_definition; std::optional<ApplicationsLib::TestDefinition> test_definition;
}; };
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