* Implementations of the
* get_dof_index/set_dof_index functions.
*/
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>)
- {
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>)
+ {
- return dof_handler.levels[obj_level]->lines.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->lines.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- return dof_handler.faces->lines.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>,
- const unsigned int global_index)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ return dof_handler.faces->lines.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>,
+ const unsigned int global_index)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- dof_handler.faces->lines.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<2>)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<2>,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ dof_handler.faces->lines.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<2>)
+ {
- return dof_handler.levels[obj_level]->quads.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<2>,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->quads.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- return dof_handler.faces->lines.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<1>,
- const unsigned int global_index)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ return dof_handler.faces->lines.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<1>,
+ const unsigned int global_index)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- dof_handler.faces->lines.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<2>)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ dof_handler.faces->lines.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<2>)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- return dof_handler.faces->quads.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<2>,
- const unsigned int global_index)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ return dof_handler.faces->quads.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<2>,
+ const unsigned int global_index)
+ {
// faces have no levels
- Assert (obj_level == 0, ExcInternalError());
- dof_handler.faces->quads.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<3>)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- dealii::internal::int2type<3>,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &,
- const unsigned int global_index)
- {
- dof_handler.faces->lines.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<2> &,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<1> &,
- const unsigned int global_index)
- {
- dof_handler.faces->lines.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.faces->quads.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<2> &,
- const unsigned int global_index)
- {
- dof_handler.faces->quads.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<3> &)
- {
- return dof_handler.levels[obj_level]->dof_object.
- get_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- void
- set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const dealii::internal::int2type<3> &,
- const unsigned int global_index)
- {
- dof_handler.levels[obj_level]->dof_object.
- set_dof_index (dof_handler,
- obj_index,
- fe_index,
- local_index,
- global_index,
- obj_level);
- }
-
-
- template <int structdim, int dim, int spacedim>
- static
- bool
- fe_index_is_active (const dealii::DoFHandler<dim,spacedim> &,
- const unsigned int,
- const unsigned int,
- const unsigned int fe_index,
- const dealii::internal::int2type<structdim> &)
- {
- return (fe_index == 0);
- }
-
-
-
- template <int structdim, int dim, int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::DoFHandler<dim,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const dealii::internal::int2type<structdim> &)
- {
+ Assert (obj_level == 0, ExcInternalError());
+ dof_handler.faces->quads.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<3>)
+ {
- return dof_handler.levels[obj_level]->hexes.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ dealii::internal::int2type<3>,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->hexes.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &)
+ {
- return dof_handler.levels[obj_level]->lines.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->lines.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &,
+ const unsigned int global_index)
+ {
+ dof_handler.faces->lines.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<2> &)
+ {
- return dof_handler.levels[obj_level]->quads.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<2> &,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->quads.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<1> &,
+ const unsigned int global_index)
+ {
+ dof_handler.faces->lines.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<2> &)
+ {
+ return dof_handler.faces->quads.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<2> &,
+ const unsigned int global_index)
+ {
+ dof_handler.faces->quads.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ get_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<3> &)
+ {
- return dof_handler.levels[obj_level]->hexes.
++ return dof_handler.levels[obj_level]->dof_object.
+ get_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ void
+ set_dof_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const dealii::internal::int2type<3> &,
+ const unsigned int global_index)
+ {
- dof_handler.levels[obj_level]->hexes.
++ dof_handler.levels[obj_level]->dof_object.
+ set_dof_index (dof_handler,
+ obj_index,
+ fe_index,
+ local_index,
+ global_index,
+ obj_level);
+ }
+
+
+ template <int structdim, int dim, int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::DoFHandler<dim,spacedim> &,
+ const unsigned int,
+ const unsigned int,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<structdim> &)
+ {
+ return (fe_index == 0);
+ }
+
+
+
+ template <int structdim, int dim, int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::DoFHandler<dim,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<structdim> &)
+ {
// check that the object we look
// at is in fact active. the
// problem is that we have
// leaves out is faces in 3d --
// let's hope that this never is
// a problem
- Assert ((dim==structdim
- ?
- typename
- dealii::DoFHandler<dim,spacedim>::
- raw_cell_iterator (&dof_handler.get_tria(),
- obj_level,
- obj_index,
- &dof_handler)->used()
- :
- (structdim==1
- ?
- typename
- dealii::DoFHandler<dim,spacedim>::
- raw_line_iterator (&dof_handler.get_tria(),
- obj_level,
- obj_index,
- &dof_handler)->used()
- :
- true))
- == true,
- ExcMessage ("This cell is not active and therefore can't be "
- "queried for its active FE indices"));
- Assert (n == 0, ExcIndexRange (n, 0, 1));
-
- return dealii::DoFHandler<dim,spacedim>::default_fe_index;
- }
-
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
-
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int ,
- const unsigned int obj_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
-
-
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
-
-
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int,
- const unsigned int obj_index,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<1> &)
- {
- return dof_handler.faces->lines.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
-
-
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.faces->quads.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
- template <int spacedim>
- static
- bool
- fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const dealii::internal::int2type<3> &)
- {
- return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
- obj_index,
- fe_index,
- obj_level);
- }
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int ,
- const unsigned int obj_index,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.faces->quads.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<2> &)
- {
- return dof_handler.faces->quads.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const dealii::internal::int2type<3> &)
- {
- return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
- obj_index);
- }
-
-
-
- template <int spacedim>
- static
- unsigned int
- nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
- const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int n,
- const dealii::internal::int2type<3> &)
- {
- return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
- obj_level,
- obj_index,
- n);
- }
+ Assert ((dim==structdim
+ ?
+ typename
+ dealii::DoFHandler<dim,spacedim>::
+ raw_cell_iterator (&dof_handler.get_tria(),
+ obj_level,
+ obj_index,
+ &dof_handler)->used()
+ :
+ (structdim==1
+ ?
+ typename
+ dealii::DoFHandler<dim,spacedim>::
+ raw_line_iterator (&dof_handler.get_tria(),
+ obj_level,
+ obj_index,
+ &dof_handler)->used()
+ :
+ true))
+ == true,
+ ExcMessage ("This cell is not active and therefore can't be "
+ "queried for its active FE indices"));
+ Assert (n == 0, ExcIndexRange (n, 0, 1));
+
+ return dealii::DoFHandler<dim,spacedim>::default_fe_index;
+ }
+
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<1> &)
+ {
- return dof_handler.levels[obj_level]->lines.fe_index_is_active(dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<1> &)
+ {
- return dof_handler.levels[obj_level]->lines.n_active_fe_indices (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<1,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<1> &)
+ {
- return dof_handler.levels[obj_level]->lines.nth_active_fe_index (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
+
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int ,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
+
+
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<2> &)
+ {
- return dof_handler.levels[obj_level]->quads.fe_index_is_active(dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<2> &)
+ {
- return dof_handler.levels[obj_level]->quads.n_active_fe_indices (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<2,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<2> &)
+ {
- return dof_handler.levels[obj_level]->quads.nth_active_fe_index (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
+
+
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<1> &)
+ {
+ return dof_handler.faces->lines.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
+
+
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<2> &)
+ {
+ return dof_handler.faces->quads.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+ template <int spacedim>
+ static
+ bool
+ fe_index_is_active (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const dealii::internal::int2type<3> &)
+ {
- return dof_handler.levels[obj_level]->hexes.fe_index_is_active(dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler,
+ obj_index,
+ fe_index,
+ obj_level);
+ }
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int ,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<2> &)
+ {
+ return dof_handler.faces->quads.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<2> &)
+ {
+ return dof_handler.faces->quads.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ n_active_fe_indices (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const dealii::internal::int2type<3> &)
+ {
- return dof_handler.levels[obj_level]->hexes.n_active_fe_indices (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler,
+ obj_index);
+ }
+
+
+
+ template <int spacedim>
+ static
+ unsigned int
+ nth_active_fe_index (const dealii::hp::DoFHandler<3,spacedim> &dof_handler,
+ const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int n,
+ const dealii::internal::int2type<3> &)
+ {
- return dof_handler.levels[obj_level]->hexes.nth_active_fe_index (dof_handler,
++ return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler,
+ obj_level,
+ obj_index,
+ n);
+ }
/**
* Set the @p local_index-th
* was selected when calling
* @p distribute_dofs the last time.
*/
- template <int spacedim>
- static
- void reserve_space (DoFHandler<1,spacedim> &dof_handler)
- {
- dof_handler.vertex_dofs
- .resize(dof_handler.tria->n_vertices() *
- dof_handler.selected_fe->dofs_per_vertex,
- DoFHandler<1,spacedim>::invalid_dof_index);
-
- for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
- {
- dof_handler.levels
- .push_back (new internal::DoFHandler::DoFLevel<1>);
-
- dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_lines(i) *
- dof_handler.selected_fe->dofs_per_line,
- DoFHandler<1,spacedim>::invalid_dof_index);
-
- dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_lines(i) *
- dof_handler.selected_fe->dofs_per_cell,
- DoFHandler<1,spacedim>::invalid_dof_index);
- }
- }
-
-
- template <int spacedim>
- static
- void reserve_space (DoFHandler<2,spacedim> &dof_handler)
- {
- dof_handler.vertex_dofs
- .resize(dof_handler.tria->n_vertices() *
- dof_handler.selected_fe->dofs_per_vertex,
- DoFHandler<2,spacedim>::invalid_dof_index);
-
- for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
- {
- dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<2>);
-
- dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_quads(i) *
- dof_handler.selected_fe->dofs_per_quad,
- DoFHandler<2,spacedim>::invalid_dof_index);
-
- dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_quads(i) *
- dof_handler.selected_fe->dofs_per_cell,
- DoFHandler<2,spacedim>::invalid_dof_index);
- }
-
- dof_handler.faces = new internal::DoFHandler::DoFFaces<2>;
- dof_handler.faces->lines.dofs
- .resize (dof_handler.tria->n_raw_lines() *
- dof_handler.selected_fe->dofs_per_line,
- DoFHandler<2,spacedim>::invalid_dof_index);
- }
-
-
- template <int spacedim>
- static
- void reserve_space (DoFHandler<3,spacedim> &dof_handler)
- {
- dof_handler.vertex_dofs
- .resize(dof_handler.tria->n_vertices() *
- dof_handler.selected_fe->dofs_per_vertex,
- DoFHandler<3,spacedim>::invalid_dof_index);
-
- for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
- {
- dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<3>);
-
- dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_hexs(i) *
- dof_handler.selected_fe->dofs_per_hex,
- DoFHandler<3,spacedim>::invalid_dof_index);
-
- dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_hexs(i) *
- dof_handler.selected_fe->dofs_per_cell,
- DoFHandler<3,spacedim>::invalid_dof_index);
- }
- dof_handler.faces = new internal::DoFHandler::DoFFaces<3>;
-
- dof_handler.faces->lines.dofs
- .resize (dof_handler.tria->n_raw_lines() *
- dof_handler.selected_fe->dofs_per_line,
- DoFHandler<3,spacedim>::invalid_dof_index);
- dof_handler.faces->quads.dofs
- .resize (dof_handler.tria->n_raw_quads() *
- dof_handler.selected_fe->dofs_per_quad,
- DoFHandler<3,spacedim>::invalid_dof_index);
- }
+ template <int spacedim>
+ static
+ void reserve_space (DoFHandler<1,spacedim> &dof_handler)
+ {
+ dof_handler.vertex_dofs
+ .resize(dof_handler.tria->n_vertices() *
+ dof_handler.selected_fe->dofs_per_vertex,
+ DoFHandler<1,spacedim>::invalid_dof_index);
+
+ for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
+ {
+ dof_handler.levels
+ .push_back (new internal::DoFHandler::DoFLevel<1>);
+
- dof_handler.levels.back()->lines.dofs
++ dof_handler.levels.back()->dof_object.dofs
+ .resize (dof_handler.tria->n_raw_lines(i) *
+ dof_handler.selected_fe->dofs_per_line,
+ DoFHandler<1,spacedim>::invalid_dof_index);
+
+ dof_handler.levels.back()->cell_dof_indices_cache
+ .resize (dof_handler.tria->n_raw_lines(i) *
+ dof_handler.selected_fe->dofs_per_cell,
+ DoFHandler<1,spacedim>::invalid_dof_index);
+ }
+ }
+
+
+ template <int spacedim>
+ static
+ void reserve_space (DoFHandler<2,spacedim> &dof_handler)
+ {
+ dof_handler.vertex_dofs
+ .resize(dof_handler.tria->n_vertices() *
+ dof_handler.selected_fe->dofs_per_vertex,
+ DoFHandler<2,spacedim>::invalid_dof_index);
+
+ for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
+ {
+ dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<2>);
+
- dof_handler.levels.back()->quads.dofs
++ dof_handler.levels.back()->dof_object.dofs
+ .resize (dof_handler.tria->n_raw_quads(i) *
+ dof_handler.selected_fe->dofs_per_quad,
+ DoFHandler<2,spacedim>::invalid_dof_index);
+
+ dof_handler.levels.back()->cell_dof_indices_cache
+ .resize (dof_handler.tria->n_raw_quads(i) *
+ dof_handler.selected_fe->dofs_per_cell,
+ DoFHandler<2,spacedim>::invalid_dof_index);
+ }
+
+ dof_handler.faces = new internal::DoFHandler::DoFFaces<2>;
+ dof_handler.faces->lines.dofs
+ .resize (dof_handler.tria->n_raw_lines() *
+ dof_handler.selected_fe->dofs_per_line,
+ DoFHandler<2,spacedim>::invalid_dof_index);
+ }
+
+
+ template <int spacedim>
+ static
+ void reserve_space (DoFHandler<3,spacedim> &dof_handler)
+ {
+ dof_handler.vertex_dofs
+ .resize(dof_handler.tria->n_vertices() *
+ dof_handler.selected_fe->dofs_per_vertex,
+ DoFHandler<3,spacedim>::invalid_dof_index);
+
+ for (unsigned int i=0; i<dof_handler.tria->n_levels(); ++i)
+ {
+ dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<3>);
+
- dof_handler.levels.back()->hexes.dofs
++ dof_handler.levels.back()->dof_object.dofs
+ .resize (dof_handler.tria->n_raw_hexs(i) *
+ dof_handler.selected_fe->dofs_per_hex,
+ DoFHandler<3,spacedim>::invalid_dof_index);
+
+ dof_handler.levels.back()->cell_dof_indices_cache
+ .resize (dof_handler.tria->n_raw_hexs(i) *
+ dof_handler.selected_fe->dofs_per_cell,
+ DoFHandler<3,spacedim>::invalid_dof_index);
+ }
+ dof_handler.faces = new internal::DoFHandler::DoFFaces<3>;
+
+ dof_handler.faces->lines.dofs
+ .resize (dof_handler.tria->n_raw_lines() *
+ dof_handler.selected_fe->dofs_per_line,
+ DoFHandler<3,spacedim>::invalid_dof_index);
+ dof_handler.faces->quads.dofs
+ .resize (dof_handler.tria->n_raw_quads() *
+ dof_handler.selected_fe->dofs_per_quad,
+ DoFHandler<3,spacedim>::invalid_dof_index);
+ }
+
+ template<int spacedim>
+ static
+ void reserve_space_mg (DoFHandler<1, spacedim>& dof_handler) {
+ Assert (dof_handler.get_tria ().n_levels () > 0, ExcMessage ("Invalid triangulation"));
+ dof_handler.clear_mg_space ();
+
+ const dealii::Triangulation<1, spacedim>& tria = dof_handler.get_tria ();
+ const unsigned int& dofs_per_line = dof_handler.get_fe ().dofs_per_line;
+ const unsigned int& n_levels = tria.n_levels ();
+
+ for (unsigned int i = 0; i < n_levels; ++i) {
+ dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<1>);
- dof_handler.mg_levels.back ()->lines.dofs = std::vector<unsigned int> (tria.n_raw_lines (i) * dofs_per_line, DoFHandler<1>::invalid_dof_index);
++ dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_lines (i) * dofs_per_line, DoFHandler<1>::invalid_dof_index);
+ }
+
+ const unsigned int& n_vertices = tria.n_vertices ();
+
+ dof_handler.mg_vertex_dofs.resize (n_vertices);
+
+ std::vector<unsigned int> max_level (n_vertices, 0);
+ std::vector<unsigned int> min_level (n_vertices, n_levels);
+
+ for (typename dealii::Triangulation<1, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell) {
+ const unsigned int level = cell->level ();
+
+ for (unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex) {
+ const unsigned int vertex_index = cell->vertex_index (vertex);
+
+ if (min_level[vertex_index] > level)
+ min_level[vertex_index] = level;
+
+ if (max_level[vertex_index] < level)
+ max_level[vertex_index] = level;
+ }
+ }
+
+ for (unsigned int vertex = 0; vertex < n_vertices; ++vertex)
+ if (tria.vertex_used (vertex)) {
+ Assert (min_level[vertex] < n_levels, ExcInternalError ());
+ Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], dof_handler.get_fe ().dofs_per_vertex);
+ }
+
+ else {
+ Assert (min_level[vertex] == n_levels, ExcInternalError ());
+ Assert (max_level[vertex] == 0, ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (1, 0, 0);
+ }
+ }
+
+ template<int spacedim>
+ static
+ void reserve_space_mg (DoFHandler<2, spacedim>& dof_handler) {
+ Assert (dof_handler.get_tria ().n_levels () > 0, ExcMessage ("Invalid triangulation"));
+ dof_handler.clear_mg_space ();
+
+ const dealii::FiniteElement<2, spacedim>& fe = dof_handler.get_fe ();
+ const dealii::Triangulation<2, spacedim>& tria = dof_handler.get_tria ();
+ const unsigned int& n_levels = tria.n_levels ();
+
+ for (unsigned int i = 0; i < n_levels; ++i) {
+ dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<2>);
- dof_handler.mg_levels.back ()->quads.dofs = std::vector<unsigned int> (tria.n_raw_quads (i) * fe.dofs_per_quad, DoFHandler<2>::invalid_dof_index);
++ dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_quads (i) * fe.dofs_per_quad, DoFHandler<2>::invalid_dof_index);
+ }
+
+ dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<2>;
+ dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<2>::invalid_dof_index);
+
+ const unsigned int& n_vertices = tria.n_vertices ();
+
+ dof_handler.mg_vertex_dofs.resize (n_vertices);
+
+ std::vector<unsigned int> max_level (n_vertices, 0);
+ std::vector<unsigned int> min_level (n_vertices, n_levels);
+
+ for (typename dealii::Triangulation<2, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell) {
+ const unsigned int level = cell->level ();
+
+ for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex) {
+ const unsigned int vertex_index = cell->vertex_index (vertex);
+
+ if (min_level[vertex_index] > level)
+ min_level[vertex_index] = level;
+
+ if (max_level[vertex_index] < level)
+ max_level[vertex_index] = level;
+ }
+ }
+
+ for (unsigned int vertex = 0; vertex < n_vertices; ++vertex)
+ if (tria.vertex_used (vertex)) {
+ Assert (min_level[vertex] < n_levels, ExcInternalError ());
+ Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
+ }
+
+ else {
+ Assert (min_level[vertex] == n_levels, ExcInternalError ());
+ Assert (max_level[vertex] == 0, ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (1, 0, 0);
+ }
+ }
+
+ template<int spacedim>
+ static
+ void reserve_space_mg (DoFHandler<3, spacedim>& dof_handler) {
+ Assert (dof_handler.get_tria ().n_levels () > 0, ExcMessage ("Invalid triangulation"));
+ dof_handler.clear_mg_space ();
+
+ const dealii::FiniteElement<3, spacedim>& fe = dof_handler.get_fe ();
+ const dealii::Triangulation<3, spacedim>& tria = dof_handler.get_tria ();
+ const unsigned int& n_levels = tria.n_levels ();
+
+ for (unsigned int i = 0; i < n_levels; ++i) {
+ dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<3>);
- dof_handler.mg_levels.back ()->hexes.dofs = std::vector<unsigned int> (tria.n_raw_hexs (i) * fe.dofs_per_hex, DoFHandler<3>::invalid_dof_index);
++ dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<unsigned int> (tria.n_raw_hexs (i) * fe.dofs_per_hex, DoFHandler<3>::invalid_dof_index);
+ }
+
+ dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<3>;
+ dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (tria.n_raw_lines () * fe.dofs_per_line, DoFHandler<3>::invalid_dof_index);
+ dof_handler.mg_faces->quads.dofs = std::vector<unsigned int> (tria.n_raw_quads () * fe.dofs_per_quad, DoFHandler<3>::invalid_dof_index);
+
+ const unsigned int& n_vertices = tria.n_vertices ();
+
+ dof_handler.mg_vertex_dofs.resize (n_vertices);
+
+ std::vector<unsigned int> max_level (n_vertices, 0);
+ std::vector<unsigned int> min_level (n_vertices, n_levels);
+
+ for (typename dealii::Triangulation<3, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell) {
+ const unsigned int level = cell->level ();
+
+ for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex) {
+ const unsigned int vertex_index = cell->vertex_index (vertex);
+
+ if (min_level[vertex_index] > level)
+ min_level[vertex_index] = level;
+
+ if (max_level[vertex_index] < level)
+ max_level[vertex_index] = level;
+ }
+ }
+
+ for (unsigned int vertex = 0; vertex < n_vertices; ++vertex)
+ if (tria.vertex_used (vertex)) {
+ Assert (min_level[vertex] < n_levels, ExcInternalError ());
+ Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
+ }
+
+ else {
+ Assert (min_level[vertex] == n_levels, ExcInternalError ());
+ Assert (max_level[vertex] == 0, ExcInternalError ());
+ dof_handler.mg_vertex_dofs[vertex].init (1, 0, 0);
+ }
+ }
+
+ template<int spacedim>
+ static
+ unsigned int distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ const FiniteElement<1, spacedim>& fe = cell->get_fe ();
+
+ if (fe.dofs_per_vertex > 0)
+ for (unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex) {
+ typename DoFHandler<1, spacedim>::cell_iterator neighbor = cell->neighbor (vertex);
+
+ if (neighbor.state () == IteratorState::valid)
+ if (neighbor->user_flag_set () && (neighbor->level () == cell->level ())) {
+ if (vertex == 0)
+ for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
+ cell->set_mg_vertex_dof_index (cell->level (), 0, dof, neighbor->mg_vertex_dof_index (cell->level (), 1, dof));
+
+ else
+ for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
+ cell->set_mg_vertex_dof_index (cell->level (), 1, dof, neighbor->mg_vertex_dof_index (cell->level (), 0, dof));
+
+ continue;
+ }
+
+ for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
+ cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
+ }
+
+ if (fe.dofs_per_line > 0)
+ for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
+ cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+
+ cell->set_user_flag ();
+ return next_free_dof;
+ }
+
+ template<int spacedim>
+ static
+ unsigned int distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ const FiniteElement<2, spacedim>& fe = cell->get_fe ();
+
+ if (fe.dofs_per_vertex > 0)
+ for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
+ if (cell->mg_vertex_dof_index (cell->level (), vertex, 0) == DoFHandler<2>::invalid_dof_index)
+ for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
+ cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
+
+ if (fe.dofs_per_line > 0)
+ for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face) {
+ typename DoFHandler<2, spacedim>::line_iterator line = cell->line (face);
+
+ if (line->mg_dof_index (cell->level (), 0) == DoFHandler<2>::invalid_dof_index)
+ for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
+ line->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+ }
+
+ if (fe.dofs_per_quad > 0)
+ for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof)
+ cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+
+ cell->set_user_flag ();
+ return next_free_dof;
+ }
+
+ template<int spacedim>
+ static
+ unsigned int distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ const FiniteElement<3, spacedim>& fe = cell->get_fe ();
+
+ if (fe.dofs_per_vertex > 0)
+ for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
+ if (cell->mg_vertex_dof_index (cell->level (), vertex, 0) == DoFHandler<3>::invalid_dof_index)
+ for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
+ cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
+
+ if (fe.dofs_per_line > 0)
+ for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_cell; ++line) {
+ typename DoFHandler<3, spacedim>::line_iterator line_it = cell->line (line);
+
+ if (line_it->mg_dof_index (cell->level (), 0) == DoFHandler<3>::invalid_dof_index)
+ for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
+ line_it->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+ }
+
+ if (fe.dofs_per_quad > 0)
+ for (unsigned int face = 0; face < GeometryInfo<3>::quads_per_cell; ++face) {
+ typename DoFHandler<3, spacedim>::quad_iterator quad = cell->quad (face);
+
+ if (quad->mg_dof_index (cell->level (), 0) == DoFHandler<3>::invalid_dof_index)
+ for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof)
+ quad->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+ }
+
+ if (fe.dofs_per_hex > 0)
+ for (unsigned int dof = 0; dof < fe.dofs_per_hex; ++dof)
+ cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
+
+ cell->set_user_flag ();
+ return next_free_dof;
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) {
- return mg_level.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
++ return mg_level.dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) {
+ return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) {
- return mg_level.quads.get_dof_index (dof_handler, obj_index, fe_index, local_index);
++ return mg_level.dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<1>) {
+ return mg_faces.lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<2>) {
+ return mg_faces.quads.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ unsigned int get_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const int2type<3>) {
- return mg_level.hexes.get_dof_index (dof_handler, obj_index, fe_index, local_index);
++ return mg_level.dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<1, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<1>& mg_level, internal::DoFHandler::DoFFaces<1>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) {
- mg_level.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
++ mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>&, internal::DoFHandler::DoFFaces<2>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) {
+ mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<2, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<2>& mg_level, internal::DoFHandler::DoFFaces<2>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>) {
- mg_level.quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
++ mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<1>) {
+ mg_faces.lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>&, internal::DoFHandler::DoFFaces<3>& mg_faces, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<2>) {
+ mg_faces.quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
+
+ template<int spacedim>
+ static
+ void set_dof_index (const DoFHandler<3, spacedim>& dof_handler, internal::DoFHandler::DoFLevel<3>& mg_level, internal::DoFHandler::DoFFaces<3>&, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const int2type<3>) {
- mg_level.hexes.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
++ mg_level.dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
+ }
};
}
}
}
- void DoFHandler<dim, spacedim>::distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const unsigned int offset) {
+template<int dim, int spacedim>
- unsigned int next_free_dof = offset;
++void DoFHandler<dim, spacedim>::distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe) {
+ Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim>*> (&*tria) == 0), ExcMessage ("Invalid triangulation"));
+ distribute_dofs (fe);
+ reserve_space ();
+
+ const unsigned int& n_levels = (*tria).n_levels ();
+
+ mg_used_dofs.resize (n_levels, 0);
+
+ std::vector<bool> user_flags;
+
+ (*tria).save_user_flags (user_flags);
+ const_cast<Triangulation<dim, spacedim>&>(*tria).clear_user_flags ();
+
+ for (unsigned int level = 0; level < n_levels; ++level) {
++ unsigned int next_free_dof = 0;
+
+ for (cell_iterator cell = begin (level); cell != end (level); ++cell)
+ next_free_dof = internal::DoFHandler::Implementation::distribute_dofs_on_cell<spacedim> (cell, next_free_dof);
+
+ mg_used_dofs[level] = next_free_dof;
+ }
+
+ const_cast<Triangulation<dim, spacedim>&>(*tria).load_user_flags (user_flags);
+ block_info_object.initialize (*this, true, true);
+}
+
+template<int dim, int spacedim>
+void DoFHandler<dim, spacedim>::reserve_space () {
+ internal::DoFHandler::Implementation::reserve_space_mg (*this);
+}
+
+template<int dim, int spacedim>
+void DoFHandler<dim, spacedim>::clear_mg_space () {
+ for (unsigned int i = 0; i < mg_levels.size (); ++i)
+ delete mg_levels[i];
+
+ mg_levels.clear ();
+ delete mg_faces;
+ mg_faces = NULL;
+
+ std::vector<MGVertexDoFs> tmp;
+
+ std::swap (mg_vertex_dofs, tmp);
+}
+
template<int dim, int spacedim>
void DoFHandler<dim,spacedim>::initialize_local_block_info ()
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<unsigned int> (dof_handler.tria->n_raw_lines(level),
- DoFHandler<dim,spacedim>::invalid_dof_index);
-
- unsigned int next_free_dof = 0;
- for (typename DoFHandler<dim,spacedim>::active_cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- {
- dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
- next_free_dof += cell->get_fe().dofs_per_line;
- }
-
- dof_handler.levels[level]->dof_object.dofs
- = std::vector<unsigned int> (next_free_dof,
- DoFHandler<dim,spacedim>::invalid_dof_index);
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
- dof_handler.levels[level]->lines.dof_offsets
++ dof_handler.levels[level]->dof_object.dof_offsets
+ = std::vector<unsigned int> (dof_handler.tria->n_raw_lines(level),
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+
+ unsigned int next_free_dof = 0;
+ for (typename DoFHandler<dim,spacedim>::active_cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ {
- dof_handler.levels[level]->lines.dof_offsets[cell->index()] = next_free_dof;
++ dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
+ next_free_dof += cell->get_fe().dofs_per_line;
+ }
+
- dof_handler.levels[level]->lines.dofs
++ dof_handler.levels[level]->dof_object.dofs
+ = std::vector<unsigned int> (next_free_dof,
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+ }
// safety check: make sure that
// the number of DoFs we
// we couldn't use this simpler
// algorithm)
#ifdef DEBUG
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- unsigned int counter = 0;
- for (typename DoFHandler<dim,spacedim>::cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- counter += cell->get_fe().dofs_per_line;
-
- Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
- ExcInternalError());
- Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
- dof_handler.levels[level]->dof_object.dof_offsets.end(),
- DoFHandler<dim,spacedim>::invalid_dof_index))
- ==
- dof_handler.tria->n_raw_lines(level) - dof_handler.tria->n_active_lines(level),
- ExcInternalError());
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
+ unsigned int counter = 0;
+ for (typename DoFHandler<dim,spacedim>::cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ counter += cell->get_fe().dofs_per_line;
+
- Assert (dof_handler.levels[level]->lines.dofs.size() == counter,
++ Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
+ ExcInternalError());
+ Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->lines.dof_offsets.begin(),
- dof_handler.levels[level]->lines.dof_offsets.end(),
++ (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
++ dof_handler.levels[level]->dof_object.dof_offsets.end(),
+ DoFHandler<dim,spacedim>::invalid_dof_index))
+ ==
+ dof_handler.tria->n_raw_lines(level) - dof_handler.tria->n_active_lines(level),
+ ExcInternalError());
+ }
#endif
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<unsigned int> (dof_handler.tria->n_raw_quads(level),
- DoFHandler<dim,spacedim>::invalid_dof_index);
-
- unsigned int next_free_dof = 0;
- for (typename DoFHandler<dim,spacedim>::active_cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- {
- dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
- next_free_dof += cell->get_fe().dofs_per_quad;
- }
-
- dof_handler.levels[level]->dof_object.dofs
- = std::vector<unsigned int> (next_free_dof,
- DoFHandler<dim,spacedim>::invalid_dof_index);
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
- dof_handler.levels[level]->quads.dof_offsets
++ dof_handler.levels[level]->dof_object.dof_offsets
+ = std::vector<unsigned int> (dof_handler.tria->n_raw_quads(level),
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+
+ unsigned int next_free_dof = 0;
+ for (typename DoFHandler<dim,spacedim>::active_cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ {
- dof_handler.levels[level]->quads.dof_offsets[cell->index()] = next_free_dof;
++ dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
+ next_free_dof += cell->get_fe().dofs_per_quad;
+ }
+
- dof_handler.levels[level]->quads.dofs
++ dof_handler.levels[level]->dof_object.dofs
+ = std::vector<unsigned int> (next_free_dof,
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+ }
// safety check: make sure that
// the number of DoFs we
// we couldn't use this simpler
// algorithm)
#ifdef DEBUG
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- unsigned int counter = 0;
- for (typename DoFHandler<dim,spacedim>::cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- counter += cell->get_fe().dofs_per_quad;
-
- Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
- ExcInternalError());
- Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
- dof_handler.levels[level]->dof_object.dof_offsets.end(),
- DoFHandler<dim,spacedim>::invalid_dof_index))
- ==
- dof_handler.tria->n_raw_quads(level) - dof_handler.tria->n_active_quads(level),
- ExcInternalError());
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
+ unsigned int counter = 0;
+ for (typename DoFHandler<dim,spacedim>::cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ counter += cell->get_fe().dofs_per_quad;
+
- Assert (dof_handler.levels[level]->quads.dofs.size() == counter,
++ Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
+ ExcInternalError());
+ Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->quads.dof_offsets.begin(),
- dof_handler.levels[level]->quads.dof_offsets.end(),
++ (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
++ dof_handler.levels[level]->dof_object.dof_offsets.end(),
+ DoFHandler<dim,spacedim>::invalid_dof_index))
+ ==
+ dof_handler.tria->n_raw_quads(level) - dof_handler.tria->n_active_quads(level),
+ ExcInternalError());
+ }
#endif
// other (lower dimensional)
// objects since exactly one
// finite element is used for it
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- dof_handler.levels[level]->dof_object.dof_offsets
- = std::vector<unsigned int> (dof_handler.tria->n_raw_hexs(level),
- DoFHandler<dim,spacedim>::invalid_dof_index);
-
- unsigned int next_free_dof = 0;
- for (typename DoFHandler<dim,spacedim>::active_cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- {
- dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
- next_free_dof += cell->get_fe().dofs_per_hex;
- }
-
- dof_handler.levels[level]->dof_object.dofs
- = std::vector<unsigned int> (next_free_dof,
- DoFHandler<dim,spacedim>::invalid_dof_index);
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
- dof_handler.levels[level]->hexes.dof_offsets
++ dof_handler.levels[level]->dof_object.dof_offsets
+ = std::vector<unsigned int> (dof_handler.tria->n_raw_hexs(level),
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+
+ unsigned int next_free_dof = 0;
+ for (typename DoFHandler<dim,spacedim>::active_cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ {
- dof_handler.levels[level]->hexes.dof_offsets[cell->index()] = next_free_dof;
++ dof_handler.levels[level]->dof_object.dof_offsets[cell->index()] = next_free_dof;
+ next_free_dof += cell->get_fe().dofs_per_hex;
+ }
+
- dof_handler.levels[level]->hexes.dofs
++ dof_handler.levels[level]->dof_object.dofs
+ = std::vector<unsigned int> (next_free_dof,
+ DoFHandler<dim,spacedim>::invalid_dof_index);
+ }
// safety check: make sure that
// the number of DoFs we
// we couldn't use this simpler
// algorithm)
#ifdef DEBUG
- for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
- {
- unsigned int counter = 0;
- for (typename DoFHandler<dim,spacedim>::cell_iterator
- cell=dof_handler.begin_active(level);
- cell!=dof_handler.end_active(level); ++cell)
- if (!cell->has_children())
- counter += cell->get_fe().dofs_per_hex;
-
- Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
- ExcInternalError());
- Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
- dof_handler.levels[level]->dof_object.dof_offsets.end(),
- DoFHandler<dim,spacedim>::invalid_dof_index))
- ==
- dof_handler.tria->n_raw_hexs(level) - dof_handler.tria->n_active_hexs(level),
- ExcInternalError());
- }
+ for (unsigned int level=0; level<dof_handler.tria->n_levels(); ++level)
+ {
+ unsigned int counter = 0;
+ for (typename DoFHandler<dim,spacedim>::cell_iterator
+ cell=dof_handler.begin_active(level);
+ cell!=dof_handler.end_active(level); ++cell)
+ if (!cell->has_children())
+ counter += cell->get_fe().dofs_per_hex;
+
- Assert (dof_handler.levels[level]->hexes.dofs.size() == counter,
++ Assert (dof_handler.levels[level]->dof_object.dofs.size() == counter,
+ ExcInternalError());
+ Assert (static_cast<unsigned int>
- (std::count (dof_handler.levels[level]->hexes.dof_offsets.begin(),
- dof_handler.levels[level]->hexes.dof_offsets.end(),
++ (std::count (dof_handler.levels[level]->dof_object.dof_offsets.begin(),
++ dof_handler.levels[level]->dof_object.dof_offsets.end(),
+ DoFHandler<dim,spacedim>::invalid_dof_index))
+ ==
+ dof_handler.tria->n_raw_hexs(level) - dof_handler.tria->n_active_hexs(level),
+ ExcInternalError());
+ }
#endif