From: Wolfgang Bangerth Date: Thu, 7 Dec 2017 20:48:55 +0000 (-0700) Subject: Enable projecting boundary values for complex-valued problems. X-Git-Tag: v9.0.0-rc1~669^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8387d00a2718cecf092632edc8ccdd199fac353b;p=dealii.git Enable projecting boundary values for complex-valued problems. --- diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index a134b95429..ed0806211f 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -2898,6 +2898,7 @@ namespace VectorTools } + template void invert_mass_matrix(const SparseMatrix &mass_matrix, const FilteredMatrix > &filtered_mass_matrix, @@ -2922,15 +2923,44 @@ namespace VectorTools filtered_preconditioner.clear(); } + + template void invert_mass_matrix (const SparseMatrix &mass_matrix, - const FilteredMatrix > > &filtered_mass_matrix, - FilteredMatrix > > &filtered_preconditioner, + const FilteredMatrix > &filtered_mass_matrix, + FilteredMatrix > &filtered_preconditioner, const Vector > &rhs, Vector > &boundary_projection) { - Assert (false, ExcInternalError()); + auto solve_for_one_component + = [&](const bool real_part) + { + // copy the real or imaginary part out of the rhs vector + Vector rhs_part (rhs.size()); + for (unsigned int i=0; i boundary_projection_part (boundary_projection.size()); + invert_mass_matrix (mass_matrix, + filtered_mass_matrix, + filtered_preconditioner, + rhs_part, + boundary_projection_part); + + // finally copy the real or imaginary part of the + // solution back into the global solution vector + for (unsigned int i=0; i > filtered_mass_matrix(mass_matrix, true); - FilteredMatrix > filtered_precondition; + FilteredMatrix::real_type> > filtered_mass_matrix(mass_matrix, true); + FilteredMatrix::real_type> > filtered_precondition; std::vector excluded_dofs(mass_matrix.m(), false); // we assemble mass matrix with unit weight,