#include <fstream>
+template <int dim>
class SystemTest
{
public:
void check_numbering ();
- Triangulation<2> triangulation;
- FESystem<2> fe;
- DoFHandler<2> dof_handler;
+ Triangulation<dim> triangulation;
+ FESystem<dim> fe;
+ DoFHandler<dim> dof_handler;
};
-SystemTest::SystemTest () :
- fe (FE_Nedelec<2>(1), 2,
- FE_Q<2>(1), 1),
+template <int dim>
+SystemTest<dim>::SystemTest () :
+ fe (FE_Nedelec<dim>(1), 2,
+ FE_Q<dim>(1), 1),
dof_handler (triangulation)
{};
-void SystemTest::make_grid_and_dofs ()
+template <int dim>
+void SystemTest<dim>::make_grid_and_dofs ()
{
GridGenerator::hyper_cube (triangulation, -1, 1);
};
-void SystemTest::shape_to_components ()
+template <int dim>
+void SystemTest<dim>::shape_to_components ()
{
// testing, if the shape function
// with index i is of type Nedelec:
-void SystemTest::check_numbering ()
+template <int dim>
+void SystemTest<dim>::check_numbering ()
{
- DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(),
+ DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
std::vector<unsigned int> local_dof_indices(fe.dofs_per_cell);
};
-void SystemTest::run ()
+template <int dim>
+void SystemTest<dim>::run ()
{
make_grid_and_dofs ();
shape_to_components ();
deallog.attach(logfile);
deallog.depth_console(0);
- SystemTest system_test;
- system_test.run ();
+ SystemTest<2>().run();
+ SystemTest<3>().run();
return 0;
};
DEAL:: DoF 3 belongs to base 0, instance 0
DEAL:: DoF 7 belongs to base 0, instance 1
DEAL::
+DEAL::Number of active cells: 1
+DEAL::Total number of cells: 1
+DEAL::Number of degrees of freedom: 32
+DEAL:: shapefunction 0 is Nedelec: false
+DEAL:: shapefunction 1 is Nedelec: false
+DEAL:: shapefunction 2 is Nedelec: false
+DEAL:: shapefunction 3 is Nedelec: false
+DEAL:: shapefunction 4 is Nedelec: false
+DEAL:: shapefunction 5 is Nedelec: false
+DEAL:: shapefunction 6 is Nedelec: false
+DEAL:: shapefunction 7 is Nedelec: false
+DEAL:: shapefunction 8 is Nedelec: true
+DEAL:: shapefunction 9 is Nedelec: true
+DEAL:: shapefunction 10 is Nedelec: true
+DEAL:: shapefunction 11 is Nedelec: true
+DEAL:: shapefunction 12 is Nedelec: true
+DEAL:: shapefunction 13 is Nedelec: true
+DEAL:: shapefunction 14 is Nedelec: true
+DEAL:: shapefunction 15 is Nedelec: true
+DEAL:: shapefunction 16 is Nedelec: true
+DEAL:: shapefunction 17 is Nedelec: true
+DEAL:: shapefunction 18 is Nedelec: true
+DEAL:: shapefunction 19 is Nedelec: true
+DEAL:: shapefunction 20 is Nedelec: true
+DEAL:: shapefunction 21 is Nedelec: true
+DEAL:: shapefunction 22 is Nedelec: true
+DEAL:: shapefunction 23 is Nedelec: true
+DEAL:: shapefunction 24 is Nedelec: true
+DEAL:: shapefunction 25 is Nedelec: true
+DEAL:: shapefunction 26 is Nedelec: true
+DEAL:: shapefunction 27 is Nedelec: true
+DEAL:: shapefunction 28 is Nedelec: true
+DEAL:: shapefunction 29 is Nedelec: true
+DEAL:: shapefunction 30 is Nedelec: true
+DEAL:: shapefunction 31 is Nedelec: true
+DEAL:: DoF 0 belongs to base element 1, instance 0
+DEAL:: DoF 1 belongs to base element 1, instance 0
+DEAL:: DoF 2 belongs to base element 1, instance 0
+DEAL:: DoF 3 belongs to base element 1, instance 0
+DEAL:: DoF 4 belongs to base element 1, instance 0
+DEAL:: DoF 5 belongs to base element 1, instance 0
+DEAL:: DoF 6 belongs to base element 1, instance 0
+DEAL:: DoF 7 belongs to base element 1, instance 0
+DEAL:: DoF 8 belongs to base element 0, instance 0
+DEAL:: DoF 9 belongs to base element 0, instance 1
+DEAL:: DoF 10 belongs to base element 0, instance 0
+DEAL:: DoF 11 belongs to base element 0, instance 1
+DEAL:: DoF 12 belongs to base element 0, instance 0
+DEAL:: DoF 13 belongs to base element 0, instance 1
+DEAL:: DoF 14 belongs to base element 0, instance 0
+DEAL:: DoF 15 belongs to base element 0, instance 1
+DEAL:: DoF 16 belongs to base element 0, instance 0
+DEAL:: DoF 17 belongs to base element 0, instance 1
+DEAL:: DoF 18 belongs to base element 0, instance 0
+DEAL:: DoF 19 belongs to base element 0, instance 1
+DEAL:: DoF 20 belongs to base element 0, instance 0
+DEAL:: DoF 21 belongs to base element 0, instance 1
+DEAL:: DoF 22 belongs to base element 0, instance 0
+DEAL:: DoF 23 belongs to base element 0, instance 1
+DEAL:: DoF 24 belongs to base element 0, instance 0
+DEAL:: DoF 25 belongs to base element 0, instance 1
+DEAL:: DoF 26 belongs to base element 0, instance 0
+DEAL:: DoF 27 belongs to base element 0, instance 1
+DEAL:: DoF 28 belongs to base element 0, instance 0
+DEAL:: DoF 29 belongs to base element 0, instance 1
+DEAL:: DoF 30 belongs to base element 0, instance 0
+DEAL:: DoF 31 belongs to base element 0, instance 1
+DEAL::
+DEAL:: Now we renumber the DoFs component-wise:
+DEAL:: ****************************************
+DEAL:: DoF 24 belongs to base 1, instance 0
+DEAL:: DoF 25 belongs to base 1, instance 0
+DEAL:: DoF 26 belongs to base 1, instance 0
+DEAL:: DoF 27 belongs to base 1, instance 0
+DEAL:: DoF 28 belongs to base 1, instance 0
+DEAL:: DoF 29 belongs to base 1, instance 0
+DEAL:: DoF 30 belongs to base 1, instance 0
+DEAL:: DoF 31 belongs to base 1, instance 0
+DEAL:: DoF 0 belongs to base 0, instance 0
+DEAL:: DoF 12 belongs to base 0, instance 1
+DEAL:: DoF 1 belongs to base 0, instance 0
+DEAL:: DoF 13 belongs to base 0, instance 1
+DEAL:: DoF 2 belongs to base 0, instance 0
+DEAL:: DoF 14 belongs to base 0, instance 1
+DEAL:: DoF 3 belongs to base 0, instance 0
+DEAL:: DoF 15 belongs to base 0, instance 1
+DEAL:: DoF 4 belongs to base 0, instance 0
+DEAL:: DoF 16 belongs to base 0, instance 1
+DEAL:: DoF 5 belongs to base 0, instance 0
+DEAL:: DoF 17 belongs to base 0, instance 1
+DEAL:: DoF 6 belongs to base 0, instance 0
+DEAL:: DoF 18 belongs to base 0, instance 1
+DEAL:: DoF 7 belongs to base 0, instance 0
+DEAL:: DoF 19 belongs to base 0, instance 1
+DEAL:: DoF 8 belongs to base 0, instance 0
+DEAL:: DoF 20 belongs to base 0, instance 1
+DEAL:: DoF 9 belongs to base 0, instance 0
+DEAL:: DoF 21 belongs to base 0, instance 1
+DEAL:: DoF 10 belongs to base 0, instance 0
+DEAL:: DoF 22 belongs to base 0, instance 1
+DEAL:: DoF 11 belongs to base 0, instance 0
+DEAL:: DoF 23 belongs to base 0, instance 1
+DEAL::