From 6538cade2c590e4b7c2c8e1a4cd1862552f8d4bd Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 30 Dec 2016 01:07:47 +0100 Subject: [PATCH] Fix compiling with complex-valued PETSc --- include/deal.II/matrix_free/operators.h | 10 +++++----- include/deal.II/numerics/vector_tools.templates.h | 2 +- source/numerics/vector_tools_project.inst.in | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 668e408a46..c653fc3c7d 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -819,7 +819,7 @@ namespace MatrixFreeOperators Base::vmult (LinearAlgebra::distributed::Vector &dst, const LinearAlgebra::distributed::Vector &src) const { - dst = 0; + dst = Number(0.); vmult_add (dst, src); } @@ -922,7 +922,7 @@ namespace MatrixFreeOperators adjust_ghost_range_if_necessary(src); adjust_ghost_range_if_necessary(dst); - dst = 0; + dst = Number(0.); if (!have_interface_matrices) return; @@ -964,7 +964,7 @@ namespace MatrixFreeOperators adjust_ghost_range_if_necessary(src); adjust_ghost_range_if_necessary(dst); - dst = 0; + dst = Number(0.); if (!have_interface_matrices) return; @@ -995,7 +995,7 @@ namespace MatrixFreeOperators Base::Tvmult (LinearAlgebra::distributed::Vector &dst, const LinearAlgebra::distributed::Vector &src) const { - dst = 0; + dst = Number(0.); Tvmult_add (dst,src); } @@ -1125,7 +1125,7 @@ namespace MatrixFreeOperators LinearAlgebra::distributed::Vector ones; this->initialize_dof_vector(ones); this->initialize_dof_vector(inverse_diagonal_vector); - ones = 1.; + ones = Number(1.); apply_add(inverse_diagonal_vector, ones); this->set_constrained_entries_to_one(inverse_diagonal_vector); diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index f10b5e810b..a89258c0c4 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -1546,7 +1546,7 @@ namespace VectorTools ExcDimensionMismatch(fe.n_components(), rhs_function.n_components)); Assert (rhs_vector.size() == dof_handler.n_dofs(), ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs())); - rhs_vector = 0; + rhs_vector = typename VectorType::value_type(0.); UpdateFlags update_flags = UpdateFlags(update_values | update_quadrature_points | diff --git a/source/numerics/vector_tools_project.inst.in b/source/numerics/vector_tools_project.inst.in index 7c045dd3f5..b9c8f827f8 100644 --- a/source/numerics/vector_tools_project.inst.in +++ b/source/numerics/vector_tools_project.inst.in @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) +for (VEC : REAL_SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) { #if deal_II_dimension <= deal_II_space_dimension namespace VectorTools \{ -- 2.39.5