<h3>Specific improvements</h3>
<ol>
+<li> Fixed: Prolongation and restriction matrices were not computed at all
+for elements of type FE_DGQ if <code>dim@<spacedim</code>. Consequently,
+consumers of this information, such as the SolutionTransfer class or
+the DoFCellAccess::set_dof_values_by_interpolation function did not
+work either and simply returned zero results. This is now fixed.
+<br>
+(M. Sebastian Pauletti, Wolfgang Bangerth, 2011/02/09)
+</li>
+
<li> Fixed: When refining a mesh with codimension one, edges were refined using
the same manifold description as adjacent cells, but this ignored that a
boundary indicator might have been purposefully set for edges that are truly at
// restriction and prolongation
// matrices to the right sizes
this->reinit_restriction_and_prolongation_matrices();
- // Fill prolongation matrices with embedding operators
- if (dim ==spacedim)
- FETools::compute_embedding_matrices (*this, this->prolongation);
- // Fill restriction matrices with L2-projection
- if (dim ==spacedim)
- FETools::compute_projection_matrices (*this, this->restriction);
+
+ // Fill prolongation matrices with
+ // embedding operators and
+ // restriction with L2 projection
+ //
+ // we can call the respective
+ // functions in the case
+ // dim==spacedim, but they are not
+ // currently implemented for the
+ // codim-1 case. there's no harm
+ // here, though, since these
+ // matrices are independent of the
+ // space dimension and so we can
+ // copy them from the respective
+ // elements (not cheap, but works)
+ if (dim == spacedim)
+ {
+ FETools::compute_embedding_matrices (*this, this->prolongation);
+ FETools::compute_projection_matrices (*this, this->restriction);
+ }
+ else
+ {
+ FE_DGQ<dim> tmp (degree);
+ this->prolongation = tmp.prolongation;
+ this->restriction = tmp.restriction;
+ }
// finally fill in support points
--- /dev/null
+//---------------------------- fe_dgq_prolongation_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010, 2011 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- fe_dgq_prolongation_01.cc ---------------------------
+
+// this is the root cause for solution_tranfer_01: the prolongation
+// matrices for FE_DGQ<dim-1,dim> were not computed at all
+
+#include "../tests.h"
+#include <fe/fe_dgq.h>
+
+
+#include <fstream>
+
+using namespace dealii;
+
+
+int main ()
+{
+ std::ofstream logfile("fe_dgq_prolongation_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
+ const unsigned int spacedim = 2;
+ const unsigned int dim = spacedim-1;
+
+ for (unsigned int degree=0; degree<3; ++degree)
+ {
+ deallog << "Degree=" << degree << std::endl;
+ FE_DGQ<dim,spacedim> fe(degree);
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+ deallog << fe.get_prolongation_matrix(0)(i,j) << std::endl;
+ }
+
+ return 0;
+}
--- /dev/null
+
+DEAL::Degree=0
+DEAL::1.00000
+DEAL::Degree=1
+DEAL::1.00000
+DEAL::0
+DEAL::0.500000
+DEAL::0.500000
+DEAL::Degree=2
+DEAL::1.00000
+DEAL::0
+DEAL::0
+DEAL::0.375000
+DEAL::0.750000
+DEAL::-0.125000
+DEAL::0
+DEAL::1.00000
+DEAL::0
--- /dev/null
+//---------------------------- solution_transfer_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010, 2011 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- solution_transfer_01.cc ---------------------------
+
+
+/*
+ Bug for solution transfer using DG in surfaces
+
+
+ set solution = 1
+ refine
+ do solution transfer
+ And the magically, solution becomes 0
+
+ This surprisingly turned out to be a problem with the prolongation
+ matrices of DGQ in codim-1. (See the fe_dgq_prolongation_01 test.)
+*/
+
+#include "../tests.h"
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_boundary_lib.h>
+
+#include <grid/grid_tools.h>
+#include <grid/grid_refinement.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_tools.h>
+
+#include <fe/fe_dgq.h>
+
+#include <numerics/vectors.h>
+#include <numerics/solution_transfer.h>
+
+#include <fstream>
+
+using namespace dealii;
+
+
+int main ()
+{
+ std::ofstream logfile("solution_transfer_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
+ const unsigned int spacedim = 2;
+ const unsigned int dim = spacedim-1;
+
+ Triangulation<dim,spacedim> boundary_mesh;
+
+ // create a line in 2d
+ GridGenerator::hyper_cube (boundary_mesh);
+
+ // attach a piecewise constant
+ // element to this one cell
+ FE_DGQ<dim,spacedim> fe(0);
+ DoFHandler<dim,spacedim> dh (boundary_mesh);
+ dh.distribute_dofs(fe);
+
+ Vector<double> solution(dh.n_dofs());
+ solution = 1.0;
+
+ deallog << "Old values:" << std::endl;
+ for (unsigned int i=0; i<solution.size(); i++)
+ deallog << solution(i) << endl;
+
+
+ // Do some refinement
+ boundary_mesh.begin_active()->set_refine_flag ();
+
+ SolutionTransfer<dim, Vector<double>, DoFHandler<dim,spacedim> >
+ soltrans(dh);
+
+ boundary_mesh.prepare_coarsening_and_refinement();
+
+ soltrans.prepare_for_coarsening_and_refinement(solution);
+ boundary_mesh.execute_coarsening_and_refinement ();
+
+ dh.distribute_dofs(fe);
+
+ // get the interpolated solution
+ // back
+ Vector<double> tmp(dh.n_dofs());
+ tmp = 2;
+ soltrans.interpolate(solution, tmp);
+
+ deallog << "New values:" << std::endl;
+ for (unsigned int i=0; i<tmp.size(); i++)
+ deallog << tmp(i) << endl;
+
+ return 0;
+}
--- /dev/null
+
+DEAL::Old values:
+DEAL::1.00000
+DEAL::New values:
+DEAL::1.00000
+DEAL::1.00000