21 #include "libmesh/dof_map.h"
22 #include "libmesh/fe.h"
23 #include "libmesh/fe_interface.h"
24 #include "libmesh/elem.h"
25 #include "libmesh/tensor_value.h"
26 #include "libmesh/enum_to_string.h"
33 void nedelec_one_nodal_soln(
const Elem * elem,
35 const std::vector<Number> & elem_soln,
37 std::vector<Number> & nodal_soln)
39 const unsigned int n_nodes = elem->n_nodes();
40 const ElemType elem_type = elem->type();
42 const Order totalorder = static_cast<Order>(order+elem->p_level());
56 libmesh_assert_equal_to (elem_soln.size(), 3);
57 libmesh_assert_equal_to (nodal_soln.size(), 6*2);
63 libmesh_assert_equal_to (elem_soln.size(), 4);
65 if (elem_type ==
QUAD8)
66 libmesh_assert_equal_to (nodal_soln.size(), 8*2);
68 libmesh_assert_equal_to (nodal_soln.size(), 9*2);
73 libmesh_assert_equal_to (elem_soln.size(), 6);
74 libmesh_assert_equal_to (nodal_soln.size(), 10*3);
76 libmesh_not_implemented();
85 libmesh_assert_equal_to (elem_soln.size(), 12);
87 if (elem_type ==
HEX20)
88 libmesh_assert_equal_to (nodal_soln.size(), 20*3);
90 libmesh_assert_equal_to (nodal_soln.size(), 27*3);
96 libmesh_error_msg(
"ERROR: Invalid ElemType " <<
Utility::enum_to_string(elem_type) <<
" selected for NEDELEC_ONE FE family!");
100 const unsigned int n_sf =
103 std::vector<Point> refspace_nodes;
105 libmesh_assert_equal_to (refspace_nodes.size(),
n_nodes);
112 const std::vector<std::vector<RealGradient>> & vis_phi = vis_fe->get_phi();
114 vis_fe->reinit(elem,&refspace_nodes);
116 for (
unsigned int n = 0; n <
n_nodes; n++)
118 libmesh_assert_equal_to (elem_soln.size(), n_sf);
121 for (
int d = 0; d <
dim; d++)
123 nodal_soln[
dim*n+d] = 0;
127 for (
unsigned int i=0; i<n_sf; i++)
129 for (
int d = 0; d <
dim; d++)
131 nodal_soln[
dim*n+d] += elem_soln[i]*(vis_phi[i][n](d));
140 libmesh_error_msg(
"ERROR: Invalid total order " <<
Utility::enum_to_string(totalorder) <<
" selected for NEDELEC_ONE FE family!");
148 unsigned int nedelec_one_n_dofs(
const ElemType t,
const Order o)
179 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for NEDELEC_ONE FE family!");
186 unsigned int nedelec_one_n_dofs_at_node(
const ElemType t,
188 const unsigned int n)
210 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
229 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
249 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
270 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
302 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
340 libmesh_error_msg(
"ERROR: Invalid node ID " << n);
353 libmesh_error_msg(
"ERROR: Invalid Order " <<
Utility::enum_to_string(o) <<
" selected for NEDELEC_ONE FE family!");
359 #ifdef LIBMESH_ENABLE_AMR
360 void nedelec_one_compute_constraints (DofConstraints & ,
363 const Elem * libmesh_dbg_var(elem),
372 libmesh_not_implemented();
475 #endif // #ifdef LIBMESH_ENABLE_AMR
479 #define NEDELEC_LOW_D_ERROR_MESSAGE \
480 libmesh_error_msg("ERROR: This method makes no sense for low-D elements!");
488 const std::vector<Number> &,
489 std::vector<Number> &)
490 { NEDELEC_LOW_D_ERROR_MESSAGE }
495 const std::vector<Number> &,
496 std::vector<Number> &)
497 { NEDELEC_LOW_D_ERROR_MESSAGE }
502 const std::vector<Number> & elem_soln,
503 std::vector<Number> & nodal_soln)
504 { nedelec_one_nodal_soln(elem, order, elem_soln, 2 , nodal_soln); }
509 const std::vector<Number> & elem_soln,
510 std::vector<Number> & nodal_soln)
511 { nedelec_one_nodal_soln(elem, order, elem_soln, 3 , nodal_soln); }
556 #ifdef LIBMESH_ENABLE_AMR
562 { NEDELEC_LOW_D_ERROR_MESSAGE }
569 { NEDELEC_LOW_D_ERROR_MESSAGE }
574 const unsigned int variable_number,
576 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, 2); }
581 const unsigned int variable_number,
583 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, 3); }
584 #endif // LIBMESH_ENABLE_AMR
589 { NEDELEC_LOW_D_ERROR_MESSAGE }
592 { NEDELEC_LOW_D_ERROR_MESSAGE }
595 const unsigned int,
const Point &)
596 { NEDELEC_LOW_D_ERROR_MESSAGE }
599 const unsigned int,
const Point &,
const bool)
600 { NEDELEC_LOW_D_ERROR_MESSAGE }
602 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
605 const unsigned int,
const Point &)
606 { NEDELEC_LOW_D_ERROR_MESSAGE }
609 const unsigned int,
const Point &,
const bool)
610 { NEDELEC_LOW_D_ERROR_MESSAGE }
616 { NEDELEC_LOW_D_ERROR_MESSAGE }
619 { NEDELEC_LOW_D_ERROR_MESSAGE }
622 const unsigned int,
const Point &)
623 { NEDELEC_LOW_D_ERROR_MESSAGE }
626 const unsigned int,
const Point &,
const bool)
627 { NEDELEC_LOW_D_ERROR_MESSAGE }
629 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
632 const unsigned int,
const Point &)
633 { NEDELEC_LOW_D_ERROR_MESSAGE }
636 const unsigned int,
const Point &,
const bool)
637 { NEDELEC_LOW_D_ERROR_MESSAGE }