Reference documentation for deal.II version Git 7e76c9f1da 2019-09-19 09:07:25 +0200
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | Public Attributes | List of all members
internal::hp::DoFIndicesOnFacesOrEdges< structdim > Class Template Reference

#include <deal.II/hp/dof_faces.h>

Inheritance diagram for internal::hp::DoFIndicesOnFacesOrEdges< structdim >:
[legend]

Public Member Functions

template<int dim, int spacedim>
void set_dof_index (const ::hp::DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index, const unsigned int obj_level)
 
template<int dim, int spacedim>
types::global_dof_index get_dof_index (const ::hp::DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int obj_level) const
 
template<int dim, int spacedim>
unsigned int n_active_fe_indices (const ::hp::DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_index) const
 
template<int dim, int spacedim>
types::global_dof_index nth_active_fe_index (const ::hp::DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const unsigned int n) const
 
template<int dim, int spacedim>
bool fe_index_is_active (const ::hp::DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int obj_level) const
 
std::size_t memory_consumption () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Public Attributes

std::vector< unsigned int > dof_offsets
 
std::vector< types::global_dof_indexdofs
 

Detailed Description

template<int structdim>
class internal::hp::DoFIndicesOnFacesOrEdges< structdim >

Store the indices of the degrees of freedom which are located on objects of dimension structdim < dim, i.e., for faces or edges of cells. This is opposed to the internal::hp::DoFLevels class that stores the DoF indices on cells.

The things we store here is very similar to what is stored in the internal::DoFHandlerImplementation::DoFObjects classes (see there for more information, in particular on the layout of the class hierarchy, and the use of file names).

Offset computations

For hp methods, not all cells may use the same finite element, and it is consequently more complicated to determine where the DoF indices for a given line, quad, or hex are stored. As described in the documentation of the internal::DoFHandlerImplementation::DoFLevel class, we can compute the location of the first line DoF, for example, by calculating the offset as line_index * dof_handler.get_fe().dofs_per_line. This of course doesn't work any more if different lines may have different numbers of degrees of freedom associated with them. Consequently, rather than using this simple multiplication, the dofs array has an associated array dof_offsets. The data corresponding to a line then starts at index line_dof_offsets[line_index] within the line_dofs array.

Multiple data sets per object

If two adjacent cells use different finite elements, then the face that they share needs to store DoF indices for both involved finite elements. While faces therefore have to have at most two sets of DoF indices, it is easy to see that edges and vertices can have as many sets of DoF indices associated with them as there are adjacent cells.

Consequently, for objects that have a lower dimensionality than cells, we have to store a map from the finite element index to the set of DoF indices associated. Since real sets are typically very inefficient to store, and since most of the time we expect the number of individual keys to be small (frequently, adjacent cells will have the same finite element, and only a single entry will exist in the map), what we do is instead to store a linked list. In this format, the first entry starting at position lines.dofs[lines.dof_offsets[line_index]] will denote the finite element index of the set of DoF indices following; after this set, we will store the finite element index of the second set followed by the corresponding DoF indices; and so on. Finally, when all finite element indices adjacent to this object have been covered, we write a -1 to indicate the end of the list.

Access to this kind of data, as well as the distinction between cells and objects of lower dimensionality are encoded in the accessor functions, DoFObjects::set_dof_index() and DoFLevel::get_dof_index(). They are able to traverse this list and pick out or set a DoF index given the finite element index and its location within the set of DoFs corresponding to this finite element.

Author
Tobias Leicht, 2006

Definition at line 95 of file dof_faces.h.

Member Function Documentation

◆ set_dof_index()

template<int structdim>
template<int dim, int spacedim>
void internal::hp::DoFIndicesOnFacesOrEdges< structdim >::set_dof_index ( const ::hp::DoFHandler< dim, spacedim > &  dof_handler,
const unsigned int  obj_index,
const unsigned int  fe_index,
const unsigned int  local_index,
const types::global_dof_index  global_index,
const unsigned int  obj_level 
)
inline

