From: kanschat Date: Wed, 3 Nov 1999 23:58:46 +0000 (+0000) Subject: create_interpolation_matrix repaired X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5582b80ebf503be1ea02ad2e1d50a36146e6379c;p=dealii-svn.git create_interpolation_matrix repaired git-svn-id: https://svn.dealii.org/trunk@1823 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 0b84b55ab6..695163e894 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -312,9 +312,17 @@ class MatrixCreator const Function *a = 0); /** - * Build Lagrange interpolation - * matrix of different finite + * Lagrange interpolation + * matrix for different * elements. + * + * This function builds a matrix + * $A$ such that a function + * $u_{high}$ is interpolated to + * a function of lower order + * $u_{low}$ by cell-wise + * multiplication + * $u_{low} = A u_{high}$. */ static void create_interpolation_matrix(const FiniteElement &high, const FiniteElement &low, diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index c409fc3dfc..c1fd121147 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -993,9 +993,10 @@ void LaplaceMatrix::assemble (Vector &rhs, weights[point]; }; +//TODO: check correctness of this function and use FEValues - -template void +template +void MatrixCreator::create_interpolation_matrix(const FiniteElement &high, const FiniteElement &low, FullMatrix& result) @@ -1005,16 +1006,27 @@ MatrixCreator::create_interpolation_matrix(const FiniteElement &high, result.reinit (low.total_dofs, high.total_dofs); - vector > unit_support_points (high.total_dofs); - high.get_unit_support_points (unit_support_points); + // Initialize FEValues at the support points + // of the low element. + vector phantom_weights(low.total_dofs,1.); + vector > support_points(low.total_dofs); + low.get_unit_support_points(support_points); + Quadrature low_points(support_points, + phantom_weights); + + FEValues fe(high, low_points, UpdateFlags(0)); +//TODO: This could be less inefficient by going component by component +//TODO: Does it work for multi-component? + for (unsigned int i=0; i