From: Ralf Hartmann Date: Tue, 8 May 2001 12:06:52 +0000 (+0000) Subject: Simplify FETools::get_interpolation_matrix by using the FE::shape_value function. X-Git-Tag: v8.0.0~19228 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a7750c9ff7dbdb397fd1649b9ea273db6493012;p=dealii.git Simplify FETools::get_interpolation_matrix by using the FE::shape_value function. git-svn-id: https://svn.dealii.org/trunk@4563 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index 6c68063eba..70fa5044e7 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -51,24 +51,10 @@ void FETools::get_interpolation_matrix(const FiniteElement &fe1, // fe2 element. const typename std::vector > & fe2_support_points = fe2.get_unit_support_points (); - Quadrature fe2_support_points_quadrature(fe2_support_points); - - // This is a bad workaround as we - // can't ask the FEs for their - // shape values any more. -// TODO:[RH,GK] do this better. don't create a triangulation and dofhandler here! -// maybe we can get it work by passing an end_iterator or something to the -// FEValues::reinit function? -// (if we have the second FEValues::reinit function, we at least no more need the DoFHandler object) - Triangulation tria; - DoFHandler dof_handler(tria); - GridGenerator::hyper_cube(tria); - dof_handler.distribute_dofs(fe1); - MappingQ1 mapping_q1; - FEValues fe_values(mapping_q1, fe1, fe2_support_points_quadrature, - update_values); - fe_values.reinit(dof_handler.begin_active()); - + + Assert(fe2_support_points.size()==fe2.dofs_per_cell, + typename FiniteElementBase::ExcFEHasNoSupportPoints()); + for (unsigned int i=0; i &fe1, { const unsigned int j1 = fe1.system_to_component_index(j).first; if (i1==j1) - interpolation_matrix(i,j) = fe_values.shape_value (j,i); + interpolation_matrix(i,j) = fe1.shape_value (j,fe2_support_points[i]); else interpolation_matrix(i,j)=0.; }