DOLFIN-X
DOLFIN-X C++ interface
Public Member Functions | List of all members
dolfinx::fem::ElementDofLayout Class Reference

The class represents the degree-of-freedom (dofs) for an element. Dofs are associated with a mesh entity. This class also handles sub-space dofs, which are views into the parent dofs. More...

#include <ElementDofLayout.h>

Public Member Functions

 ElementDofLayout (int block_size, const std::vector< std::vector< std::set< int >>> &entity_dofs, const std::vector< int > &parent_map, const std::vector< std::shared_ptr< const ElementDofLayout >> &sub_dofmaps, const mesh::CellType cell_type, const Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > &base_permutations)
 Constructor. More...
 
ElementDofLayout copy () const
 Copy the DOF layout, discarding any parent information.
 
 ElementDofLayout (const ElementDofLayout &dofmap)=default
 Copy constructor.
 
 ElementDofLayout (ElementDofLayout &&dofmap)=default
 Move constructor.
 
 ~ElementDofLayout ()=default
 Destructor.
 
ElementDofLayoutoperator= (const ElementDofLayout &dofmap)=default
 Copy assignment.
 
ElementDofLayoutoperator= (ElementDofLayout &&dofmap)=default
 Move assignment.
 
int num_dofs () const
 Return the dimension of the local finite element function space on a cell (number of dofs on element) More...
 
int num_entity_dofs (int dim) const
 Return the number of dofs for a given entity dimension. More...
 
int num_entity_closure_dofs (int dim) const
 Return the number of closure dofs for a given entity dimension. More...
 
Eigen::Array< int, Eigen::Dynamic, 1 > entity_dofs (int entity_dim, int cell_entity_index) const
 Local-local mapping of dofs on entity of cell. More...
 
Eigen::Array< int, Eigen::Dynamic, 1 > entity_closure_dofs (int entity_dim, int cell_entity_index) const
 Local-local closure dofs on entity of cell. More...
 
const std::vector< std::vector< std::set< int > > > & entity_dofs_all () const
 Direct access to all entity dofs (dof = _entity_dofs[dim][entity][i])
 
const std::vector< std::vector< std::set< int > > > & entity_closure_dofs_all () const
 Direct access to all entity closure dofs (dof = _entity_dofs[dim][entity][i])
 
int num_sub_dofmaps () const
 Get number of sub-dofmaps.
 
std::shared_ptr< const ElementDofLayoutsub_dofmap (const std::vector< int > &component) const
 Get sub-dofmap given by list of components, one for each level.
 
std::vector< int > sub_view (const std::vector< int > &component) const
 Get view for a sub dofmap, defined by the component list (as for sub_dofmap()), into this dofmap. I.e., the dofs in this dofmap that are the sub-dofs.
 
int block_size () const
 Block size.
 
bool is_view () const
 True iff dof map is a view into another map. More...
 
Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > base_permutations () const
 Returns the base permutations of the DoFs, as computed by FFCx.
 

Detailed Description

The class represents the degree-of-freedom (dofs) for an element. Dofs are associated with a mesh entity. This class also handles sub-space dofs, which are views into the parent dofs.

Constructor & Destructor Documentation

◆ ElementDofLayout()

ElementDofLayout::ElementDofLayout ( int  block_size,
const std::vector< std::vector< std::set< int >>> &  entity_dofs,
const std::vector< int > &  parent_map,
const std::vector< std::shared_ptr< const ElementDofLayout >> &  sub_dofmaps,
const mesh::CellType  cell_type,
const Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > &  base_permutations 
)

Constructor.

Parameters
[in]block_sizeThe number of dofs co-located at each point.
[in]entity_dofsThe dofs on each entity, in the format: entity_dofs[entity_dim][entity_number] = [dof0, dof1, ...]
[in]parent_mapTODO
[in]sub_dofmapsTODO
[in]cell_typeThe cell type of the mesh.
[in]base_permutationsThe base permutations for the dofs on the cell. These will be used to permute the dofs on the cell. Each row of this array is one base permutation, and the number of columns should be the number of (local) dofs on each cell. Points (dim 0 entities) have no permutations. Lines (dim 1 entities) have one permutation each to represent the line being reversed. Faces (dim 2 entities) have two permutations each to represent the face being rotated (one vertex anticlockwise) and reflected. Volumes (dim 3 entities) have four permutations each to represent the volume being rotated (by one vertex) in three directions and reflected. It would be possible to represent a volume with 3 base permutations (2 rotations and 1 reflection), but the implementation with 3 is simpler.

Member Function Documentation

◆ entity_closure_dofs()

Eigen::Array< int, Eigen::Dynamic, 1 > ElementDofLayout::entity_closure_dofs ( int  entity_dim,
int  cell_entity_index 
) const

Local-local closure dofs on entity of cell.

Parameters
[in]entity_dimThe entity dimension
[in]cell_entity_indexThe local entity index on the cell
Returns
Degrees of freedom on a single element

◆ entity_dofs()

Eigen::Array< int, Eigen::Dynamic, 1 > ElementDofLayout::entity_dofs ( int  entity_dim,
int  cell_entity_index 
) const

Local-local mapping of dofs on entity of cell.

Parameters
[in]entity_dimThe entity dimension
[in]cell_entity_indexThe local entity index on the cell
Returns
Degrees of freedom on a single element.

◆ is_view()

bool ElementDofLayout::is_view ( ) const

True iff dof map is a view into another map.

Returns
bool True if the dof map is a sub-dof map (a view into another map).

◆ num_dofs()

int ElementDofLayout::num_dofs ( ) const

Return the dimension of the local finite element function space on a cell (number of dofs on element)

Returns
Dimension of the local finite element function space.

◆ num_entity_closure_dofs()

int ElementDofLayout::num_entity_closure_dofs ( int  dim) const

Return the number of closure dofs for a given entity dimension.

Parameters
[in]dimEntity dimension
Returns
Number of dofs associated with closure of given entity dimension

◆ num_entity_dofs()

int ElementDofLayout::num_entity_dofs ( int  dim) const

Return the number of dofs for a given entity dimension.

Parameters
[in]dimEntity dimension
Returns
Number of dofs associated with given entity dimension

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