// enable the user to write DoFHandler
// independent code.
#include <fe/hp_fe_values.h>
+#include <fe/mapping_collection.h>
// A compressed sparsity pattern is
// not an explicit prerequisite for the
// boundaries come into play, this
// object should be replaced by
// a MappingCollection.
- const MappingQ1<dim> mapping;
+ hp::MappingCollection<dim> mapping_collection;
// In contrast to the example code
// of step-12, this time DG elements
template <int dim>
DGMethod<dim>::DGMethod ()
:
- mapping (),
dof_handler (triangulation),
dg ()
{
unsigned int elm_no;
for (unsigned int i = 0; i < hp_degree; ++i)
{
- elm_no = fe_collection.add_fe (FE_DGQ<dim> (i+1));
+ elm_no = fe_collection.add_fe (FE_DGQ<dim> (i));
quadratures.add_quadrature (QGauss<dim> (i+2));
face_quadratures.add_quadrature (QGauss<dim-1> (i+2));
}
+
+ static const MappingQ1<dim> mapping;
+ mapping_collection.add_mapping (mapping);
}
// assumes a ``MappingQ1'' mapping)
// and makes it easier to change
// the mapping object later.
- hp::FEValues<dim> fe_v_x (mapping, fe_collection, quadratures, update_flags);
+ hp::FEValues<dim> fe_v_x (mapping_collection, fe_collection, quadratures, update_flags);
// Similarly we create the
// ``FEFaceValues'' and
// current cell and the face (and
// subface) number.
hp::FEFaceValues<dim> fe_v_face_x (
- mapping, fe_collection, face_quadratures, face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, face_update_flags);
hp::FESubfaceValues<dim> fe_v_subface_x (
- mapping, fe_collection, face_quadratures, face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, face_update_flags);
hp::FEFaceValues<dim> fe_v_face_neighbor_x (
- mapping, fe_collection, face_quadratures, neighbor_face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, neighbor_face_update_flags);
hp::FESubfaceValues<dim> fe_v_subface_neighbor_x (
- mapping, fe_collection, face_quadratures, neighbor_face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, neighbor_face_update_flags);
// Now we create the cell matrices
// and vectors. Here we need two
// ``fe_v_face_neighbor'' as case 4
// does not occur.
hp::FEValues<dim> fe_v_x (
- mapping, fe_collection, quadratures, update_flags);
+ mapping_collection, fe_collection, quadratures, update_flags);
hp::FEFaceValues<dim> fe_v_face_x (
- mapping, fe_collection, face_quadratures, face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, face_update_flags);
hp::FESubfaceValues<dim> fe_v_subface_x (
- mapping, fe_collection, face_quadratures, face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, face_update_flags);
hp::FEFaceValues<dim> fe_v_face_neighbor_x (
- mapping, fe_collection, face_quadratures, neighbor_face_update_flags);
+ mapping_collection, fe_collection, face_quadratures, neighbor_face_update_flags);
const unsigned int max_dofs_per_cell = fe_collection.max_dofs_per_cell ();
// Now the approximate gradients
// are computed
- DerivativeApproximation::approximate_gradient (mapping,
+ DerivativeApproximation::approximate_gradient (mapping_collection[0],
dof_handler,
solution2,
gradient_indicator);
{
GridGenerator::hyper_cube (triangulation);
- triangulation.refine_global (3);
+ triangulation.refine_global (1);
}
else
refine_grid ();