From: Denis Davydov Date: Mon, 22 Feb 2016 12:29:45 +0000 (+0100) Subject: minor adjustments to block matrix and vector to work with complex PETSc X-Git-Tag: v8.5.0-rc1~1298^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e6ee3421961e56442e53209ab2ce5fe26c4ca5d;p=dealii.git minor adjustments to block matrix and vector to work with complex PETSc --- 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