Set the global index of the local_index-th degree of freedom located on the object with number obj_index to the value given by global_index. The dof_handler argument is used to access the finite element that is to be used to compute the location where this data is stored.

The third argument, fe_index, denotes which of the finite elements associated with this object we shall access. Refer to the general documentation of the internal::hp::DoFLevel class template for more information.

Definition at line 424 of file dof_faces.h.

◆ get_dof_index()

template<int structdim>
template<int dim, int spacedim>
types::global_dof_index internal::hp::DoFIndicesOnFacesOrEdges< structdim >::get_dof_index ( const ::hp::DoFHandler< dim, spacedim > &  dof_handler,
const unsigned int  obj_index,
const unsigned int  fe_index,
const unsigned int  local_index,
const unsigned int  obj_level 
) const
inline

Return the global index of the local_index-th degree of freedom located on the object with number obj_index. The dof_handler argument is used to access the finite element that is to be used to compute the location where this data is stored.

The third argument, fe_index, denotes which of the finite elements associated with this object we shall access. Refer to the general documentation of the internal::hp::DoFLevel class template for more information.

Definition at line 364 of file dof_faces.h.

◆ n_active_fe_indices()

template<int structdim>
template<int dim, int spacedim>
unsigned int internal::hp::DoFIndicesOnFacesOrEdges< structdim >::n_active_fe_indices ( const ::hp::DoFHandler< dim, spacedim > &  dof_handler,
const unsigned int  obj_index 
) const
inline

Return the number of finite elements that are active on a given object. If this is a cell, the answer is of course one. If it is a face, the answer may be one or two, depending on whether the two adjacent cells use the same finite element or not. If it is an edge in 3d, the possible return value may be one or any other value larger than that.

If the object is not part of an active cell, then no degrees of freedom have been distributed and zero is returned.

Definition at line 487 of file dof_faces.h.

◆ nth_active_fe_index()

template<int structdim>
template<int dim, int spacedim>
types::global_dof_index internal::hp::DoFIndicesOnFacesOrEdges< structdim >::nth_active_fe_index ( const ::hp::DoFHandler< dim, spacedim > &  dof_handler,
const unsigned int  obj_level,
const unsigned int  obj_index,
const unsigned int  n 
) const
inline

Return the fe_index of the n-th active finite element on this object.

Definition at line 531 of file dof_faces.h.

◆ fe_index_is_active()

template<int structdim>
template<int dim, int spacedim>
bool internal::hp::DoFIndicesOnFacesOrEdges< structdim >::fe_index_is_active ( const ::hp::DoFHandler< dim, spacedim > &  dof_handler,
const unsigned int  obj_index,
const unsigned int  fe_index,
const unsigned int  obj_level 
) const
inline

Check whether a given finite element index is used on the present object or not.

Definition at line 586 of file dof_faces.h.

◆ memory_consumption()

template<int structdim>
template std::size_t internal::hp::DoFIndicesOnFacesOrEdges< structdim >::memory_consumption ( ) const

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 30 of file dof_faces.cc.

◆ serialize()

template<int structdim>
template<class Archive >
void internal::hp::DoFIndicesOnFacesOrEdges< structdim >::serialize ( Archive &  ar,
const unsigned int  version 
)

Read or write the data of this object to or from a stream for the purpose of serialization

Definition at line 641 of file dof_faces.h.

Member Data Documentation

◆ dof_offsets

template<int structdim>
std::vector<unsigned int> internal::hp::DoFIndicesOnFacesOrEdges< structdim >::dof_offsets

Store the start index for the degrees of freedom of each object in the dofs array.

The type we store is then obviously the type the dofs array uses for indexing.

Definition at line 105 of file dof_faces.h.

◆ dofs

template<int structdim>
std::vector<types::global_dof_index> internal::hp::DoFIndicesOnFacesOrEdges< structdim >::dofs

Store the global indices of the degrees of freedom. See DoFLevel() for detailed information.

Definition at line 111 of file dof_faces.h.


The documentation for this class was generated from the following files: