* in y-direction and finally in z-direction. Discontinuous elements of
* class FE_DGQ() are numbered in this way, for example.
*
- * This function constructs a table which lexicographic index each degree of
- * freedom in the hierarchic numbering would have. It operates on the
- * continuous finite element given as first argument, and outputs the
- * lexicographic indices in the second.
- *
- * Note that since this function uses specifics of the continuous finite
- * elements, it can only operate on FiniteElementData<dim> objects inherent
- * in FE_Q(). However, this function does not take a FE_Q object as it is
- * also invoked by the FE_Q() constructor.
- *
- * It is assumed that the size of the output argument already matches the
- * correct size, which is equal to the number of degrees of freedom in the
- * finite element.
+ * This function returns a vector containing information about the
+ * lexicographic index each degree of freedom in the hierarchic numbering
+ * would have to a given degree of a continuous finite element.
*/
template <int dim>
- void
- hierarchic_to_lexicographic_numbering(unsigned int degree,
- std::vector<unsigned int> &h2l);
+ std::vector<unsigned int>
+ hierarchic_to_lexicographic_numbering(unsigned int degree);
/**
- * Like the previous function but instead of returning its result through
- * the last argument return it as a value.
+ * Like the previous function but instead of returning its result as a value
+ * return it through the last argument.
+ *
+ * @deprecated Use the function that returns the renumbering in a vector
+ * instead.
*/
template <int dim>
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering(unsigned int degree);
+ DEAL_II_DEPRECATED void
+ hierarchic_to_lexicographic_numbering(unsigned int degree,
+ std::vector<unsigned int> &h2l);
/**
* Like the previous functions but using a FiniteElementData instead of the
* polynomial degree.
+ *
+ * @deprecated Use the function that returns the renumbering in a vector and
+ * uses the degree of the basis as an argument instead.
*/
template <int dim>
- void
+ DEAL_II_DEPRECATED void
hierarchic_to_lexicographic_numbering(const FiniteElementData<dim> &fe_data,
std::vector<unsigned int> & h2l);
/**
- * Like the previous function but instead of returning its result through
- * the last argument return it as a value.
+ * @deprecated Use the function that uses the degree of the basis as an
+ * argument instead.
*/
template <int dim>
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering(const FiniteElementData<dim> &fe_data);
+ DEAL_II_DEPRECATED std::vector<unsigned int>
+ hierarchic_to_lexicographic_numbering(const FiniteElementData<dim> &fe_data);
/**
* This is the reverse function to the above one, generating the map from
- * the lexicographic to the hierarchical numbering. All the remarks made
- * about the above function are also valid here.
+ * the lexicographic to the hierarchical numbering for a given polynomial
+ * degree of a continuous finite element. All the remarks made about the
+ * above function are also valid here.
*/
template <int dim>
std::vector<unsigned int>
lexicographic_to_hierarchic_numbering(unsigned int degree);
/**
- * Like the previous functions but using a FiniteElementData instead of the
- * polynomial degree.
+ * @deprecated Use the function that returns the renumbering in a vector and
+ * uses the degree of the basis as an argument instead.
*/
template <int dim>
- void
+ DEAL_II_DEPRECATED void
lexicographic_to_hierarchic_numbering(const FiniteElementData<dim> &fe_data,
std::vector<unsigned int> & l2h);
/**
- * Like the previous function but instead of returning its result through
- * the last argument return it as a value.
+ * @deprecated Use the function that uses the degree of the basis as an
+ * argument instead.
*/
template <int dim>
- std::vector<unsigned int>
- lexicographic_to_hierarchic_numbering(const FiniteElementData<dim> &fe_data);
+ DEAL_II_DEPRECATED std::vector<unsigned int>
+ lexicographic_to_hierarchic_numbering(const FiniteElementData<dim> &fe_data);
/**
template <int dim>
- void
- hierarchic_to_lexicographic_numbering(const unsigned int degree,
- std::vector<unsigned int> &h2l)
+ std::vector<unsigned int>
+ hierarchic_to_lexicographic_numbering(const unsigned int degree)
{
// number of support points in each direction
const unsigned int n = degree + 1;
const unsigned int dofs_per_cell = Utilities::fixed_power<dim>(n);
- // Assert size matches degree
- AssertDimension(h2l.size(), dofs_per_cell);
+ std::vector<unsigned int> h2l(dofs_per_cell);
// polynomial degree
const unsigned int dofs_per_line = degree - 1;
default:
Assert(false, ExcNotImplemented());
}
+
+ return h2l;
}
template <int dim>
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering(const unsigned int degree)
+ void
+ hierarchic_to_lexicographic_numbering(const unsigned int degree,
+ std::vector<unsigned int> &h2l)
{
- std::vector<unsigned int> h2l(Utilities::pow(degree + 1, dim));
- hierarchic_to_lexicographic_numbering<dim>(degree, h2l);
- return h2l;
+ AssertDimension(h2l.size(), Utilities::fixed_power<dim>(degree + 1));
+ h2l = hierarchic_to_lexicographic_numbering<dim>(degree);
}
hierarchic_to_lexicographic_numbering(const FiniteElementData<dim> &fe)
{
Assert(fe.n_components() == 1, ExcInvalidFE());
- std::vector<unsigned int> h2l(fe.dofs_per_cell);
- hierarchic_to_lexicographic_numbering<dim>(fe.dofs_per_line + 1, h2l);
- return h2l;
+ return hierarchic_to_lexicographic_numbering<dim>(fe.dofs_per_line + 1);
}