/**
* Return true if c1 less c2.
*/
- bool operator () (const std::pair<Point<dim>,unsigned int> &c1,
- const std::pair<Point<dim>,unsigned int> &c2) const
+ bool operator () (const std::pair<Point<dim>,types::global_dof_index> &c1,
+ const std::pair<Point<dim>,types::global_dof_index> &c2) const
{
const Point<dim> diff = c2.first-c1.first;
return (diff*dir > 0 || (diff*dir==0 && c1.second<c2.second));
*/
template <class DH>
void
- compute_Cuthill_McKee (std::vector<unsigned int>& new_dof_indices,
+ compute_Cuthill_McKee (std::vector<types::global_dof_index>& new_dof_indices,
const DH&,
const bool reversed_numbering = false,
const bool use_constraints = false);
*/
template <class DH>
void
- compute_king_ordering (std::vector<unsigned int>& new_dof_indices,
+ compute_king_ordering (std::vector<types::global_dof_index>& new_dof_indices,
const DH&,
const bool reversed_numbering = false,
const bool use_constraints = false);
*/
template <class DH>
void
- compute_minimum_degree (std::vector<unsigned int>& new_dof_indices,
+ compute_minimum_degree (std::vector<types::global_dof_index>& new_dof_indices,
const DH&,
const bool reversed_numbering = false,
const bool use_constraints = false);
Cuthill_McKee (DH& dof_handler,
const bool reversed_numbering = false,
const bool use_constraints = false,
- const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
+ const std::vector<types::global_dof_index> &starting_indices = std::vector<types::global_dof_index>());
/**
* Computes the renumbering
*/
template <class DH>
void
- compute_Cuthill_McKee (std::vector<unsigned int>& new_dof_indices,
+ compute_Cuthill_McKee (std::vector<types::global_dof_index>& new_dof_indices,
const DH&,
const bool reversed_numbering = false,
const bool use_constraints = false,
- const std::vector<unsigned int> &starting_indices = std::vector<unsigned int>());
+ const std::vector<types::global_dof_index> &starting_indices = std::vector<types::global_dof_index>());
/**
* Renumber the degrees of
Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
const unsigned int level,
const bool reversed_numbering = false,
- const std::vector<unsigned int> &starting_indices = std::vector<unsigned int> ());
+ const std::vector<types::global_dof_index> &starting_indices = std::vector<types::global_dof_index> ());
/**
* Sort the degrees of freedom by
* the renumbering vector.
*/
template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
- unsigned int
- compute_component_wise (std::vector<unsigned int>& new_dof_indices,
+ types::global_dof_index
+ compute_component_wise (std::vector<types::global_dof_index>& new_dof_indices,
const ITERATOR& start,
const ENDITERATOR& end,
const std::vector<unsigned int> &target_component);
*/
template <class DH>
void
- compute_cell_wise_dg (std::vector<unsigned int>& renumbering,
- std::vector<unsigned int>& inverse_renumbering,
+ compute_cell_wise_dg (std::vector<types::global_dof_index>& renumbering,
+ std::vector<types::global_dof_index>& inverse_renumbering,
const DH &dof_handler,
const std::vector<typename DH::cell_iterator> &cell_order);
*/
template <class DH>
void
- compute_cell_wise (std::vector<unsigned int>& renumbering,
- std::vector<unsigned int>& inverse_renumbering,
+ compute_cell_wise (std::vector<types::global_dof_index>& renumbering,
+ std::vector<types::global_dof_index>& inverse_renumbering,
const DH &dof_handler,
const std::vector<typename DH::cell_iterator> &cell_order);
*/
template <int dim>
void
- compute_cell_wise_dg (std::vector<unsigned int>& renumbering,
- std::vector<unsigned int>& inverse_renumbering,
+ compute_cell_wise_dg (std::vector<types::global_dof_index>& renumbering,
+ std::vector<types::global_dof_index>& inverse_renumbering,
const MGDoFHandler<dim>& dof_handler,
const unsigned int level,
const std::vector<typename MGDoFHandler<dim>::cell_iterator>& cell_order);
*/
template <int dim>
void
- compute_cell_wise (std::vector<unsigned int>& renumbering,
- std::vector<unsigned int>& inverse_renumbering,
+ compute_cell_wise (std::vector<types::global_dof_index>& renumbering,
+ std::vector<types::global_dof_index>& inverse_renumbering,
const MGDoFHandler<dim>& dof_handler,
const unsigned int level,
const std::vector<typename MGDoFHandler<dim>::cell_iterator>& cell_order);
*/
template <class DH, int dim>
void
- compute_downstream_dg (std::vector<unsigned int>& new_dof_indices,
+ compute_downstream_dg (std::vector<types::global_dof_index>& new_dof_indices,
const DH& dof_handler,
const Point<dim>& direction);
*/
template <class DH, int dim>
void
- compute_downstream (std::vector<unsigned int>& new_dof_indices,
- std::vector<unsigned int>& reverse,
+ compute_downstream (std::vector<types::global_dof_index>& new_dof_indices,
+ std::vector<types::global_dof_index>& reverse,
const DH& dof_handler,
const Point<dim>& direction,
const bool dof_wise_renumbering);
*/
template <class DH, int dim>
void
- compute_downstream_dg (std::vector<unsigned int>& new_dof_indices,
- std::vector<unsigned int>& reverse,
+ compute_downstream_dg (std::vector<types::global_dof_index>& new_dof_indices,
+ std::vector<types::global_dof_index>& reverse,
const DH& dof_handler,
const Point<dim>& direction);
*/
template <int dim>
void
- compute_downstream (std::vector<unsigned int>& new_dof_indices,
- std::vector<unsigned int>& reverse,
+ compute_downstream (std::vector<types::global_dof_index>& new_dof_indices,
+ std::vector<types::global_dof_index>& reverse,
const MGDoFHandler<dim>& dof_handler,
const unsigned int level,
const Point<dim>& direction,
*/
template <int dim>
void
- compute_downstream_dg (std::vector<unsigned int>& new_dof_indices,
- std::vector<unsigned int>& reverse,
+ compute_downstream_dg (std::vector<types::global_dof_index>& new_dof_indices,
+ std::vector<types::global_dof_index>& reverse,
const MGDoFHandler<dim>& dof_handler,
const unsigned int level,
const Point<dim>& direction);
*/
template <class DH, int dim>
void
- compute_clockwise_dg (std::vector<unsigned int>& new_dof_indices,
+ compute_clockwise_dg (std::vector<types::global_dof_index>& new_dof_indices,
const DH& dof_handler,
const Point<dim>& center,
const bool counter);
*/
template <class DH>
void
- compute_sort_selected_dofs_back (std::vector<unsigned int>& new_dof_indices,
+ compute_sort_selected_dofs_back (std::vector<types::global_dof_index>& new_dof_indices,
const DH& dof_handler,
const std::vector<bool>& selected_dofs);
*/
template <class DH>
void
- compute_random (std::vector<unsigned int> &new_dof_indices,
+ compute_random (std::vector<types::global_dof_index> &new_dof_indices,
const DH& dof_handler);
/**
*/
template <class DH>
void
- compute_subdomain_wise (std::vector<unsigned int> &new_dof_indices,
+ compute_subdomain_wise (std::vector<types::global_dof_index> &new_dof_indices,
const DH &dof_handler);
/**
WrapDoFIterator (const T& t) : T(t) {}
- void get_dof_indices (std::vector<unsigned int>& v) const
+ void get_dof_indices (std::vector<types::global_dof_index>& v) const
{
(*this)->get_dof_indices(v);
}
WrapMGDoFIterator (const T& t) : T(t) {}
- void get_dof_indices (std::vector<unsigned int>& v) const
+ void get_dof_indices (std::vector<types::global_dof_index>& v) const
{
(*this)->get_mg_dof_indices(v);
}
const bool reversed_numbering,
const bool use_constraints)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_Cuthill_McKee(renumbering, dof_handler, reversed_numbering,
use_constraints);
template <class DH>
void
- compute_Cuthill_McKee (std::vector<unsigned int>& new_dof_indices,
+ compute_Cuthill_McKee (std::vector<types::global_dof_index>& new_dof_indices,
const DH &dof_handler,
const bool reversed_numbering,
const bool use_constraints)
const bool reversed_numbering,
const bool use_constraints)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_king_ordering(renumbering, dof_handler, reversed_numbering,
use_constraints);
template <class DH>
void
- compute_king_ordering (std::vector<unsigned int>& new_dof_indices,
+ compute_king_ordering (std::vector<types::global_dof_index>& new_dof_indices,
const DH &dof_handler,
const bool reversed_numbering,
const bool use_constraints)
const bool reversed_numbering,
const bool use_constraints)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_minimum_degree(renumbering, dof_handler, reversed_numbering,
use_constraints);
template <class DH>
void
- compute_minimum_degree (std::vector<unsigned int>& new_dof_indices,
+ compute_minimum_degree (std::vector<types::global_dof_index>& new_dof_indices,
const DH &dof_handler,
const bool reversed_numbering,
const bool use_constraints)
Cuthill_McKee (DH& dof_handler,
const bool reversed_numbering,
const bool use_constraints,
- const std::vector<unsigned int> &starting_indices)
+ const std::vector<types::global_dof_index> &starting_indices)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_Cuthill_McKee(renumbering, dof_handler, reversed_numbering,
use_constraints, starting_indices);
template <class DH>
void
- compute_Cuthill_McKee (std::vector<unsigned int>& new_indices,
+ compute_Cuthill_McKee (std::vector<types::global_dof_index>& new_indices,
const DH& dof_handler,
const bool reversed_numbering,
const bool use_constraints,
- const std::vector<unsigned int>& starting_indices)
+ const std::vector<types::global_dof_index>& starting_indices)
{
// make the connection graph. in
// more than 2d use an intermediate
void Cuthill_McKee (MGDoFHandler<dim> &dof_handler,
const unsigned int level,
const bool reversed_numbering,
- const std::vector<unsigned int> &starting_indices)
+ const std::vector<types::global_dof_index> &starting_indices)
{
//TODO: we should be doing the same here as in the other compute_CMK function to preserve some memory
component_wise (DoFHandler<dim,spacedim> &dof_handler,
const std::vector<unsigned int> &component_order_arg)
{
- std::vector<unsigned int> renumbering (dof_handler.n_locally_owned_dofs(),
+ std::vector<types::global_dof_index> renumbering (dof_handler.n_locally_owned_dofs(),
DoFHandler<dim>::invalid_dof_index);
typedef
component_wise (hp::DoFHandler<dim> &dof_handler,
const std::vector<unsigned int> &component_order_arg)
{
- std::vector<unsigned int> renumbering (dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(),
hp::DoFHandler<dim>::invalid_dof_index);
typedef
const unsigned int level,
const std::vector<unsigned int> &component_order_arg)
{
- std::vector<unsigned int> renumbering (dof_handler.n_dofs(level),
+ std::vector<types::global_dof_index> renumbering (dof_handler.n_dofs(level),
DoFHandler<dim>::invalid_dof_index);
typedef
template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
- unsigned int
- compute_component_wise (std::vector<unsigned int>& new_indices,
+ types::global_dof_index
+ compute_component_wise (std::vector<types::global_dof_index>& new_indices,
const ITERATOR & start,
const ENDITERATOR& end,
const std::vector<unsigned int> &component_order_arg)
// now concatenate all the
// components in the order the user
// desired to see
- unsigned int next_free_index = 0;
+ types::global_dof_index next_free_index = 0;
for (unsigned int component=0; component<fe_collection.n_components(); ++component)
{
const typename std::vector<unsigned int>::const_iterator
{
// helper function for hierarchical()
template <int dim, class iterator>
- unsigned int
+ types::global_dof_index
compute_hierarchical_recursive (
- unsigned int next_free,
+ types::global_dof_index next_free,
std::vector<unsigned int>& new_indices,
const iterator & cell,
const IndexSet & locally_owned)
void
hierarchical (DoFHandler<dim> &dof_handler)
{
- std::vector<unsigned int> renumbering (dof_handler.n_locally_owned_dofs(),
+ std::vector<types::global_dof_index> renumbering (dof_handler.n_locally_owned_dofs(),
DoFHandler<dim>::invalid_dof_index);
typename DoFHandler<dim>::cell_iterator cell;
- unsigned int next_free = 0;
+ types::global_dof_index next_free = 0;
const IndexSet locally_owned = dof_handler.locally_owned_dofs();
const parallel::distributed::Triangulation<dim> * tria
sort_selected_dofs_back (DH& dof_handler,
const std::vector<bool>& selected_dofs)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_sort_selected_dofs_back(renumbering, dof_handler, selected_dofs);
template <class DH>
void
- compute_sort_selected_dofs_back (std::vector<unsigned int>& new_indices,
+ compute_sort_selected_dofs_back (std::vector<types::global_dof_index>& new_indices,
const DH& dof_handler,
const std::vector<bool>& selected_dofs)
{
- const unsigned int n_dofs = dof_handler.n_dofs();
+ const types::global_dof_index n_dofs = dof_handler.n_dofs();
Assert (selected_dofs.size() == n_dofs,
ExcDimensionMismatch (selected_dofs.size(), n_dofs));
Assert (new_indices.size() == n_dofs,
ExcDimensionMismatch(new_indices.size(), n_dofs));
- const unsigned int n_selected_dofs = std::count (selected_dofs.begin(),
+ const types::global_dof_index n_selected_dofs = std::count (selected_dofs.begin(),
selected_dofs.end(),
false);
- unsigned int next_unselected = 0;
- unsigned int next_selected = n_selected_dofs;
- for (unsigned int i=0; i<n_dofs; ++i)
+ types::global_dof_index next_unselected = 0;
+ types::global_dof_index next_selected = n_selected_dofs;
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
if (selected_dofs[i] == false)
{
new_indices[i] = next_unselected;
// 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<dim>,unsigned int> > support_point_list
+ const types::global_dof_index n_dofs = dof.n_dofs();
+ std::vector<std::pair<Point<dim>,types::global_dof_index> > support_point_list
(n_dofs);
const hp::FECollection<dim> fe_collection (dof.get_fe ());
ComparePointwiseDownstream<dim> comparator (direction);
std::sort (support_point_list.begin(), support_point_list.end(),
comparator);
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
new_indices[support_point_list[i].second] = i;
}
}
{
Assert (dof.get_fe().has_support_points(),
typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
- const unsigned int n_dofs = dof.n_dofs(level);
- std::vector<std::pair<Point<dim>,unsigned int> > support_point_list
+ const types::global_dof_index n_dofs = dof.n_dofs(level);
+ std::vector<std::pair<Point<dim>,types::global_dof_index> > support_point_list
(n_dofs);
Quadrature<dim> q_dummy(dof.get_fe().get_unit_support_points());
ComparePointwiseDownstream<dim> comparator (direction);
std::sort (support_point_list.begin(), support_point_list.end(),
comparator);
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
new_indices[support_point_list[i].second] = i;
}
}
void
random (DH& dof_handler)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_random(renumbering, dof_handler);
void
subdomain_wise (DH &dof_handler)
{
- std::vector<unsigned int> renumbering(dof_handler.n_dofs(),
+ std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
DH::invalid_dof_index);
compute_subdomain_wise(renumbering, dof_handler);
template <class DH>
void
- compute_subdomain_wise (std::vector<unsigned int> &new_dof_indices,
+ compute_subdomain_wise (std::vector<types::global_dof_index> &new_dof_indices,
const DH &dof_handler)
{
- const unsigned int n_dofs = dof_handler.n_dofs();
+ const types::global_dof_index n_dofs = dof_handler.n_dofs();
Assert (new_dof_indices.size() == n_dofs,
ExcDimensionMismatch (new_dof_indices.size(), n_dofs));
// this order also after reordering
std::fill (new_dof_indices.begin(), new_dof_indices.end(),
numbers::invalid_unsigned_int);
- unsigned int next_free_index = 0;
- for (unsigned int subdomain=0; subdomain<n_subdomains; ++subdomain)
- for (unsigned int i=0; i<n_dofs; ++i)
+ types::global_dof_index next_free_index = 0;
+ for (types::subdomain_id_t subdomain=0; subdomain<n_subdomains; ++subdomain)
+ for (types::global_dof_index i=0; i<n_dofs; ++i)
if (subdomain_association[i] == subdomain)
{
Assert (new_dof_indices[i] == numbers::invalid_unsigned_int,