* comparison of various algorithms in the documentation of the
* DoFRenumbering namespace.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType &dof_handler,
- const bool reversed_numbering = false,
- const bool use_constraints = false);
+ Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering = false,
+ const bool use_constraints = false);
/**
* Compute the renumbering vector needed by the Cuthill_McKee() function.
* Does not perform the renumbering on the DoFHandler dofs but returns the
* renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_Cuthill_McKee(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType &,
+ const DoFHandler<dim, spacedim> &,
const bool reversed_numbering = false,
const bool use_constraints = false);
*
* This algorithm is used in step-22.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- king_ordering(DoFHandlerType &dof_handler,
- const bool reversed_numbering = false,
- const bool use_constraints = false);
+ king_ordering(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering = false,
+ const bool use_constraints = false);
/**
* Compute the renumbering for the King algorithm but do not actually
* renumber the degrees of freedom in the DoF handler argument.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_king_ordering(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType &,
+ const DoFHandler<dim, spacedim> &,
const bool reversed_numbering = false,
const bool use_constraints = false);
* comparison of various algorithms in the documentation of the
* DoFRenumbering namespace.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- minimum_degree(DoFHandlerType &dof_handler,
- const bool reversed_numbering = false,
- const bool use_constraints = false);
+ minimum_degree(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering = false,
+ const bool use_constraints = false);
/**
* Compute the renumbering for the minimum degree algorithm but do not
* actually renumber the degrees of freedom in the DoF handler argument.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_minimum_degree(
std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType &,
+ const DoFHandler<dim, spacedim> &,
const bool reversed_numbering = false,
const bool use_constraints = false);
} // namespace boost
* starting indices even though it can only renumber them on a given
* processor if they are also locally owned.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType &dof_handler,
- const bool reversed_numbering = false,
- const bool use_constraints = false,
+ Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering = false,
+ const bool use_constraints = false,
const std::vector<types::global_dof_index> &starting_indices =
std::vector<types::global_dof_index>());
*
* See the Cuthill_McKee() function for an explanation of the arguments.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_Cuthill_McKee(
std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType &,
+ const DoFHandler<dim, spacedim> &,
const bool reversed_numbering = false,
const bool use_constraints = false,
const std::vector<types::global_dof_index> &starting_indices =
* See the general documentation of this class for details on the different
* methods.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType & dof_handler,
- const unsigned int level,
- const bool reversed_numbering = false,
+ Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const bool reversed_numbering = false,
const std::vector<types::global_dof_index> &starting_indices =
std::vector<types::global_dof_index>());
* For finite elements with only one component, or a single non-primitive
* base element, this function is the identity operation.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- component_wise(DoFHandlerType & dof_handler,
+ component_wise(DoFHandler<dim, spacedim> & dof_handler,
const std::vector<unsigned int> &target_component =
std::vector<unsigned int>());
* multilevel discretization. The non-multigrid part of the DoFHandler
* is not touched.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- component_wise(DoFHandlerType & dof_handler,
+ component_wise(DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level,
const std::vector<unsigned int> &target_component =
std::vector<unsigned int>());
* number of blocks and that subsequent blocks in one element have the same
* meaning as in another element.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- block_wise(DoFHandlerType &dof_handler);
+ block_wise(DoFHandler<dim, spacedim> &dof_handler);
/**
* Sort the degrees of freedom by vector block. It does the same thing as
* multilevel discretization. The non-multigrid part of the DoFHandler
* is not touched.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- block_wise(DoFHandlerType &dof_handler, const unsigned int level);
+ block_wise(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level);
/**
* Compute the renumbering vector needed by the block_wise() functions.
* have been produced by a previous call to a renumbering function is
* ignored.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- hierarchical(DoFHandlerType &dof_handler);
+ hierarchical(DoFHandler<dim, spacedim> &dof_handler);
/**
* Renumber degrees of freedom by cell. The function takes a vector of cell
* iterator of that triangulation needs to be present in @p cell_order exactly
* once.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- cell_wise(DoFHandlerType &dof_handler,
- const std::vector<typename DoFHandlerType::active_cell_iterator>
- &cell_order);
+ cell_wise(
+ DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+ &cell_order);
/**
* Compute a renumbering of degrees of freedom by cell. The function takes a
* <code>renumbering[inverse_renumbering[i]] ==
* dof_handler.locally_owned_dofs().nth_index_in_set(i)</code> will hold.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_cell_wise(
std::vector<types::global_dof_index> &renumbering,
std::vector<types::global_dof_index> &inverse_renumbering,
- const DoFHandlerType & dof_handler,
- const std::vector<typename DoFHandlerType::active_cell_iterator>
+ const DoFHandler<dim, spacedim> & dof_handler,
+ const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
&cell_order);
/**
* Like the other cell_wise() function, but for one level of a multilevel
* enumeration of degrees of freedom.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- cell_wise(DoFHandlerType & dof_handler,
- const unsigned int level,
- const std::vector<typename DoFHandlerType::level_cell_iterator>
- &cell_order);
+ cell_wise(
+ DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+ &cell_order);
/**
* Like the other compute_cell_wise() function, but for one level of a
* multilevel enumeration of degrees of freedom.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_cell_wise(
std::vector<types::global_dof_index> &renumbering,
std::vector<types::global_dof_index> &inverse_renumbering,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level,
- const std::vector<typename DoFHandlerType::level_cell_iterator>
+ const std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
&cell_order);
/**
* downstream location (e.g. those parallel to the flow direction, or
* several dofs within a FESystem) will be unaffected.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- downstream(DoFHandlerType & dof_handler,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering = false);
+ downstream(DoFHandler<dim, spacedim> &dof_handler,
+ const Tensor<1, spacedim> &direction,
+ const bool dof_wise_renumbering = false);
/**
* on one level of a multigrid hierarchy. See the other function with the same
* name.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- downstream(DoFHandlerType & dof_handler,
- const unsigned int level,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering = false);
+ downstream(DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const Tensor<1, spacedim> &direction,
+ const bool dof_wise_renumbering = false);
/**
* Compute the set of renumbering indices needed by the downstream() function.
* Does not perform the renumbering on the DoFHandler dofs but returns the
* renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- compute_downstream(
- std::vector<types::global_dof_index> & new_dof_indices,
- std::vector<types::global_dof_index> & reverse,
- const DoFHandlerType & dof_handler,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering);
+ compute_downstream(std::vector<types::global_dof_index> &new_dof_indices,
+ std::vector<types::global_dof_index> &reverse,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ const Tensor<1, spacedim> & direction,
+ const bool dof_wise_renumbering);
/**
* Compute the set of renumbering indices needed by the downstream() function.
* Does not perform the renumbering on the DoFHandler dofs but returns the
* renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- compute_downstream(
- std::vector<types::global_dof_index> & new_dof_indices,
- std::vector<types::global_dof_index> & reverse,
- const DoFHandlerType & dof_handler,
- const unsigned int level,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering);
+ compute_downstream(std::vector<types::global_dof_index> &new_dof_indices,
+ std::vector<types::global_dof_index> &reverse,
+ const DoFHandler<dim, spacedim> & dof_handler,
+ const unsigned int level,
+ const Tensor<1, spacedim> & direction,
+ const bool dof_wise_renumbering);
/**
* Cell-wise clockwise numbering.
* only works with Discontinuous Galerkin Finite Elements, i.e. all degrees
* of freedom have to be associated with the interior of the cell.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- clockwise_dg(DoFHandlerType & dof_handler,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter = false);
+ clockwise_dg(DoFHandler<dim, spacedim> &dof_handler,
+ const Point<spacedim> & center,
+ const bool counter = false);
/**
* Cell-wise clockwise numbering on one level of a multigrid
* hierarchy. See the other function with the same name.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- clockwise_dg(DoFHandlerType & dof_handler,
- const unsigned int level,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter = false);
+ clockwise_dg(DoFHandler<dim, spacedim> &dof_handler,
+ const unsigned int level,
+ const Point<spacedim> & center,
+ const bool counter = false);
/**
* Compute the renumbering vector needed by the clockwise_dg() functions.
* Does not perform the renumbering on the DoFHandler dofs but returns the
* renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_clockwise_dg(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter);
+ const DoFHandler<dim, spacedim> & dof_handler,
+ const Point<spacedim> & center,
+ const bool counter);
/**
* @}
* @pre The @p selected_dofs array must have as many elements as the @p
* dof_handler has degrees of freedom.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- sort_selected_dofs_back(DoFHandlerType & dof_handler,
- const std::vector<bool> &selected_dofs);
+ sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & selected_dofs);
/**
* Sort those degrees of freedom which are tagged with @p true in the @p
* @pre The @p selected_dofs array must have as many elements as the @p
* dof_handler has degrees of freedom on the given level.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- sort_selected_dofs_back(DoFHandlerType & dof_handler,
- const std::vector<bool> &selected_dofs,
- const unsigned int level);
+ sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & selected_dofs,
+ const unsigned int level);
/**
* Compute the renumbering vector needed by the sort_selected_dofs_back()
* @pre The @p selected_dofs array must have as many elements as the @p
* dof_handler has degrees of freedom.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_sort_selected_dofs_back(
std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const std::vector<bool> & selected_dofs);
/**
* @pre The @p selected_dofs array must have as many elements as the @p
* dof_handler has degrees of freedom on the given level.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_sort_selected_dofs_back(
std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const std::vector<bool> & selected_dofs,
const unsigned int level);
* before this function (or, for that matter, whether other threads running
* concurrently to this function also draw random numbers).
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- random(DoFHandlerType &dof_handler);
+ random(DoFHandler<dim, spacedim> &dof_handler);
/**
* Renumber the degrees of freedom in a random way. It does the same thing as
* multilevel discretization. The non-multigrid part of the DoFHandler
* is not touched.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- random(DoFHandlerType &dof_handler, const unsigned int level);
+ random(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level);
/**
* Compute the renumbering vector needed by the random() function. See
* This function does not perform the renumbering on the DoFHandler dofs but
* returns the renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_random(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler);
+ const DoFHandler<dim, spacedim> & dof_handler);
/**
* Compute the renumbering vector needed by the random() function. Same
* as the above function but for a single level of a multilevel
* discretization.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_random(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level);
/**
* belong to the same subdomain, then they will be in this order also after
* reordering.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- subdomain_wise(DoFHandlerType &dof_handler);
+ subdomain_wise(DoFHandler<dim, spacedim> &dof_handler);
/**
* Compute the renumbering vector needed by the subdomain_wise() function.
* Does not perform the renumbering on the @p DoFHandler dofs but returns
* the renumbering vector.
*/
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_subdomain_wise(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler);
+ const DoFHandler<dim, spacedim> & dof_handler);
/**
* @}
namespace internal
{
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- create_graph(const DoFHandlerType &dof_handler,
- const bool use_constraints,
- boosttypes::Graph & graph,
+ create_graph(const DoFHandler<dim, spacedim> &dof_handler,
+ const bool use_constraints,
+ boosttypes::Graph & graph,
boosttypes::property_map<boosttypes::Graph,
boosttypes::vertex_degree_t>::type
&graph_degree)
} // namespace internal
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType &dof_handler,
- const bool reversed_numbering,
- const bool use_constraints)
+ Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering,
+ const bool use_constraints)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_dofs(), numbers::invalid_dof_index);
}
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_Cuthill_McKee(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const bool reversed_numbering,
const bool use_constraints)
{
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- king_ordering(DoFHandlerType &dof_handler,
- const bool reversed_numbering,
- const bool use_constraints)
+ king_ordering(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering,
+ const bool use_constraints)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_dofs(), numbers::invalid_dof_index);
}
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_king_ordering(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const bool reversed_numbering,
const bool use_constraints)
{
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- minimum_degree(DoFHandlerType &dof_handler,
- const bool reversed_numbering,
- const bool use_constraints)
+ minimum_degree(DoFHandler<dim, spacedim> &dof_handler,
+ const bool reversed_numbering,
+ const bool use_constraints)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_dofs(), numbers::invalid_dof_index);
}
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_minimum_degree(
std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const bool reversed_numbering,
const bool use_constraints)
{
std::vector<dealii::types::global_dof_index> dofs_on_this_cell;
- typename DoFHandlerType::active_cell_iterator cell = dof_handler
- .begin_active(),
- endc = dof_handler.end();
-
- for (; cell != endc; ++cell)
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType & dof_handler,
+ Cuthill_McKee(DoFHandler<dim, spacedim> & dof_handler,
const bool reversed_numbering,
const bool use_constraints,
const std::vector<types::global_dof_index> &starting_indices)
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_Cuthill_McKee(
std::vector<types::global_dof_index> & new_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const bool reversed_numbering,
const bool use_constraints,
const std::vector<types::global_dof_index> &starting_indices)
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- Cuthill_McKee(DoFHandlerType & dof_handler,
+ Cuthill_McKee(DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level,
const bool reversed_numbering,
const std::vector<types::global_dof_index> &starting_indices)
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- component_wise(DoFHandlerType & dof_handler,
+ component_wise(DoFHandler<dim, spacedim> & dof_handler,
const std::vector<unsigned int> &component_order_arg)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
- typename DoFHandlerType::active_cell_iterator start =
- dof_handler.begin_active();
- const typename DoFHandlerType::level_cell_iterator end = dof_handler.end();
-
const types::global_dof_index result =
- compute_component_wise<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>(
- renumbering, start, end, component_order_arg, false);
+ compute_component_wise<dim, spacedim>(renumbering,
+ dof_handler.begin_active(),
+ dof_handler.end(),
+ component_order_arg,
+ false);
if (result == 0)
return;
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- component_wise(DoFHandlerType & dof_handler,
+ component_wise(DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level,
const std::vector<unsigned int> &component_order_arg)
{
dof_handler.locally_owned_mg_dofs(level).n_elements(),
numbers::invalid_dof_index);
- typename DoFHandlerType::level_cell_iterator start =
+ typename DoFHandler<dim, spacedim>::level_cell_iterator start =
dof_handler.begin(level);
- typename DoFHandlerType::level_cell_iterator end = dof_handler.end(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+ dof_handler.end(level);
const types::global_dof_index result =
- compute_component_wise<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>(
+ compute_component_wise<dim, spacedim>(
renumbering, start, end, component_order_arg, true);
if (result == 0)
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- block_wise(DoFHandlerType &dof_handler)
+ block_wise(DoFHandler<dim, spacedim> &dof_handler)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
- typename DoFHandlerType::active_cell_iterator start =
- dof_handler.begin_active();
- const typename DoFHandlerType::level_cell_iterator end = dof_handler.end();
-
- const types::global_dof_index result =
- compute_block_wise<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension,
- typename DoFHandlerType::active_cell_iterator,
- typename DoFHandlerType::level_cell_iterator>(
- renumbering, start, end, false);
+ const types::global_dof_index result = compute_block_wise<
+ dim,
+ spacedim,
+ typename DoFHandler<dim, spacedim>::active_cell_iterator,
+ typename DoFHandler<dim, spacedim>::level_cell_iterator>(
+ renumbering, dof_handler.begin_active(), dof_handler.end(), false);
if (result == 0)
return;
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- block_wise(DoFHandlerType &dof_handler, const unsigned int level)
+ block_wise(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level)
{
Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
ExcDoFHandlerNotInitialized());
dof_handler.locally_owned_mg_dofs(level).n_elements(),
numbers::invalid_dof_index);
- typename DoFHandlerType::level_cell_iterator start =
+ typename DoFHandler<dim, spacedim>::level_cell_iterator start =
dof_handler.begin(level);
- typename DoFHandlerType::level_cell_iterator end = dof_handler.end(level);
-
- const types::global_dof_index result =
- compute_block_wise<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension,
- typename DoFHandlerType::level_cell_iterator,
- typename DoFHandlerType::level_cell_iterator>(
- renumbering, start, end, true);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+ dof_handler.end(level);
+
+ const types::global_dof_index result = compute_block_wise<
+ dim,
+ spacedim,
+ typename DoFHandler<dim, spacedim>::level_cell_iterator,
+ typename DoFHandler<dim, spacedim>::level_cell_iterator>(renumbering,
+ start,
+ end,
+ true);
if (result == 0)
return;
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- hierarchical(DoFHandlerType &dof_handler)
+ hierarchical(DoFHandler<dim, spacedim> &dof_handler)
{
- const int dim = DoFHandlerType::dimension;
- const int spacedim = DoFHandlerType::space_dimension;
-
std::vector<types::global_dof_index> renumbering(
dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
const unsigned int coarse_cell_index =
tria->get_p4est_tree_to_coarse_cell_permutation()[c];
- const typename DoFHandlerType::level_cell_iterator this_cell(
- tria, 0, coarse_cell_index, &dof_handler);
+ const typename DoFHandler<dim, spacedim>::level_cell_iterator
+ this_cell(tria, 0, coarse_cell_index, &dof_handler);
next_free_dof_offset =
compute_hierarchical_recursive<dim>(next_free_dof_offset,
{
// this is not a distributed Triangulation, so we can traverse coarse
// cells in the normal order
- for (typename DoFHandlerType::cell_iterator cell = dof_handler.begin(0);
+ for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
+ dof_handler.begin(0);
cell != dof_handler.end(0);
++cell)
next_free_dof_offset =
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- sort_selected_dofs_back(DoFHandlerType & dof_handler,
- const std::vector<bool> &selected_dofs)
+ sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & selected_dofs)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_dofs(), numbers::invalid_dof_index);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- sort_selected_dofs_back(DoFHandlerType & dof_handler,
- const std::vector<bool> &selected_dofs,
- const unsigned int level)
+ sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+ const std::vector<bool> & selected_dofs,
+ const unsigned int level)
{
Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
ExcDoFHandlerNotInitialized());
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_sort_selected_dofs_back(
std::vector<types::global_dof_index> &new_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const std::vector<bool> & selected_dofs)
{
const types::global_dof_index n_dofs = dof_handler.n_dofs();
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_sort_selected_dofs_back(
std::vector<types::global_dof_index> &new_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const std::vector<bool> & selected_dofs,
const unsigned int level)
{
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
cell_wise(
- DoFHandlerType & dof,
- const std::vector<typename DoFHandlerType::active_cell_iterator> &cells)
+ DoFHandler<dim, spacedim> &dof,
+ const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+ &cells)
{
std::vector<types::global_dof_index> renumbering(
dof.n_locally_owned_dofs());
}
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_cell_wise(
std::vector<types::global_dof_index> &new_indices,
std::vector<types::global_dof_index> &reverse,
- const DoFHandlerType & dof,
- const typename std::vector<typename DoFHandlerType::active_cell_iterator>
- &cells)
+ const DoFHandler<dim, spacedim> & dof,
+ const typename std::vector<
+ typename DoFHandler<dim, spacedim>::active_cell_iterator> &cells)
{
- if (const parallel::TriangulationBase<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> *p =
- dynamic_cast<const parallel::TriangulationBase<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> *>(&dof.get_triangulation()))
+ if (const parallel::TriangulationBase<dim, spacedim> *p =
+ dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
+ &dof.get_triangulation()))
{
AssertDimension(cells.size(), p->n_locally_owned_active_cells());
}
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- cell_wise(
- DoFHandlerType & dof,
- const unsigned int level,
- const typename std::vector<typename DoFHandlerType::level_cell_iterator>
- &cells)
+ cell_wise(DoFHandler<dim, spacedim> &dof,
+ const unsigned int level,
+ const typename std::vector<
+ typename DoFHandler<dim, spacedim>::level_cell_iterator> &cells)
{
Assert(dof.n_dofs(level) != numbers::invalid_dof_index,
ExcDoFHandlerNotInitialized());
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_cell_wise(
std::vector<types::global_dof_index> &new_order,
std::vector<types::global_dof_index> &reverse,
- const DoFHandlerType & dof,
+ const DoFHandler<dim, spacedim> & dof,
const unsigned int level,
- const typename std::vector<typename DoFHandlerType::level_cell_iterator>
- &cells)
+ const typename std::vector<
+ typename DoFHandler<dim, spacedim>::level_cell_iterator> &cells)
{
Assert(cells.size() == dof.get_triangulation().n_cells(level),
ExcDimensionMismatch(cells.size(),
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- downstream(DoFHandlerType & dof,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering)
+ downstream(DoFHandler<dim, spacedim> &dof,
+ const Tensor<1, spacedim> &direction,
+ const bool dof_wise_renumbering)
{
std::vector<types::global_dof_index> renumbering(dof.n_dofs());
std::vector<types::global_dof_index> reverse(dof.n_dofs());
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- compute_downstream(
- std::vector<types::global_dof_index> & new_indices,
- std::vector<types::global_dof_index> & reverse,
- const DoFHandlerType & dof,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering)
+ compute_downstream(std::vector<types::global_dof_index> &new_indices,
+ std::vector<types::global_dof_index> &reverse,
+ const DoFHandler<dim, spacedim> & dof,
+ const Tensor<1, spacedim> & direction,
+ const bool dof_wise_renumbering)
{
- Assert(
- (dynamic_cast<
- const parallel::TriangulationBase<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> *>(
- &dof.get_triangulation()) == nullptr),
- ExcNotImplemented());
+ Assert((dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
+ &dof.get_triangulation()) == nullptr),
+ ExcNotImplemented());
if (dof_wise_renumbering == false)
{
- std::vector<typename DoFHandlerType::active_cell_iterator>
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
ordered_cells;
ordered_cells.reserve(dof.get_triangulation().n_active_cells());
- const CompareDownstream<typename DoFHandlerType::active_cell_iterator,
- DoFHandlerType::space_dimension>
+ const CompareDownstream<
+ typename DoFHandler<dim, spacedim>::active_cell_iterator,
+ spacedim>
comparator(direction);
- typename DoFHandlerType::active_cell_iterator p = dof.begin_active();
- typename DoFHandlerType::active_cell_iterator end = dof.end();
+ for (const auto &cell : dof.active_cell_iterators())
+ ordered_cells.push_back(cell);
- while (p != end)
- {
- ordered_cells.push_back(p);
- ++p;
- }
std::sort(ordered_cells.begin(), ordered_cells.end(), comparator);
compute_cell_wise(new_indices, reverse, dof, ordered_cells);
{
// similar code as for
// DoFTools::map_dofs_to_support_points, but
- // need to do this for general DoFHandlerType classes and
+ // need to do this for general DoFHandler<dim, spacedim> classes and
// want to be able to sort the result
// (otherwise, could use something like
// DoFTools::map_support_points_to_dofs)
const unsigned int n_dofs = dof.n_dofs();
- std::vector<
- std::pair<Point<DoFHandlerType::space_dimension>, unsigned int>>
+ std::vector<std::pair<Point<spacedim>, unsigned int>>
support_point_list(n_dofs);
- const hp::FECollection<DoFHandlerType::dimension> &fe_collection =
- dof.get_fe_collection();
+ const hp::FECollection<dim> &fe_collection = dof.get_fe_collection();
Assert(fe_collection[0].has_support_points(),
- typename FiniteElement<
- DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
- hp::QCollection<DoFHandlerType::dimension> quadrature_collection;
+ typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
+ hp::QCollection<dim> quadrature_collection;
for (unsigned int comp = 0; comp < fe_collection.size(); ++comp)
{
Assert(fe_collection[comp].has_support_points(),
- typename FiniteElement<
- DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
+ typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
quadrature_collection.push_back(
- Quadrature<DoFHandlerType::dimension>(
- fe_collection[comp].get_unit_support_points()));
+ Quadrature<dim>(fe_collection[comp].get_unit_support_points()));
}
- hp::FEValues<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
- hp_fe_values(fe_collection,
- quadrature_collection,
- update_quadrature_points);
+ hp::FEValues<dim, spacedim> hp_fe_values(fe_collection,
+ quadrature_collection,
+ update_quadrature_points);
std::vector<bool> already_touched(n_dofs, false);
- std::vector<types::global_dof_index> local_dof_indices;
- typename DoFHandlerType::active_cell_iterator begin =
- dof.begin_active();
- typename DoFHandlerType::active_cell_iterator end = dof.end();
- for (; begin != end; ++begin)
+ std::vector<types::global_dof_index> local_dof_indices;
+
+ for (const auto &cell : dof.active_cell_iterators())
{
- const unsigned int dofs_per_cell = begin->get_fe().dofs_per_cell;
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
local_dof_indices.resize(dofs_per_cell);
- hp_fe_values.reinit(begin);
- const FEValues<DoFHandlerType::dimension> &fe_values =
+ hp_fe_values.reinit(cell);
+ const FEValues<dim> &fe_values =
hp_fe_values.get_present_fe_values();
- begin->get_active_or_mg_dof_indices(local_dof_indices);
- const std::vector<Point<DoFHandlerType::space_dimension>> &points =
+ cell->get_active_or_mg_dof_indices(local_dof_indices);
+ const std::vector<Point<spacedim>> &points =
fe_values.get_quadrature_points();
for (unsigned int i = 0; i < dofs_per_cell; ++i)
if (!already_touched[local_dof_indices[i]])
}
}
- ComparePointwiseDownstream<DoFHandlerType::space_dimension> comparator(
- direction);
+ ComparePointwiseDownstream<spacedim> comparator(direction);
std::sort(support_point_list.begin(),
support_point_list.end(),
comparator);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- downstream(DoFHandlerType & dof,
- const unsigned int level,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering)
+ downstream(DoFHandler<dim, spacedim> &dof,
+ const unsigned int level,
+ const Tensor<1, spacedim> &direction,
+ const bool dof_wise_renumbering)
{
std::vector<types::global_dof_index> renumbering(dof.n_dofs(level));
std::vector<types::global_dof_index> reverse(dof.n_dofs(level));
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- compute_downstream(
- std::vector<types::global_dof_index> & new_indices,
- std::vector<types::global_dof_index> & reverse,
- const DoFHandlerType & dof,
- const unsigned int level,
- const Tensor<1, DoFHandlerType::space_dimension> &direction,
- const bool dof_wise_renumbering)
+ compute_downstream(std::vector<types::global_dof_index> &new_indices,
+ std::vector<types::global_dof_index> &reverse,
+ const DoFHandler<dim, spacedim> & dof,
+ const unsigned int level,
+ const Tensor<1, spacedim> & direction,
+ const bool dof_wise_renumbering)
{
if (dof_wise_renumbering == false)
{
- std::vector<typename DoFHandlerType::level_cell_iterator> ordered_cells;
+ std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+ ordered_cells;
ordered_cells.reserve(dof.get_triangulation().n_cells(level));
- const CompareDownstream<typename DoFHandlerType::level_cell_iterator,
- DoFHandlerType::space_dimension>
+ const CompareDownstream<
+ typename DoFHandler<dim, spacedim>::level_cell_iterator,
+ spacedim>
comparator(direction);
- typename DoFHandlerType::level_cell_iterator p = dof.begin(level);
- typename DoFHandlerType::level_cell_iterator end = dof.end(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator p =
+ dof.begin(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+ dof.end(level);
while (p != end)
{
else
{
Assert(dof.get_fe().has_support_points(),
- typename FiniteElement<
- DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
+ typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
const unsigned int n_dofs = dof.n_dofs(level);
- std::vector<
- std::pair<Point<DoFHandlerType::space_dimension>, unsigned int>>
+ std::vector<std::pair<Point<spacedim>, unsigned int>>
support_point_list(n_dofs);
- Quadrature<DoFHandlerType::dimension> q_dummy(
- dof.get_fe().get_unit_support_points());
- FEValues<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
- fe_values(dof.get_fe(), q_dummy, update_quadrature_points);
+ Quadrature<dim> q_dummy(dof.get_fe().get_unit_support_points());
+ FEValues<dim, spacedim> fe_values(dof.get_fe(),
+ q_dummy,
+ update_quadrature_points);
std::vector<bool> already_touched(dof.n_dofs(), false);
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
- typename DoFHandlerType::level_cell_iterator begin = dof.begin(level);
- typename DoFHandlerType::level_cell_iterator end = dof.end(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator begin =
+ dof.begin(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+ dof.end(level);
for (; begin != end; ++begin)
{
- const typename Triangulation<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>::cell_iterator &begin_tria =
- begin;
+ const typename Triangulation<dim, spacedim>::cell_iterator
+ &begin_tria = begin;
begin->get_active_or_mg_dof_indices(local_dof_indices);
fe_values.reinit(begin_tria);
- const std::vector<Point<DoFHandlerType::space_dimension>> &points =
+ const std::vector<Point<spacedim>> &points =
fe_values.get_quadrature_points();
for (unsigned int i = 0; i < dofs_per_cell; ++i)
if (!already_touched[local_dof_indices[i]])
}
}
- ComparePointwiseDownstream<DoFHandlerType::space_dimension> comparator(
- direction);
+ ComparePointwiseDownstream<spacedim> comparator(direction);
std::sort(support_point_list.begin(),
support_point_list.end(),
comparator);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- clockwise_dg(DoFHandlerType & dof,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter)
+ clockwise_dg(DoFHandler<dim, spacedim> &dof,
+ const Point<spacedim> & center,
+ const bool counter)
{
std::vector<types::global_dof_index> renumbering(dof.n_dofs());
compute_clockwise_dg(renumbering, dof, center, counter);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_clockwise_dg(std::vector<types::global_dof_index> &new_indices,
- const DoFHandlerType & dof,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter)
+ const DoFHandler<dim, spacedim> & dof,
+ const Point<spacedim> & center,
+ const bool counter)
{
- std::vector<typename DoFHandlerType::active_cell_iterator> ordered_cells;
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+ ordered_cells;
ordered_cells.reserve(dof.get_triangulation().n_active_cells());
- internal::ClockCells<DoFHandlerType::space_dimension> comparator(center,
- counter);
+ internal::ClockCells<spacedim> comparator(center, counter);
- typename DoFHandlerType::active_cell_iterator p = dof.begin_active();
- typename DoFHandlerType::active_cell_iterator end = dof.end();
+ for (const auto &cell : dof.active_cell_iterators())
+ ordered_cells.push_back(cell);
- while (p != end)
- {
- ordered_cells.push_back(p);
- ++p;
- }
std::sort(ordered_cells.begin(), ordered_cells.end(), comparator);
std::vector<types::global_dof_index> reverse(new_indices.size());
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- clockwise_dg(DoFHandlerType & dof,
- const unsigned int level,
- const Point<DoFHandlerType::space_dimension> ¢er,
- const bool counter)
+ clockwise_dg(DoFHandler<dim, spacedim> &dof,
+ const unsigned int level,
+ const Point<spacedim> & center,
+ const bool counter)
{
- std::vector<typename DoFHandlerType::level_cell_iterator> ordered_cells;
+ std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+ ordered_cells;
ordered_cells.reserve(dof.get_triangulation().n_active_cells());
- internal::ClockCells<DoFHandlerType::space_dimension> comparator(center,
- counter);
+ internal::ClockCells<spacedim> comparator(center, counter);
- typename DoFHandlerType::level_cell_iterator p = dof.begin(level);
- typename DoFHandlerType::level_cell_iterator end = dof.end(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator p =
+ dof.begin(level);
+ typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+ dof.end(level);
while (p != end)
{
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- random(DoFHandlerType &dof_handler)
+ random(DoFHandler<dim, spacedim> &dof_handler)
{
std::vector<types::global_dof_index> renumbering(
dof_handler.n_dofs(), numbers::invalid_dof_index);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- random(DoFHandlerType &dof_handler, const unsigned int level)
+ random(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level)
{
Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
ExcDoFHandlerNotInitialized());
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_random(std::vector<types::global_dof_index> &new_indices,
- const DoFHandlerType & dof_handler)
+ const DoFHandler<dim, spacedim> & dof_handler)
{
const types::global_dof_index n_dofs = dof_handler.n_dofs();
Assert(new_indices.size() == n_dofs,
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_random(std::vector<types::global_dof_index> &new_indices,
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> & dof_handler,
const unsigned int level)
{
const types::global_dof_index n_dofs = dof_handler.n_dofs(level);
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
- subdomain_wise(DoFHandlerType &dof_handler)
+ subdomain_wise(DoFHandler<dim, spacedim> &dof_handler)
{
Assert(
- (!dynamic_cast<
- const parallel::TriangulationBase<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> *>(
+ (!dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
&dof_handler.get_triangulation())),
ExcMessage(
"Parallel triangulations are already enumerated according to their MPI process id."));
- template <typename DoFHandlerType>
+ template <int dim, int spacedim>
void
compute_subdomain_wise(std::vector<types::global_dof_index> &new_dof_indices,
- const DoFHandlerType & dof_handler)
+ const DoFHandler<dim, spacedim> & dof_handler)
{
const types::global_dof_index n_dofs = dof_handler.n_dofs();
Assert(new_dof_indices.size() == n_dofs,