From: Wolfgang Bangerth Date: Wed, 24 May 2000 10:58:26 +0000 (+0000) Subject: Make apply_boundary_values a template of the number type. X-Git-Tag: v8.0.0~20473 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcb9db28a1353c62845ea86623a0f782b194bae3;p=dealii.git Make apply_boundary_values a template of the number type. git-svn-id: https://svn.dealii.org/trunk@2933 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/matrices.h b/deal.II/deal.II/include/numerics/matrices.h index 679948e1de..9e5ecfaa72 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -448,11 +448,12 @@ class MatrixTools : public MatrixCreator * as described in the general * documentation. */ + template static void apply_boundary_values (const map &boundary_values, - SparseMatrix &matrix, - Vector &solution, - Vector &right_hand_side, + SparseMatrix &matrix, + Vector &solution, + Vector &right_hand_side, const bool eliminate_columns = true); /** diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index be9eeb19a0..7c00e02973 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -517,11 +517,12 @@ void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, template +template void MatrixTools::apply_boundary_values (const map &boundary_values, - SparseMatrix &matrix, - Vector &solution, - Vector &right_hand_side, + SparseMatrix &matrix, + Vector &solution, + Vector &right_hand_side, const bool preserve_symmetry) { Assert (matrix.n() == matrix.m(), @@ -549,7 +550,7 @@ MatrixTools::apply_boundary_values (const map &boundar // the first nonzero diagonal // element of the matrix, or 1 if // there is no such thing - double first_nonzero_diagonal_entry = 1; + number first_nonzero_diagonal_entry = 1; for (unsigned int i=0; i::apply_boundary_values (const map &boundar // // store the new rhs entry to make // the gauss step more efficient - double new_rhs; + number new_rhs; if (matrix.diag_element(dof_number) != 0.0) new_rhs = right_hand_side(dof_number) = dof->second * matrix.diag_element(dof_number); @@ -600,7 +601,7 @@ MatrixTools::apply_boundary_values (const map &boundar // use the SparseMatrix:: // to work around a bug in // egcs - matrix.SparseMatrix::set (dof_number, dof_number, + matrix.SparseMatrix::set (dof_number, dof_number, first_nonzero_diagonal_entry); new_rhs = right_hand_side(dof_number) = dof->second * first_nonzero_diagonal_entry; @@ -619,7 +620,7 @@ MatrixTools::apply_boundary_values (const map &boundar // store the only nonzero entry // of this line for the Gauss // elimination step - const double diagonal_entry = matrix.diag_element(dof_number); + const number diagonal_entry = matrix.diag_element(dof_number); // we have to loop over all // rows of the matrix which @@ -1411,6 +1412,22 @@ template class MassMatrix; template class LaplaceMatrix; +template +void +MatrixTools::apply_boundary_values (const map &boundary_values, + SparseMatrix &matrix, + Vector &solution, + Vector &right_hand_side, + const bool preserve_symmetry); + +template +void +MatrixTools::apply_boundary_values (const map &boundary_values, + SparseMatrix &matrix, + Vector &solution, + Vector &right_hand_side, + const bool preserve_symmetry); + template void MatrixTools::