19 #ifndef DISCRETE_SPACE_HH_ 20 #define DISCRETE_SPACE_HH_ 28 using FEPtr = std::shared_ptr<FiniteElement<dim>>;
45 virtual unsigned int n_node_dofs(
unsigned int nid)
const = 0;
54 template<
unsigned int dim>
57 ASSERT(
false).error(
"Not implemented.");
98 {
return _n_elem_dofs[cell.
dim()];}
101 {
return _n_edge_dofs[edge.
side(0)->
dim() + 1];}
112 auto fe_ptr = fe_.get<dim>();
113 for (
unsigned int d=0; d < fe_ptr->n_dofs(); d++) {
114 if (fe_ptr->dof(d).dim == 0)
116 if (fe_ptr->dof(d).dim == dim-1 && fe_ptr->dof(d).n_face_idx == 0)
118 if (fe_ptr->dof(d).dim == 0 && fe_ptr->dof(d).n_face_idx == 0)
unsigned int n_face_dofs(unsigned int face_id)
Number of dofs associated to generalized n-face (node, line, triangle or tetrahedron).
const std::vector< unsigned int > & node_dim() const
virtual unsigned int n_node_dofs(unsigned int nid) const =0
Number of dofs associated to node. nid is the node index in the mesh tree.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
EqualOrderDiscreteSpace(Mesh *mesh, MixedPtr< FiniteElement > fe)
unsigned int n_elem_dofs(const ElementAccessor< 3 > &cell) const override
Number of dofs associated to element (not shared by adjacent elements).
std::vector< unsigned int > _n_edge_dofs
unsigned int dim() const
Returns dimension of the side, that is dimension of the element minus one.
virtual ~DiscreteSpace()
Destructor.
DiscreteSpace(Mesh *mesh)
Constructor.
unsigned int n_node_dofs(unsigned int nid) const override
Number of dofs associated to node. nid is the node index in the mesh tree.
std::shared_ptr< FiniteElement< dim >> FEPtr
unsigned int n_edge_dofs(const Edge &edge) const override
Number of dofs associated to edge.
std::vector< unsigned int > _n_elem_dofs
MixedPtr< FiniteElement > fe_
virtual MixedPtr< FiniteElement > fe(const ElementAccessor< 3 > &) const =0
Return Mixed of finite element objects.
Abstract class for description of finite elements.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
virtual unsigned int n_elem_dofs(const ElementAccessor< 3 > &cell) const =0
Number of dofs associated to element (not shared by adjacent elements).
virtual unsigned int n_edge_dofs(const Edge &edge) const =0
Number of dofs associated to edge.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
std::vector< unsigned int > _n_node_dofs