From 30debed9d28d34eb1af76b94571fb98dc6bb615e Mon Sep 17 00:00:00 2001
From: Nicolas Marsic <marsic@temf.tu-darmstadt.de>
Date: Wed, 21 Apr 2021 20:42:59 +0200
Subject: [PATCH] bug fix in CCC

---
 simulation/CCC.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/simulation/CCC.cpp b/simulation/CCC.cpp
index b65ff8d1..c5299ffb 100644
--- a/simulation/CCC.cpp
+++ b/simulation/CCC.cpp
@@ -231,7 +231,7 @@ void compute(const Options& option){
 
   // Get solver to use ASM (if PETSc) //
   IS is[2];
-  try{
+  if(!solver.compare("petsc")){
     SolverPETSc<double>& solver =
       dynamic_cast<SolverPETSc<double>&>(system.getSolver());
 
@@ -250,8 +250,6 @@ void compute(const Options& option){
     // Setup subsolvers
     solver.setPostKSPSetUp(asmSubSolver);
   }
-  catch(...){
-  }
 
   // Solve //
   cout << "Solving..." << endl << flush;
@@ -310,14 +308,12 @@ void compute(const Options& option){
   }
 
   // Clear PETSc stuff (if we used PETSc) //
-  try{
+  if(!solver.compare("petsc")){
     dynamic_cast<SolverPETSc<double>&>(system.getSolver());
 
     ISDestroy(&is[0]);
     ISDestroy(&is[1]);
   }
-  catch(...){
-  }
 
   // Clear other stuff //
   for(int i = 0; i < nPhi; i++)
-- 
GitLab