* according to the given distribution
* method.
*
+ * The additional optional parameter #offset#
+ * allows you to reserve space for a finite number
+ * of additional vector entries in the beginning
+ * of all discretization vectors.
+ *
* A pointer of the transferred finite
* element is stored. Therefore, the
* lifetime of the finite element object
* don't need them after calling this
* function, or if so store them.
*/
- virtual void distribute_dofs (const FiniteElement<dim> &);
+ virtual void distribute_dofs (const FiniteElement<dim> &,
+ unsigned int offset = 0);
/**
* Clear all data of this object and
* don't need them after calling this
* function, or if so store them.
*/
- virtual void distribute_dofs (const FiniteElement<dim> &);
+ virtual void distribute_dofs (const FiniteElement<dim> &, unsigned int offset=0);
/**
* Actually do the renumbering based on
//#include <grid/tria_boundary.h>
#include <base/subscriptor.h>
-
/**
* Declare some symbolic names for mesh smoothing algorithms. The meaning of
* these flags is documented in the #Triangulation# class.
* don't need them after calling this
* function, or if so store them.
*/
- virtual void distribute_dofs (const FiniteElement<dim> &);
+ virtual void distribute_dofs (const FiniteElement<dim> &, unsigned int offset=0);
/**
* Actually do the renumbering based on
template <int dim>
-void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff) {
+void DoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &ff,
+ unsigned int offset)
+{
Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
selected_fe = &ff;
// need them
tria->clear_user_flags ();
- unsigned int next_free_dof = 0;
+ unsigned int next_free_dof = offset;
active_cell_iterator cell = begin_active(),
endc = end();
last_round_dofs = next_round_dofs;
};
+//TODO: Allow incomplete renumbering for non-discretization values
+
#ifdef DEBUG
// test for all indices numbered
if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
template <int dim>
-void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
+void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe,
+ unsigned int offset)
+{
// first distribute global dofs
- DoFHandler<dim>::distribute_dofs (fe);
+ DoFHandler<dim>::distribute_dofs (fe, offset);
// reserve space for the MG dof numbers
// separately
for (unsigned int level=0; level<tria->n_levels(); ++level)
{
- unsigned int next_free_dof = 0;
+ unsigned int next_free_dof = offset;
cell_iterator cell = begin(level),
endc = end(level);
template <int dim>
-void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe) {
+void MGDoFHandler<dim>::distribute_dofs (const FiniteElement<dim> &fe,
+ unsigned int offset)
+{
// first distribute global dofs
- DoFHandler<dim>::distribute_dofs (fe);
+ DoFHandler<dim>::distribute_dofs (fe, offset);
// reserve space for the MG dof numbers
// separately
for (unsigned int level=0; level<tria->n_levels(); ++level)
{
- unsigned int next_free_dof = 0;
+ unsigned int next_free_dof = offset;
cell_iterator cell = begin(level),
endc = end(level);