]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Create a solver if there is not one yet, otherwise continue.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jan 2013 14:51:25 +0000 (14:51 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jan 2013 14:51:25 +0000 (14:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@28184 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/slepc_solver.cc

index 926a76f1ade9e44791d705e418f0e61b9ab8c03d..27988d65ebf9acca1528e10bde63638fa0391bf8 100644 (file)
@@ -99,23 +99,27 @@ namespace SLEPcWrappers
   {
     int ierr;
 
-    AssertThrow (solver_data.get() == 0, ExcSLEPcWrappersUsageError());
-    solver_data.reset (new SolverData());
-
-    // create eigensolver context and set operators
-    ierr = EPSCreate (mpi_communicator, &solver_data->eps);
-    AssertThrow (ierr == 0, ExcSLEPcError(ierr));
-
-    // set eigenspectrum problem type (general/standard)
-    AssertThrow (opA, ExcSLEPcWrappersUsageError());
-    if (opB)
-      ierr = EPSSetOperators (solver_data->eps, *opA, *opB);
-    else
-      ierr = EPSSetOperators (solver_data->eps, *opA, PETSC_NULL);
-    AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+    // create a solver object if this is necessary
+    if (solver_data.get() == 0)
+      {
+       // reset solver dtaa
+       solver_data.reset (new SolverData());
 
-    // set runtime options
-    set_solver_type (solver_data->eps);
+       // create eigensolver context and set operators
+       ierr = EPSCreate (mpi_communicator, &solver_data->eps);
+       AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+       
+       // set eigenspectrum problem type (general/standard)
+       AssertThrow (opA, ExcSLEPcWrappersUsageError());
+       if (opB)
+         ierr = EPSSetOperators (solver_data->eps, *opA, *opB);
+       else
+         ierr = EPSSetOperators (solver_data->eps, *opA, PETSC_NULL);
+       AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+       
+       // set runtime options
+       set_solver_type (solver_data->eps);
+      }
 
     // set the initial vector(s) if any
     if (initial_vector && initial_vector->size() != 0)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.