From a9f2679a3ff9edb7a438712801f0644c594cb74b Mon Sep 17 00:00:00 2001 From: young Date: Mon, 10 Jun 2013 11:48:06 +0000 Subject: [PATCH] One happy fix in matrix_tools. git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@29802 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/numerics/matrix_tools.cc | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index e0bd90bbd2..ad3c1936a2 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -2392,10 +2392,10 @@ namespace MatrixTools template void apply_boundary_values (const std::map &boundary_values, - PETScMatrix &matrix, - PETScVector &solution, - PETScVector &right_hand_side, - const bool eliminate_columns) + PETScMatrix &matrix, + PETScVector &solution, + PETScVector &right_hand_side, + const bool eliminate_columns) { Assert (eliminate_columns == false, ExcNotImplemented()); @@ -2420,9 +2420,14 @@ namespace MatrixTools // entry from within the part of the // matrix that we can see. if we can't // find such an entry, take one +#ifndef PETSC_USE_COMPLEX PetscScalar average_nonzero_diagonal_entry = 1; +#else + PetscScalar average_nonzero_diagonal_entry = (PetscScalar) std::complex (1,1); +#endif + for (types::global_dof_index i=local_range.first; i (0,0)) { average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i)); break; @@ -2485,10 +2490,10 @@ namespace MatrixTools void apply_boundary_values (const std::map &boundary_values, - PETScWrappers::SparseMatrix &matrix, - PETScWrappers::Vector &solution, - PETScWrappers::Vector &right_hand_side, - const bool eliminate_columns) + PETScWrappers::SparseMatrix &matrix, + PETScWrappers::Vector &solution, + PETScWrappers::Vector &right_hand_side, + const bool eliminate_columns) { // simply redirect to the generic function // used for both petsc matrix types @@ -2500,10 +2505,10 @@ namespace MatrixTools void apply_boundary_values (const std::map &boundary_values, - PETScWrappers::MPI::SparseMatrix &matrix, - PETScWrappers::MPI::Vector &solution, - PETScWrappers::MPI::Vector &right_hand_side, - const bool eliminate_columns) + PETScWrappers::MPI::SparseMatrix &matrix, + PETScWrappers::MPI::Vector &solution, + PETScWrappers::MPI::Vector &right_hand_side, + const bool eliminate_columns) { // simply redirect to the generic function // used for both petsc matrix types -- 2.39.5