From: Wolfgang Bangerth Date: Thu, 23 Jan 2020 01:37:07 +0000 (-0700) Subject: Selectively disable complex UMFPACK instantiations if DEAL_II_WITH_COMPLEX=OFF. X-Git-Tag: v9.2.0-rc1~612^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3adb4e4718581869285583d7be79dc7f4f925051;p=dealii.git Selectively disable complex UMFPACK instantiations if DEAL_II_WITH_COMPLEX=OFF. --- diff --git a/source/lac/sparse_direct.cc b/source/lac/sparse_direct.cc index 2a0205db8a..ef46e7c30c 100644 --- a/source/lac/sparse_direct.cc +++ b/source/lac/sparse_direct.cc @@ -384,6 +384,7 @@ void SparseDirectUMFPACK::solve(Vector> &rhs_and_solution, const bool transpose /*=false*/) const { +# ifdef DEAL_II_WITH_COMPLEX_VALUES // make sure that some kind of factorize() call has happened before Assert(Ap.size() != 0, ExcNotInitialized()); Assert(Ai.size() != 0, ExcNotInitialized()); @@ -481,6 +482,16 @@ SparseDirectUMFPACK::solve(Vector> &rhs_and_solution, for (unsigned int i = 0; i < rhs.size(); ++i) rhs_and_solution(i).imag(rhs_real_or_imag(i)); } + +# else + + (void)rhs_and_solution; + (void)transpose; + Assert(false, + ExcMessage( + "This function can't be called if deal.II has been configured " + "with DEAL_II_WITH_COMPLEX_VALUES=FALSE.")); +# endif } @@ -503,6 +514,7 @@ void SparseDirectUMFPACK::solve(BlockVector> &rhs_and_solution, const bool transpose /*=false*/) const { +# ifdef DEAL_II_WITH_COMPLEX_VALUES // the UMFPACK functions want a contiguous array of elements, so // there is no way around copying data around. thus, just copy the // data into a regular vector and back @@ -510,6 +522,15 @@ SparseDirectUMFPACK::solve(BlockVector> &rhs_and_solution, tmp = rhs_and_solution; solve(tmp, transpose); rhs_and_solution = tmp; + +# else + (void)rhs_and_solution; + (void)transpose; + Assert(false, + ExcMessage( + "This function can't be called if deal.II has been configured " + "with DEAL_II_WITH_COMPLEX_VALUES=FALSE.")); +# endif } @@ -532,8 +553,20 @@ SparseDirectUMFPACK::solve(const Matrix & matrix, Vector> &rhs_and_solution, const bool transpose /*=false*/) { +# ifdef DEAL_II_WITH_COMPLEX_VALUES factorize(matrix); solve(rhs_and_solution, transpose); + +# else + + (void)matrix; + (void)rhs_and_solution; + (void)transpose; + Assert(false, + ExcMessage( + "This function can't be called if deal.II has been configured " + "with DEAL_II_WITH_COMPLEX_VALUES=FALSE.")); +# endif } @@ -556,8 +589,20 @@ SparseDirectUMFPACK::solve(const Matrix & matrix, BlockVector> &rhs_and_solution, const bool transpose /*=false*/) { +# ifdef DEAL_II_WITH_COMPLEX_VALUES factorize(matrix); solve(rhs_and_solution, transpose); + +# else + + (void)matrix; + (void)rhs_and_solution; + (void)transpose; + Assert(false, + ExcMessage( + "This function can't be called if deal.II has been configured " + "with DEAL_II_WITH_COMPLEX_VALUES=FALSE.")); +# endif } @@ -790,10 +835,11 @@ InstantiateUMFPACK(BlockSparseMatrix); InstantiateUMFPACK(BlockSparseMatrix); // Now also for complex-valued matrices +#ifdef DEAL_II_WITH_COMPLEX_VALUES InstantiateUMFPACK(SparseMatrix>); InstantiateUMFPACK(SparseMatrix>); InstantiateUMFPACK(BlockSparseMatrix>); InstantiateUMFPACK(BlockSparseMatrix>); - +#endif DEAL_II_NAMESPACE_CLOSE diff --git a/tests/umfpack/umfpack_03_complex.output b/tests/umfpack/umfpack_03_complex.with_complex_values=on.output similarity index 100% rename from tests/umfpack/umfpack_03_complex.output rename to tests/umfpack/umfpack_03_complex.with_complex_values=on.output diff --git a/tests/umfpack/umfpack_03_complex_complex.output b/tests/umfpack/umfpack_03_complex_complex.with_complex_values=on.output similarity index 100% rename from tests/umfpack/umfpack_03_complex_complex.output rename to tests/umfpack/umfpack_03_complex_complex.with_complex_values=on.output diff --git a/tests/umfpack/umfpack_09_complex.output b/tests/umfpack/umfpack_09_complex.with_complex_values=on.output similarity index 100% rename from tests/umfpack/umfpack_09_complex.output rename to tests/umfpack/umfpack_09_complex.with_complex_values=on.output diff --git a/tests/umfpack/umfpack_09_complex_complex_complex_nonblock.output b/tests/umfpack/umfpack_09_complex_complex_complex_nonblock.with_complex_values=on.output similarity index 100% rename from tests/umfpack/umfpack_09_complex_complex_complex_nonblock.output rename to tests/umfpack/umfpack_09_complex_complex_complex_nonblock.with_complex_values=on.output