21 #include "libmesh/elem.h" 22 #include "libmesh/enum_to_string.h" 23 #include "libmesh/fe.h" 24 #include "libmesh/fe_interface.h" 25 #include "libmesh/fe_macro.h" 36 void hierarchic_nodal_soln(
const Elem * elem,
38 const std::vector<Number> & elem_soln,
39 std::vector<Number> & nodal_soln,
40 const bool add_p_level)
42 const unsigned int n_nodes = elem->n_nodes();
44 const ElemType elem_type = elem->type();
48 const Order totalorder =
static_cast<Order>(order + add_p_level*elem->p_level());
58 libmesh_assert_equal_to (elem_soln.size(), 1);
60 const Number val = elem_soln[0];
62 for (
unsigned int n=0; n<
n_nodes; n++)
73 const unsigned int n_sf =
76 std::vector<Point> refspace_nodes;
78 libmesh_assert_equal_to (refspace_nodes.size(),
n_nodes);
80 for (
unsigned int n=0; n<
n_nodes; n++)
82 libmesh_assert_equal_to (elem_soln.size(), n_sf);
88 for (
unsigned int i=0; i<n_sf; i++)
89 nodal_soln[n] += elem_soln[i] *
101 unsigned int hierarchic_n_dofs(
const ElemType t,
const Order o)
103 libmesh_assert_greater (o, 0);
113 libmesh_assert_less (o, 2);
114 libmesh_fallthrough();
118 return ((o+1)*(o+1));
120 libmesh_assert_less (o, 2);
121 libmesh_fallthrough();
123 libmesh_assert_less (o, 2);
124 libmesh_fallthrough();
126 return ((o+1)*(o+1)*(o+1));
129 libmesh_assert_less (o, 2);
130 libmesh_fallthrough();
132 libmesh_assert_less (o, 3);
133 libmesh_fallthrough();
136 return ((o+1)*(o+1)*(o+2)/2);
138 libmesh_assert_less (o, 2);
139 libmesh_fallthrough();
142 return ((o+1)*(o+2)/2);
144 libmesh_assert_less (o, 2);
145 libmesh_fallthrough();
147 libmesh_assert_less (o, 3);
148 libmesh_fallthrough();
150 return ((o+1)*(o+2)*(o+3)/6);
154 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for HIERARCHIC FE family!");
161 unsigned int hierarchic_n_dofs_at_node(
const ElemType t,
163 const unsigned int n)
165 libmesh_assert_greater (o, 0);
179 libmesh_assert_equal_to(t,
EDGE3);
182 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for EDGE2/3!");
185 libmesh_assert_less (n, 3);
186 libmesh_assert_less (o, 2);
187 libmesh_fallthrough();
190 libmesh_assert_less (n, 6);
191 libmesh_fallthrough();
206 return ((o-1)*(o-2)/2);
208 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TRI!");
212 libmesh_assert_less (n, 4);
213 libmesh_assert_less (o, 2);
214 libmesh_fallthrough();
237 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for QUAD4/8/9!");
240 libmesh_assert_less (n, 8);
241 libmesh_assert_less (o, 2);
242 libmesh_fallthrough();
244 libmesh_assert_less (n, 20);
245 libmesh_assert_less (o, 2);
246 libmesh_fallthrough();
280 return ((o-1)*(o-1));
286 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for HEX8/20/27!");
290 libmesh_assert_less (n, 6);
291 libmesh_fallthrough();
293 libmesh_assert_less (n, 15);
294 libmesh_assert_less (o, 2);
295 libmesh_fallthrough();
297 libmesh_assert_less (n, 18);
298 libmesh_assert_less (o, 3);
299 libmesh_fallthrough();
303 libmesh_assert_less (n, 20);
304 libmesh_fallthrough();
306 libmesh_assert_less (n, 21);
331 return ((o-1)*(o-1));
335 return ((o-1)*(o-2)/2);
337 return ((o-1)*(o-1)*(o-2)/2);
339 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TRI!");
343 libmesh_assert_less (o, 2);
344 libmesh_assert_less (n, 4);
345 libmesh_fallthrough();
347 libmesh_assert_less (o, 3);
348 libmesh_assert_less (n, 10);
349 libmesh_fallthrough();
351 libmesh_assert_less (n, 14);
372 return ((o-1)*(o-2)/2);
375 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TET!");
390 unsigned int hierarchic_n_dofs_per_elem(
const ElemType t,
393 libmesh_assert_greater (o, 0);
407 return ((o-1)*(o-2)/2);
413 return ((o-1)*(o-1));
416 libmesh_assert_less (o, 2);
419 return ((o-1)*(o-1)*(o-1));
422 libmesh_assert_less (o, 2);
423 libmesh_fallthrough();
425 libmesh_assert_less (o, 3);
428 return ((o-1)*(o-1)*(o-2)/2);
432 libmesh_assert_less (o, 2);
433 libmesh_fallthrough();
435 libmesh_assert_less (o, 3);
436 libmesh_fallthrough();
438 return ((o-3)*(o-2)*(o-1)/6);
484 #ifdef LIBMESH_ENABLE_AMR 489 const unsigned int variable_number,
491 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
496 const unsigned int variable_number,
498 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
499 #endif // #ifdef LIBMESH_ENABLE_AMR static unsigned int n_dofs(const ElemType t, const Order o)
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
This is the base class from which all geometric element types are derived.
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
virtual bool shapes_need_reinit() const override
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool is_hierarchic() const override
This class handles the numbering of degrees of freedom on a mesh.
LIBMESH_FE_NODAL_SOLN(BERNSTEIN, bernstein_nodal_soln)
LIBMESH_FE_SIDE_NODAL_SOLN(HIERARCHIC_VEC)
const dof_id_type n_nodes
static unsigned int n_shape_functions(const unsigned int dim, const FEType &fe_t, const ElemType t)
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
static void get_refspace_nodes(const ElemType t, std::vector< Point > &nodes)
static unsigned int n_dofs_per_elem(const ElemType t, const Order o)
virtual FEContinuity get_continuity() const override
std::string enum_to_string(const T e)
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to var...
FEContinuity
defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.
The constraint matrix storage format.