* object to the finite element.
*/
virtual void distribute_dofs (const FiniteElement<dim,spacedim> &fe,
- const unsigned int offset = 0);
+ const types::global_dof_index offset = 0);
- virtual void distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const unsigned int offset = 0);
+ virtual void distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const types::global_dof_index offset = 0);
/**
* After distribute_dofs() with
* case that only one processor
* participates in the mesh.
*/
- void renumber_dofs (const std::vector<unsigned int> &new_numbers);
+ void renumber_dofs (const std::vector<types::global_dof_index> &new_numbers);
/**
* @deprecated Use
* DoFs which are constrained by
* hanging nodes, see @ref constraints.
*/
- unsigned int n_dofs () const;
+ types::global_dof_index n_dofs () const;
- unsigned int n_dofs (const unsigned int level) const;
+ types::global_dof_index n_dofs (const unsigned int level) const;
/**
* Return the number of degrees of freedom
* located on the boundary.
*/
- unsigned int n_boundary_dofs () const;
+ types::global_dof_index n_boundary_dofs () const;
/**
* Return the number of degrees
* @p make_boundary_sparsity_pattern
* function.
*/
- unsigned int
+ types::global_dof_index
n_boundary_dofs (const FunctionMap &boundary_indicators) const;
/**
* indicators under
* consideration.
*/
- unsigned int
+ types::global_dof_index
n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const;
/**
* degrees of freedom located at
* vertices.
*/
- std::vector<unsigned int> vertex_dofs;
+ std::vector<types::global_dof_index> vertex_dofs;
private:
unsigned int coarsest_level;
unsigned int finest_level;
- unsigned int* indices;
- unsigned int* indices_offset;
+ types::global_dof_index* indices;
+ types::global_dof_index* indices_offset;
public:
DeclException0 (ExcNoMemory);
~MGVertexDoFs ();
unsigned int get_coarsest_level () const;
unsigned int get_finest_level () const;
- unsigned int get_index (const unsigned int level, const unsigned int dof_number) const;
+ types::global_dof_index get_index (const unsigned int level, const unsigned int dof_number) const;
void init (const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex);
- void set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index);
+ void set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index);
};
void clear_mg_space ();
void reserve_space ();
template <int structdim>
- unsigned int get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
+ types::global_dof_index get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const;
template<int structdim>
- void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const;
+ void set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const;
/**
* Space to store the DoF numbers
std::vector<MGVertexDoFs> mg_vertex_dofs;
- std::vector<unsigned int> mg_used_dofs;
+ std::vector<types::global_dof_index> mg_used_dofs;
/**
* Make accessor objects friends.
#ifndef DOXYGEN
-template <> unsigned int DoFHandler<1>::n_boundary_dofs () const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs () const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
+template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const;
/* ----------------------- Inline functions ---------------------------------- */
template<int dim, int spacedim>
inline
-unsigned int DoFHandler<dim, spacedim>::n_dofs (const unsigned int level) const {
+types::global_dof_index DoFHandler<dim, spacedim>::n_dofs (const unsigned int level) const {
Assert (level < mg_used_dofs.size (), ExcInvalidLevel (level));
return mg_used_dofs[level];
}
template<int dim, int spacedim>
inline
-unsigned int DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (const unsigned int level, const unsigned int dof_number) const {
+types::global_dof_index DoFHandler<dim, spacedim>::MGVertexDoFs::get_index (const unsigned int level, const unsigned int dof_number) const {
Assert ((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel (level));
return indices[indices_offset[level - coarsest_level] + dof_number];
}
template<int dim, int spacedim>
inline
-void DoFHandler<dim, spacedim>::MGVertexDoFs::set_index (const unsigned int level, const unsigned int dof_number, const unsigned int index) {
+void DoFHandler<dim, spacedim>::MGVertexDoFs::set_index (const unsigned int level, const unsigned int dof_number, const types::global_dof_index index) {
Assert ((level >= coarsest_level) && (level <= finest_level), ExcInvalidLevel (level));
indices[indices_offset[level - coarsest_level] + dof_number] = index;
}
template<int spacedim>
static
- unsigned int distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ 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)
template<int spacedim>
static
- unsigned int distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ 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)
template<int spacedim>
static
- unsigned int distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator& cell, unsigned int next_free_dof) {
+ 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)
template<int spacedim>
static
- unsigned int 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>) {
+ 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);
}
template<int spacedim>
static
- unsigned int 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>) {
+ 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
- unsigned int 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>) {
+ 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);
}
template<int spacedim>
static
- unsigned int 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>) {
+ 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
- unsigned int 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>) {
+ 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
- unsigned int 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>) {
+ 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);
}
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 unsigned int global_index, const int2type<1>) {
+ 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);
}
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 unsigned int global_index, const int2type<1>) {
+ 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 unsigned int global_index, const int2type<2>) {
+ 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);
}
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 unsigned int global_index, const int2type<1>) {
+ 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 unsigned int global_index, const int2type<2>) {
+ 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 unsigned int global_index, const int2type<3>) {
+ 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);
}
};
template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
+types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
// check that only boundary
// indicators 0 and 1 are allowed
template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
+types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
// check that only boundary
// indicators 0 and 1 are allowed
template<int dim, int spacedim>
-unsigned int
+types::global_dof_index
DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
{
Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
mem += MemoryConsumption::memory_consumption (*mg_faces);
for (unsigned int i = 0; i < mg_vertex_dofs.size (); ++i)
- mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (unsigned int);
+ mem += sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) * sizeof (types::global_dof_index);
mem += MemoryConsumption::memory_consumption (mg_used_dofs);
return mem;
template<int dim, int spacedim>
void DoFHandler<dim,spacedim>::
distribute_dofs (const FiniteElement<dim,spacedim> &ff,
- const unsigned int offset)
+ const types::global_dof_index offset)
{
selected_fe = &ff;
template<int dim, int spacedim>
-void DoFHandler<dim, spacedim>::distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const unsigned int offset) {
+void DoFHandler<dim, spacedim>::distribute_mg_dofs (const FiniteElement<dim, spacedim>& fe, const types::global_dof_index offset) {
Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim>*> (&*tria) == 0), ExcMessage ("Invalid triangulation"));
distribute_dofs (fe);
reserve_space ();
const_cast<Triangulation<dim, spacedim>&>(*tria).clear_user_flags ();
for (unsigned int level = 0; level < n_levels; ++level) {
- unsigned int next_free_dof = offset;
+ types::global_dof_index next_free_dof = offset;
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);
// processor
if (n_locally_owned_dofs() == n_dofs())
{
- std::vector<unsigned int> tmp(new_numbers);
+ std::vector<types::global_dof_index> tmp(new_numbers);
std::sort (tmp.begin(), tmp.end());
- std::vector<unsigned int>::const_iterator p = tmp.begin();
- unsigned int i = 0;
+ std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
+ types::global_dof_index i = 0;
for (; p!=tmp.end(); ++p, ++i)
Assert (*p == i, ExcNewNumbersNotConsecutive(i));
}
else
- for (unsigned int i=0; i<new_numbers.size(); ++i)
+ for (types::global_dof_index i=0; i<new_numbers.size(); ++i)
Assert (new_numbers[i] < n_dofs(),
ExcMessage ("New DoF index is not less than the total number of dofs."));
#endif
template<int dim, int spacedim>
template<int structdim>
-unsigned int DoFHandler<dim, spacedim>::get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const {
+types::global_dof_index DoFHandler<dim, spacedim>::get_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const {
return internal::DoFHandler::Implementation::get_dof_index (*this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, internal::int2type<structdim> ());
}
template<int dim, int spacedim>
template<int structdim>
-void DoFHandler<dim, spacedim>::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index) const {
+void DoFHandler<dim, spacedim>::set_dof_index (const unsigned int obj_level, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index) const {
internal::DoFHandler::Implementation::set_dof_index (*this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, global_index, internal::int2type<structdim> ());
}