22 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 38 void bernstein_nodal_soln(
const Elem * elem,
40 const std::vector<Number> & elem_soln,
41 std::vector<Number> & nodal_soln,
44 const unsigned int n_nodes = elem->n_nodes();
46 const ElemType elem_type = elem->type();
50 const Order totalorder =
static_cast<Order>(order + elem->p_level());
60 libmesh_assert_equal_to (elem_soln.size(), 1);
62 const Number val = elem_soln[0];
64 for (
unsigned int n=0; n<
n_nodes; n++)
81 const unsigned int n_sf =
85 std::vector<Point> refspace_nodes;
87 libmesh_assert_equal_to (refspace_nodes.size(),
n_nodes);
89 for (
unsigned int n=0; n<
n_nodes; n++)
91 libmesh_assert_equal_to (elem_soln.size(), n_sf);
97 for (
unsigned int i=0; i<n_sf; i++)
98 nodal_soln[n] += elem_soln[i] *
107 libmesh_error_msg(
"ERROR: Invalid total order " << totalorder);
113 unsigned int bernstein_n_dofs(
const ElemType t,
const Order o)
124 libmesh_assert_less (o, 2);
125 libmesh_fallthrough();
134 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for BERNSTEIN FE family!");
137 return ((o+1)*(o+1));
139 libmesh_assert_less (o, 2);
140 libmesh_fallthrough();
148 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for BERNSTEIN FE family!");
151 return ((o+1)*(o+1)*(o+1));
154 libmesh_assert_less (o, 2);
155 libmesh_fallthrough();
157 return ((o+1)*(o+2)/2);
159 libmesh_assert_less (o, 2);
160 libmesh_fallthrough();
163 libmesh_assert_less (o, 3);
164 return ((o+1)*(o+2)*(o+3)/6);
169 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
176 unsigned int bernstein_n_dofs_at_node(
const ElemType t,
178 const unsigned int n)
193 libmesh_assert (o>1);
196 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for EDGE2/3!");
199 libmesh_assert_less (n, 3);
200 libmesh_assert_less (o, 2);
201 libmesh_fallthrough();
216 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TRI6!");
219 libmesh_assert_less (n, 4);
220 libmesh_assert_less (o, 2);
221 libmesh_fallthrough();
223 libmesh_assert_less (n, 8);
224 libmesh_assert_less (o, 3);
225 libmesh_fallthrough();
247 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for QUAD9!");
251 libmesh_assert_less (n, 8);
252 libmesh_assert_less (o, 2);
253 libmesh_fallthrough();
255 libmesh_assert_less (n, 20);
256 libmesh_assert_less (o, 3);
257 libmesh_fallthrough();
291 return ((o-1)*(o-1));
298 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for HEX27!");
301 libmesh_assert_less (n, 4);
302 libmesh_assert_less (o, 2);
303 libmesh_fallthrough();
305 libmesh_assert_less (o, 3);
306 libmesh_assert_less (n, 10);
324 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TET10!");
329 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
336 unsigned int bernstein_n_dofs_per_elem(
const ElemType t,
const Order o)
350 return ((o-1)*(o-2)/2);
355 libmesh_fallthrough();
357 return ((o-1)*(o-1));
359 libmesh_assert_less (o, 2);
360 libmesh_fallthrough();
362 libmesh_assert_less (o, 3);
365 return ((o-1)*(o-1)*(o-1));
367 libmesh_assert_less (o, 2);
368 libmesh_fallthrough();
370 libmesh_assert_less (o, 3);
375 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
391 const std::vector<Number> & elem_soln,
392 std::vector<Number> & nodal_soln)
393 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, 0); }
398 const std::vector<Number> & elem_soln,
399 std::vector<Number> & nodal_soln)
400 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, 1); }
405 const std::vector<Number> & elem_soln,
406 std::vector<Number> & nodal_soln)
407 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, 2); }
412 const std::vector<Number> & elem_soln,
413 std::vector<Number> & nodal_soln)
414 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, 3); }
447 #ifdef LIBMESH_ENABLE_AMR 452 const unsigned int variable_number,
454 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
459 const unsigned int variable_number,
461 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
462 #endif // #ifdef LIBMESH_ENABLE_AMR 473 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES static unsigned int n_dofs(const ElemType t, const Order o)
The base class for all geometric element types.
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
virtual bool shapes_need_reinit() const override
virtual bool is_hierarchic() const override
Manages the degrees of freedom (DOFs) in a simulation.
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)
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)