21 #include "libmesh/libmesh_config.h" 23 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 25 #include "libmesh/elem.h" 26 #include "libmesh/enum_to_string.h" 27 #include "libmesh/fe.h" 28 #include "libmesh/fe_interface.h" 29 #include "libmesh/fe_macro.h" 40 void bernstein_nodal_soln(
const Elem * elem,
42 const std::vector<Number> & elem_soln,
43 std::vector<Number> & nodal_soln,
44 const bool add_p_level)
46 const unsigned int n_nodes = elem->n_nodes();
48 const ElemType elem_type = elem->type();
52 const Order totalorder =
static_cast<Order>(order + add_p_level*elem->p_level());
62 libmesh_assert_equal_to (elem_soln.size(), 1);
64 const Number val = elem_soln[0];
66 for (
unsigned int n=0; n<
n_nodes; n++)
82 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] *
106 libmesh_error_msg(
"ERROR: Invalid total order " << totalorder);
112 unsigned int bernstein_n_dofs(
const ElemType t,
const Order o)
123 libmesh_assert_less (o, 2);
124 libmesh_fallthrough();
133 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for BERNSTEIN FE family!");
136 return ((o+1)*(o+1));
138 libmesh_assert_less (o, 2);
139 libmesh_fallthrough();
147 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for BERNSTEIN FE family!");
150 return ((o+1)*(o+1)*(o+1));
153 libmesh_assert_less (o, 2);
154 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);
168 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
175 unsigned int bernstein_n_dofs_at_node(
const ElemType t,
177 const unsigned int n)
195 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for EDGE2/3!");
198 libmesh_assert_less (n, 3);
199 libmesh_assert_less (o, 2);
200 libmesh_fallthrough();
203 libmesh_assert_less (n, 6);
204 libmesh_fallthrough();
219 return ((o-1)*(o-2)/2);
221 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TRI!");
224 libmesh_assert_less (n, 4);
225 libmesh_assert_less (o, 2);
226 libmesh_fallthrough();
228 libmesh_assert_less (n, 8);
229 libmesh_assert_less (o, 3);
230 libmesh_fallthrough();
248 return ((o-1)*(o-1));
251 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for QUAD9!");
255 libmesh_assert_less (n, 8);
256 libmesh_assert_less (o, 2);
257 libmesh_fallthrough();
259 libmesh_assert_less (n, 20);
260 libmesh_assert_less (o, 3);
261 libmesh_fallthrough();
295 return ((o-1)*(o-1));
298 return ((o-1)*(o-1)*(o-1));
301 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for HEX27!");
304 libmesh_assert_less (n, 4);
305 libmesh_assert_less (o, 2);
306 libmesh_fallthrough();
308 libmesh_assert_less (n, 10);
309 libmesh_fallthrough();
311 libmesh_assert_less (o, 3);
335 libmesh_error_msg(
"ERROR: Invalid node ID " << n <<
" selected for TET4/10/14!");
340 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
347 unsigned int bernstein_n_dofs_per_elem(
const ElemType t,
const Order o)
361 return ((o-1)*(o-2)/2);
368 libmesh_fallthrough();
372 libmesh_assert_less (o, 2);
375 libmesh_assert_less (o, 3);
380 libmesh_assert_less (o, 2);
381 libmesh_fallthrough();
384 libmesh_assert_less (o, 3);
389 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(t) <<
" selected for BERNSTEIN FE family!");
431 #ifdef LIBMESH_ENABLE_AMR 436 const unsigned int variable_number,
438 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
443 const unsigned int variable_number,
445 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
446 #endif // #ifdef LIBMESH_ENABLE_AMR 457 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 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.