From 2e6ee3421961e56442e53209ab2ce5fe26c4ca5d Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 22 Feb 2016 13:29:45 +0100 Subject: [PATCH] minor adjustments to block matrix and vector to work with complex PETSc --- include/deal.II/lac/block_vector_base.h | 5 +++-- source/lac/block_matrix_array.cc | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 6aed46afdf..17d5eebaeb 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -1686,10 +1686,11 @@ typename BlockVectorBase::value_type BlockVectorBase::mean_value () const { value_type sum = 0.; + // need to do static_cast as otherwise it won't work with value_type=complex for (size_type i=0; i(components[i].size()); - return sum/size(); + return sum/static_cast(size()); } diff --git a/source/lac/block_matrix_array.cc b/source/lac/block_matrix_array.cc index 58c4746291..c8dce1d78f 100644 --- a/source/lac/block_matrix_array.cc +++ b/source/lac/block_matrix_array.cc @@ -323,7 +323,7 @@ BlockTrianglePrecondition::do_row m->matrix->Tvmult(aux, dst.block(j)); else m->matrix->vmult(aux, dst.block(j)); - dst.block(i).add (-1 * m->prefix, aux); + dst.block(i).add (-1.0 * m->prefix, aux); } } Assert (diagonals.size() != 0, ExcNoDiagonal(row_num)); @@ -438,10 +438,17 @@ template class BlockTrianglePrecondition, PETScWrappers::MPI::BlockVector>; +template class BlockMatrixArray, PETScWrappers::MPI::BlockVector>; +template class BlockTrianglePrecondition, PETScWrappers::MPI::BlockVector>; +template class BlockTrianglePrecondition, PETScWrappers::MPI::BlockVector>; +#else template class BlockMatrixArray; template class BlockMatrixArray; template class BlockTrianglePrecondition; template class BlockTrianglePrecondition; #endif +#endif DEAL_II_NAMESPACE_CLOSE -- 2.39.5