37 libmesh_error_msg(
"ERROR: Do not define an object of this type.");
42 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 77 #endif //ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 81 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 82 #define fe_family_switch(dim, func_and_args, prefix, suffix) \ 84 switch (fe_t.family) \ 87 prefix FE<dim,CLOUGH>::func_and_args suffix \ 89 prefix FE<dim,HERMITE>::func_and_args suffix \ 91 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 93 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 95 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 97 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 99 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 101 prefix FE<dim,SCALAR>::func_and_args suffix \ 103 prefix FE<dim,BERNSTEIN>::func_and_args suffix \ 105 prefix FE<dim,SZABAB>::func_and_args suffix \ 107 prefix FEXYZ<dim>::func_and_args suffix \ 109 libmesh_assert_equal_to (dim, 2); \ 110 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 112 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 116 #define fe_family_with_vec_switch(dim, func_and_args, prefix, suffix) \ 118 switch (fe_t.family) \ 121 prefix FE<dim,CLOUGH>::func_and_args suffix \ 123 prefix FE<dim,HERMITE>::func_and_args suffix \ 125 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 126 case L2_HIERARCHIC: \ 127 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 129 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 131 prefix FELagrangeVec<dim>::func_and_args suffix \ 133 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 135 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 137 prefix FE<dim,SCALAR>::func_and_args suffix \ 139 prefix FE<dim,BERNSTEIN>::func_and_args suffix \ 141 prefix FE<dim,SZABAB>::func_and_args suffix \ 143 prefix FEXYZ<dim>::func_and_args suffix \ 145 libmesh_assert_equal_to (dim, 2); \ 146 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 148 prefix FENedelecOne<dim>::func_and_args suffix \ 150 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 154 #define fe_scalar_vec_error_switch(dim, func_and_args, prefix, suffix) \ 156 switch (fe_t.family) \ 159 prefix FE<dim,CLOUGH>::func_and_args suffix \ 161 prefix FE<dim,HERMITE>::func_and_args suffix \ 163 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 164 case L2_HIERARCHIC: \ 165 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 167 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 169 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 171 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 173 prefix FE<dim,SCALAR>::func_and_args suffix \ 175 prefix FE<dim,BERNSTEIN>::func_and_args suffix \ 177 prefix FE<dim,SZABAB>::func_and_args suffix \ 179 prefix FEXYZ<dim>::func_and_args suffix \ 181 libmesh_assert_equal_to (dim, 2); \ 182 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 185 libmesh_error_msg("Error: Can only request scalar valued elements for Real FEInterface::func_and_args"); \ 187 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 192 #define fe_vector_scalar_error_switch(dim, func_and_args, prefix, suffix) \ 194 switch (fe_t.family) \ 197 prefix FELagrangeVec<dim>::func_and_args suffix \ 199 prefix FENedelecOne<dim>::func_and_args suffix \ 202 case L2_HIERARCHIC: \ 211 libmesh_error_msg("Error: Can only request vector valued elements for RealGradient FEInterface::shape"); \ 213 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 218 #define fe_family_switch(dim, func_and_args, prefix, suffix) \ 220 switch (fe_t.family) \ 223 prefix FE<dim,CLOUGH>::func_and_args suffix \ 225 prefix FE<dim,HERMITE>::func_and_args suffix \ 227 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 228 case L2_HIERARCHIC: \ 229 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 231 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 233 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 235 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 237 prefix FE<dim,SCALAR>::func_and_args suffix \ 239 prefix FEXYZ<dim>::func_and_args suffix \ 241 libmesh_assert_equal_to (dim, 2); \ 242 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 244 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 248 #define fe_family_with_vec_switch(dim, func_and_args, prefix, suffix) \ 250 switch (fe_t.family) \ 253 prefix FE<dim,CLOUGH>::func_and_args suffix \ 255 prefix FE<dim,HERMITE>::func_and_args suffix \ 257 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 258 case L2_HIERARCHIC: \ 259 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 261 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 263 prefix FELagrangeVec<dim>::func_and_args suffix \ 265 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 267 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 269 prefix FE<dim,SCALAR>::func_and_args suffix \ 271 prefix FEXYZ<dim>::func_and_args suffix \ 273 libmesh_assert_equal_to (dim, 2); \ 274 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 276 prefix FENedelecOne<dim>::func_and_args suffix \ 278 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 282 #define fe_scalar_vec_error_switch(dim, func_and_args, prefix, suffix) \ 284 switch (fe_t.family) \ 287 prefix FE<dim,CLOUGH>::func_and_args suffix \ 289 prefix FE<dim,HERMITE>::func_and_args suffix \ 291 prefix FE<dim,HIERARCHIC>::func_and_args suffix \ 292 case L2_HIERARCHIC: \ 293 prefix FE<dim,L2_HIERARCHIC>::func_and_args suffix \ 295 prefix FE<dim,LAGRANGE>::func_and_args suffix \ 297 prefix FE<dim,L2_LAGRANGE>::func_and_args suffix \ 299 prefix FE<dim,MONOMIAL>::func_and_args suffix \ 301 prefix FE<dim,SCALAR>::func_and_args suffix \ 303 prefix FEXYZ<dim>::func_and_args suffix \ 305 libmesh_assert_equal_to (dim, 2); \ 306 prefix FE<2,SUBDIVISION>::func_and_args suffix \ 309 libmesh_error_msg("Error: Can only request scalar valued elements for Real FEInterface::func_and_args"); \ 311 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 316 #define fe_vector_scalar_error_switch(dim, func_and_args, prefix, suffix) \ 318 switch (fe_t.family) \ 321 prefix FELagrangeVec<dim>::func_and_args suffix \ 323 prefix FENedelecOne<dim>::func_and_args suffix \ 326 case L2_HIERARCHIC: \ 333 libmesh_error_msg("Error: Can only request vector valued elements for RealGradient FEInterface::func_and_args"); \ 335 libmesh_error_msg("Unsupported family = " << fe_t.family); \ 341 #define fe_switch(func_and_args) \ 347 fe_family_switch (0, func_and_args, return, ;); \ 350 fe_family_switch (1, func_and_args, return, ;); \ 353 fe_family_switch (2, func_and_args, return, ;); \ 356 fe_family_switch (3, func_and_args, return, ;); \ 358 libmesh_error_msg("Invalid dim = " << dim); \ 362 #define fe_with_vec_switch(func_and_args) \ 368 fe_family_with_vec_switch (0, func_and_args, return, ;); \ 371 fe_family_with_vec_switch (1, func_and_args, return, ;); \ 374 fe_family_with_vec_switch (2, func_and_args, return, ;); \ 377 fe_family_with_vec_switch (3, func_and_args, return, ;); \ 379 libmesh_error_msg("Invalid dim = " << dim); \ 384 #define void_fe_switch(func_and_args) \ 390 fe_family_switch (0, func_and_args, ;, ; return;); \ 393 fe_family_switch (1, func_and_args, ;, ; return;); \ 396 fe_family_switch (2, func_and_args, ;, ; return;); \ 399 fe_family_switch (3, func_and_args, ;, ; return;); \ 401 libmesh_error_msg("Invalid dim = " << dim); \ 405 #define void_fe_with_vec_switch(func_and_args) \ 411 fe_family_with_vec_switch (0, func_and_args, ;, ; return;); \ 414 fe_family_with_vec_switch (1, func_and_args, ;, ; return;); \ 417 fe_family_with_vec_switch (2, func_and_args, ;, ; return;); \ 420 fe_family_with_vec_switch (3, func_and_args, ;, ; return;); \ 422 libmesh_error_msg("Invalid dim = " << dim); \ 433 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 458 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 467 fe_with_vec_switch(
n_dofs(t, o));
476 const unsigned int n)
478 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 508 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 524 const unsigned int dim,
527 std::vector<unsigned int> & di)
537 const unsigned int dim,
540 std::vector<unsigned int> & di)
553 const std::vector<Number> & elem_soln,
554 std::vector<Number> & nodal_soln)
556 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 579 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 581 return ifem_map(dim, fe_t, elem, p);
583 fe_with_vec_switch(
map(elem, p));
594 const Real tolerance,
597 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 604 fe_with_vec_switch(
inverse_map(elem, p, tolerance, secure));
613 const std::vector<Point> & physical_points,
614 std::vector<Point> & reference_points,
615 const Real tolerance,
618 const std::size_t n_pts = physical_points.
size();
621 reference_points.resize(n_pts);
625 libMesh::err <<
"WARNING: empty vector physical_points!" 631 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 635 ifem_inverse_map(dim, fe_t, elem, physical_points, reference_points, tolerance, secure);
642 void_fe_with_vec_switch(
inverse_map(elem, physical_points, reference_points, tolerance, secure));
660 const unsigned int i,
663 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 672 fe_switch(
shape(t,o,i,p));
678 const unsigned int i,
681 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 690 fe_switch(
shape(elem,o,i,p));
694 void FEInterface::shape<Real>(
const unsigned int dim,
697 const unsigned int i,
701 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 703 if (is_InfFE_elem(t))
705 phi = ifem_shape(dim, fe_t, t, i, p);
711 const Order o = fe_t.order;
716 fe_scalar_vec_error_switch(0, shape(t,o,i,p), phi = , ;
break;);
719 fe_scalar_vec_error_switch(1, shape(t,o,i,p), phi = , ;
break;);
722 fe_scalar_vec_error_switch(2, shape(t,o,i,p), phi = , ;
break;);
725 fe_scalar_vec_error_switch(3, shape(t,o,i,p), phi = , ;
break;);
728 libmesh_error_msg(
"Invalid dimension = " << dim);
735 void FEInterface::shape<Real>(
const unsigned int dim,
738 const unsigned int i,
742 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 744 if (elem && is_InfFE_elem(elem->type()))
746 phi = ifem_shape(dim, fe_t, elem, i, p);
751 const Order o = fe_t.order;
756 fe_scalar_vec_error_switch(0, shape(elem,o,i,p), phi = , ;
break;);
759 fe_scalar_vec_error_switch(1, shape(elem,o,i,p), phi = , ;
break;);
762 fe_scalar_vec_error_switch(2, shape(elem,o,i,p), phi = , ;
break;);
765 fe_scalar_vec_error_switch(3, shape(elem,o,i,p), phi = , ;
break;);
768 libmesh_error_msg(
"Invalid dimension = " << dim);
775 void FEInterface::shape<RealGradient>(
const unsigned int dim,
778 const unsigned int i,
783 const Order o = fe_t.order;
788 fe_vector_scalar_error_switch(0, shape(t,o,i,p), phi = , ;
break;);
791 fe_vector_scalar_error_switch(1, shape(t,o,i,p), phi = , ;
break;);
794 fe_vector_scalar_error_switch(2, shape(t,o,i,p), phi = , ;
break;);
797 fe_vector_scalar_error_switch(3, shape(t,o,i,p), phi = , ;
break;);
800 libmesh_error_msg(
"Invalid dimension = " << dim);
807 void FEInterface::shape<RealGradient>(
const unsigned int dim,
810 const unsigned int i,
814 const Order o = fe_t.order;
819 fe_vector_scalar_error_switch(0, shape(elem,o,i,p), phi = , ;
break;);
822 fe_vector_scalar_error_switch(1, shape(elem,o,i,p), phi = , ;
break;);
825 fe_vector_scalar_error_switch(2, shape(elem,o,i,p), phi = , ;
break;);
828 fe_vector_scalar_error_switch(3, shape(elem,o,i,p), phi = , ;
break;);
831 libmesh_error_msg(
"Invalid dimension = " << dim);
842 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 856 const unsigned int n_dof =
n_dofs (dim, p_refined, elem->
type());
858 data.shape.resize(n_dof);
863 for (
unsigned int n=0; n<n_dof; n++)
864 data.shape[n] =
shape(dim, p_refined, elem, n, p);
871 #ifdef LIBMESH_ENABLE_AMR 875 const unsigned int variable_number,
878 libmesh_assert(elem);
933 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 986 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 1007 libmesh_error_msg(
"Invalid dimension = " << elem->
dim());
1011 #endif // #ifdef LIBMESH_ENABLE_AMR 1015 #ifdef LIBMESH_ENABLE_PERIODIC 1022 const unsigned int variable_number,
1035 #endif // #ifdef LIBMESH_ENABLE_PERIODIC 1046 const unsigned int unlimited = 11;
1050 const unsigned int unknown = unlimited;
1128 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 1428 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 1463 return mesh.mesh_dimension();
static unsigned int n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)
static void dofs_on_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di)
Manages the family, order, etc. parameters for a given FE.
static Point map(unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
static unsigned int ifem_n_shape_functions(const unsigned int dim, const FEType &fe_t, const ElemType t)
static Real ifem_shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di)
Helper class used with FEInterface::compute_data().
Maps between boundary ids and PeriodicBoundaryBase objects.
const FEType & variable_type(const unsigned int c) const
The base class for all geometric element types.
static FEFieldType field_type(const FEType &fe_type)
unsigned int p_level() const
static Point ifem_inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
static unsigned int max_order(const FEType &fe_t, const ElemType &el_t)
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Manages the degrees of freedom (DOFs) in a simulation.
static void ifem_compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
static bool extra_hanging_dofs(const FEType &fe_t)
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 compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
static Point ifem_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p)
OStreamProxy err(std::cerr)
static void ifem_nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
static unsigned int ifem_n_dofs_per_elem(const unsigned int dim, const FEType &fe_t, const ElemType t)
static unsigned int n_vec_dim(const MeshBase &mesh, const FEType &fe_type)
static n_dofs_at_node_ptr n_dofs_at_node_function(const unsigned int dim, const FEType &fe_t)
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
static void compute_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
static unsigned int ifem_n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
unsigned int(* n_dofs_at_node_ptr)(const ElemType, const Order, const unsigned int)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
static bool is_InfFE_elem(const ElemType et)
static void nodal_soln(const unsigned int dim, const FEType &fe_t, const Elem *elem, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
static void compute_periodic_constraints(DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
virtual ElemType type() const =0
A geometric point in (x,y,z) space.
static unsigned int ifem_n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)