]> https://gitweb.dealii.org/ - dealii.git/commitdiff
static_asserts for SUNDIALS solvers 5178/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 3 Oct 2017 11:00:42 +0000 (13:00 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 3 Oct 2017 11:00:42 +0000 (13:00 +0200)
include/deal.II/sundials/arkode.h
include/deal.II/sundials/ida.h
tests/sundials/copy_01.with_mpi=true.with_petsc=true.with_petsc_with_complex=false.mpirun=4.output [moved from tests/sundials/copy_01.with_mpi=true.with_petsc=true.mpirun=4.output with 100% similarity]

index 3f19773b6b47b1907f0f61c2c1c9eb59e0f7adab..5877e64dd24dec9c12647097a8365d5470502a9a 100644 (file)
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/base/conditional_ostream.h>
 #include <deal.II/base/mpi.h>
+#ifdef DEAL_II_WITH_PETSC
+#include <deal.II/lac/petsc_parallel_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#endif
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/vector_view.h>
 #include <deal.II/lac/vector_memory.h>
 
+
 #include <arkode/arkode.h>
 #include <arkode/arkode_impl.h>
 #include <nvector/nvector_serial.h>
@@ -857,11 +862,22 @@ namespace SUNDIALS
      * Memory pool of vectors.
      */
     GrowingVectorMemory<VectorType> mem;
+
+#ifdef DEAL_II_WITH_PETSC
+#ifdef PETSC_USE_COMPLEX
+    static_assert(!std::is_same<VectorType, PETScWrappers::MPI::Vector>::value,
+                  "Sundials does not support complex scalar types, "
+                  "but PETSc is configured to use a complex scalar type!");
+
+    static_assert(!std::is_same<VectorType, PETScWrappers::MPI::BlockVector>::value,
+                  "Sundials does not support complex scalar types, "
+                  "but PETSc is configured to use a complex scalar type!");
+#endif // PETSC_USE_COMPLEX
+#endif // DEAL_II_WITH_PETSC
   };
 
 }
 
-
 DEAL_II_NAMESPACE_CLOSE
 #endif
 
index d705b250c0d65f113cf391504e968fedcd09e7c1..38bddded3902c797d1ab6f2ca9cc1e2547d612db 100644 (file)
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/base/conditional_ostream.h>
 #include <deal.II/base/mpi.h>
+#ifdef DEAL_II_WITH_PETSC
+#include <deal.II/lac/petsc_parallel_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#endif
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/vector_view.h>
 #include <deal.II/lac/vector_memory.h>
 
+
 #include <ida/ida.h>
 #include <ida/ida_spils.h>
 #include <ida/ida_spgmr.h>
@@ -810,6 +815,18 @@ namespace SUNDIALS
      * Memory pool of vectors.
      */
     GrowingVectorMemory<VectorType> mem;
+
+#ifdef DEAL_II_WITH_PETSC
+#ifdef PETSC_USE_COMPLEX
+    static_assert(!std::is_same<VectorType, PETScWrappers::MPI::Vector>::value,
+                  "Sundials does not support complex scalar types, "
+                  "but PETSc is configured to use a complex scalar type!");
+
+    static_assert(!std::is_same<VectorType, PETScWrappers::MPI::BlockVector>::value,
+                  "Sundials does not support complex scalar types, "
+                  "but PETSc is configured to use a complex scalar type!");
+#endif // PETSC_USE_COMPLEX
+#endif // DEAL_II_WITH_PETSC
   };
 
 }

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.