Public Member Functions | |
template<int dimm, int spacedim> | |
void | set_dof_index (const ::hp::DoFHandler< dimm, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const unsigned int global_index, const unsigned int obj_level) |
template<int dimm, int spacedim> | |
unsigned int | get_dof_index (const ::hp::DoFHandler< dimm, 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 dimm, int spacedim> | |
unsigned int | n_active_fe_indices (const ::hp::DoFHandler< dimm, spacedim > &dof_handler, const unsigned int obj_index) const |
template<int dimm, int spacedim> | |
unsigned int | nth_active_fe_index (const ::hp::DoFHandler< dimm, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const unsigned int n) const |
template<int dimm, int spacedim> | |
bool | fe_index_is_active (const ::hp::DoFHandler< dimm, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int obj_level) const |
unsigned int | memory_consumption () const |
Public Attributes | |
std::vector< unsigned int > | dof_offsets |
std::vector< unsigned int > | dofs |
dim
.The things we store here is very similar to what is stored in the internal::DoFHandler::DoFObjects classes (see there for more information, in particular on the layout of the class hierarchy, and the use of file names).
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::DoFHandler::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.
If an object corresponds to a cell, the global dof indices of this cell are stored at the location indicated above in sequential order.
However, 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 vertices for example can have as many sets of DoF indices associated with them as there are adjacent cells, and the same holds for lines in 3d.
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.
void internal::hp::DoFObjects< dim >::set_dof_index | ( | const ::hp::DoFHandler< dimm, spacedim > & | dof_handler, | |
const unsigned int | obj_index, | |||
const unsigned int | fe_index, | |||
const unsigned int | local_index, | |||
const unsigned int | global_index, | |||
const unsigned int | obj_level | |||
) | [inline] |
Set the global index of the local_index-th
degree of freedom located on the hex with number hex_index
to the value given by the last argument. 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.
References Assert, internal::hp::DoFObjects< dim >::dof_offsets, internal::hp::DoFObjects< dim >::dofs, and numbers::invalid_unsigned_int.
unsigned int internal::hp::DoFObjects< dim >::get_dof_index | ( | const ::hp::DoFHandler< dimm, 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 hex with number hex_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.
References Assert, internal::hp::DoFObjects< dim >::dof_offsets, internal::hp::DoFObjects< dim >::dofs, and numbers::invalid_unsigned_int.
unsigned int internal::hp::DoFObjects< dim >::n_active_fe_indices | ( | const ::hp::DoFHandler< dimm, 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 degrtees of freedom have been distributed and zero is returned.
References Assert, internal::hp::DoFObjects< dim >::dof_offsets, internal::hp::DoFObjects< dim >::dofs, and numbers::invalid_unsigned_int.
Referenced by internal::hp::DoFObjects< dim >::nth_active_fe_index().
unsigned int internal::hp::DoFObjects< dim >::nth_active_fe_index | ( | const ::hp::DoFHandler< dimm, 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.
References Assert, internal::hp::DoFObjects< dim >::dof_offsets, internal::hp::DoFObjects< dim >::dofs, numbers::invalid_unsigned_int, and internal::hp::DoFObjects< dim >::n_active_fe_indices().
bool internal::hp::DoFObjects< dim >::fe_index_is_active | ( | const ::hp::DoFHandler< dimm, 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.
References Assert, internal::hp::DoFObjects< dim >::dof_offsets, internal::hp::DoFObjects< dim >::dofs, and numbers::invalid_unsigned_int.
unsigned int internal::hp::DoFObjects< dim >::memory_consumption | ( | ) | const |
Determine an estimate for the memory consumption (in bytes) of this object.
std::vector<unsigned int> internal::hp::DoFObjects< dim >::dof_offsets |
Store the start index for the degrees of freedom of each hex in the hex_dofs
array.
Referenced by internal::hp::DoFObjects< dim >::fe_index_is_active(), internal::hp::DoFObjects< dim >::get_dof_index(), internal::hp::DoFObjects< dim >::n_active_fe_indices(), internal::hp::DoFObjects< dim >::nth_active_fe_index(), and internal::hp::DoFObjects< dim >::set_dof_index().
std::vector<unsigned int> internal::hp::DoFObjects< dim >::dofs |
Store the global indices of the degrees of freedom. See DoFLevel() for detailed information.
Referenced by internal::hp::DoFObjects< dim >::fe_index_is_active(), internal::hp::DoFObjects< dim >::get_dof_index(), internal::hp::DoFObjects< dim >::n_active_fe_indices(), internal::hp::DoFObjects< dim >::nth_active_fe_index(), and internal::hp::DoFObjects< dim >::set_dof_index().