From: Daniel Arndt Date: Tue, 3 Oct 2017 11:00:42 +0000 (+0200) Subject: static_asserts for SUNDIALS solvers X-Git-Tag: v9.0.0-rc1~1004^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5178%2Fhead;p=dealii.git static_asserts for SUNDIALS solvers --- diff --git a/include/deal.II/sundials/arkode.h b/include/deal.II/sundials/arkode.h index 3f19773b6b..5877e64dd2 100644 --- a/include/deal.II/sundials/arkode.h +++ b/include/deal.II/sundials/arkode.h @@ -24,10 +24,15 @@ #include #include #include +#ifdef DEAL_II_WITH_PETSC +#include +#include +#endif #include #include #include + #include #include #include @@ -857,11 +862,22 @@ namespace SUNDIALS * Memory pool of vectors. */ GrowingVectorMemory mem; + +#ifdef DEAL_II_WITH_PETSC +#ifdef PETSC_USE_COMPLEX + static_assert(!std::is_same::value, + "Sundials does not support complex scalar types, " + "but PETSc is configured to use a complex scalar type!"); + + static_assert(!std::is_same::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 diff --git a/include/deal.II/sundials/ida.h b/include/deal.II/sundials/ida.h index d705b250c0..38bddded39 100644 --- a/include/deal.II/sundials/ida.h +++ b/include/deal.II/sundials/ida.h @@ -24,10 +24,15 @@ #include #include #include +#ifdef DEAL_II_WITH_PETSC +#include +#include +#endif #include #include #include + #include #include #include @@ -810,6 +815,18 @@ namespace SUNDIALS * Memory pool of vectors. */ GrowingVectorMemory mem; + +#ifdef DEAL_II_WITH_PETSC +#ifdef PETSC_USE_COMPLEX + static_assert(!std::is_same::value, + "Sundials does not support complex scalar types, " + "but PETSc is configured to use a complex scalar type!"); + + static_assert(!std::is_same::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 }; } diff --git a/tests/sundials/copy_01.with_mpi=true.with_petsc=true.mpirun=4.output b/tests/sundials/copy_01.with_mpi=true.with_petsc=true.with_petsc_with_complex=false.mpirun=4.output similarity index 100% rename from tests/sundials/copy_01.with_mpi=true.with_petsc=true.mpirun=4.output rename to tests/sundials/copy_01.with_mpi=true.with_petsc=true.with_petsc_with_complex=false.mpirun=4.output