From: Guido Kanschat Date: Fri, 28 Nov 2003 11:51:13 +0000 (+0000) Subject: new function for projection prepared X-Git-Tag: v8.0.0~16011 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=217c34b59159d944144106fe0663591f8d74d02f;p=dealii.git new function for projection prepared git-svn-id: https://svn.dealii.org/trunk@8205 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_tools.h b/deal.II/deal.II/include/fe/fe_tools.h index fac0190c82..5e87a72e21 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -112,6 +112,12 @@ class FETools const FiniteElement &fe2, FullMatrix &difference_matrix); + template + static void get_projection_matrix(const FiniteElement &fe1, + const FiniteElement &fe2, + FullMatrix &matrix); + + /** * Gives the interpolation of a the * @p{dof1}-function @p{u1} to a diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index 3214ad68c9..23b76f20e0 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -310,6 +311,38 @@ void FETools::get_interpolation_difference_matrix (const FiniteElement &fe1 } +template +void FETools::get_projection_matrix (const FiniteElement &fe1, + const FiniteElement &fe2, + FullMatrix &interpolation_matrix) +{ + Assert (fe1.n_components() == fe2.n_components(), + ExcDimensionMismatch(fe1.n_components(), fe2.n_components())); + Assert(interpolation_matrix.m()==fe2.dofs_per_cell && + interpolation_matrix.n()==fe1.dofs_per_cell, + ExcMatrixDimensionMismatch(interpolation_matrix.m(), + interpolation_matrix.n(), + fe2.dofs_per_cell, + fe1.dofs_per_cell)); + + unsigned int m = fe1.dofs_per_cell; + unsigned int n = fe2.dofs_per_cell; + // First, create a mass matrix. We + // cannot use MatrixTools, since we + // want to have a FullMatrix. + // + // This happens in the target space + FullMatrix mass (n, n); + Triangulation tr; + GridGenerator::hyper_cube(tr); + DoFHandler dof; + dof.distribute_dofs(tr, fe2); + typename DoFHandler::active_cell_iterator cell = dof.begin(); + + // Set up FEValues. Here, we +} + + template void FETools::interpolate(const DoFHandler &dof1, const InVector &u1,