FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
Vector<double> cell_rhs (dofs_per_cell);
- std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
void PlasticityContactProblem<dim>::run ()
{
pcout << "Solving problem in " << dim << " space dimensions." << std::endl;
-
+
+ Timer t;
run_time.resize (8);
- clock_t start, end;
+ const unsigned int n_cycles = 5;
+ for (unsigned int cycle=0; cycle<n_cycles; ++cycle)
+ {
+ pcout << "Cycle " << cycle << ':' << std::endl;
+
+ MPI_Barrier (mpi_communicator);
+ t.restart();
- start = clock();
- make_grid();
- // mesh_surface ();
+ if (cycle == 0)
+ {
+ make_grid();
+ }
+ else
+ refine_grid ();
- setup_system ();
+ setup_system ();
+
+ MPI_Barrier (mpi_communicator);
+ t.stop();
+ run_time[0] += t.wall_time();;
- end = clock();
- run_time[0] = (double)(end-start)/CLOCKS_PER_SEC;
+ solve_newton ();
- solve_newton ();
+ pcout<< "Creating output." <<std::endl;
+ MPI_Barrier (mpi_communicator);
+ t.restart();
+ std::ostringstream filename_solution;
+ filename_solution << "solution_";
+ filename_solution << cycle;
+ output_results (filename_solution.str ());
+ MPI_Barrier (mpi_communicator);
+ t.stop();
+ if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
+ run_time[4] += t.wall_time();
+ }
}
}
*/
const unsigned int artificial_subdomain_id = static_cast<subdomain_id>(-2);
- /**
- * The type used to denote global dof
- * indices.
- */
+
+#ifdef DEAL_II_USE_LARGE_INDEX_TYPE
+ /**
+ * The type used for global indices of
+ * degrees of freedom. While in sequential
+ * computations the 4 billion indices of
+ * 32-bit unsigned integers is plenty,
+ * parallel computations using the
+ * parallel::distributed::Triangulation
+ * class can overflow this number and we
+ * need a bigger index space.
+ *
+ * The data type always indicates an
+ * unsigned integer type.
+ */
+ typedef unsigned long long int global_dof_index;
+
+ /**
+ * An identifier that denotes the MPI type
+ * associated with types::global_dof_index.
+ */
+# define DEAL_II_DOF_INDEX_MPI_TYPE MPI_UNSIGNED_LONG_LONG
+#else
+ /**
+ * The type used for global indices of
+ * degrees of freedom. While in sequential
+ * computations the 4 billion indices of
+ * 32-bit unsigned integers is plenty,
+ * parallel computations using the
+ * parallel::distributed::Triangulation
+ * class can overflow this number and we
+ * need a bigger index space.
+ *
+ * The data type always indicates an
+ * unsigned integer type.
+ */
typedef unsigned int global_dof_index;
- /**
- * An invalid value for indices of degrees
- * of freedom.
- */
+ /**
+ * An identifier that denotes the MPI type
+ * associated with types::global_dof_index.
+ */
+# define DEAL_II_DOF_INDEX_MPI_TYPE MPI_UNSIGNED
+#endif
+
+ /**
+ * @deprecated Use numbers::invalid_dof_index
+ */
const global_dof_index invalid_dof_index = static_cast<global_dof_index>(-1);
+
/**
* The type used to denote boundary indicators associated with every
* piece of the boundary and, in the case of meshes that describe
*/
typedef material_id material_id_t;
- /**
- * Invalid material_id which we need in several places as a default value.
- * We assume that all material_ids lie in the range [0, invalid_material_id).
- */
- const material_id invalid_material_id = static_cast<material_id>(-1);
+ }
+
++
+ // this part of the namespace numbers got moved to the bottom types.h file,
+ // because otherwise we get a circular inclusion of config.h, types.h, and
+ // numbers.h
+ namespace numbers
+ {
+ /**
+ * Representation of the
+ * largest number that
+ * can be put into an
+ * unsigned integer. This
+ * value is widely used
+ * throughout the library
+ * as a marker for an
+ * invalid unsigned
+ * integer value, such as
+ * an invalid array
+ * index, an invalid
+ * array size, and the
+ * like.
+ */
+ static const unsigned int
+ invalid_unsigned_int = static_cast<unsigned int> (-1);
+
+ /**
+ * An invalid value for indices of degrees
+ * of freedom.
+ */
+ const types::global_dof_index invalid_dof_index = static_cast<types::global_dof_index>(-1);
+ /**
+ * Invalid material_id which we
+ * need in several places as a
+ * default value. We assume that
+ * all material_ids lie in the
+ * range [0, invalid_material_id).
+ */
+ const types::material_id invalid_material_id = static_cast<types::material_id>(-1);
+ /**
+ * The number which we reserve for
+ * internal faces. We assume that
+ * all boundary_ids lie in the
+ * range [0,
+ * internal_face_boundary_id).
+ */
+ const types::boundary_id internal_face_boundary_id = static_cast<types::boundary_id>(-1);
-
+ /**
+ * A special id for an invalid
+ * subdomain id. This value may not
+ * be used as a valid id but is
+ * used, for example, for default
+ * arguments to indicate a
+ * subdomain id that is not to be
+ * used.
+ *
+ * See the @ref GlossSubdomainId
+ * "glossary" for more information.
+ */
+ const types::subdomain_id invalid_subdomain_id = static_cast<types::subdomain_id>(-1);
+
+ /**
+ * The subdomain id assigned to a
+ * cell whose true subdomain id we
+ * don't know, for example because
+ * it resides on a different
+ * processor on a mesh that is kept
+ * distributed on many
+ * processors. Such cells are
+ * called "artificial".
+ *
+ * See the glossary entries on @ref
+ * GlossSubdomainId "subdomain ids"
+ * and @ref GlossArtificialCell
+ * "artificial cells" as well as
+ * the @ref distributed module for
+ * more information.
+ */
+ const types::subdomain_id artificial_subdomain_id = static_cast<types::subdomain_id>(-2);
}
* 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
+ types::global_dof_index
+ 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 types::global_dof_index 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
* releases the lock of this
* object to the finite element.
*/
- virtual void distribute_dofs (const FiniteElement<dim,spacedim> &fe,
- const types::global_dof_index offset = 0);
+ virtual void distribute_dofs (const FiniteElement<dim,spacedim> &fe);
+
++ virtual void distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe);
+
+ virtual void distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const types::global_dof_index offset = 0);
+
/**
* After distribute_dofs() with
* an FESystem element, the block
* times
* selected_fe.dofs_per_cell.
*/
- std::vector<unsigned int> cell_dof_indices_cache;
+ std::vector<types::global_dof_index> cell_dof_indices_cache;
+ /**
+ * The object containing dof-indices
+ * and related access-functions
+ */
+ DoFObjects<dim> dof_object;
- /**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
- */
- std::size_t memory_consumption () const;
-
- /**
- * Read or write the data of this object to or
- * from a stream for the purpose of serialization
- */
- template <class Archive>
- void serialize(Archive & ar,
- const unsigned int version);
- };
-
- /**
- * Store the indices of the degrees of freedom which are located on
- * lines. See the general template DoFLevel for more information.
- *
- * @author Wolfgang Bangerth, 1998, 2006
- */
- template <>
- class DoFLevel<1> : public DoFLevel<0>
- {
- public:
- /**
- * The object containing dof-indices
- * and related access-functions
- */
- DoFObjects<1> lines;
-
- /**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
- */
- std::size_t memory_consumption () const;
-
- /**
- * Read or write the data of this object to or
- * from a stream for the purpose of serialization
- */
- template <class Archive>
- void serialize(Archive & ar,
- const unsigned int version);
- };
-
-
- /**
- * Store the indices of the degrees of freedom which are located on
- * quads. See the general template DoFLevel for more information.
- *
- * @author Wolfgang Bangerth, 1998, 2006
- */
- template <>
- class DoFLevel<2> : public DoFLevel<0>
- {
- public:
- /**
- * The object containing dof-indices
- * and related access-functions
- */
- internal::DoFHandler::DoFObjects<2> quads;
-
- /**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
- */
- std::size_t memory_consumption () const;
-
- /**
- * Read or write the data of this object to or
- * from a stream for the purpose of serialization
- */
- template <class Archive>
- void serialize(Archive & ar,
- const unsigned int version);
- };
-
-
- /**
- * Store the indices of the degrees of freedom which are located on
- * hexhedra. See the general template DoFLevel for more information.
- *
- * @author Wolfgang Bangerth, 1998, 2006
- */
- template <>
- class DoFLevel<3> : public DoFLevel<0>
- {
- public:
- /**
- * The object containing dof-indices
- * and related access-functions
- */
- internal::DoFHandler::DoFObjects<3> hexes;
/**
* Determine an estimate for the
* to the same degrees of freedom,
* you'd generate several constraint
* objects, then shift them, and
- * finally @p merge them together
+ * finally merge() them together
* again.
*/
- void shift (const unsigned int offset);
+ void shift (const types::global_dof_index offset);
/**
* Clear all entries of this
* 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
+ types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator& cell, types::global_dof_index 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
+ types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator& cell, types::global_dof_index 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
+ types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator& cell, types::global_dof_index 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
+ types::global_dof_index 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
+ types::global_dof_index 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
+ types::global_dof_index 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
+ types::global_dof_index 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
+ types::global_dof_index 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
+ types::global_dof_index 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 types::global_dof_index 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 types::global_dof_index 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 types::global_dof_index 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 types::global_dof_index 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 types::global_dof_index 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 types::global_dof_index 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);
+ }
};
}
}
template<int dim, int spacedim>
-unsigned int
+types::global_dof_index
DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
{
- Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
+ Assert (boundary_indicators.find(numbers::internal_face_boundary_id) == boundary_indicators.end(),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
std::set<int> boundary_dofs;
template<int dim, int spacedim>
-unsigned int
+types::global_dof_index
DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_indicators) const
{
- Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (numbers::internal_face_boundary_id) == boundary_indicators.end(),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
std::set<int> boundary_dofs;
}
- void DoFHandler<dim, spacedim>::distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const types::global_dof_index offset) {
+template<int dim, int spacedim>
- types::global_dof_index 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) {
++ types::global_dof_index 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 ()
*/
template <int dim, int spacedim>
static
- types::global_dof_index
- unsigned int
- distribute_dofs (const unsigned int offset,
++ types::global_dof_index
+ distribute_dofs (const types::global_dof_index offset,
const types::subdomain_id subdomain_id,
DoFHandler<dim,spacedim> &dof_handler)
{
ExcInternalError ());
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
- i=dof_handler.levels[level]->lines.dofs.begin();
- i!=dof_handler.levels[level]->lines.dofs.end(); ++i)
+ i=dof_handler.levels[level]->dof_object.dofs.begin();
+ i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
if (*i != DoFHandler<1,spacedim>::invalid_dof_index)
*i = new_numbers[*i];
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
{
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
- i=dof_handler.levels[level]->quads.dofs.begin();
- i!=dof_handler.levels[level]->quads.dofs.end(); ++i)
+ i=dof_handler.levels[level]->dof_object.dofs.begin();
+ i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
if (*i != DoFHandler<2,spacedim>::invalid_dof_index)
*i = ((indices.n_elements() == 0) ?
new_numbers[*i] :
for (unsigned int level=0; level<dof_handler.levels.size(); ++level)
{
- for (std::vector<unsigned int>::iterator
+ for (std::vector<types::global_dof_index>::iterator
- i=dof_handler.levels[level]->hexes.dofs.begin();
- i!=dof_handler.levels[level]->hexes.dofs.end(); ++i)
+ i=dof_handler.levels[level]->dof_object.dofs.begin();
+ i!=dof_handler.levels[level]->dof_object.dofs.end(); ++i)
if (*i != DoFHandler<3,spacedim>::invalid_dof_index)
*i = ((indices.n_elements() == 0) ?
new_numbers[*i] :
template <int dim, int spacedim>
NumberCache
Sequential<dim,spacedim>::
- distribute_dofs (const types::global_dof_index offset,
- DoFHandler<dim,spacedim> &dof_handler) const
+ distribute_dofs (DoFHandler<dim,spacedim> &dof_handler) const
{
- const unsigned int n_dofs =
+ const types::global_dof_index n_dofs =
- Implementation::distribute_dofs (offset,
+ Implementation::distribute_dofs (0,
types::invalid_subdomain_id,
dof_handler);
const unsigned int n_dofs = dof.n_dofs();
AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
- Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
+ Assert (boundary_indicators.find(numbers::internal_face_boundary_id) == boundary_indicators.end(),
- typename DH::ExcInvalidBoundaryIndicator());
+ typename DH::ExcInvalidBoundaryIndicator());
Assert (sparsity.n_rows() == dof.n_boundary_dofs (boundary_indicators),
- ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs (boundary_indicators)));
+ ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs (boundary_indicators)));
Assert (sparsity.n_cols() == dof.n_boundary_dofs (boundary_indicators),
- ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs (boundary_indicators)));
+ ExcDimensionMismatch (sparsity.n_cols(), dof.n_boundary_dofs (boundary_indicators)));
#ifdef DEBUG
if (sparsity.n_rows() != 0)
{
template <class DH>
void
extract_dofs_with_support_on_boundary (const DH &dof_handler,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs,
- const std::set<types::boundary_id> &boundary_indicators)
+ const std::vector<bool> &component_select,
+ std::vector<bool> &selected_dofs,
+ const std::set<types::boundary_id> &boundary_indicators)
{
AssertDimension (component_select.size(), n_components(dof_handler));
- Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (numbers::internal_face_boundary_id) == boundary_indicators.end(),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
// let's see whether we have to
// check for certain boundary
void map_dof_to_boundary_indices (
const DH &dof_handler,
const std::set<types::boundary_id> &boundary_indicators,
- std::vector<unsigned int> &mapping)
+ std::vector<types::global_dof_index> &mapping)
{
Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
- Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
+ Assert (boundary_indicators.find (numbers::internal_face_boundary_id) == boundary_indicators.end(),
- ExcInvalidBoundaryIndicator());
+ ExcInvalidBoundaryIndicator());
mapping.clear ();
mapping.insert (mapping.end(), dof_handler.n_dofs(),
// 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);
+
+ types::global_dof_index 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<types::global_dof_index> (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)
+ {
+ types::global_dof_index 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);
+
+ types::global_dof_index 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<types::global_dof_index> (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)
+ {
+ types::global_dof_index 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);
+
+ types::global_dof_index 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<types::global_dof_index> (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)
+ {
+ types::global_dof_index 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
const MGDoFHandler<deal_II_dimension, deal_II_space_dimension> &,
PATTERN &,
const unsigned int);
++ template void
++ make_sparsity_pattern<DoFHandler<deal_II_dimension, deal_II_space_dimension>, PATTERN> (
++ const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
++ PATTERN &,
++ const unsigned int);
#endif
++
#if deal_II_dimension == deal_II_space_dimension
template void
make_flux_sparsity_pattern<deal_II_dimension> (
const FunctionMap<deal_II_dimension>::type&,
std::vector<std::set<unsigned int> >&,
const std::vector<bool>&);
++
++ template void make_boundary_list(
++ const DoFHandler<deal_II_dimension>&,
++ const FunctionMap<deal_II_dimension>::type&,
++ std::vector<std::set<unsigned int> >&,
++ const std::vector<bool>&);
#endif
template void make_boundary_list(
extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
std::vector<std::vector<bool> > &interface_dofs,
std::vector<std::vector<bool> > &boundary_interface_dofs);
++ template
++ void
++ extract_inner_interface_dofs (const DoFHandler<deal_II_dimension> &mg_dof_handler,
++ std::vector<std::vector<bool> > &interface_dofs,
++ std::vector<std::vector<bool> > &boundary_interface_dofs);
template
void
extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
std::vector<std::set<unsigned int> > &non_interface_dofs);
#if deal_II_dimension < 3
- template void count_dofs_per_block<deal_II_dimension,deal_II_dimension+1> (
+ template void count_dofs_per_block (
const MGDoFHandler<deal_II_dimension,deal_II_dimension+1>&,
std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
++ template void count_dofs_per_block<DoFHandler<deal_II_dimension,deal_II_dimension+1> > (
++ const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
++ std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
#endif
#if deal_II_dimension == 3
- template void count_dofs_per_block<1,3> (
+ template void count_dofs_per_block (
const MGDoFHandler<1,3>&,
std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
-
+ template void count_dofs_per_block (
+ const DoFHandler<1,3>&,
+ std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
- template void count_dofs_per_block (
- const DoFHandler<2,3>&,
- std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
- template void count_dofs_per_block (
- const DoFHandler<1,2>&,
- std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
#endif
-- \}
++ \}
}