libMesh::FEScalar< Dim > Class Template Reference

#include <fe.h>

Inheritance diagram for libMesh::FEScalar< Dim >:

Public Types

typedef FEGenericBase< typename FEOutputType< T >::type >::OutputShape OutputShape
 
typedef TensorTools::IncrementRank< OutputShape >::type OutputGradient
 
typedef TensorTools::IncrementRank< OutputGradient >::type OutputTensor
 
typedef TensorTools::DecrementRank< OutputShape >::type OutputDivergence
 
typedef TensorTools::MakeNumber< OutputShape >::type OutputNumber
 
typedef TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
 
typedef TensorTools::IncrementRank< OutputNumberGradient >::type OutputNumberTensor
 
typedef TensorTools::DecrementRank< OutputNumber >::type OutputNumberDivergence
 

Public Member Functions

 FEScalar (const FEType &fet)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const Point &)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
RealGradient shape (const Elem *, const Order, const unsigned int, const Point &)
 
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
RealGradient shape (const Elem *, const Order, const unsigned int, const Point &)
 
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &)
 
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &point_in)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int libmesh_dbg_var(i), const unsigned int libmesh_dbg_var(j), const Point &)
 
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &libmesh_dbg_var(p))
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &point_in)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *, const Order, const std::vector< Number > &, std::vector< Number > &)
 
void nodal_soln (const Elem *, const Order, const std::vector< Number > &, std::vector< Number > &)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
virtual unsigned int n_shape_functions () const override
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType, const Order)
 
unsigned int n_dofs (const ElemType, const Order)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType, const Order o)
 
unsigned int n_dofs (const ElemType, const Order o)
 
unsigned int n_dofs (const ElemType, const Order o)
 
unsigned int n_dofs (const ElemType, const Order o)
 
unsigned int n_dofs (const ElemType, const Order)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs (const ElemType t, const Order o)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
virtual FEContinuity get_continuity () const override
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
FEContinuity get_continuity () const
 
virtual bool is_hierarchic () const override
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
bool is_hierarchic () const
 
void dofs_on_side (const Elem *const, const Order, unsigned int, std::vector< unsigned int > &di)
 
void dofs_on_edge (const Elem *const, const Order, unsigned int, std::vector< unsigned int > &di)
 
Point inverse_map (const Elem *, const Point &, const Real, const bool)
 
void inverse_map (const Elem *, const std::vector< Point > &, std::vector< Point > &, Real, bool)
 
virtual void reinit (const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
 
virtual void reinit (const Elem *elem, const unsigned int side, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
 
virtual void edge_reinit (const Elem *elem, const unsigned int edge, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
 
void edge_reinit (Elem const *, unsigned int, Real, const std::vector< Point > *const, const std::vector< Real > *const)
 
virtual void side_map (const Elem *elem, const Elem *side, const unsigned int s, const std::vector< Point > &reference_side_points, std::vector< Point > &reference_points) override
 
void side_map (const Elem *, const Elem *, const unsigned int, const std::vector< Point > &, std::vector< Point > &)
 
virtual void attach_quadrature_rule (QBase *q) override
 
virtual unsigned int n_quadrature_points () const override
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
virtual bool shapes_need_reinit () const override
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
bool shapes_need_reinit () const
 
std::unique_ptr< FEGenericBase< Real > > build (const unsigned int dim, const FEType &fet)
 
std::unique_ptr< FEGenericBase< RealGradient > > build (const unsigned int dim, const FEType &fet)
 
std::unique_ptr< FEGenericBase< Real > > build_InfFE (const unsigned int dim, const FEType &fet)
 
std::unique_ptr< FEGenericBase< RealGradient > > build_InfFE (const unsigned int, const FEType &)
 
const std::vector< std::vector< OutputShape > > & get_phi () const
 
const std::vector< std::vector< OutputGradient > > & get_dphi () const
 
const std::vector< std::vector< OutputShape > > & get_curl_phi () const
 
const std::vector< std::vector< OutputDivergence > > & get_div_phi () const
 
const std::vector< std::vector< OutputShape > > & get_dphidx () const
 
const std::vector< std::vector< OutputShape > > & get_dphidy () const
 
const std::vector< std::vector< OutputShape > > & get_dphidz () const
 
const std::vector< std::vector< OutputShape > > & get_dphidxi () const
 
const std::vector< std::vector< OutputShape > > & get_dphideta () const
 
const std::vector< std::vector< OutputShape > > & get_dphidzeta () const
 
const std::vector< std::vector< OutputTensor > > & get_d2phi () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidx2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdy () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidy2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidydz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidz2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxi2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxideta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxidzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phideta2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidetadzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidzeta2 () const
 
const std::vector< OutputGradient > & get_dphase () const
 
const std::vector< Real > & get_Sobolev_weight () const
 
const std::vector< RealGradient > & get_Sobolev_dweight () const
 
void print_phi (std::ostream &os) const
 
void print_dphi (std::ostream &os) const
 
void print_d2phi (std::ostream &os) const
 
unsigned int get_dim () const
 
const std::vector< Point > & get_xyz () const
 
const std::vector< Real > & get_JxW () const
 
const std::vector< RealGradient > & get_dxyzdxi () const
 
const std::vector< RealGradient > & get_dxyzdeta () const
 
const std::vector< RealGradient > & get_dxyzdzeta () const
 
const std::vector< RealGradient > & get_d2xyzdxi2 () const
 
const std::vector< RealGradient > & get_d2xyzdeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdzeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdxideta () const
 
const std::vector< RealGradient > & get_d2xyzdxidzeta () const
 
const std::vector< RealGradient > & get_d2xyzdetadzeta () const
 
const std::vector< Real > & get_dxidx () const
 
const std::vector< Real > & get_dxidy () const
 
const std::vector< Real > & get_dxidz () const
 
const std::vector< Real > & get_detadx () const
 
const std::vector< Real > & get_detady () const
 
const std::vector< Real > & get_detadz () const
 
const std::vector< Real > & get_dzetadx () const
 
const std::vector< Real > & get_dzetady () const
 
const std::vector< Real > & get_dzetadz () const
 
const std::vector< std::vector< Point > > & get_tangents () const
 
const std::vector< Point > & get_normals () const
 
const std::vector< Real > & get_curvatures () const
 
ElemType get_type () const
 
unsigned int get_p_level () const
 
FEType get_fe_type () const
 
Order get_order () const
 
void set_fe_order (int new_order)
 
FEFamily get_family () const
 
const FEMapget_fe_map () const
 
void print_JxW (std::ostream &os) const
 
void print_xyz (std::ostream &os) const
 
void print_info (std::ostream &os) const
 

Static Public Member Functions

static OutputShape shape (const ElemType t, const Order o, const unsigned int i, const Point &p)
 
static OutputShape shape (const Elem *elem, const Order o, const unsigned int i, const Point &p)
 
static OutputShape shape_deriv (const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_deriv (const Elem *elem, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_second_deriv (const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_second_deriv (const Elem *elem, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static void nodal_soln (const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
static unsigned int n_shape_functions (const ElemType t, const Order o)
 
static unsigned int n_dofs (const ElemType t, const Order o)
 
static unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
static unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
static void dofs_on_side (const Elem *const elem, const Order o, unsigned int s, std::vector< unsigned int > &di)
 
static void dofs_on_edge (const Elem *const elem, const Order o, unsigned int e, std::vector< unsigned int > &di)
 
static Point inverse_map (const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
 
static void inverse_map (const Elem *elem, const std::vector< Point > &physical_points, std::vector< Point > &reference_points, const Real tolerance=TOLERANCE, const bool secure=true)
 
static void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
static Point map (const Elem *elem, const Point &reference_point)
 
static Point map_xi (const Elem *elem, const Point &reference_point)
 
static Point map_eta (const Elem *elem, const Point &reference_point)
 
static Point map_zeta (const Elem *elem, const Point &reference_point)
 
static std::unique_ptr< FEGenericBasebuild (const unsigned int dim, const FEType &type)
 
static std::unique_ptr< FEGenericBasebuild_InfFE (const unsigned int dim, const FEType &type)
 
static void compute_proj_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
static void coarsened_dof_values (const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const unsigned int var, const bool use_old_dof_indices=false)
 
static void coarsened_dof_values (const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const bool use_old_dof_indices=false)
 
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 bool on_reference_element (const Point &p, const ElemType t, const Real eps=TOLERANCE)
 
static void get_refspace_nodes (const ElemType t, std::vector< Point > &nodes)
 
static void compute_node_constraints (NodeConstraints &constraints, const Elem *elem)
 
static void compute_periodic_node_constraints (NodeConstraints &constraints, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const Elem *elem)
 
static void print_info (std::ostream &out=libMesh::out)
 
static std::string get_info ()
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

virtual void init_shape_functions (const std::vector< Point > &qp, const Elem *e)
 
virtual void init_base_shape_functions (const std::vector< Point > &qp, const Elem *e) override
 
void determine_calculations ()
 
virtual void compute_shape_functions (const Elem *elem, const std::vector< Point > &qp)
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Protected Attributes

std::vector< Pointcached_nodes
 
ElemType last_side
 
unsigned int last_edge
 
std::unique_ptr< FETransformationBase< FEOutputType< T >::type > > _fe_trans
 
std::vector< std::vector< OutputShape > > phi
 
std::vector< std::vector< OutputGradient > > dphi
 
std::vector< std::vector< OutputShape > > curl_phi
 
std::vector< std::vector< OutputDivergence > > div_phi
 
std::vector< std::vector< OutputShape > > dphidxi
 
std::vector< std::vector< OutputShape > > dphideta
 
std::vector< std::vector< OutputShape > > dphidzeta
 
std::vector< std::vector< OutputShape > > dphidx
 
std::vector< std::vector< OutputShape > > dphidy
 
std::vector< std::vector< OutputShape > > dphidz
 
std::vector< std::vector< OutputTensor > > d2phi
 
std::vector< std::vector< OutputShape > > d2phidxi2
 
std::vector< std::vector< OutputShape > > d2phidxideta
 
std::vector< std::vector< OutputShape > > d2phidxidzeta
 
std::vector< std::vector< OutputShape > > d2phideta2
 
std::vector< std::vector< OutputShape > > d2phidetadzeta
 
std::vector< std::vector< OutputShape > > d2phidzeta2
 
std::vector< std::vector< OutputShape > > d2phidx2
 
std::vector< std::vector< OutputShape > > d2phidxdy
 
std::vector< std::vector< OutputShape > > d2phidxdz
 
std::vector< std::vector< OutputShape > > d2phidy2
 
std::vector< std::vector< OutputShape > > d2phidydz
 
std::vector< std::vector< OutputShape > > d2phidz2
 
std::vector< OutputGradientdphase
 
std::vector< RealGradientdweight
 
std::vector< Realweight
 
std::unique_ptr< FEMap_fe_map
 
const unsigned int dim
 
bool calculations_started
 
bool calculate_phi
 
bool calculate_dphi
 
bool calculate_d2phi
 
bool calculate_curl_phi
 
bool calculate_div_phi
 
bool calculate_dphiref
 
FEType fe_type
 
ElemType elem_type
 
unsigned int _p_level
 
QBaseqrule
 
bool shapes_on_quadrature
 

Static Protected Attributes

static Counts _counts
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 

Detailed Description

template<unsigned int Dim>
class libMesh::FEScalar< Dim >

The FEScalar class is used for working with SCALAR variables.

Definition at line 798 of file fe.h.

Member Typedef Documentation

◆ Counts

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information. The log is identified by the class name.

Definition at line 117 of file reference_counter.h.

◆ OutputDivergence

Definition at line 122 of file fe_base.h.

◆ OutputGradient

Definition at line 120 of file fe_base.h.

◆ OutputNumber

Definition at line 123 of file fe_base.h.

◆ OutputNumberDivergence

Definition at line 126 of file fe_base.h.

◆ OutputNumberGradient

Definition at line 124 of file fe_base.h.

◆ OutputNumberTensor

Definition at line 125 of file fe_base.h.

◆ OutputShape

typedef FEGenericBase<typename FEOutputType<T>::type>::OutputShape libMesh::FE< Dim, T >::OutputShape
inherited

Definition at line 101 of file fe.h.

◆ OutputTensor

Definition at line 121 of file fe_base.h.

Constructor & Destructor Documentation

◆ FEScalar()

template<unsigned int Dim>
libMesh::FEScalar< Dim >::FEScalar ( const FEType fet)
inlineexplicit

Constructor. Creates a SCALAR finite element which simply represents one or more extra DOFs coupled to all other DOFs in the system.

Definition at line 809 of file fe.h.

809  :
810  FE<Dim,SCALAR> (fet)
811  {}

Member Function Documentation

◆ attach_quadrature_rule()

void libMesh::FE< Dim, T >::attach_quadrature_rule ( QBase q)
overridevirtualinherited

Provides the class with the quadrature rule, which provides the locations (on a reference element) where the shape functions are to be calculated.

Implements libMesh::FEAbstract.

Definition at line 58 of file fe.C.

59 {
60  libmesh_assert(q);
61  this->qrule = q;
62  // make sure we don't cache results from a previous quadrature rule
63  this->elem_type = INVALID_ELEM;
64  return;
65 }

◆ build() [1/3]

static std::unique_ptr<FEGenericBase> libMesh::FEGenericBase< FEOutputType< T >::type >::build ( const unsigned int  dim,
const FEType type 
)
staticinherited

Builds a specific finite element type. A std::unique_ptr<FEGenericBase> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The build call will fail if the OutputType of this class is not compatible with the output required for the requested type

◆ build() [2/3]

std::unique_ptr< FEGenericBase< Real > > libMesh::FEGenericBase< Real >::build ( const unsigned int  dim,
const FEType fet 
)
inherited

Definition at line 182 of file fe_base.C.

References libMesh::BERNSTEIN, libMesh::CLOUGH, libMesh::FEType::family, libMesh::HERMITE, libMesh::HIERARCHIC, libMesh::L2_HIERARCHIC, libMesh::L2_LAGRANGE, libMesh::LAGRANGE, libMesh::MONOMIAL, libMesh::SCALAR, libMesh::SUBDIVISION, libMesh::SZABAB, and libMesh::XYZ.

184 {
185  switch (dim)
186  {
187  // 0D
188  case 0:
189  {
190  switch (fet.family)
191  {
192  case CLOUGH:
193  return libmesh_make_unique<FE<0,CLOUGH>>(fet);
194 
195  case HERMITE:
196  return libmesh_make_unique<FE<0,HERMITE>>(fet);
197 
198  case LAGRANGE:
199  return libmesh_make_unique<FE<0,LAGRANGE>>(fet);
200 
201  case L2_LAGRANGE:
202  return libmesh_make_unique<FE<0,L2_LAGRANGE>>(fet);
203 
204  case HIERARCHIC:
205  return libmesh_make_unique<FE<0,HIERARCHIC>>(fet);
206 
207  case L2_HIERARCHIC:
208  return libmesh_make_unique<FE<0,L2_HIERARCHIC>>(fet);
209 
210  case MONOMIAL:
211  return libmesh_make_unique<FE<0,MONOMIAL>>(fet);
212 
213 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
214  case SZABAB:
215  return libmesh_make_unique<FE<0,SZABAB>>(fet);
216 
217  case BERNSTEIN:
218  return libmesh_make_unique<FE<0,BERNSTEIN>>(fet);
219 #endif
220 
221  case XYZ:
222  return libmesh_make_unique<FEXYZ<0>>(fet);
223 
224  case SCALAR:
225  return libmesh_make_unique<FEScalar<0>>(fet);
226 
227  default:
228  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
229  }
230  }
231  // 1D
232  case 1:
233  {
234  switch (fet.family)
235  {
236  case CLOUGH:
237  return libmesh_make_unique<FE<1,CLOUGH>>(fet);
238 
239  case HERMITE:
240  return libmesh_make_unique<FE<1,HERMITE>>(fet);
241 
242  case LAGRANGE:
243  return libmesh_make_unique<FE<1,LAGRANGE>>(fet);
244 
245  case L2_LAGRANGE:
246  return libmesh_make_unique<FE<1,L2_LAGRANGE>>(fet);
247 
248  case HIERARCHIC:
249  return libmesh_make_unique<FE<1,HIERARCHIC>>(fet);
250 
251  case L2_HIERARCHIC:
252  return libmesh_make_unique<FE<1,L2_HIERARCHIC>>(fet);
253 
254  case MONOMIAL:
255  return libmesh_make_unique<FE<1,MONOMIAL>>(fet);
256 
257 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
258  case SZABAB:
259  return libmesh_make_unique<FE<1,SZABAB>>(fet);
260 
261  case BERNSTEIN:
262  return libmesh_make_unique<FE<1,BERNSTEIN>>(fet);
263 #endif
264 
265  case XYZ:
266  return libmesh_make_unique<FEXYZ<1>>(fet);
267 
268  case SCALAR:
269  return libmesh_make_unique<FEScalar<1>>(fet);
270 
271  default:
272  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
273  }
274  }
275 
276 
277  // 2D
278  case 2:
279  {
280  switch (fet.family)
281  {
282  case CLOUGH:
283  return libmesh_make_unique<FE<2,CLOUGH>>(fet);
284 
285  case HERMITE:
286  return libmesh_make_unique<FE<2,HERMITE>>(fet);
287 
288  case LAGRANGE:
289  return libmesh_make_unique<FE<2,LAGRANGE>>(fet);
290 
291  case L2_LAGRANGE:
292  return libmesh_make_unique<FE<2,L2_LAGRANGE>>(fet);
293 
294  case HIERARCHIC:
295  return libmesh_make_unique<FE<2,HIERARCHIC>>(fet);
296 
297  case L2_HIERARCHIC:
298  return libmesh_make_unique<FE<2,L2_HIERARCHIC>>(fet);
299 
300  case MONOMIAL:
301  return libmesh_make_unique<FE<2,MONOMIAL>>(fet);
302 
303 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
304  case SZABAB:
305  return libmesh_make_unique<FE<2,SZABAB>>(fet);
306 
307  case BERNSTEIN:
308  return libmesh_make_unique<FE<2,BERNSTEIN>>(fet);
309 #endif
310 
311  case XYZ:
312  return libmesh_make_unique<FEXYZ<2>>(fet);
313 
314  case SCALAR:
315  return libmesh_make_unique<FEScalar<2>>(fet);
316 
317  case SUBDIVISION:
318  return libmesh_make_unique<FESubdivision>(fet);
319 
320  default:
321  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
322  }
323  }
324 
325 
326  // 3D
327  case 3:
328  {
329  switch (fet.family)
330  {
331  case CLOUGH:
332  libmesh_error_msg("ERROR: Clough-Tocher elements currently only support 1D and 2D");
333 
334  case HERMITE:
335  return libmesh_make_unique<FE<3,HERMITE>>(fet);
336 
337  case LAGRANGE:
338  return libmesh_make_unique<FE<3,LAGRANGE>>(fet);
339 
340  case L2_LAGRANGE:
341  return libmesh_make_unique<FE<3,L2_LAGRANGE>>(fet);
342 
343  case HIERARCHIC:
344  return libmesh_make_unique<FE<3,HIERARCHIC>>(fet);
345 
346  case L2_HIERARCHIC:
347  return libmesh_make_unique<FE<3,L2_HIERARCHIC>>(fet);
348 
349  case MONOMIAL:
350  return libmesh_make_unique<FE<3,MONOMIAL>>(fet);
351 
352 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
353  case SZABAB:
354  return libmesh_make_unique<FE<3,SZABAB>>(fet);
355 
356  case BERNSTEIN:
357  return libmesh_make_unique<FE<3,BERNSTEIN>>(fet);
358 #endif
359 
360  case XYZ:
361  return libmesh_make_unique<FEXYZ<3>>(fet);
362 
363  case SCALAR:
364  return libmesh_make_unique<FEScalar<3>>(fet);
365 
366  default:
367  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
368  }
369  }
370 
371  default:
372  libmesh_error_msg("Invalid dimension dim = " << dim);
373  }
374 }
FEFamily family
Definition: fe_type.h:204
const unsigned int dim
Definition: fe_abstract.h:531

◆ build() [3/3]

std::unique_ptr< FEGenericBase< RealGradient > > libMesh::FEGenericBase< RealGradient >::build ( const unsigned int  dim,
const FEType fet 
)
inherited

Definition at line 380 of file fe_base.C.

References libMesh::FEType::family, libMesh::LAGRANGE_VEC, and libMesh::NEDELEC_ONE.

382 {
383  switch (dim)
384  {
385  // 0D
386  case 0:
387  {
388  switch (fet.family)
389  {
390  case LAGRANGE_VEC:
391  return libmesh_make_unique<FELagrangeVec<0>>(fet);
392 
393  default:
394  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
395  }
396  }
397  case 1:
398  {
399  switch (fet.family)
400  {
401  case LAGRANGE_VEC:
402  return libmesh_make_unique<FELagrangeVec<1>>(fet);
403 
404  default:
405  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
406  }
407  }
408  case 2:
409  {
410  switch (fet.family)
411  {
412  case LAGRANGE_VEC:
413  return libmesh_make_unique<FELagrangeVec<2>>(fet);
414 
415  case NEDELEC_ONE:
416  return libmesh_make_unique<FENedelecOne<2>>(fet);
417 
418  default:
419  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
420  }
421  }
422  case 3:
423  {
424  switch (fet.family)
425  {
426  case LAGRANGE_VEC:
427  return libmesh_make_unique<FELagrangeVec<3>>(fet);
428 
429  case NEDELEC_ONE:
430  return libmesh_make_unique<FENedelecOne<3>>(fet);
431 
432  default:
433  libmesh_error_msg("ERROR: Bad FEType.family= " << fet.family);
434  }
435  }
436 
437  default:
438  libmesh_error_msg("Invalid dimension dim = " << dim);
439  } // switch(dim)
440 }
FEFamily family
Definition: fe_type.h:204
const unsigned int dim
Definition: fe_abstract.h:531

◆ build_InfFE() [1/3]

static std::unique_ptr<FEGenericBase> libMesh::FEGenericBase< FEOutputType< T >::type >::build_InfFE ( const unsigned int  dim,
const FEType type 
)
staticinherited

Builds a specific infinite element type. A std::unique_ptr<FEGenericBase> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The build call will fail if the OutputShape of this class is not compatible with the output required for the requested type

◆ build_InfFE() [2/3]

std::unique_ptr< FEGenericBase< Real > > libMesh::FEGenericBase< Real >::build_InfFE ( const unsigned int  dim,
const FEType fet 
)
inherited

Definition at line 453 of file fe_base.C.

References libMesh::CARTESIAN, libMesh::FEType::inf_map, libMesh::INFINITE_MAP, libMesh::JACOBI_20_00, libMesh::JACOBI_30_00, libMesh::LAGRANGE, libMesh::LEGENDRE, and libMesh::FEType::radial_family.

455 {
456  switch (dim)
457  {
458 
459  // 1D
460  case 1:
461  {
462  switch (fet.radial_family)
463  {
464  case INFINITE_MAP:
465  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
466 
467  case JACOBI_20_00:
468  {
469  switch (fet.inf_map)
470  {
471  case CARTESIAN:
472  return libmesh_make_unique<InfFE<1,JACOBI_20_00,CARTESIAN>>(fet);
473 
474  default:
475  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
476  }
477  }
478 
479  case JACOBI_30_00:
480  {
481  switch (fet.inf_map)
482  {
483  case CARTESIAN:
484  return libmesh_make_unique<InfFE<1,JACOBI_30_00,CARTESIAN>>(fet);
485 
486  default:
487  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
488  }
489  }
490 
491  case LEGENDRE:
492  {
493  switch (fet.inf_map)
494  {
495  case CARTESIAN:
496  return libmesh_make_unique<InfFE<1,LEGENDRE,CARTESIAN>>(fet);
497 
498  default:
499  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
500  }
501  }
502 
503  case LAGRANGE:
504  {
505  switch (fet.inf_map)
506  {
507  case CARTESIAN:
508  return libmesh_make_unique<InfFE<1,LAGRANGE,CARTESIAN>>(fet);
509 
510  default:
511  libmesh_error_msg("ERROR: Can't build an infinite element with InfMapType = " << fet.inf_map);
512  }
513  }
514 
515  default:
516  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
517  }
518  }
519 
520 
521 
522 
523  // 2D
524  case 2:
525  {
526  switch (fet.radial_family)
527  {
528  case INFINITE_MAP:
529  libmesh_error_msg("ERROR: Can't build an infinite element with FEFamily = " << fet.radial_family);
530 
531  case JACOBI_20_00:
532  {
533  switch (fet.inf_map)
534  {
535  case CARTESIAN:
536  return libmesh_make_unique<InfFE<2,JACOBI_20_00,CARTESIAN>>(fet);
537 
538  default:
539  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
540  }
541  }
542 
543  case JACOBI_30_00:
544  {
545  switch (fet.inf_map)
546  {
547  case CARTESIAN:
548  return libmesh_make_unique<InfFE<2,JACOBI_30_00,CARTESIAN>>(fet);
549 
550  default:
551  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
552  }
553  }
554 
555  case LEGENDRE:
556  {
557  switch (fet.inf_map)
558  {
559  case CARTESIAN:
560  return libmesh_make_unique<InfFE<2,LEGENDRE,CARTESIAN>>(fet);
561 
562  default:
563  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
564  }
565  }
566 
567  case LAGRANGE:
568  {
569  switch (fet.inf_map)
570  {
571  case CARTESIAN:
572  return libmesh_make_unique<InfFE<2,LAGRANGE,CARTESIAN>>(fet);
573 
574  default:
575  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
576  }
577  }
578 
579  default:
580  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
581  }
582  }
583 
584 
585 
586 
587  // 3D
588  case 3:
589  {
590  switch (fet.radial_family)
591  {
592  case INFINITE_MAP:
593  libmesh_error_msg("ERROR: Don't build an infinite element with FEFamily = " << fet.radial_family);
594 
595  case JACOBI_20_00:
596  {
597  switch (fet.inf_map)
598  {
599  case CARTESIAN:
600  return libmesh_make_unique<InfFE<3,JACOBI_20_00,CARTESIAN>>(fet);
601 
602  default:
603  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
604  }
605  }
606 
607  case JACOBI_30_00:
608  {
609  switch (fet.inf_map)
610  {
611  case CARTESIAN:
612  return libmesh_make_unique<InfFE<3,JACOBI_30_00,CARTESIAN>>(fet);
613 
614  default:
615  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
616  }
617  }
618 
619  case LEGENDRE:
620  {
621  switch (fet.inf_map)
622  {
623  case CARTESIAN:
624  return libmesh_make_unique<InfFE<3,LEGENDRE,CARTESIAN>>(fet);
625 
626  default:
627  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
628  }
629  }
630 
631  case LAGRANGE:
632  {
633  switch (fet.inf_map)
634  {
635  case CARTESIAN:
636  return libmesh_make_unique<InfFE<3,LAGRANGE,CARTESIAN>>(fet);
637 
638  default:
639  libmesh_error_msg("ERROR: Don't build an infinite element with InfMapType = " << fet.inf_map);
640  }
641  }
642 
643  default:
644  libmesh_error_msg("ERROR: Bad FEType.radial_family= " << fet.radial_family);
645  }
646  }
647 
648  default:
649  libmesh_error_msg("Invalid dimension dim = " << dim);
650  }
651 }
const unsigned int dim
Definition: fe_abstract.h:531
InfMapType inf_map
Definition: fe_type.h:258
FEFamily radial_family
Definition: fe_type.h:250

◆ build_InfFE() [3/3]

std::unique_ptr< FEGenericBase< RealGradient > > libMesh::FEGenericBase< RealGradient >::build_InfFE ( const unsigned  int,
const FEType  
)
inherited

Definition at line 657 of file fe_base.C.

659 {
660  // No vector types defined... YET.
661  libmesh_not_implemented();
662  return std::unique_ptr<FEVectorBase>();
663 }

◆ coarsened_dof_values() [1/2]

void libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values ( const NumericVector< Number > &  global_vector,
const DofMap dof_map,
const Elem coarse_elem,
DenseVector< Number > &  coarse_dofs,
const unsigned int  var,
const bool  use_old_dof_indices = false 
)
staticinherited

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to dof_indices for only the single given var

Definition at line 791 of file fe_base.C.

References std::abs(), libMesh::C_ONE, libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::FEType::default_quadrature_rule(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::FEInterface::dofs_on_edge(), libMesh::FEInterface::dofs_on_side(), libMesh::Elem::edge_index_range(), libMesh::TensorTools::inner_product(), libMesh::FEInterface::inverse_map(), libMesh::Elem::is_child_on_edge(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_vertex(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::n_children(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), n_nodes, libMesh::Elem::n_nodes(), libMesh::DofMap::old_dof_indices(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::Elem::side_index_range(), libMesh::TOLERANCE, libMesh::Elem::type(), libMesh::DofMap::variable_type(), libMesh::DenseMatrix< T >::zero(), libMesh::DenseVector< T >::zero(), and libMesh::zero.

797 {
798  // Side/edge local DOF indices
799  std::vector<unsigned int> new_side_dofs, old_side_dofs;
800 
801  // FIXME: what about 2D shells in 3D space?
802  unsigned int dim = elem->dim();
803 
804  // Cache n_children(); it's a virtual call but it's const.
805  const unsigned int n_children = elem->n_children();
806 
807  // We use local FE objects for now
808  // FIXME: we should use more, external objects instead for efficiency
809  const FEType & base_fe_type = dof_map.variable_type(var);
810  std::unique_ptr<FEGenericBase<OutputShape>> fe
811  (FEGenericBase<OutputShape>::build(dim, base_fe_type));
812  std::unique_ptr<FEGenericBase<OutputShape>> fe_coarse
813  (FEGenericBase<OutputShape>::build(dim, base_fe_type));
814 
815  std::unique_ptr<QBase> qrule (base_fe_type.default_quadrature_rule(dim));
816  std::unique_ptr<QBase> qedgerule (base_fe_type.default_quadrature_rule(1));
817  std::unique_ptr<QBase> qsiderule (base_fe_type.default_quadrature_rule(dim-1));
818  std::vector<Point> coarse_qpoints;
819 
820  // The values of the shape functions at the quadrature
821  // points
822  const std::vector<std::vector<OutputShape>> & phi_values =
823  fe->get_phi();
824  const std::vector<std::vector<OutputShape>> & phi_coarse =
825  fe_coarse->get_phi();
826 
827  // The gradients of the shape functions at the quadrature
828  // points on the child element.
829  const std::vector<std::vector<OutputGradient>> * dphi_values =
830  nullptr;
831  const std::vector<std::vector<OutputGradient>> * dphi_coarse =
832  nullptr;
833 
834  const FEContinuity cont = fe->get_continuity();
835 
836  if (cont == C_ONE)
837  {
838  const std::vector<std::vector<OutputGradient>> &
839  ref_dphi_values = fe->get_dphi();
840  dphi_values = &ref_dphi_values;
841  const std::vector<std::vector<OutputGradient>> &
842  ref_dphi_coarse = fe_coarse->get_dphi();
843  dphi_coarse = &ref_dphi_coarse;
844  }
845 
846  // The Jacobian * quadrature weight at the quadrature points
847  const std::vector<Real> & JxW =
848  fe->get_JxW();
849 
850  // The XYZ locations of the quadrature points on the
851  // child element
852  const std::vector<Point> & xyz_values =
853  fe->get_xyz();
854 
855 
856 
857  FEType fe_type = base_fe_type, temp_fe_type;
858  const ElemType elem_type = elem->type();
859  fe_type.order = static_cast<Order>(fe_type.order +
860  elem->max_descendant_p_level());
861 
862  // Number of nodes on parent element
863  const unsigned int n_nodes = elem->n_nodes();
864 
865  // Number of dofs on parent element
866  const unsigned int new_n_dofs =
867  FEInterface::n_dofs(dim, fe_type, elem_type);
868 
869  // Fixed vs. free DoFs on edge/face projections
870  std::vector<char> dof_is_fixed(new_n_dofs, false); // bools
871  std::vector<int> free_dof(new_n_dofs, 0);
872 
875  Ue.resize(new_n_dofs); Ue.zero();
876 
877 
878  // When coarsening, in general, we need a series of
879  // projections to ensure a unique and continuous
880  // solution. We start by interpolating nodes, then
881  // hold those fixed and project edges, then
882  // hold those fixed and project faces, then
883  // hold those fixed and project interiors
884 
885  // Copy node values first
886  {
887  std::vector<dof_id_type> node_dof_indices;
888  if (use_old_dof_indices)
889  dof_map.old_dof_indices (elem, node_dof_indices, var);
890  else
891  dof_map.dof_indices (elem, node_dof_indices, var);
892 
893  unsigned int current_dof = 0;
894  for (unsigned int n=0; n!= n_nodes; ++n)
895  {
896  // FIXME: this should go through the DofMap,
897  // not duplicate dof_indices code badly!
898  const unsigned int my_nc =
899  FEInterface::n_dofs_at_node (dim, fe_type,
900  elem_type, n);
901  if (!elem->is_vertex(n))
902  {
903  current_dof += my_nc;
904  continue;
905  }
906 
907  temp_fe_type = base_fe_type;
908  // We're assuming here that child n shares vertex n,
909  // which is wrong on non-simplices right now
910  // ... but this code isn't necessary except on elements
911  // where p refinement creates more vertex dofs; we have
912  // no such elements yet.
913  /*
914  if (elem->child_ptr(n)->p_level() < elem->p_level())
915  {
916  temp_fe_type.order =
917  static_cast<Order>(temp_fe_type.order +
918  elem->child_ptr(n)->p_level());
919  }
920  */
921  const unsigned int nc =
922  FEInterface::n_dofs_at_node (dim, temp_fe_type,
923  elem_type, n);
924  for (unsigned int i=0; i!= nc; ++i)
925  {
926  Ue(current_dof) =
927  old_vector(node_dof_indices[current_dof]);
928  dof_is_fixed[current_dof] = true;
929  current_dof++;
930  }
931  }
932  }
933 
934  // In 3D, project any edge values next
935  if (dim > 2 && cont != DISCONTINUOUS)
936  for (auto e : elem->edge_index_range())
937  {
938  FEInterface::dofs_on_edge(elem, dim, fe_type,
939  e, new_side_dofs);
940 
941  const unsigned int n_new_side_dofs =
942  cast_int<unsigned int>(new_side_dofs.size());
943 
944  // Some edge dofs are on nodes and already
945  // fixed, others are free to calculate
946  unsigned int free_dofs = 0;
947  for (unsigned int i=0; i != n_new_side_dofs; ++i)
948  if (!dof_is_fixed[new_side_dofs[i]])
949  free_dof[free_dofs++] = i;
950  Ke.resize (free_dofs, free_dofs); Ke.zero();
951  Fe.resize (free_dofs); Fe.zero();
952  // The new edge coefficients
953  DenseVector<Number> Uedge(free_dofs);
954 
955  // Add projection terms from each child sharing
956  // this edge
957  for (unsigned int c=0; c != n_children; ++c)
958  {
959  if (!elem->is_child_on_edge(c,e))
960  continue;
961  const Elem * child = elem->child_ptr(c);
962 
963  std::vector<dof_id_type> child_dof_indices;
964  if (use_old_dof_indices)
965  dof_map.old_dof_indices (child,
966  child_dof_indices, var);
967  else
968  dof_map.dof_indices (child,
969  child_dof_indices, var);
970  const unsigned int child_n_dofs =
971  cast_int<unsigned int>
972  (child_dof_indices.size());
973 
974  temp_fe_type = base_fe_type;
975  temp_fe_type.order =
976  static_cast<Order>(temp_fe_type.order +
977  child->p_level());
978 
979  FEInterface::dofs_on_edge(child, dim,
980  temp_fe_type, e, old_side_dofs);
981 
982  // Initialize both child and parent FE data
983  // on the child's edge
984  fe->attach_quadrature_rule (qedgerule.get());
985  fe->edge_reinit (child, e);
986  const unsigned int n_qp = qedgerule->n_points();
987 
988  FEInterface::inverse_map (dim, fe_type, elem,
989  xyz_values, coarse_qpoints);
990 
991  fe_coarse->reinit(elem, &coarse_qpoints);
992 
993  // Loop over the quadrature points
994  for (unsigned int qp=0; qp<n_qp; qp++)
995  {
996  // solution value at the quadrature point
997  OutputNumber fineval = libMesh::zero;
998  // solution grad at the quadrature point
999  OutputNumberGradient finegrad;
1000 
1001  // Sum the solution values * the DOF
1002  // values at the quadrature point to
1003  // get the solution value and gradient.
1004  for (unsigned int i=0; i<child_n_dofs;
1005  i++)
1006  {
1007  fineval +=
1008  (old_vector(child_dof_indices[i])*
1009  phi_values[i][qp]);
1010  if (cont == C_ONE)
1011  finegrad += (*dphi_values)[i][qp] *
1012  old_vector(child_dof_indices[i]);
1013  }
1014 
1015  // Form edge projection matrix
1016  for (unsigned int sidei=0, freei=0; sidei != n_new_side_dofs; ++sidei)
1017  {
1018  unsigned int i = new_side_dofs[sidei];
1019  // fixed DoFs aren't test functions
1020  if (dof_is_fixed[i])
1021  continue;
1022  for (unsigned int sidej=0, freej=0; sidej != n_new_side_dofs; ++sidej)
1023  {
1024  unsigned int j =
1025  new_side_dofs[sidej];
1026  if (dof_is_fixed[j])
1027  Fe(freei) -=
1028  TensorTools::inner_product(phi_coarse[i][qp],
1029  phi_coarse[j][qp]) *
1030  JxW[qp] * Ue(j);
1031  else
1032  Ke(freei,freej) +=
1033  TensorTools::inner_product(phi_coarse[i][qp],
1034  phi_coarse[j][qp]) *
1035  JxW[qp];
1036  if (cont == C_ONE)
1037  {
1038  if (dof_is_fixed[j])
1039  Fe(freei) -=
1040  TensorTools::inner_product((*dphi_coarse)[i][qp],
1041  (*dphi_coarse)[j][qp]) *
1042  JxW[qp] * Ue(j);
1043  else
1044  Ke(freei,freej) +=
1045  TensorTools::inner_product((*dphi_coarse)[i][qp],
1046  (*dphi_coarse)[j][qp]) *
1047  JxW[qp];
1048  }
1049  if (!dof_is_fixed[j])
1050  freej++;
1051  }
1052  Fe(freei) += TensorTools::inner_product(phi_coarse[i][qp],
1053  fineval) * JxW[qp];
1054  if (cont == C_ONE)
1055  Fe(freei) +=
1056  TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1057  freei++;
1058  }
1059  }
1060  }
1061  Ke.cholesky_solve(Fe, Uedge);
1062 
1063  // Transfer new edge solutions to element
1064  for (unsigned int i=0; i != free_dofs; ++i)
1065  {
1066  Number & ui = Ue(new_side_dofs[free_dof[i]]);
1067  libmesh_assert(std::abs(ui) < TOLERANCE ||
1068  std::abs(ui - Uedge(i)) < TOLERANCE);
1069  ui = Uedge(i);
1070  dof_is_fixed[new_side_dofs[free_dof[i]]] = true;
1071  }
1072  }
1073 
1074  // Project any side values (edges in 2D, faces in 3D)
1075  if (dim > 1 && cont != DISCONTINUOUS)
1076  for (auto s : elem->side_index_range())
1077  {
1078  FEInterface::dofs_on_side(elem, dim, fe_type,
1079  s, new_side_dofs);
1080 
1081  const unsigned int n_new_side_dofs =
1082  cast_int<unsigned int>(new_side_dofs.size());
1083 
1084  // Some side dofs are on nodes/edges and already
1085  // fixed, others are free to calculate
1086  unsigned int free_dofs = 0;
1087  for (unsigned int i=0; i != n_new_side_dofs; ++i)
1088  if (!dof_is_fixed[new_side_dofs[i]])
1089  free_dof[free_dofs++] = i;
1090  Ke.resize (free_dofs, free_dofs); Ke.zero();
1091  Fe.resize (free_dofs); Fe.zero();
1092  // The new side coefficients
1093  DenseVector<Number> Uside(free_dofs);
1094 
1095  // Add projection terms from each child sharing
1096  // this side
1097  for (unsigned int c=0; c != n_children; ++c)
1098  {
1099  if (!elem->is_child_on_side(c,s))
1100  continue;
1101  const Elem * child = elem->child_ptr(c);
1102 
1103  std::vector<dof_id_type> child_dof_indices;
1104  if (use_old_dof_indices)
1105  dof_map.old_dof_indices (child,
1106  child_dof_indices, var);
1107  else
1108  dof_map.dof_indices (child,
1109  child_dof_indices, var);
1110  const unsigned int child_n_dofs =
1111  cast_int<unsigned int>
1112  (child_dof_indices.size());
1113 
1114  temp_fe_type = base_fe_type;
1115  temp_fe_type.order =
1116  static_cast<Order>(temp_fe_type.order +
1117  child->p_level());
1118 
1119  FEInterface::dofs_on_side(child, dim,
1120  temp_fe_type, s, old_side_dofs);
1121 
1122  // Initialize both child and parent FE data
1123  // on the child's side
1124  fe->attach_quadrature_rule (qsiderule.get());
1125  fe->reinit (child, s);
1126  const unsigned int n_qp = qsiderule->n_points();
1127 
1128  FEInterface::inverse_map (dim, fe_type, elem,
1129  xyz_values, coarse_qpoints);
1130 
1131  fe_coarse->reinit(elem, &coarse_qpoints);
1132 
1133  // Loop over the quadrature points
1134  for (unsigned int qp=0; qp<n_qp; qp++)
1135  {
1136  // solution value at the quadrature point
1137  OutputNumber fineval = libMesh::zero;
1138  // solution grad at the quadrature point
1139  OutputNumberGradient finegrad;
1140 
1141  // Sum the solution values * the DOF
1142  // values at the quadrature point to
1143  // get the solution value and gradient.
1144  for (unsigned int i=0; i<child_n_dofs;
1145  i++)
1146  {
1147  fineval +=
1148  old_vector(child_dof_indices[i]) *
1149  phi_values[i][qp];
1150  if (cont == C_ONE)
1151  finegrad += (*dphi_values)[i][qp] *
1152  old_vector(child_dof_indices[i]);
1153  }
1154 
1155  // Form side projection matrix
1156  for (unsigned int sidei=0, freei=0; sidei != n_new_side_dofs; ++sidei)
1157  {
1158  unsigned int i = new_side_dofs[sidei];
1159  // fixed DoFs aren't test functions
1160  if (dof_is_fixed[i])
1161  continue;
1162  for (unsigned int sidej=0, freej=0; sidej != n_new_side_dofs; ++sidej)
1163  {
1164  unsigned int j =
1165  new_side_dofs[sidej];
1166  if (dof_is_fixed[j])
1167  Fe(freei) -=
1168  TensorTools::inner_product(phi_coarse[i][qp],
1169  phi_coarse[j][qp]) *
1170  JxW[qp] * Ue(j);
1171  else
1172  Ke(freei,freej) +=
1173  TensorTools::inner_product(phi_coarse[i][qp],
1174  phi_coarse[j][qp]) *
1175  JxW[qp];
1176  if (cont == C_ONE)
1177  {
1178  if (dof_is_fixed[j])
1179  Fe(freei) -=
1180  TensorTools::inner_product((*dphi_coarse)[i][qp],
1181  (*dphi_coarse)[j][qp]) *
1182  JxW[qp] * Ue(j);
1183  else
1184  Ke(freei,freej) +=
1185  TensorTools::inner_product((*dphi_coarse)[i][qp],
1186  (*dphi_coarse)[j][qp]) *
1187  JxW[qp];
1188  }
1189  if (!dof_is_fixed[j])
1190  freej++;
1191  }
1192  Fe(freei) += TensorTools::inner_product(fineval, phi_coarse[i][qp]) * JxW[qp];
1193  if (cont == C_ONE)
1194  Fe(freei) +=
1195  TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1196  freei++;
1197  }
1198  }
1199  }
1200  Ke.cholesky_solve(Fe, Uside);
1201 
1202  // Transfer new side solutions to element
1203  for (unsigned int i=0; i != free_dofs; ++i)
1204  {
1205  Number & ui = Ue(new_side_dofs[free_dof[i]]);
1206  libmesh_assert(std::abs(ui) < TOLERANCE ||
1207  std::abs(ui - Uside(i)) < TOLERANCE);
1208  ui = Uside(i);
1209  dof_is_fixed[new_side_dofs[free_dof[i]]] = true;
1210  }
1211  }
1212 
1213  // Project the interior values, finally
1214 
1215  // Some interior dofs are on nodes/edges/sides and
1216  // already fixed, others are free to calculate
1217  unsigned int free_dofs = 0;
1218  for (unsigned int i=0; i != new_n_dofs; ++i)
1219  if (!dof_is_fixed[i])
1220  free_dof[free_dofs++] = i;
1221  Ke.resize (free_dofs, free_dofs); Ke.zero();
1222  Fe.resize (free_dofs); Fe.zero();
1223  // The new interior coefficients
1224  DenseVector<Number> Uint(free_dofs);
1225 
1226  // Add projection terms from each child
1227  for (auto & child : elem->child_ref_range())
1228  {
1229  std::vector<dof_id_type> child_dof_indices;
1230  if (use_old_dof_indices)
1231  dof_map.old_dof_indices (&child,
1232  child_dof_indices, var);
1233  else
1234  dof_map.dof_indices (&child,
1235  child_dof_indices, var);
1236  const unsigned int child_n_dofs =
1237  cast_int<unsigned int>
1238  (child_dof_indices.size());
1239 
1240  // Initialize both child and parent FE data
1241  // on the child's quadrature points
1242  fe->attach_quadrature_rule (qrule.get());
1243  fe->reinit (&child);
1244  const unsigned int n_qp = qrule->n_points();
1245 
1246  FEInterface::inverse_map (dim, fe_type, elem,
1247  xyz_values, coarse_qpoints);
1248 
1249  fe_coarse->reinit(elem, &coarse_qpoints);
1250 
1251  // Loop over the quadrature points
1252  for (unsigned int qp=0; qp<n_qp; qp++)
1253  {
1254  // solution value at the quadrature point
1255  OutputNumber fineval = libMesh::zero;
1256  // solution grad at the quadrature point
1257  OutputNumberGradient finegrad;
1258 
1259  // Sum the solution values * the DOF
1260  // values at the quadrature point to
1261  // get the solution value and gradient.
1262  for (unsigned int i=0; i<child_n_dofs; i++)
1263  {
1264  fineval +=
1265  (old_vector(child_dof_indices[i]) *
1266  phi_values[i][qp]);
1267  if (cont == C_ONE)
1268  finegrad += (*dphi_values)[i][qp] *
1269  old_vector(child_dof_indices[i]);
1270  }
1271 
1272  // Form interior projection matrix
1273  for (unsigned int i=0, freei=0;
1274  i != new_n_dofs; ++i)
1275  {
1276  // fixed DoFs aren't test functions
1277  if (dof_is_fixed[i])
1278  continue;
1279  for (unsigned int j=0, freej=0; j !=
1280  new_n_dofs; ++j)
1281  {
1282  if (dof_is_fixed[j])
1283  Fe(freei) -=
1284  TensorTools::inner_product(phi_coarse[i][qp],
1285  phi_coarse[j][qp]) *
1286  JxW[qp] * Ue(j);
1287  else
1288  Ke(freei,freej) +=
1289  TensorTools::inner_product(phi_coarse[i][qp],
1290  phi_coarse[j][qp]) *
1291  JxW[qp];
1292  if (cont == C_ONE)
1293  {
1294  if (dof_is_fixed[j])
1295  Fe(freei) -=
1296  TensorTools::inner_product((*dphi_coarse)[i][qp],
1297  (*dphi_coarse)[j][qp]) *
1298  JxW[qp] * Ue(j);
1299  else
1300  Ke(freei,freej) +=
1301  TensorTools::inner_product((*dphi_coarse)[i][qp],
1302  (*dphi_coarse)[j][qp]) *
1303  JxW[qp];
1304  }
1305  if (!dof_is_fixed[j])
1306  freej++;
1307  }
1308  Fe(freei) += TensorTools::inner_product(phi_coarse[i][qp], fineval) *
1309  JxW[qp];
1310  if (cont == C_ONE)
1311  Fe(freei) += TensorTools::inner_product(finegrad, (*dphi_coarse)[i][qp]) * JxW[qp];
1312  freei++;
1313  }
1314  }
1315  }
1316  Ke.cholesky_solve(Fe, Uint);
1317 
1318  // Transfer new interior solutions to element
1319  for (unsigned int i=0; i != free_dofs; ++i)
1320  {
1321  Number & ui = Ue(free_dof[i]);
1322  libmesh_assert(std::abs(ui) < TOLERANCE ||
1323  std::abs(ui - Uint(i)) < TOLERANCE);
1324  ui = Uint(i);
1325  // We should be fixing all dofs by now; no need to keep track of
1326  // that unless we're debugging
1327 #ifndef NDEBUG
1328  dof_is_fixed[free_dof[i]] = true;
1329 #endif
1330  }
1331 
1332 #ifndef NDEBUG
1333  // Make sure every DoF got reached!
1334  for (unsigned int i=0; i != new_n_dofs; ++i)
1335  libmesh_assert(dof_is_fixed[i]);
1336 #endif
1337 }
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
double abs(double a)
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1930
void resize(const unsigned int n)
Definition: dense_vector.h:355
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1792
The base class for all geometric element types.
Definition: elem.h:100
TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
Definition: fe_base.h:124
unsigned int p_level() const
Definition: elem.h:2555
OrderWrapper order
Definition: fe_type.h:198
static const Real TOLERANCE
const Number zero
Definition: libmesh.h:239
void old_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn=libMesh::invalid_uint) const
Definition: dof_map.C:2434
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
Definition: fe_type.C:31
const dof_id_type n_nodes
Definition: tecplot_io.C:68
const unsigned int dim
Definition: fe_abstract.h:531
unsigned int n_points() const
Definition: quadrature.h:127
TensorTools::MakeNumber< OutputShape >::type OutputNumber
Definition: fe_base.h:123
virtual void zero() override
Definition: dense_matrix.h:808
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:792
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578
virtual void zero() override
Definition: dense_vector.h:379

◆ coarsened_dof_values() [2/2]

void libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values ( const NumericVector< Number > &  global_vector,
const DofMap dof_map,
const Elem coarse_elem,
DenseVector< Number > &  coarse_dofs,
const bool  use_old_dof_indices = false 
)
staticinherited

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to all dof_indices.

Definition at line 1343 of file fe_base.C.

References libMesh::DenseVector< T >::append(), libMesh::DofMap::n_variables(), and libMesh::DenseVector< T >::resize().

1348 {
1349  Ue.resize(0);
1350 
1351  for (unsigned int v=0; v != dof_map.n_variables(); ++v)
1352  {
1353  DenseVector<Number> Usub;
1354 
1355  coarsened_dof_values(old_vector, dof_map, elem, Usub,
1356  use_old_dof_indices);
1357 
1358  Ue.append (Usub);
1359  }
1360 }
unsigned int n_variables() const
Definition: dof_map.h:541
static void coarsened_dof_values(const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const unsigned int var, const bool use_old_dof_indices=false)
Definition: fe_base.C:791

◆ compute_constraints() [1/29]

void libMesh::FE< 2, SCALAR >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 122 of file fe_scalar.C.

126 { }

◆ compute_constraints() [2/29]

void libMesh::FE< 3, SCALAR >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 129 of file fe_scalar.C.

133 { }

◆ compute_constraints() [3/29]

void libMesh::FE< 2, L2_HIERARCHIC >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 207 of file fe_l2_hierarchic.C.

211 { }

◆ compute_constraints() [4/29]

void libMesh::FE< 3, L2_HIERARCHIC >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 214 of file fe_l2_hierarchic.C.

218 { }

◆ compute_constraints() [5/29]

void libMesh::FE< 2, CLOUGH >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 304 of file fe_clough.C.

308 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [6/29]

void libMesh::FE< 3, CLOUGH >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 311 of file fe_clough.C.

315 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [7/29]

void libMesh::FE< 2, HERMITE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 355 of file fe_hermite.C.

359 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [8/29]

void libMesh::FE< 3, HERMITE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 362 of file fe_hermite.C.

366 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [9/29]

void libMesh::FE< 2, HIERARCHIC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 383 of file fe_hierarchic.C.

387 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [10/29]

void libMesh::FE< 3, HIERARCHIC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 390 of file fe_hierarchic.C.

394 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [11/29]

static void libMesh::FE< Dim, T >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
staticinherited

Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using element-specific optimizations if possible.

◆ compute_constraints() [12/29]

void libMesh::FE< 2, MONOMIAL >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 419 of file fe_monomial.C.

419 {}

◆ compute_constraints() [13/29]

void libMesh::FE< 3, MONOMIAL >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 420 of file fe_monomial.C.

420 {}

◆ compute_constraints() [14/29]

void libMesh::FE< 2, BERNSTEIN >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 450 of file fe_bernstein.C.

454 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [15/29]

void libMesh::FE< 3, BERNSTEIN >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 457 of file fe_bernstein.C.

461 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [16/29]

void libMesh::FE< 2, L2_LAGRANGE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 495 of file fe_l2_lagrange.C.

499 { }

◆ compute_constraints() [17/29]

void libMesh::FE< 3, L2_LAGRANGE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 502 of file fe_l2_lagrange.C.

506 { }

◆ compute_constraints() [18/29]

void libMesh::FE< 0, NEDELEC_ONE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 563 of file fe_nedelec_one.C.

567 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ compute_constraints() [19/29]

void libMesh::FE< 1, NEDELEC_ONE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 570 of file fe_nedelec_one.C.

574 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ compute_constraints() [20/29]

void libMesh::FE< 2, NEDELEC_ONE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 577 of file fe_nedelec_one.C.

581 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/2); }

◆ compute_constraints() [21/29]

void libMesh::FE< 3, NEDELEC_ONE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 584 of file fe_nedelec_one.C.

588 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/3); }

◆ compute_constraints() [22/29]

void libMesh::FE< 2, LAGRANGE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 900 of file fe_lagrange.C.

904 { lagrange_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/2); }

◆ compute_constraints() [23/29]

void libMesh::FE< 3, LAGRANGE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 907 of file fe_lagrange.C.

911 { lagrange_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/3); }

◆ compute_constraints() [24/29]

void libMesh::FE< 2, XYZ >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 942 of file fe_xyz.C.

942 {}

◆ compute_constraints() [25/29]

void libMesh::FE< 3, XYZ >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)
inherited

Definition at line 943 of file fe_xyz.C.

943 {}

◆ compute_constraints() [26/29]

void libMesh::FE< 2, LAGRANGE_VEC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 950 of file fe_lagrange_vec.C.

954 { //libmesh_not_implemented();
955  FEVectorBase::compute_proj_constraints(constraints, dof_map, variable_number, elem);
956 }

◆ compute_constraints() [27/29]

void libMesh::FE< 3, LAGRANGE_VEC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 959 of file fe_lagrange_vec.C.

963 { //libmesh_not_implemented();
964  FEVectorBase::compute_proj_constraints(constraints, dof_map, variable_number, elem);
965 }

◆ compute_constraints() [28/29]

void libMesh::FE< 2, SZABAB >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 1287 of file fe_szabab.C.

1291 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_constraints() [29/29]

void libMesh::FE< 3, SZABAB >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
inherited

Definition at line 1294 of file fe_szabab.C.

1298 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1366

◆ compute_node_constraints()

void libMesh::FEAbstract::compute_node_constraints ( NodeConstraints constraints,
const Elem elem 
)
staticinherited

Computes the nodal constraint contributions (for non-conforming adapted meshes), using Lagrange geometry

Definition at line 820 of file fe_abstract.C.

References std::abs(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), libMesh::FEInterface::n_dofs(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Real, libMesh::remote_elem, libMesh::FEInterface::shape(), libMesh::Elem::side_index_range(), libMesh::Threads::spin_mtx, and libMesh::Elem::subactive().

822 {
823  libmesh_assert(elem);
824 
825  const unsigned int Dim = elem->dim();
826 
827  // Only constrain elements in 2,3D.
828  if (Dim == 1)
829  return;
830 
831  // Only constrain active and ancestor elements
832  if (elem->subactive())
833  return;
834 
835  // We currently always use LAGRANGE mappings for geometry
836  const FEType fe_type(elem->default_order(), LAGRANGE);
837 
838  // Pull objects out of the loop to reduce heap operations
839  std::vector<const Node *> my_nodes, parent_nodes;
840  std::unique_ptr<const Elem> my_side, parent_side;
841 
842  // Look at the element faces. Check to see if we need to
843  // build constraints.
844  for (auto s : elem->side_index_range())
845  if (elem->neighbor_ptr(s) != nullptr &&
846  elem->neighbor_ptr(s) != remote_elem)
847  if (elem->neighbor_ptr(s)->level() < elem->level()) // constrain dofs shared between
848  { // this element and ones coarser
849  // than this element.
850  // Get pointers to the elements of interest and its parent.
851  const Elem * parent = elem->parent();
852 
853  // This can't happen... Only level-0 elements have nullptr
854  // parents, and no level-0 elements can be at a higher
855  // level than their neighbors!
856  libmesh_assert(parent);
857 
858  elem->build_side_ptr(my_side, s);
859  parent->build_side_ptr(parent_side, s);
860 
861  const unsigned int n_side_nodes = my_side->n_nodes();
862 
863  my_nodes.clear();
864  my_nodes.reserve (n_side_nodes);
865  parent_nodes.clear();
866  parent_nodes.reserve (n_side_nodes);
867 
868  for (unsigned int n=0; n != n_side_nodes; ++n)
869  my_nodes.push_back(my_side->node_ptr(n));
870 
871  for (unsigned int n=0; n != n_side_nodes; ++n)
872  parent_nodes.push_back(parent_side->node_ptr(n));
873 
874  for (unsigned int my_side_n=0;
875  my_side_n < n_side_nodes;
876  my_side_n++)
877  {
878  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
879 
880  const Node * my_node = my_nodes[my_side_n];
881 
882  // The support point of the DOF
883  const Point & support_point = *my_node;
884 
885  // Figure out where my node lies on their reference element.
886  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
887  parent_side.get(),
888  support_point);
889 
890  // Compute the parent's side shape function values.
891  for (unsigned int their_side_n=0;
892  their_side_n < n_side_nodes;
893  their_side_n++)
894  {
895  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, parent_side->type()));
896 
897  const Node * their_node = parent_nodes[their_side_n];
898  libmesh_assert(their_node);
899 
900  const Real their_value = FEInterface::shape(Dim-1,
901  fe_type,
902  parent_side->type(),
903  their_side_n,
904  mapped_point);
905 
906  const Real their_mag = std::abs(their_value);
907 #ifdef DEBUG
908  // Protect for the case u_i ~= u_j,
909  // in which case i better equal j.
910  if (their_mag > 0.999)
911  {
912  libmesh_assert_equal_to (my_node, their_node);
913  libmesh_assert_less (std::abs(their_value - 1.), 0.001);
914  }
915  else
916 #endif
917  // To make nodal constraints useful for constructing
918  // sparsity patterns faster, we need to get EVERY
919  // POSSIBLE constraint coupling identified, even if
920  // there is no coupling in the isoparametric
921  // Lagrange case.
922  if (their_mag < 1.e-5)
923  {
924  // since we may be running this method concurrently
925  // on multiple threads we need to acquire a lock
926  // before modifying the shared constraint_row object.
927  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
928 
929  // A reference to the constraint row.
930  NodeConstraintRow & constraint_row = constraints[my_node].first;
931 
932  constraint_row.insert(std::make_pair (their_node,
933  0.));
934  }
935  // To get nodal coordinate constraints right, only
936  // add non-zero and non-identity values for Lagrange
937  // basis functions.
938  else // (1.e-5 <= their_mag <= .999)
939  {
940  // since we may be running this method concurrently
941  // on multiple threads we need to acquire a lock
942  // before modifying the shared constraint_row object.
943  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
944 
945  // A reference to the constraint row.
946  NodeConstraintRow & constraint_row = constraints[my_node].first;
947 
948  constraint_row.insert(std::make_pair (their_node,
949  their_value));
950  }
951  }
952  }
953  }
954 }
double abs(double a)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:454
spin_mutex spin_mtx
Definition: threads.C:29
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:657
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)
Definition: fe_interface.C:590
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:145
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ compute_periodic_constraints()

void libMesh::FEGenericBase< FEOutputType< T >::type >::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 
)
staticinherited

Computes the constraint matrix contributions (for meshes with periodic boundary conditions) corresponding to variable number var_number, using generic projections.

Definition at line 1650 of file fe_base.C.

References std::abs(), libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::Elem::active(), libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::C_ONE, libMesh::C_ZERO, libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::DofMap::constrain_p_dofs(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::FEInterface::dofs_on_side(), libMesh::MeshBase::get_boundary_info(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::PeriodicBoundaryBase::get_transformation_matrix(), libMesh::PeriodicBoundaryBase::get_variables(), libMesh::PeriodicBoundaryBase::has_transformation_matrix(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::index_range(), libMesh::TensorTools::inner_product(), libMesh::DofObject::invalid_id, libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::DofMap::is_constrained_dof(), libMesh::Elem::is_edge(), libMesh::Elem::is_face(), libMesh::PeriodicBoundaryBase::is_my_variable(), libMesh::Elem::is_node_on_edge(), libMesh::Elem::is_node_on_side(), libMesh::Elem::is_vertex(), libMesh::Elem::level(), mesh, std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofObject::n_comp(), libMesh::Elem::n_edges(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref(), libMesh::Elem::p_level(), libMesh::PeriodicBoundaryBase::pairedboundary, libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::Threads::spin_mtx, swap(), libMesh::DofMap::sys_number(), libMesh::TOLERANCE, and libMesh::DofMap::variable_type().

1657 {
1658  // Only bother if we truly have periodic boundaries
1659  if (boundaries.empty())
1660  return;
1661 
1662  libmesh_assert(elem);
1663 
1664  // Only constrain active elements with this method
1665  if (!elem->active())
1666  return;
1667 
1668  const unsigned int Dim = elem->dim();
1669 
1670  // We need sys_number and variable_number for DofObject methods
1671  // later
1672  const unsigned int sys_number = dof_map.sys_number();
1673 
1674  const FEType & base_fe_type = dof_map.variable_type(variable_number);
1675 
1676  // Construct FE objects for this element and its pseudo-neighbors.
1677  std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1678  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1679  const FEContinuity cont = my_fe->get_continuity();
1680 
1681  // We don't need to constrain discontinuous elements
1682  if (cont == DISCONTINUOUS)
1683  return;
1684  libmesh_assert (cont == C_ZERO || cont == C_ONE);
1685 
1686  // We'll use element size to generate relative tolerances later
1687  const Real primary_hmin = elem->hmin();
1688 
1689  std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1690  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1691 
1692  QGauss my_qface(Dim-1, base_fe_type.default_quadrature_order());
1693  my_fe->attach_quadrature_rule (&my_qface);
1694  std::vector<Point> neigh_qface;
1695 
1696  const std::vector<Real> & JxW = my_fe->get_JxW();
1697  const std::vector<Point> & q_point = my_fe->get_xyz();
1698  const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1699  const std::vector<std::vector<OutputShape>> & neigh_phi =
1700  neigh_fe->get_phi();
1701  const std::vector<Point> * face_normals = nullptr;
1702  const std::vector<std::vector<OutputGradient>> * dphi = nullptr;
1703  const std::vector<std::vector<OutputGradient>> * neigh_dphi = nullptr;
1704  std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1705  std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1706 
1707  if (cont != C_ZERO)
1708  {
1709  const std::vector<Point> & ref_face_normals =
1710  my_fe->get_normals();
1711  face_normals = &ref_face_normals;
1712  const std::vector<std::vector<OutputGradient>> & ref_dphi =
1713  my_fe->get_dphi();
1714  dphi = &ref_dphi;
1715  const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1716  neigh_fe->get_dphi();
1717  neigh_dphi = &ref_neigh_dphi;
1718  }
1719 
1720  DenseMatrix<Real> Ke;
1721  DenseVector<Real> Fe;
1722  std::vector<DenseVector<Real>> Ue;
1723 
1724  // Container to catch the boundary ids that BoundaryInfo hands us.
1725  std::vector<boundary_id_type> bc_ids;
1726 
1727  // Look at the element faces. Check to see if we need to
1728  // build constraints.
1729  const unsigned short int max_ns = elem->n_sides();
1730  for (unsigned short int s = 0; s != max_ns; ++s)
1731  {
1732  if (elem->neighbor_ptr(s))
1733  continue;
1734 
1735  mesh.get_boundary_info().boundary_ids (elem, s, bc_ids);
1736 
1737  for (const auto & boundary_id : bc_ids)
1738  {
1739  const PeriodicBoundaryBase * periodic = boundaries.boundary(boundary_id);
1740  if (periodic && periodic->is_my_variable(variable_number))
1741  {
1742  libmesh_assert(point_locator);
1743 
1744  // Get pointers to the element's neighbor.
1745  const Elem * neigh = boundaries.neighbor(boundary_id, *point_locator, elem, s);
1746 
1747  if (neigh == nullptr)
1748  libmesh_error_msg("PeriodicBoundaries point locator object returned nullptr!");
1749 
1750  // periodic (and possibly h refinement) constraints:
1751  // constrain dofs shared between
1752  // this element and ones as coarse
1753  // as or coarser than this element.
1754  if (neigh->level() <= elem->level())
1755  {
1756  unsigned int s_neigh =
1758  libmesh_assert_not_equal_to (s_neigh, libMesh::invalid_uint);
1759 
1760 #ifdef LIBMESH_ENABLE_AMR
1761  // Find the minimum p level; we build the h constraint
1762  // matrix with this and then constrain away all higher p
1763  // DoFs.
1764  libmesh_assert(neigh->active());
1765  const unsigned int min_p_level =
1766  std::min(elem->p_level(), neigh->p_level());
1767 
1768  // we may need to make the FE objects reinit with the
1769  // minimum shared p_level
1770  // FIXME - I hate using const_cast<> and avoiding
1771  // accessor functions; there's got to be a
1772  // better way to do this!
1773  const unsigned int old_elem_level = elem->p_level();
1774  if (old_elem_level != min_p_level)
1775  (const_cast<Elem *>(elem))->hack_p_level(min_p_level);
1776  const unsigned int old_neigh_level = neigh->p_level();
1777  if (old_neigh_level != min_p_level)
1778  (const_cast<Elem *>(neigh))->hack_p_level(min_p_level);
1779 #endif // #ifdef LIBMESH_ENABLE_AMR
1780 
1781  // We can do a projection with a single integration,
1782  // due to the assumption of nested finite element
1783  // subspaces.
1784  // FIXME: it might be more efficient to do nodes,
1785  // then edges, then side, to reduce the size of the
1786  // Cholesky factorization(s)
1787  my_fe->reinit(elem, s);
1788 
1789  dof_map.dof_indices (elem, my_dof_indices,
1790  variable_number);
1791  dof_map.dof_indices (neigh, neigh_dof_indices,
1792  variable_number);
1793 
1794  // We use neigh_dof_indices_all_variables in the case that the
1795  // periodic boundary condition involves mappings between multiple
1796  // variables.
1797  std::vector<std::vector<dof_id_type>> neigh_dof_indices_all_variables;
1798  if(periodic->has_transformation_matrix())
1799  {
1800  const std::set<unsigned int> & variables = periodic->get_variables();
1801  neigh_dof_indices_all_variables.resize(variables.size());
1802  unsigned int index = 0;
1803  for(unsigned int var : variables)
1804  {
1805  dof_map.dof_indices (neigh, neigh_dof_indices_all_variables[index],
1806  var);
1807  index++;
1808  }
1809  }
1810 
1811  const unsigned int n_qp = my_qface.n_points();
1812 
1813  // Translate the quadrature points over to the
1814  // neighbor's boundary
1815  std::vector<Point> neigh_point(q_point.size());
1816  for (auto i : index_range(neigh_point))
1817  neigh_point[i] = periodic->get_corresponding_pos(q_point[i]);
1818 
1819  FEInterface::inverse_map (Dim, base_fe_type, neigh,
1820  neigh_point, neigh_qface);
1821 
1822  neigh_fe->reinit(neigh, &neigh_qface);
1823 
1824  // We're only concerned with DOFs whose values (and/or first
1825  // derivatives for C1 elements) are supported on side nodes
1826  FEInterface::dofs_on_side(elem, Dim, base_fe_type, s, my_side_dofs);
1827  FEInterface::dofs_on_side(neigh, Dim, base_fe_type, s_neigh, neigh_side_dofs);
1828 
1829  // We're done with functions that examine Elem::p_level(),
1830  // so let's unhack those levels
1831 #ifdef LIBMESH_ENABLE_AMR
1832  if (elem->p_level() != old_elem_level)
1833  (const_cast<Elem *>(elem))->hack_p_level(old_elem_level);
1834  if (neigh->p_level() != old_neigh_level)
1835  (const_cast<Elem *>(neigh))->hack_p_level(old_neigh_level);
1836 #endif // #ifdef LIBMESH_ENABLE_AMR
1837 
1838  const unsigned int n_side_dofs =
1839  cast_int<unsigned int>
1840  (my_side_dofs.size());
1841  libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1842 
1843  Ke.resize (n_side_dofs, n_side_dofs);
1844  Ue.resize(n_side_dofs);
1845 
1846  // Form the projection matrix, (inner product of fine basis
1847  // functions against fine test functions)
1848  for (unsigned int is = 0; is != n_side_dofs; ++is)
1849  {
1850  const unsigned int i = my_side_dofs[is];
1851  for (unsigned int js = 0; js != n_side_dofs; ++js)
1852  {
1853  const unsigned int j = my_side_dofs[js];
1854  for (unsigned int qp = 0; qp != n_qp; ++qp)
1855  {
1856  Ke(is,js) += JxW[qp] *
1858  phi[j][qp]);
1859  if (cont != C_ZERO)
1860  Ke(is,js) += JxW[qp] *
1861  TensorTools::inner_product((*dphi)[i][qp] *
1862  (*face_normals)[qp],
1863  (*dphi)[j][qp] *
1864  (*face_normals)[qp]);
1865  }
1866  }
1867  }
1868 
1869  // Form the right hand sides, (inner product of coarse basis
1870  // functions against fine test functions)
1871  for (unsigned int is = 0; is != n_side_dofs; ++is)
1872  {
1873  const unsigned int i = neigh_side_dofs[is];
1874  Fe.resize (n_side_dofs);
1875  for (unsigned int js = 0; js != n_side_dofs; ++js)
1876  {
1877  const unsigned int j = my_side_dofs[js];
1878  for (unsigned int qp = 0; qp != n_qp; ++qp)
1879  {
1880  Fe(js) += JxW[qp] *
1881  TensorTools::inner_product(neigh_phi[i][qp],
1882  phi[j][qp]);
1883  if (cont != C_ZERO)
1884  Fe(js) += JxW[qp] *
1885  TensorTools::inner_product((*neigh_dphi)[i][qp] *
1886  (*face_normals)[qp],
1887  (*dphi)[j][qp] *
1888  (*face_normals)[qp]);
1889  }
1890  }
1891  Ke.cholesky_solve(Fe, Ue[is]);
1892  }
1893 
1894  // Make sure we're not adding recursive constraints
1895  // due to the redundancy in the way we add periodic
1896  // boundary constraints
1897  //
1898  // In order for this to work while threaded or on
1899  // distributed meshes, we need a rigorous way to
1900  // avoid recursive constraints. Here it is:
1901  //
1902  // For vertex DoFs, if there is a "prior" element
1903  // (i.e. a coarser element or an equally refined
1904  // element with a lower id) on this boundary which
1905  // contains the vertex point, then we will avoid
1906  // generating constraints; the prior element (or
1907  // something prior to it) may do so. If we are the
1908  // most prior (or "primary") element on this
1909  // boundary sharing this point, then we look at the
1910  // boundary periodic to us, we find the primary
1911  // element there, and if that primary is coarser or
1912  // equal-but-lower-id, then our vertex dofs are
1913  // constrained in terms of that element.
1914  //
1915  // For edge DoFs, if there is a coarser element
1916  // on this boundary sharing this edge, then we will
1917  // avoid generating constraints (we will be
1918  // constrained indirectly via AMR constraints
1919  // connecting us to the coarser element's DoFs). If
1920  // we are the coarsest element sharing this edge,
1921  // then we generate constraints if and only if we
1922  // are finer than the coarsest element on the
1923  // boundary periodic to us sharing the corresponding
1924  // periodic edge, or if we are at equal level but
1925  // our edge nodes have higher ids than the periodic
1926  // edge nodes (sorted from highest to lowest, then
1927  // compared lexicographically)
1928  //
1929  // For face DoFs, we generate constraints if we are
1930  // finer than our periodic neighbor, or if we are at
1931  // equal level but our element id is higher than its
1932  // element id.
1933  //
1934  // If the primary neighbor is also the current elem
1935  // (a 1-element-thick mesh) then we choose which
1936  // vertex dofs to constrain via lexicographic
1937  // ordering on point locations
1938 
1939  // FIXME: This code doesn't yet properly handle
1940  // cases where multiple different periodic BCs
1941  // intersect.
1942  std::set<dof_id_type> my_constrained_dofs;
1943 
1944  // Container to catch boundary IDs handed back by BoundaryInfo.
1945  std::vector<boundary_id_type> new_bc_ids;
1946 
1947  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
1948  {
1949  if (!elem->is_node_on_side(n,s))
1950  continue;
1951 
1952  const Node & my_node = elem->node_ref(n);
1953 
1954  if (elem->is_vertex(n))
1955  {
1956  // Find all boundary ids that include this
1957  // point and have periodic boundary
1958  // conditions for this variable
1959  std::set<boundary_id_type> point_bcids;
1960 
1961  for (unsigned int new_s = 0;
1962  new_s != max_ns; ++new_s)
1963  {
1964  if (!elem->is_node_on_side(n,new_s))
1965  continue;
1966 
1967  mesh.get_boundary_info().boundary_ids (elem, s, new_bc_ids);
1968 
1969  for (const auto & new_boundary_id : new_bc_ids)
1970  {
1971  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
1972  if (new_periodic && new_periodic->is_my_variable(variable_number))
1973  point_bcids.insert(new_boundary_id);
1974  }
1975  }
1976 
1977  // See if this vertex has point neighbors to
1978  // defer to
1979  if (primary_boundary_point_neighbor
1980  (elem, my_node, mesh.get_boundary_info(), point_bcids)
1981  != elem)
1982  continue;
1983 
1984  // Find the complementary boundary id set
1985  std::set<boundary_id_type> point_pairedids;
1986  for (const auto & new_boundary_id : point_bcids)
1987  {
1988  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
1989  point_pairedids.insert(new_periodic->pairedboundary);
1990  }
1991 
1992  // What do we want to constrain against?
1993  const Elem * primary_elem = nullptr;
1994  const Elem * main_neigh = nullptr;
1995  Point main_pt = my_node,
1996  primary_pt = my_node;
1997 
1998  for (const auto & new_boundary_id : point_bcids)
1999  {
2000  // Find the corresponding periodic point and
2001  // its primary neighbor
2002  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2003 
2004  const Point neigh_pt =
2005  new_periodic->get_corresponding_pos(my_node);
2006 
2007  // If the point is getting constrained
2008  // to itself by this PBC then we don't
2009  // generate any constraints
2010  if (neigh_pt.absolute_fuzzy_equals
2011  (my_node, primary_hmin*TOLERANCE))
2012  continue;
2013 
2014  // Otherwise we'll have a constraint in
2015  // one direction or another
2016  if (!primary_elem)
2017  primary_elem = elem;
2018 
2019  const Elem * primary_neigh =
2020  primary_boundary_point_neighbor(neigh, neigh_pt,
2022  point_pairedids);
2023 
2024  libmesh_assert(primary_neigh);
2025 
2026  if (new_boundary_id == boundary_id)
2027  {
2028  main_neigh = primary_neigh;
2029  main_pt = neigh_pt;
2030  }
2031 
2032  // Finer elements will get constrained in
2033  // terms of coarser neighbors, not the
2034  // other way around
2035  if ((primary_neigh->level() > primary_elem->level()) ||
2036 
2037  // For equal-level elements, the one with
2038  // higher id gets constrained in terms of
2039  // the one with lower id
2040  (primary_neigh->level() == primary_elem->level() &&
2041  primary_neigh->id() > primary_elem->id()) ||
2042 
2043  // On a one-element-thick mesh, we compare
2044  // points to see what side gets constrained
2045  (primary_neigh == primary_elem &&
2046  (neigh_pt > primary_pt)))
2047  continue;
2048 
2049  primary_elem = primary_neigh;
2050  primary_pt = neigh_pt;
2051  }
2052 
2053  if (!primary_elem ||
2054  primary_elem != main_neigh ||
2055  primary_pt != main_pt)
2056  continue;
2057  }
2058  else if (elem->is_edge(n))
2059  {
2060  // Find which edge we're on
2061  unsigned int e=0;
2062  for (; e != elem->n_edges(); ++e)
2063  {
2064  if (elem->is_node_on_edge(n,e))
2065  break;
2066  }
2067  libmesh_assert_less (e, elem->n_edges());
2068 
2069  // Find the edge end nodes
2070  const Node
2071  * e1 = nullptr,
2072  * e2 = nullptr;
2073  for (unsigned int nn = 0; nn != elem->n_nodes(); ++nn)
2074  {
2075  if (nn == n)
2076  continue;
2077 
2078  if (elem->is_node_on_edge(nn, e))
2079  {
2080  if (e1 == nullptr)
2081  {
2082  e1 = elem->node_ptr(nn);
2083  }
2084  else
2085  {
2086  e2 = elem->node_ptr(nn);
2087  break;
2088  }
2089  }
2090  }
2091  libmesh_assert (e1 && e2);
2092 
2093  // Find all boundary ids that include this
2094  // edge and have periodic boundary
2095  // conditions for this variable
2096  std::set<boundary_id_type> edge_bcids;
2097 
2098  for (unsigned int new_s = 0;
2099  new_s != max_ns; ++new_s)
2100  {
2101  if (!elem->is_node_on_side(n,new_s))
2102  continue;
2103 
2104  // We're reusing the new_bc_ids vector created outside the loop over nodes.
2105  mesh.get_boundary_info().boundary_ids (elem, s, new_bc_ids);
2106 
2107  for (const auto & new_boundary_id : new_bc_ids)
2108  {
2109  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2110  if (new_periodic && new_periodic->is_my_variable(variable_number))
2111  edge_bcids.insert(new_boundary_id);
2112  }
2113  }
2114 
2115 
2116  // See if this edge has neighbors to defer to
2117  if (primary_boundary_edge_neighbor
2118  (elem, *e1, *e2, mesh.get_boundary_info(), edge_bcids)
2119  != elem)
2120  continue;
2121 
2122  // Find the complementary boundary id set
2123  std::set<boundary_id_type> edge_pairedids;
2124  for (const auto & new_boundary_id : edge_bcids)
2125  {
2126  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2127  edge_pairedids.insert(new_periodic->pairedboundary);
2128  }
2129 
2130  // What do we want to constrain against?
2131  const Elem * primary_elem = nullptr;
2132  const Elem * main_neigh = nullptr;
2133  Point main_pt1 = *e1,
2134  main_pt2 = *e2,
2135  primary_pt1 = *e1,
2136  primary_pt2 = *e2;
2137 
2138  for (const auto & new_boundary_id : edge_bcids)
2139  {
2140  // Find the corresponding periodic edge and
2141  // its primary neighbor
2142  const PeriodicBoundaryBase * new_periodic = boundaries.boundary(new_boundary_id);
2143 
2144  Point neigh_pt1 = new_periodic->get_corresponding_pos(*e1),
2145  neigh_pt2 = new_periodic->get_corresponding_pos(*e2);
2146 
2147  // If the edge is getting constrained
2148  // to itself by this PBC then we don't
2149  // generate any constraints
2150  if (neigh_pt1.absolute_fuzzy_equals
2151  (*e1, primary_hmin*TOLERANCE) &&
2152  neigh_pt2.absolute_fuzzy_equals
2153  (*e2, primary_hmin*TOLERANCE))
2154  continue;
2155 
2156  // Otherwise we'll have a constraint in
2157  // one direction or another
2158  if (!primary_elem)
2159  primary_elem = elem;
2160 
2161  const Elem * primary_neigh = primary_boundary_edge_neighbor
2162  (neigh, neigh_pt1, neigh_pt2,
2163  mesh.get_boundary_info(), edge_pairedids);
2164 
2165  libmesh_assert(primary_neigh);
2166 
2167  if (new_boundary_id == boundary_id)
2168  {
2169  main_neigh = primary_neigh;
2170  main_pt1 = neigh_pt1;
2171  main_pt2 = neigh_pt2;
2172  }
2173 
2174  // If we have a one-element thick mesh,
2175  // we'll need to sort our points to get a
2176  // consistent ordering rule
2177  //
2178  // Use >= in this test to make sure that,
2179  // for angular constraints, no node gets
2180  // constrained to itself.
2181  if (primary_neigh == primary_elem)
2182  {
2183  if (primary_pt1 > primary_pt2)
2184  std::swap(primary_pt1, primary_pt2);
2185  if (neigh_pt1 > neigh_pt2)
2186  std::swap(neigh_pt1, neigh_pt2);
2187 
2188  if (neigh_pt2 >= primary_pt2)
2189  continue;
2190  }
2191 
2192  // Otherwise:
2193  // Finer elements will get constrained in
2194  // terms of coarser ones, not the other way
2195  // around
2196  if ((primary_neigh->level() > primary_elem->level()) ||
2197 
2198  // For equal-level elements, the one with
2199  // higher id gets constrained in terms of
2200  // the one with lower id
2201  (primary_neigh->level() == primary_elem->level() &&
2202  primary_neigh->id() > primary_elem->id()))
2203  continue;
2204 
2205  primary_elem = primary_neigh;
2206  primary_pt1 = neigh_pt1;
2207  primary_pt2 = neigh_pt2;
2208  }
2209 
2210  if (!primary_elem ||
2211  primary_elem != main_neigh ||
2212  primary_pt1 != main_pt1 ||
2213  primary_pt2 != main_pt2)
2214  continue;
2215  }
2216  else if (elem->is_face(n))
2217  {
2218  // If we have a one-element thick mesh,
2219  // use the ordering of the face node and its
2220  // periodic counterpart to determine what
2221  // gets constrained
2222  if (neigh == elem)
2223  {
2224  const Point neigh_pt =
2225  periodic->get_corresponding_pos(my_node);
2226  if (neigh_pt > my_node)
2227  continue;
2228  }
2229 
2230  // Otherwise:
2231  // Finer elements will get constrained in
2232  // terms of coarser ones, not the other way
2233  // around
2234  if ((neigh->level() > elem->level()) ||
2235 
2236  // For equal-level elements, the one with
2237  // higher id gets constrained in terms of
2238  // the one with lower id
2239  (neigh->level() == elem->level() &&
2240  neigh->id() > elem->id()))
2241  continue;
2242  }
2243 
2244  // If we made it here without hitting a continue
2245  // statement, then we're at a node whose dofs
2246  // should be constrained by this element's
2247  // calculations.
2248  const unsigned int n_comp =
2249  my_node.n_comp(sys_number, variable_number);
2250 
2251  for (unsigned int i=0; i != n_comp; ++i)
2252  my_constrained_dofs.insert
2253  (my_node.dof_number
2254  (sys_number, variable_number, i));
2255  }
2256 
2257  // FIXME: old code for disambiguating periodic BCs:
2258  // this is not threadsafe nor safe to run on a
2259  // non-serialized mesh.
2260  /*
2261  std::vector<bool> recursive_constraint(n_side_dofs, false);
2262 
2263  for (unsigned int is = 0; is != n_side_dofs; ++is)
2264  {
2265  const unsigned int i = neigh_side_dofs[is];
2266  const dof_id_type their_dof_g = neigh_dof_indices[i];
2267  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
2268 
2269  {
2270  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
2271 
2272  if (!dof_map.is_constrained_dof(their_dof_g))
2273  continue;
2274  }
2275 
2276  DofConstraintRow & their_constraint_row =
2277  constraints[their_dof_g].first;
2278 
2279  for (unsigned int js = 0; js != n_side_dofs; ++js)
2280  {
2281  const unsigned int j = my_side_dofs[js];
2282  const dof_id_type my_dof_g = my_dof_indices[j];
2283  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
2284 
2285  if (their_constraint_row.count(my_dof_g))
2286  recursive_constraint[js] = true;
2287  }
2288  }
2289  */
2290 
2291  for (unsigned int js = 0; js != n_side_dofs; ++js)
2292  {
2293  // FIXME: old code path
2294  // if (recursive_constraint[js])
2295  // continue;
2296 
2297  const unsigned int j = my_side_dofs[js];
2298  const dof_id_type my_dof_g = my_dof_indices[j];
2299  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
2300 
2301  // FIXME: new code path
2302  if (!my_constrained_dofs.count(my_dof_g))
2303  continue;
2304 
2305  DofConstraintRow * constraint_row;
2306 
2307  // we may be running constraint methods concurrently
2308  // on multiple threads, so we need a lock to
2309  // ensure that this constraint is "ours"
2310  {
2311  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
2312 
2313  if (dof_map.is_constrained_dof(my_dof_g))
2314  continue;
2315 
2316  constraint_row = &(constraints[my_dof_g]);
2317  libmesh_assert(constraint_row->empty());
2318  }
2319 
2320  for (unsigned int is = 0; is != n_side_dofs; ++is)
2321  {
2322  const unsigned int i = neigh_side_dofs[is];
2323  const dof_id_type their_dof_g = neigh_dof_indices[i];
2324  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
2325 
2326  // Periodic constraints should never be
2327  // self-constraints
2328  // libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
2329 
2330  const Real their_dof_value = Ue[is](js);
2331 
2332  if (their_dof_g == my_dof_g)
2333  {
2334  libmesh_assert_less (std::abs(their_dof_value-1.), 1.e-5);
2335  for (unsigned int k = 0; k != n_side_dofs; ++k)
2336  libmesh_assert(k == is || std::abs(Ue[k](js)) < 1.e-5);
2337  continue;
2338  }
2339 
2340  if (std::abs(their_dof_value) < 10*TOLERANCE)
2341  continue;
2342 
2343  if(!periodic->has_transformation_matrix())
2344  {
2345  constraint_row->insert(std::make_pair(their_dof_g,
2346  their_dof_value));
2347  }
2348  else
2349  {
2350  // In this case the current variable is constrained in terms of other variables.
2351  // We assume that all variables in this constraint have the same FE type (this
2352  // is asserted below), and hence we can create the constraint row contribution
2353  // by multiplying their_dof_value by the corresponding row of the transformation
2354  // matrix.
2355 
2356  const std::set<unsigned int> & variables = periodic->get_variables();
2357  neigh_dof_indices_all_variables.resize(variables.size());
2358  unsigned int index = 0;
2359  for(unsigned int other_var : variables)
2360  {
2361  libmesh_assert_msg(base_fe_type == dof_map.variable_type(other_var), "FE types must match for all variables involved in constraint");
2362 
2363  Real var_weighting = periodic->get_transformation_matrix()(variable_number, other_var);
2364  constraint_row->insert(std::make_pair(neigh_dof_indices_all_variables[index][i],
2365  var_weighting*their_dof_value));
2366  index++;
2367  }
2368  }
2369 
2370  }
2371  }
2372  }
2373  // p refinement constraints:
2374  // constrain dofs shared between
2375  // active elements and neighbors with
2376  // lower polynomial degrees
2377 #ifdef LIBMESH_ENABLE_AMR
2378  const unsigned int min_p_level =
2379  neigh->min_p_level_by_neighbor(elem, elem->p_level());
2380  if (min_p_level < elem->p_level())
2381  {
2382  // Adaptive p refinement of non-hierarchic bases will
2383  // require more coding
2384  libmesh_assert(my_fe->is_hierarchic());
2385  dof_map.constrain_p_dofs(variable_number, elem,
2386  s, min_p_level);
2387  }
2388 #endif // #ifdef LIBMESH_ENABLE_AMR
2389  }
2390  }
2391  }
2392 }
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
double abs(double a)
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:833
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
const unsigned int invalid_uint
Definition: libmesh.h:245
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
virtual bool is_face(const unsigned int i) const =0
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1930
const std::set< unsigned int > & get_variables() const
void resize(const unsigned int n)
Definition: dense_vector.h:355
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1792
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
The base class for all geometric element types.
Definition: elem.h:100
MeshBase & mesh
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Definition: int_range.h:104
PeriodicBoundaryBase * boundary(boundary_id_type id)
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
Order default_quadrature_order() const
Definition: fe_type.h:333
unsigned int p_level() const
Definition: elem.h:2555
static const Real TOLERANCE
const BoundaryInfo & get_boundary_info() const
Definition: mesh_base.h:131
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1870
unsigned int sys_number() const
Definition: dof_map.h:1744
std::vector< boundary_id_type > boundary_ids(const Node *node) const
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
virtual Point get_corresponding_pos(const Point &pt) const =0
spin_mutex spin_mtx
Definition: threads.C:29
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1979
dof_id_type id() const
Definition: dof_object.h:655
virtual Real hmin() const
Definition: elem.C:356
virtual unsigned int n_nodes() const =0
bool is_constrained_dof(const dof_id_type dof) const
Definition: dof_map.h:1829
virtual unsigned int n_edges() const =0
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
Definition: type_vector.h:965
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503
const DenseMatrix< Real > & get_transformation_matrix() const
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side) const
virtual unsigned short dim() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957
virtual bool is_vertex(const unsigned int i) const =0
void swap(Iterator &lhs, Iterator &rhs)
bool is_my_variable(unsigned int var_num) const
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
Definition: dof_map.h:97
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:792
Implements 1, 2, and 3D "Gaussian" quadrature rules.
Base class for all PeriodicBoundary implementations.
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
bool active() const
Definition: elem.h:2390
long double min(long double a, double b)
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual bool is_edge(const unsigned int i) const =0
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
void constrain_p_dofs(unsigned int var, const Elem *elem, unsigned int s, unsigned int p)
uint8_t dof_id_type
Definition: id_types.h:64

◆ compute_periodic_node_constraints()

void libMesh::FEAbstract::compute_periodic_node_constraints ( NodeConstraints constraints,
const PeriodicBoundaries boundaries,
const MeshBase mesh,
const PointLocatorBase point_locator,
const Elem elem 
)
staticinherited

Computes the node position constraint equation contributions (for meshes with periodic boundary conditions)

Definition at line 965 of file fe_abstract.C.

References libMesh::Elem::active(), libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), mesh, libMesh::FEInterface::n_dofs(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), libMesh::PeriodicBoundaryBase::pairedboundary, libMesh::Real, libMesh::FEInterface::shape(), libMesh::Elem::side_index_range(), and libMesh::Threads::spin_mtx.

970 {
971  // Only bother if we truly have periodic boundaries
972  if (boundaries.empty())
973  return;
974 
975  libmesh_assert(elem);
976 
977  // Only constrain active elements with this method
978  if (!elem->active())
979  return;
980 
981  const unsigned int Dim = elem->dim();
982 
983  // We currently always use LAGRANGE mappings for geometry
984  const FEType fe_type(elem->default_order(), LAGRANGE);
985 
986  // Pull objects out of the loop to reduce heap operations
987  std::vector<const Node *> my_nodes, neigh_nodes;
988  std::unique_ptr<const Elem> my_side, neigh_side;
989 
990  // Look at the element faces. Check to see if we need to
991  // build constraints.
992  std::vector<boundary_id_type> bc_ids;
993  for (auto s : elem->side_index_range())
994  {
995  if (elem->neighbor_ptr(s))
996  continue;
997 
998  mesh.get_boundary_info().boundary_ids (elem, s, bc_ids);
999  for (const auto & boundary_id : bc_ids)
1000  {
1001  const PeriodicBoundaryBase * periodic = boundaries.boundary(boundary_id);
1002  if (periodic)
1003  {
1004  libmesh_assert(point_locator);
1005 
1006  // Get pointers to the element's neighbor.
1007  const Elem * neigh = boundaries.neighbor(boundary_id, *point_locator, elem, s);
1008 
1009  // h refinement constraints:
1010  // constrain dofs shared between
1011  // this element and ones as coarse
1012  // as or coarser than this element.
1013  if (neigh->level() <= elem->level())
1014  {
1015  unsigned int s_neigh =
1016  mesh.get_boundary_info().side_with_boundary_id(neigh, periodic->pairedboundary);
1017  libmesh_assert_not_equal_to (s_neigh, libMesh::invalid_uint);
1018 
1019 #ifdef LIBMESH_ENABLE_AMR
1020  libmesh_assert(neigh->active());
1021 #endif // #ifdef LIBMESH_ENABLE_AMR
1022 
1023  elem->build_side_ptr(my_side, s);
1024  neigh->build_side_ptr(neigh_side, s_neigh);
1025 
1026  const unsigned int n_side_nodes = my_side->n_nodes();
1027 
1028  my_nodes.clear();
1029  my_nodes.reserve (n_side_nodes);
1030  neigh_nodes.clear();
1031  neigh_nodes.reserve (n_side_nodes);
1032 
1033  for (unsigned int n=0; n != n_side_nodes; ++n)
1034  my_nodes.push_back(my_side->node_ptr(n));
1035 
1036  for (unsigned int n=0; n != n_side_nodes; ++n)
1037  neigh_nodes.push_back(neigh_side->node_ptr(n));
1038 
1039  // Make sure we're not adding recursive constraints
1040  // due to the redundancy in the way we add periodic
1041  // boundary constraints, or adding constraints to
1042  // nodes that already have AMR constraints
1043  std::vector<bool> skip_constraint(n_side_nodes, false);
1044 
1045  for (unsigned int my_side_n=0;
1046  my_side_n < n_side_nodes;
1047  my_side_n++)
1048  {
1049  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1050 
1051  const Node * my_node = my_nodes[my_side_n];
1052 
1053  // Figure out where my node lies on their reference element.
1054  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1055 
1056  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1057  neigh_side.get(),
1058  neigh_point);
1059 
1060  // If we've already got a constraint on this
1061  // node, then the periodic constraint is
1062  // redundant
1063  {
1064  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1065 
1066  if (constraints.count(my_node))
1067  {
1068  skip_constraint[my_side_n] = true;
1069  continue;
1070  }
1071  }
1072 
1073  // Compute the neighbors's side shape function values.
1074  for (unsigned int their_side_n=0;
1075  their_side_n < n_side_nodes;
1076  their_side_n++)
1077  {
1078  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1079 
1080  const Node * their_node = neigh_nodes[their_side_n];
1081 
1082  // If there's a constraint on an opposing node,
1083  // we need to see if it's constrained by
1084  // *our side* making any periodic constraint
1085  // on us recursive
1086  {
1087  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1088 
1089  if (!constraints.count(their_node))
1090  continue;
1091 
1092  const NodeConstraintRow & their_constraint_row =
1093  constraints[their_node].first;
1094 
1095  for (unsigned int orig_side_n=0;
1096  orig_side_n < n_side_nodes;
1097  orig_side_n++)
1098  {
1099  libmesh_assert_less (orig_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1100 
1101  const Node * orig_node = my_nodes[orig_side_n];
1102 
1103  if (their_constraint_row.count(orig_node))
1104  skip_constraint[orig_side_n] = true;
1105  }
1106  }
1107  }
1108  }
1109  for (unsigned int my_side_n=0;
1110  my_side_n < n_side_nodes;
1111  my_side_n++)
1112  {
1113  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1114 
1115  if (skip_constraint[my_side_n])
1116  continue;
1117 
1118  const Node * my_node = my_nodes[my_side_n];
1119 
1120  // Figure out where my node lies on their reference element.
1121  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1122 
1123  // Figure out where my node lies on their reference element.
1124  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1125  neigh_side.get(),
1126  neigh_point);
1127 
1128  for (unsigned int their_side_n=0;
1129  their_side_n < n_side_nodes;
1130  their_side_n++)
1131  {
1132  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1133 
1134  const Node * their_node = neigh_nodes[their_side_n];
1135  libmesh_assert(their_node);
1136 
1137  const Real their_value = FEInterface::shape(Dim-1,
1138  fe_type,
1139  neigh_side->type(),
1140  their_side_n,
1141  mapped_point);
1142 
1143  // since we may be running this method concurrently
1144  // on multiple threads we need to acquire a lock
1145  // before modifying the shared constraint_row object.
1146  {
1147  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1148 
1149  NodeConstraintRow & constraint_row =
1150  constraints[my_node].first;
1151 
1152  constraint_row.insert(std::make_pair(their_node,
1153  their_value));
1154  }
1155  }
1156  }
1157  }
1158  }
1159  }
1160  }
1161 }
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:454
const unsigned int invalid_uint
Definition: libmesh.h:245
MeshBase & mesh
spin_mutex spin_mtx
Definition: threads.C:29
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:657
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)
Definition: fe_interface.C:590
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:145

◆ compute_proj_constraints()

void libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
staticinherited

Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using generic projections.

Definition at line 1366 of file fe_base.C.

References std::abs(), libMesh::Elem::active(), libMesh::C_ONE, libMesh::C_ZERO, libMesh::DenseMatrix< T >::cholesky_solve(), libMesh::DofMap::constrain_p_dofs(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::DISCONTINUOUS, libMesh::DofMap::dof_indices(), libMesh::FEInterface::dofs_on_side(), libMesh::OrderWrapper::get_order(), libMesh::TensorTools::inner_product(), libMesh::DofObject::invalid_id, libMesh::FEInterface::inverse_map(), libMesh::DofMap::is_constrained_dof(), libMesh::Elem::level(), std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::Real, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::Elem::side_index_range(), libMesh::Threads::spin_mtx, libMesh::TOLERANCE, libMesh::DofMap::variable_type(), and libMesh::Elem::which_neighbor_am_i().

1370 {
1371  libmesh_assert(elem);
1372 
1373  const unsigned int Dim = elem->dim();
1374 
1375  // Only constrain elements in 2,3D.
1376  if (Dim == 1)
1377  return;
1378 
1379  // Only constrain active elements with this method
1380  if (!elem->active())
1381  return;
1382 
1383  const FEType & base_fe_type = dof_map.variable_type(variable_number);
1384 
1385  // Construct FE objects for this element and its neighbors.
1386  std::unique_ptr<FEGenericBase<OutputShape>> my_fe
1387  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1388  const FEContinuity cont = my_fe->get_continuity();
1389 
1390  // We don't need to constrain discontinuous elements
1391  if (cont == DISCONTINUOUS)
1392  return;
1393  libmesh_assert (cont == C_ZERO || cont == C_ONE);
1394 
1395  std::unique_ptr<FEGenericBase<OutputShape>> neigh_fe
1396  (FEGenericBase<OutputShape>::build(Dim, base_fe_type));
1397 
1398  QGauss my_qface(Dim-1, base_fe_type.default_quadrature_order());
1399  my_fe->attach_quadrature_rule (&my_qface);
1400  std::vector<Point> neigh_qface;
1401 
1402  const std::vector<Real> & JxW = my_fe->get_JxW();
1403  const std::vector<Point> & q_point = my_fe->get_xyz();
1404  const std::vector<std::vector<OutputShape>> & phi = my_fe->get_phi();
1405  const std::vector<std::vector<OutputShape>> & neigh_phi =
1406  neigh_fe->get_phi();
1407  const std::vector<Point> * face_normals = nullptr;
1408  const std::vector<std::vector<OutputGradient>> * dphi = nullptr;
1409  const std::vector<std::vector<OutputGradient>> * neigh_dphi = nullptr;
1410 
1411  std::vector<dof_id_type> my_dof_indices, neigh_dof_indices;
1412  std::vector<unsigned int> my_side_dofs, neigh_side_dofs;
1413 
1414  if (cont != C_ZERO)
1415  {
1416  const std::vector<Point> & ref_face_normals =
1417  my_fe->get_normals();
1418  face_normals = &ref_face_normals;
1419  const std::vector<std::vector<OutputGradient>> & ref_dphi =
1420  my_fe->get_dphi();
1421  dphi = &ref_dphi;
1422  const std::vector<std::vector<OutputGradient>> & ref_neigh_dphi =
1423  neigh_fe->get_dphi();
1424  neigh_dphi = &ref_neigh_dphi;
1425  }
1426 
1427  DenseMatrix<Real> Ke;
1428  DenseVector<Real> Fe;
1429  std::vector<DenseVector<Real>> Ue;
1430 
1431  // Look at the element faces. Check to see if we need to
1432  // build constraints.
1433  for (auto s : elem->side_index_range())
1434  if (elem->neighbor_ptr(s) != nullptr)
1435  {
1436  // Get pointers to the element's neighbor.
1437  const Elem * neigh = elem->neighbor_ptr(s);
1438 
1439  // h refinement constraints:
1440  // constrain dofs shared between
1441  // this element and ones coarser
1442  // than this element.
1443  if (neigh->level() < elem->level())
1444  {
1445  unsigned int s_neigh = neigh->which_neighbor_am_i(elem);
1446  libmesh_assert_less (s_neigh, neigh->n_neighbors());
1447 
1448  // Find the minimum p level; we build the h constraint
1449  // matrix with this and then constrain away all higher p
1450  // DoFs.
1451  libmesh_assert(neigh->active());
1452  const unsigned int min_p_level =
1453  std::min(elem->p_level(), neigh->p_level());
1454 
1455  // we may need to make the FE objects reinit with the
1456  // minimum shared p_level
1457  const unsigned int old_elem_level = elem->p_level();
1458  if (elem->p_level() != min_p_level)
1459  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() - old_elem_level + min_p_level);
1460  const unsigned int old_neigh_level = neigh->p_level();
1461  if (old_neigh_level != min_p_level)
1462  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() - old_neigh_level + min_p_level);
1463 
1464  my_fe->reinit(elem, s);
1465 
1466  // This function gets called element-by-element, so there
1467  // will be a lot of memory allocation going on. We can
1468  // at least minimize this for the case of the dof indices
1469  // by efficiently preallocating the requisite storage.
1470  // n_nodes is not necessarily n_dofs, but it is better
1471  // than nothing!
1472  my_dof_indices.reserve (elem->n_nodes());
1473  neigh_dof_indices.reserve (neigh->n_nodes());
1474 
1475  dof_map.dof_indices (elem, my_dof_indices,
1476  variable_number,
1477  min_p_level);
1478  dof_map.dof_indices (neigh, neigh_dof_indices,
1479  variable_number,
1480  min_p_level);
1481 
1482  const unsigned int n_qp = my_qface.n_points();
1483 
1484  FEInterface::inverse_map (Dim, base_fe_type, neigh,
1485  q_point, neigh_qface);
1486 
1487  neigh_fe->reinit(neigh, &neigh_qface);
1488 
1489  // We're only concerned with DOFs whose values (and/or first
1490  // derivatives for C1 elements) are supported on side nodes
1491  FEType elem_fe_type = base_fe_type;
1492  if (old_elem_level != min_p_level)
1493  elem_fe_type.order = base_fe_type.order.get_order() - old_elem_level + min_p_level;
1494  FEType neigh_fe_type = base_fe_type;
1495  if (old_neigh_level != min_p_level)
1496  neigh_fe_type.order = base_fe_type.order.get_order() - old_neigh_level + min_p_level;
1497  FEInterface::dofs_on_side(elem, Dim, elem_fe_type, s, my_side_dofs);
1498  FEInterface::dofs_on_side(neigh, Dim, neigh_fe_type, s_neigh, neigh_side_dofs);
1499 
1500  const unsigned int n_side_dofs =
1501  cast_int<unsigned int>(my_side_dofs.size());
1502  libmesh_assert_equal_to (n_side_dofs, neigh_side_dofs.size());
1503 
1504  Ke.resize (n_side_dofs, n_side_dofs);
1505  Ue.resize(n_side_dofs);
1506 
1507  // Form the projection matrix, (inner product of fine basis
1508  // functions against fine test functions)
1509  for (unsigned int is = 0; is != n_side_dofs; ++is)
1510  {
1511  const unsigned int i = my_side_dofs[is];
1512  for (unsigned int js = 0; js != n_side_dofs; ++js)
1513  {
1514  const unsigned int j = my_side_dofs[js];
1515  for (unsigned int qp = 0; qp != n_qp; ++qp)
1516  {
1517  Ke(is,js) += JxW[qp] * TensorTools::inner_product(phi[i][qp], phi[j][qp]);
1518  if (cont != C_ZERO)
1519  Ke(is,js) += JxW[qp] *
1520  TensorTools::inner_product((*dphi)[i][qp] *
1521  (*face_normals)[qp],
1522  (*dphi)[j][qp] *
1523  (*face_normals)[qp]);
1524  }
1525  }
1526  }
1527 
1528  // Form the right hand sides, (inner product of coarse basis
1529  // functions against fine test functions)
1530  for (unsigned int is = 0; is != n_side_dofs; ++is)
1531  {
1532  const unsigned int i = neigh_side_dofs[is];
1533  Fe.resize (n_side_dofs);
1534  for (unsigned int js = 0; js != n_side_dofs; ++js)
1535  {
1536  const unsigned int j = my_side_dofs[js];
1537  for (unsigned int qp = 0; qp != n_qp; ++qp)
1538  {
1539  Fe(js) += JxW[qp] *
1540  TensorTools::inner_product(neigh_phi[i][qp],
1541  phi[j][qp]);
1542  if (cont != C_ZERO)
1543  Fe(js) += JxW[qp] *
1544  TensorTools::inner_product((*neigh_dphi)[i][qp] *
1545  (*face_normals)[qp],
1546  (*dphi)[j][qp] *
1547  (*face_normals)[qp]);
1548  }
1549  }
1550  Ke.cholesky_solve(Fe, Ue[is]);
1551  }
1552 
1553  for (unsigned int js = 0; js != n_side_dofs; ++js)
1554  {
1555  const unsigned int j = my_side_dofs[js];
1556  const dof_id_type my_dof_g = my_dof_indices[j];
1557  libmesh_assert_not_equal_to (my_dof_g, DofObject::invalid_id);
1558 
1559  // Hunt for "constraining against myself" cases before
1560  // we bother creating a constraint row
1561  bool self_constraint = false;
1562  for (unsigned int is = 0; is != n_side_dofs; ++is)
1563  {
1564  const unsigned int i = neigh_side_dofs[is];
1565  const dof_id_type their_dof_g = neigh_dof_indices[i];
1566  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1567 
1568  if (their_dof_g == my_dof_g)
1569  {
1570 #ifndef NDEBUG
1571  const Real their_dof_value = Ue[is](js);
1572  libmesh_assert_less (std::abs(their_dof_value-1.),
1573  10*TOLERANCE);
1574 
1575  for (unsigned int k = 0; k != n_side_dofs; ++k)
1576  libmesh_assert(k == is ||
1577  std::abs(Ue[k](js)) <
1578  10*TOLERANCE);
1579 #endif
1580 
1581  self_constraint = true;
1582  break;
1583  }
1584  }
1585 
1586  if (self_constraint)
1587  continue;
1588 
1589  DofConstraintRow * constraint_row;
1590 
1591  // we may be running constraint methods concurrently
1592  // on multiple threads, so we need a lock to
1593  // ensure that this constraint is "ours"
1594  {
1595  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1596 
1597  if (dof_map.is_constrained_dof(my_dof_g))
1598  continue;
1599 
1600  constraint_row = &(constraints[my_dof_g]);
1601  libmesh_assert(constraint_row->empty());
1602  }
1603 
1604  for (unsigned int is = 0; is != n_side_dofs; ++is)
1605  {
1606  const unsigned int i = neigh_side_dofs[is];
1607  const dof_id_type their_dof_g = neigh_dof_indices[i];
1608  libmesh_assert_not_equal_to (their_dof_g, DofObject::invalid_id);
1609  libmesh_assert_not_equal_to (their_dof_g, my_dof_g);
1610 
1611  const Real their_dof_value = Ue[is](js);
1612 
1613  if (std::abs(their_dof_value) < 10*TOLERANCE)
1614  continue;
1615 
1616  constraint_row->insert(std::make_pair(their_dof_g,
1617  their_dof_value));
1618  }
1619  }
1620 
1621  my_fe->set_fe_order(my_fe->get_fe_type().order.get_order() + old_elem_level - min_p_level);
1622  neigh_fe->set_fe_order(neigh_fe->get_fe_type().order.get_order() + old_neigh_level - min_p_level);
1623  }
1624 
1625  // p refinement constraints:
1626  // constrain dofs shared between
1627  // active elements and neighbors with
1628  // lower polynomial degrees
1629  const unsigned int min_p_level =
1630  neigh->min_p_level_by_neighbor(elem, elem->p_level());
1631  if (min_p_level < elem->p_level())
1632  {
1633  // Adaptive p refinement of non-hierarchic bases will
1634  // require more coding
1635  libmesh_assert(my_fe->is_hierarchic());
1636  dof_map.constrain_p_dofs(variable_number, elem,
1637  s, min_p_level);
1638  }
1639  }
1640 }
Manages the family, order, etc. parameters for a given FE.
Definition: fe_type.h:179
double abs(double a)
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2166
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:1930
void resize(const unsigned int n)
Definition: dense_vector.h:355
const FEType & variable_type(const unsigned int c) const
Definition: dof_map.h:1792
The base class for all geometric element types.
Definition: elem.h:100
Order default_quadrature_order() const
Definition: fe_type.h:333
unsigned int p_level() const
Definition: elem.h:2555
OrderWrapper order
Definition: fe_type.h:198
static const Real TOLERANCE
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1870
spin_mutex spin_mtx
Definition: threads.C:29
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498
virtual unsigned int n_nodes() const =0
unsigned int which_neighbor_am_i(const Elem *e) const
Definition: elem.h:2314
bool is_constrained_dof(const dof_id_type dof) const
Definition: dof_map.h:1829
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503
int get_order() const
Definition: fe_type.h:78
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
unsigned int n_neighbors() const
Definition: elem.h:644
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
Definition: dof_map.h:97
void resize(const unsigned int new_m, const unsigned int new_n)
Definition: dense_matrix.h:792
Implements 1, 2, and 3D "Gaussian" quadrature rules.
void cholesky_solve(const DenseVector< T2 > &b, DenseVector< T2 > &x)
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
bool active() const
Definition: elem.h:2390
long double min(long double a, double b)
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product(const T &a, const T2 &b)
Definition: tensor_tools.h:47
void constrain_p_dofs(unsigned int var, const Elem *elem, unsigned int s, unsigned int p)
uint8_t dof_id_type
Definition: id_types.h:64

◆ compute_shape_functions()

void libMesh::FEGenericBase< FEOutputType< T >::type >::compute_shape_functions ( const Elem elem,
const std::vector< Point > &  qp 
)
protectedvirtualinherited

After having updated the jacobian and the transformation from local to global coordinates in FEAbstract::compute_map(), the first derivatives of the shape functions are transformed to global coordinates, giving dphi, dphidx, dphidy, and dphidz. This method should rarely be re-defined in derived classes, but still should be usable for children. Therefore, keep it protected.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FEXYZ< Dim >.

Definition at line 669 of file fe_base.C.

671 {
672  //-------------------------------------------------------------------------
673  // Compute the shape function values (and derivatives)
674  // at the Quadrature points. Note that the actual values
675  // have already been computed via init_shape_functions
676 
677  // Start logging the shape function computation
678  LOG_SCOPE("compute_shape_functions()", "FE");
679 
680  this->determine_calculations();
681 
682  if (calculate_phi)
683  this->_fe_trans->map_phi(this->dim, elem, qp, (*this), this->phi);
684 
685  if (calculate_dphi)
686  this->_fe_trans->map_dphi(this->dim, elem, qp, (*this), this->dphi,
687  this->dphidx, this->dphidy, this->dphidz);
688 
689 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
690  if (calculate_d2phi)
691  this->_fe_trans->map_d2phi(this->dim, qp, (*this), this->d2phi,
692  this->d2phidx2, this->d2phidxdy, this->d2phidxdz,
693  this->d2phidy2, this->d2phidydz, this->d2phidz2);
694 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
695 
696  // Only compute curl for vector-valued elements
698  this->_fe_trans->map_curl(this->dim, elem, qp, (*this), this->curl_phi);
699 
700  // Only compute div for vector-valued elements
702  this->_fe_trans->map_div(this->dim, elem, qp, (*this), this->div_phi);
703 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:551
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:596
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:606
std::unique_ptr< FETransformationBase< FEOutputType< T >::type > > _fe_trans
Definition: fe_base.h:493
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:586
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:508
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:538
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:601
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:591
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:533
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498
const unsigned int dim
Definition: fe_abstract.h:531
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:513
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:611
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:543

◆ determine_calculations()

void libMesh::FEGenericBase< FEOutputType< T >::type >::determine_calculations ( )
protectedinherited

Determine which values are to be calculated, for both the FE itself and for the FEMap.

Definition at line 728 of file fe_base.C.

References libMesh::FEInterface::field_type(), and libMesh::TYPE_VECTOR.

729 {
730  this->calculations_started = true;
731 
732  // If the user forgot to request anything, we'll be safe and
733  // calculate everything:
734 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
735  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_d2phi
736  && !this->calculate_curl_phi && !this->calculate_div_phi)
737  {
738  this->calculate_phi = this->calculate_dphi = this->calculate_d2phi = this->calculate_dphiref = true;
739  if (FEInterface::field_type(fe_type.family) == TYPE_VECTOR)
740  {
741  this->calculate_curl_phi = true;
742  this->calculate_div_phi = true;
743  }
744  }
745 #else
746  if (!this->calculate_phi && !this->calculate_dphi && !this->calculate_curl_phi && !this->calculate_div_phi)
747  {
748  this->calculate_phi = this->calculate_dphi = this->calculate_dphiref = true;
749  if (FEInterface::field_type(fe_type.family) == TYPE_VECTOR)
750  {
751  this->calculate_curl_phi = true;
752  this->calculate_div_phi = true;
753  }
754  }
755 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES
756 
757  // Request whichever terms are necessary from the FEMap
758  if (this->calculate_phi)
759  this->_fe_trans->init_map_phi(*this);
760 
761  if (this->calculate_dphiref)
762  this->_fe_trans->init_map_dphi(*this);
763 
764 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
765  if (this->calculate_d2phi)
766  this->_fe_trans->init_map_d2phi(*this);
767 #endif //LIBMESH_ENABLE_SECOND_DERIVATIVES
768 }
FEFamily family
Definition: fe_type.h:204
std::unique_ptr< FETransformationBase< FEOutputType< T >::type > > _fe_trans
Definition: fe_base.h:493

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

107 {
108  _enable_print_counter = false;
109  return;
110 }

◆ dofs_on_edge() [1/2]

void libMesh::FE< Dim, T >::dofs_on_edge ( const Elem *const  elem,
const Order  o,
unsigned int  e,
std::vector< unsigned int > &  di 
)
staticinherited

Fills the vector di with the local degree of freedom indices associated with edge e of element elem

On a p-refined element, o should be the base order of the element.

Definition at line 103 of file fe.C.

107 {
108  libmesh_assert(elem);
109  libmesh_assert_less (e, elem->n_edges());
110 
111  di.clear();
112  unsigned int nodenum = 0;
113  const unsigned int n_nodes = elem->n_nodes();
114  for (unsigned int n = 0; n != n_nodes; ++n)
115  {
116  const unsigned int n_dofs = n_dofs_at_node(elem->type(),
117  static_cast<Order>(o + elem->p_level()), n);
118  if (elem->is_node_on_edge(n, e))
119  for (unsigned int i = 0; i != n_dofs; ++i)
120  di.push_back(nodenum++);
121  else
122  nodenum += n_dofs;
123  }
124 }
static unsigned int n_dofs(const ElemType t, const Order o)
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
const dof_id_type n_nodes
Definition: tecplot_io.C:68

◆ dofs_on_edge() [2/2]

void libMesh::FE< 2, SUBDIVISION >::dofs_on_edge ( const Elem const,
const Order  ,
unsigned  int,
std::vector< unsigned int > &  di 
)
inherited

Definition at line 907 of file fe_subdivision_2D.C.

907 { di.resize(0); }

◆ dofs_on_side() [1/2]

void libMesh::FE< Dim, T >::dofs_on_side ( const Elem *const  elem,
const Order  o,
unsigned int  s,
std::vector< unsigned int > &  di 
)
staticinherited

Fills the vector di with the local degree of freedom indices associated with side s of element elem

On a p-refined element, o should be the base order of the element.

Definition at line 77 of file fe.C.

81 {
82  libmesh_assert(elem);
83  libmesh_assert_less (s, elem->n_sides());
84 
85  di.clear();
86  unsigned int nodenum = 0;
87  const unsigned int n_nodes = elem->n_nodes();
88  for (unsigned int n = 0; n != n_nodes; ++n)
89  {
90  const unsigned int n_dofs = n_dofs_at_node(elem->type(),
91  static_cast<Order>(o + elem->p_level()), n);
92  if (elem->is_node_on_side(n, s))
93  for (unsigned int i = 0; i != n_dofs; ++i)
94  di.push_back(nodenum++);
95  else
96  nodenum += n_dofs;
97  }
98 }
static unsigned int n_dofs(const ElemType t, const Order o)
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
const dof_id_type n_nodes
Definition: tecplot_io.C:68

◆ dofs_on_side() [2/2]

void libMesh::FE< 2, SUBDIVISION >::dofs_on_side ( const Elem const,
const Order  ,
unsigned  int,
std::vector< unsigned int > &  di 
)
inherited

Definition at line 906 of file fe_subdivision_2D.C.

906 { di.resize(0); }

◆ edge_reinit() [1/2]

void libMesh::FE< Dim, T >::edge_reinit ( const Elem elem,
const unsigned int  edge,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *const  pts = nullptr,
const std::vector< Real > *const  weights = nullptr 
)
overridevirtualinherited

Reinitializes all the physical element-dependent data based on the edge. The tolerance parameter is passed to the involved call to inverse_map(). By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference side element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 260 of file fe_boundary.C.

265 {
266  libmesh_assert(elem);
267  libmesh_assert (this->qrule != nullptr || pts != nullptr);
268  // We don't do this for 1D elements!
269  libmesh_assert_not_equal_to (Dim, 1);
270 
271  // We're (possibly re-) calculating now! Time to determine what.
272  // FIXME - we currently just assume that we're using JxW and calling
273  // edge_map later.
274  this->_fe_map->calculations_started = false;
275  this->_fe_map->get_JxW();
276  this->_fe_map->get_xyz();
277  this->determine_calculations();
278 
279  // Build the side of interest
280  const std::unique_ptr<const Elem> edge(elem->build_edge_ptr(e));
281 
282  // Initialize the shape functions at the user-specified
283  // points
284  if (pts != nullptr)
285  {
286  // The shape functions do not correspond to the qrule
287  this->shapes_on_quadrature = false;
288 
289  // Initialize the edge shape functions
290  this->_fe_map->template init_edge_shape_functions<Dim> (*pts, edge.get());
291 
292  // Compute the Jacobian*Weight on the face for integration
293  if (weights != nullptr)
294  {
295  this->_fe_map->compute_edge_map (Dim, *weights, edge.get());
296  }
297  else
298  {
299  std::vector<Real> dummy_weights (pts->size(), 1.);
300  this->_fe_map->compute_edge_map (Dim, dummy_weights, edge.get());
301  }
302  }
303  // If there are no user specified points, we use the
304  // quadrature rule
305  else
306  {
307  // initialize quadrature rule
308  this->qrule->init(edge->type(), elem->p_level());
309 
310  if (this->qrule->shapes_need_reinit())
311  this->shapes_on_quadrature = false;
312 
313  // We might not need to reinitialize the shape functions
314  if ((this->get_type() != elem->type()) ||
315  (edge->type() != static_cast<int>(last_edge)) || // Comparison between enum and unsigned, cast the unsigned to int
316  this->shapes_need_reinit() ||
317  !this->shapes_on_quadrature)
318  {
319  // Set the element type
320  this->elem_type = elem->type();
321 
322  // Set the last_edge
323  last_edge = edge->type();
324 
325  // Initialize the edge shape functions
326  this->_fe_map->template init_edge_shape_functions<Dim> (this->qrule->get_points(), edge.get());
327  }
328 
329  // Compute the Jacobian*Weight on the face for integration
330  this->_fe_map->compute_edge_map (Dim, this->qrule->get_weights(), edge.get());
331 
332  // The shape functions correspond to the qrule
333  this->shapes_on_quadrature = true;
334  }
335 
336  // make a copy of the Jacobian for integration
337  const std::vector<Real> JxW_int(this->_fe_map->get_JxW());
338 
339  // Find where the integration points are located on the
340  // full element.
341  std::vector<Point> qp;
342  this->inverse_map (elem, this->_fe_map->get_xyz(), qp, tolerance);
343 
344  // compute the shape function and derivative values
345  // at the points qp
346  this->reinit (elem, &qp);
347 
348  // copy back old data
349  this->_fe_map->get_JxW() = JxW_int;
350 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:231
unsigned int last_edge
Definition: fe.h:482
ElemType get_type() const
Definition: fe_abstract.h:418
const std::vector< Real > & get_weights() const
Definition: quadrature.h:154
virtual bool shapes_need_reinit() const override
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
Definition: fe.C:129
const std::vector< Point > & get_points() const
Definition: quadrature.h:142
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_map.C:1576

◆ edge_reinit() [2/2]

void libMesh::FE< 2, SUBDIVISION >::edge_reinit ( Elem const *  ,
unsigned int  ,
Real  ,
const std::vector< Point > *  const,
const std::vector< Real > *  const 
)
virtualinherited

Reinitializes all the physical element-dependent data based on the edge of the element elem. The tolerance parameter is passed to the involved call to inverse_map(). By default the element data are computed at the quadrature points specified by the quadrature rule qrule, but any set of points on the reference edge element may be specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 866 of file fe_subdivision_2D.C.

871 {
872  libmesh_not_implemented();
873 }

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }

◆ get_continuity() [1/54]

FEContinuity libMesh::FE< 0, SCALAR >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 107 of file fe_scalar.C.

◆ get_continuity() [2/54]

FEContinuity libMesh::FE< 1, SCALAR >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 108 of file fe_scalar.C.

◆ get_continuity() [3/54]

FEContinuity libMesh::FE< 2, SCALAR >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 109 of file fe_scalar.C.

◆ get_continuity() [4/54]

FEContinuity libMesh::FE< 3, SCALAR >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 110 of file fe_scalar.C.

◆ get_continuity() [5/54]

FEContinuity libMesh::FE< 0, L2_HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 193 of file fe_l2_hierarchic.C.

◆ get_continuity() [6/54]

FEContinuity libMesh::FE< 1, L2_HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 194 of file fe_l2_hierarchic.C.

◆ get_continuity() [7/54]

FEContinuity libMesh::FE< 2, L2_HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 195 of file fe_l2_hierarchic.C.

◆ get_continuity() [8/54]

FEContinuity libMesh::FE< 3, L2_HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 196 of file fe_l2_hierarchic.C.

◆ get_continuity() [9/54]

virtual FEContinuity libMesh::FE< Dim, T >::get_continuity ( ) const
overridevirtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

◆ get_continuity() [10/54]

FEContinuity libMesh::FE< 0, CLOUGH >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 290 of file fe_clough.C.

290 { return C_ONE; }

◆ get_continuity() [11/54]

FEContinuity libMesh::FE< 1, CLOUGH >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 291 of file fe_clough.C.

291 { return C_ONE; }

◆ get_continuity() [12/54]

FEContinuity libMesh::FE< 2, CLOUGH >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 292 of file fe_clough.C.

292 { return C_ONE; }

◆ get_continuity() [13/54]

FEContinuity libMesh::FE< 3, CLOUGH >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 293 of file fe_clough.C.

293 { return C_ONE; }

◆ get_continuity() [14/54]

FEContinuity libMesh::FE< 0, HERMITE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 340 of file fe_hermite.C.

340 { return C_ONE; }

◆ get_continuity() [15/54]

FEContinuity libMesh::FE< 1, HERMITE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 341 of file fe_hermite.C.

341 { return C_ONE; }

◆ get_continuity() [16/54]

FEContinuity libMesh::FE< 2, HERMITE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 342 of file fe_hermite.C.

342 { return C_ONE; }

◆ get_continuity() [17/54]

FEContinuity libMesh::FE< 3, HERMITE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 343 of file fe_hermite.C.

343 { return C_ONE; }

◆ get_continuity() [18/54]

FEContinuity libMesh::FE< 0, HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 369 of file fe_hierarchic.C.

369 { return C_ZERO; }

◆ get_continuity() [19/54]

FEContinuity libMesh::FE< 1, HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 370 of file fe_hierarchic.C.

370 { return C_ZERO; }

◆ get_continuity() [20/54]

FEContinuity libMesh::FE< 2, HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 371 of file fe_hierarchic.C.

371 { return C_ZERO; }

◆ get_continuity() [21/54]

FEContinuity libMesh::FE< 3, HIERARCHIC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 372 of file fe_hierarchic.C.

372 { return C_ZERO; }

◆ get_continuity() [22/54]

FEContinuity libMesh::FE< 0, MONOMIAL >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 402 of file fe_monomial.C.

◆ get_continuity() [23/54]

FEContinuity libMesh::FE< 1, MONOMIAL >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 403 of file fe_monomial.C.

◆ get_continuity() [24/54]

FEContinuity libMesh::FE< 2, MONOMIAL >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 404 of file fe_monomial.C.

◆ get_continuity() [25/54]

FEContinuity libMesh::FE< 3, MONOMIAL >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 405 of file fe_monomial.C.

◆ get_continuity() [26/54]

FEContinuity libMesh::FE< 0, BERNSTEIN >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 436 of file fe_bernstein.C.

436 { return C_ZERO; }

◆ get_continuity() [27/54]

FEContinuity libMesh::FE< 1, BERNSTEIN >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 437 of file fe_bernstein.C.

437 { return C_ZERO; }

◆ get_continuity() [28/54]

FEContinuity libMesh::FE< 2, BERNSTEIN >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 438 of file fe_bernstein.C.

438 { return C_ZERO; }

◆ get_continuity() [29/54]

FEContinuity libMesh::FE< 3, BERNSTEIN >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 439 of file fe_bernstein.C.

439 { return C_ZERO; }

◆ get_continuity() [30/54]

FEContinuity libMesh::FE< 0, L2_LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 474 of file fe_l2_lagrange.C.

◆ get_continuity() [31/54]

FEContinuity libMesh::FE< 1, L2_LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 475 of file fe_l2_lagrange.C.

◆ get_continuity() [32/54]

FEContinuity libMesh::FE< 2, L2_LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 476 of file fe_l2_lagrange.C.

◆ get_continuity() [33/54]

FEContinuity libMesh::FE< 3, L2_LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 477 of file fe_l2_lagrange.C.

◆ get_continuity() [34/54]

FEContinuity libMesh::FE< 0, NEDELEC_ONE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 544 of file fe_nedelec_one.C.

544 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ get_continuity() [35/54]

FEContinuity libMesh::FE< 1, NEDELEC_ONE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 545 of file fe_nedelec_one.C.

545 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ get_continuity() [36/54]

FEContinuity libMesh::FE< 2, NEDELEC_ONE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 546 of file fe_nedelec_one.C.

546 { return H_CURL; }

◆ get_continuity() [37/54]

FEContinuity libMesh::FE< 3, NEDELEC_ONE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 547 of file fe_nedelec_one.C.

547 { return H_CURL; }

◆ get_continuity() [38/54]

FEContinuity libMesh::FE< 0, LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 877 of file fe_lagrange.C.

877 { return C_ZERO; }

◆ get_continuity() [39/54]

FEContinuity libMesh::FE< 1, LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 878 of file fe_lagrange.C.

878 { return C_ZERO; }

◆ get_continuity() [40/54]

FEContinuity libMesh::FE< 2, LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 879 of file fe_lagrange.C.

879 { return C_ZERO; }

◆ get_continuity() [41/54]

FEContinuity libMesh::FE< 3, LAGRANGE >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 880 of file fe_lagrange.C.

880 { return C_ZERO; }

◆ get_continuity() [42/54]

FEContinuity libMesh::FE< 2, SUBDIVISION >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 910 of file fe_subdivision_2D.C.

910 { return C_ONE; }

◆ get_continuity() [43/54]

FEContinuity libMesh::FE< 0, XYZ >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 925 of file fe_xyz.C.

◆ get_continuity() [44/54]

FEContinuity libMesh::FE< 1, XYZ >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 926 of file fe_xyz.C.

◆ get_continuity() [45/54]

FEContinuity libMesh::FE< 0, LAGRANGE_VEC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 927 of file fe_lagrange_vec.C.

927 { return C_ZERO; }

◆ get_continuity() [46/54]

FEContinuity libMesh::FE< 2, XYZ >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 927 of file fe_xyz.C.

◆ get_continuity() [47/54]

FEContinuity libMesh::FE< 1, LAGRANGE_VEC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 928 of file fe_lagrange_vec.C.

928 { return C_ZERO; }

◆ get_continuity() [48/54]

FEContinuity libMesh::FE< 3, XYZ >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 928 of file fe_xyz.C.

◆ get_continuity() [49/54]

FEContinuity libMesh::FE< 2, LAGRANGE_VEC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 929 of file fe_lagrange_vec.C.

929 { return C_ZERO; }

◆ get_continuity() [50/54]

FEContinuity libMesh::FE< 3, LAGRANGE_VEC >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 930 of file fe_lagrange_vec.C.

930 { return C_ZERO; }

◆ get_continuity() [51/54]

FEContinuity libMesh::FE< 0, SZABAB >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1273 of file fe_szabab.C.

1273 { return C_ZERO; }

◆ get_continuity() [52/54]

FEContinuity libMesh::FE< 1, SZABAB >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1274 of file fe_szabab.C.

1274 { return C_ZERO; }

◆ get_continuity() [53/54]

FEContinuity libMesh::FE< 2, SZABAB >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1275 of file fe_szabab.C.

1275 { return C_ZERO; }

◆ get_continuity() [54/54]

FEContinuity libMesh::FE< 3, SZABAB >::get_continuity ( ) const
virtualinherited
Returns
The continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1276 of file fe_szabab.C.

1276 { return C_ZERO; }

◆ get_curl_phi()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi ( ) const
inlineinherited
Returns
The curl of the shape function at the quadrature points.

Definition at line 223 of file fe_base.h.

References libMesh::FEAbstract::calculate_curl_phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::curl_phi.

224  { libmesh_assert(!calculations_started || calculate_curl_phi);
225  calculate_curl_phi = calculate_dphiref = true; return curl_phi; }
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:508

◆ get_curvatures()

const std::vector<Real>& libMesh::FEAbstract::get_curvatures ( ) const
inlineinherited
Returns
The curvatures for use in face integration.

Definition at line 391 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

392  { return this->_fe_map->get_curvatures();}
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2phi()

const std::vector<std::vector<OutputTensor> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 289 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phi.

290  { libmesh_assert(!calculations_started || calculate_d2phi);
291  calculate_d2phi = calculate_dphiref = true; return d2phi; }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:551

◆ get_d2phideta2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 369 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phideta2.

370  { libmesh_assert(!calculations_started || calculate_d2phi);
371  calculate_d2phi = calculate_dphiref = true; return d2phideta2; }
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:571

◆ get_d2phidetadzeta()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 377 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidetadzeta.

378  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:576

◆ get_d2phidx2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 297 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidx2.

298  { libmesh_assert(!calculations_started || calculate_d2phi);
299  calculate_d2phi = calculate_dphiref = true; return d2phidx2; }
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:586

◆ get_d2phidxdy()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 305 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidxdy.

306  { libmesh_assert(!calculations_started || calculate_d2phi);
307  calculate_d2phi = calculate_dphiref = true; return d2phidxdy; }
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:591

◆ get_d2phidxdz()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 313 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidxdz.

314  { libmesh_assert(!calculations_started || calculate_d2phi);
315  calculate_d2phi = calculate_dphiref = true; return d2phidxdz; }
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:596

◆ get_d2phidxi2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 345 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidxi2.

346  { libmesh_assert(!calculations_started || calculate_d2phi);
347  calculate_d2phi = calculate_dphiref = true; return d2phidxi2; }
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:556

◆ get_d2phidxideta()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 353 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidxideta.

354  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:561

◆ get_d2phidxidzeta()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 361 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidxidzeta.

362  { libmesh_assert(!calculations_started || calculate_d2phi);
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:566

◆ get_d2phidy2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 321 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidy2.

322  { libmesh_assert(!calculations_started || calculate_d2phi);
323  calculate_d2phi = calculate_dphiref = true; return d2phidy2; }
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:601

◆ get_d2phidydz()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 329 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidydz.

330  { libmesh_assert(!calculations_started || calculate_d2phi);
331  calculate_d2phi = calculate_dphiref = true; return d2phidydz; }
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:606

◆ get_d2phidz2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points.

Definition at line 337 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidz2.

338  { libmesh_assert(!calculations_started || calculate_d2phi);
339  calculate_d2phi = calculate_dphiref = true; return d2phidz2; }
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:611

◆ get_d2phidzeta2()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2 ( ) const
inlineinherited
Returns
The shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 385 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::d2phidzeta2.

386  { libmesh_assert(!calculations_started || calculate_d2phi);
387  calculate_d2phi = calculate_dphiref = true; return d2phidzeta2; }
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:581

◆ get_d2xyzdeta2()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdeta2 ( ) const
inlineinherited
Returns
The second partial derivatives in eta.

Definition at line 278 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

279  { return this->_fe_map->get_d2xyzdeta2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2xyzdetadzeta()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdetadzeta ( ) const
inlineinherited
Returns
The second partial derivatives in eta-zeta.

Definition at line 308 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

309  { return this->_fe_map->get_d2xyzdetadzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2xyzdxi2()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxi2 ( ) const
inlineinherited
Returns
The second partial derivatives in xi.

Definition at line 272 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

273  { return this->_fe_map->get_d2xyzdxi2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2xyzdxideta()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxideta ( ) const
inlineinherited
Returns
The second partial derivatives in xi-eta.

Definition at line 294 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

295  { return this->_fe_map->get_d2xyzdxideta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2xyzdxidzeta()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxidzeta ( ) const
inlineinherited
Returns
The second partial derivatives in xi-zeta.

Definition at line 302 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

303  { return this->_fe_map->get_d2xyzdxidzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_d2xyzdzeta2()

const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdzeta2 ( ) const
inlineinherited
Returns
The second partial derivatives in zeta.

Definition at line 286 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

287  { return this->_fe_map->get_d2xyzdzeta2(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_detadx()

const std::vector<Real>& libMesh::FEAbstract::get_detadx ( ) const
inlineinherited
Returns
The deta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 338 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

339  { return this->_fe_map->get_detadx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_detady()

const std::vector<Real>& libMesh::FEAbstract::get_detady ( ) const
inlineinherited
Returns
The deta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 345 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

346  { return this->_fe_map->get_detady(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_detadz()

const std::vector<Real>& libMesh::FEAbstract::get_detadz ( ) const
inlineinherited
Returns
The deta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 352 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

353  { return this->_fe_map->get_detadz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dim()

unsigned int libMesh::FEAbstract::get_dim ( ) const
inlineinherited
Returns
the dimension of this FE

Definition at line 231 of file fe_abstract.h.

References libMesh::FEAbstract::dim.

232  { return dim; }
const unsigned int dim
Definition: fe_abstract.h:531

◆ get_div_phi()

const std::vector<std::vector<OutputDivergence> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi ( ) const
inlineinherited
Returns
The divergence of the shape function at the quadrature points.

Definition at line 231 of file fe_base.h.

References libMesh::FEAbstract::calculate_div_phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::div_phi.

232  { libmesh_assert(!calculations_started || calculate_div_phi);
233  calculate_div_phi = calculate_dphiref = true; return div_phi; }
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:513

◆ get_dphase()

const std::vector<OutputGradient>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphase ( ) const
inlineinherited
Returns
The global first derivative of the phase term which is used in infinite elements, evaluated at the quadrature points.

In case of the general finite element class FE this field is initialized to all zero, so that the variational formulation for an infinite element produces correct element matrices for a mesh using both finite and infinite elements.

Definition at line 403 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::dphase.

404  { return dphase; }
std::vector< OutputGradient > dphase
Definition: fe_base.h:629

◆ get_dphi()

const std::vector<std::vector<OutputGradient> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi ( ) const
inlineinherited
Returns
The shape function derivatives at the quadrature points.

Definition at line 215 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphi.

216  { libmesh_assert(!calculations_started || calculate_dphi);
217  calculate_dphi = calculate_dphiref = true; return dphi; }
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503

◆ get_dphideta()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta ( ) const
inlineinherited
Returns
The shape function eta-derivative at the quadrature points.

Definition at line 271 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphideta.

272  { libmesh_assert(!calculations_started || calculate_dphiref);
273  calculate_dphiref = true; return dphideta; }
std::vector< std::vector< OutputShape > > dphideta
Definition: fe_base.h:523

◆ get_dphidx()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx ( ) const
inlineinherited
Returns
The shape function x-derivative at the quadrature points.

Definition at line 239 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphidx.

240  { libmesh_assert(!calculations_started || calculate_dphi);
241  calculate_dphi = calculate_dphiref = true; return dphidx; }
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:533

◆ get_dphidxi()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi ( ) const
inlineinherited
Returns
The shape function xi-derivative at the quadrature points.

Definition at line 263 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphidxi.

264  { libmesh_assert(!calculations_started || calculate_dphiref);
265  calculate_dphiref = true; return dphidxi; }
std::vector< std::vector< OutputShape > > dphidxi
Definition: fe_base.h:518

◆ get_dphidy()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy ( ) const
inlineinherited
Returns
The shape function y-derivative at the quadrature points.

Definition at line 247 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphidy.

248  { libmesh_assert(!calculations_started || calculate_dphi);
249  calculate_dphi = calculate_dphiref = true; return dphidy; }
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:538

◆ get_dphidz()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz ( ) const
inlineinherited
Returns
The shape function z-derivative at the quadrature points.

Definition at line 255 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphidz.

256  { libmesh_assert(!calculations_started || calculate_dphi);
257  calculate_dphi = calculate_dphiref = true; return dphidz; }
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:543

◆ get_dphidzeta()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta ( ) const
inlineinherited
Returns
The shape function zeta-derivative at the quadrature points.

Definition at line 279 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::dphidzeta.

280  { libmesh_assert(!calculations_started || calculate_dphiref);
281  calculate_dphiref = true; return dphidzeta; }
std::vector< std::vector< OutputShape > > dphidzeta
Definition: fe_base.h:528

◆ get_dxidx()

const std::vector<Real>& libMesh::FEAbstract::get_dxidx ( ) const
inlineinherited
Returns
The dxi/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 317 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

318  { return this->_fe_map->get_dxidx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dxidy()

const std::vector<Real>& libMesh::FEAbstract::get_dxidy ( ) const
inlineinherited
Returns
The dxi/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 324 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

325  { return this->_fe_map->get_dxidy(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dxidz()

const std::vector<Real>& libMesh::FEAbstract::get_dxidz ( ) const
inlineinherited
Returns
The dxi/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 331 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

332  { return this->_fe_map->get_dxidz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dxyzdeta()

const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdeta ( ) const
inlineinherited
Returns
The element tangents in eta-direction at the quadrature points.

Definition at line 259 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

260  { return this->_fe_map->get_dxyzdeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dxyzdxi()

const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdxi ( ) const
inlineinherited
Returns
The element tangents in xi-direction at the quadrature points.

Definition at line 252 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

253  { return this->_fe_map->get_dxyzdxi(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dxyzdzeta()

const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdzeta ( ) const
inlineinherited
Returns
The element tangents in zeta-direction at the quadrature points.

Definition at line 266 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

267  { return _fe_map->get_dxyzdzeta(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dzetadx()

const std::vector<Real>& libMesh::FEAbstract::get_dzetadx ( ) const
inlineinherited
Returns
The dzeta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 359 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

360  { return this->_fe_map->get_dzetadx(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dzetady()

const std::vector<Real>& libMesh::FEAbstract::get_dzetady ( ) const
inlineinherited
Returns
The dzeta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 366 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

367  { return this->_fe_map->get_dzetady(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_dzetadz()

const std::vector<Real>& libMesh::FEAbstract::get_dzetadz ( ) const
inlineinherited
Returns
The dzeta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 373 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

374  { return this->_fe_map->get_dzetadz(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_family()

FEFamily libMesh::FEAbstract::get_family ( ) const
inlineinherited
Returns
The finite element family of this element.

Definition at line 455 of file fe_abstract.h.

References libMesh::FEType::family, and libMesh::FEAbstract::fe_type.

455 { return fe_type.family; }
FEFamily family
Definition: fe_type.h:204

◆ get_fe_map()

◆ get_fe_type()

◆ get_info()

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42

◆ get_JxW()

◆ get_normals()

const std::vector<Point>& libMesh::FEAbstract::get_normals ( ) const
inlineinherited

◆ get_order()

Order libMesh::FEAbstract::get_order ( ) const
inlineinherited
Returns
The approximation order of the finite element.

Definition at line 434 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level, libMesh::FEAbstract::fe_type, and libMesh::FEType::order.

434 { return static_cast<Order>(fe_type.order + _p_level); }
unsigned int _p_level
Definition: fe_abstract.h:587
OrderWrapper order
Definition: fe_type.h:198

◆ get_p_level()

unsigned int libMesh::FEAbstract::get_p_level ( ) const
inlineinherited
Returns
The p refinement level that the current shape functions have been calculated for.

Definition at line 424 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level.

424 { return _p_level; }
unsigned int _p_level
Definition: fe_abstract.h:587

◆ get_phi()

const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi ( ) const
inlineinherited
Returns
The shape function values at the quadrature points on the element.

Definition at line 207 of file fe_base.h.

References libMesh::FEAbstract::calculate_phi, libMesh::FEAbstract::calculations_started, and libMesh::FEGenericBase< OutputType >::phi.

208  { libmesh_assert(!calculations_started || calculate_phi);
209  calculate_phi = true; return phi; }
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498

◆ get_refspace_nodes()

void libMesh::FEAbstract::get_refspace_nodes ( const ElemType  t,
std::vector< Point > &  nodes 
)
staticinherited
Returns
The reference space coordinates of nodes based on the element type.

Definition at line 283 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

284 {
285  switch(itemType)
286  {
287  case EDGE2:
288  {
289  nodes.resize(2);
290  nodes[0] = Point (-1.,0.,0.);
291  nodes[1] = Point (1.,0.,0.);
292  return;
293  }
294  case EDGE3:
295  {
296  nodes.resize(3);
297  nodes[0] = Point (-1.,0.,0.);
298  nodes[1] = Point (1.,0.,0.);
299  nodes[2] = Point (0.,0.,0.);
300  return;
301  }
302  case TRI3:
303  case TRISHELL3:
304  {
305  nodes.resize(3);
306  nodes[0] = Point (0.,0.,0.);
307  nodes[1] = Point (1.,0.,0.);
308  nodes[2] = Point (0.,1.,0.);
309  return;
310  }
311  case TRI6:
312  {
313  nodes.resize(6);
314  nodes[0] = Point (0.,0.,0.);
315  nodes[1] = Point (1.,0.,0.);
316  nodes[2] = Point (0.,1.,0.);
317  nodes[3] = Point (.5,0.,0.);
318  nodes[4] = Point (.5,.5,0.);
319  nodes[5] = Point (0.,.5,0.);
320  return;
321  }
322  case QUAD4:
323  case QUADSHELL4:
324  {
325  nodes.resize(4);
326  nodes[0] = Point (-1.,-1.,0.);
327  nodes[1] = Point (1.,-1.,0.);
328  nodes[2] = Point (1.,1.,0.);
329  nodes[3] = Point (-1.,1.,0.);
330  return;
331  }
332  case QUAD8:
333  case QUADSHELL8:
334  {
335  nodes.resize(8);
336  nodes[0] = Point (-1.,-1.,0.);
337  nodes[1] = Point (1.,-1.,0.);
338  nodes[2] = Point (1.,1.,0.);
339  nodes[3] = Point (-1.,1.,0.);
340  nodes[4] = Point (0.,-1.,0.);
341  nodes[5] = Point (1.,0.,0.);
342  nodes[6] = Point (0.,1.,0.);
343  nodes[7] = Point (-1.,0.,0.);
344  return;
345  }
346  case QUAD9:
347  {
348  nodes.resize(9);
349  nodes[0] = Point (-1.,-1.,0.);
350  nodes[1] = Point (1.,-1.,0.);
351  nodes[2] = Point (1.,1.,0.);
352  nodes[3] = Point (-1.,1.,0.);
353  nodes[4] = Point (0.,-1.,0.);
354  nodes[5] = Point (1.,0.,0.);
355  nodes[6] = Point (0.,1.,0.);
356  nodes[7] = Point (-1.,0.,0.);
357  nodes[8] = Point (0.,0.,0.);
358  return;
359  }
360  case TET4:
361  {
362  nodes.resize(4);
363  nodes[0] = Point (0.,0.,0.);
364  nodes[1] = Point (1.,0.,0.);
365  nodes[2] = Point (0.,1.,0.);
366  nodes[3] = Point (0.,0.,1.);
367  return;
368  }
369  case TET10:
370  {
371  nodes.resize(10);
372  nodes[0] = Point (0.,0.,0.);
373  nodes[1] = Point (1.,0.,0.);
374  nodes[2] = Point (0.,1.,0.);
375  nodes[3] = Point (0.,0.,1.);
376  nodes[4] = Point (.5,0.,0.);
377  nodes[5] = Point (.5,.5,0.);
378  nodes[6] = Point (0.,.5,0.);
379  nodes[7] = Point (0.,0.,.5);
380  nodes[8] = Point (.5,0.,.5);
381  nodes[9] = Point (0.,.5,.5);
382  return;
383  }
384  case HEX8:
385  {
386  nodes.resize(8);
387  nodes[0] = Point (-1.,-1.,-1.);
388  nodes[1] = Point (1.,-1.,-1.);
389  nodes[2] = Point (1.,1.,-1.);
390  nodes[3] = Point (-1.,1.,-1.);
391  nodes[4] = Point (-1.,-1.,1.);
392  nodes[5] = Point (1.,-1.,1.);
393  nodes[6] = Point (1.,1.,1.);
394  nodes[7] = Point (-1.,1.,1.);
395  return;
396  }
397  case HEX20:
398  {
399  nodes.resize(20);
400  nodes[0] = Point (-1.,-1.,-1.);
401  nodes[1] = Point (1.,-1.,-1.);
402  nodes[2] = Point (1.,1.,-1.);
403  nodes[3] = Point (-1.,1.,-1.);
404  nodes[4] = Point (-1.,-1.,1.);
405  nodes[5] = Point (1.,-1.,1.);
406  nodes[6] = Point (1.,1.,1.);
407  nodes[7] = Point (-1.,1.,1.);
408  nodes[8] = Point (0.,-1.,-1.);
409  nodes[9] = Point (1.,0.,-1.);
410  nodes[10] = Point (0.,1.,-1.);
411  nodes[11] = Point (-1.,0.,-1.);
412  nodes[12] = Point (-1.,-1.,0.);
413  nodes[13] = Point (1.,-1.,0.);
414  nodes[14] = Point (1.,1.,0.);
415  nodes[15] = Point (-1.,1.,0.);
416  nodes[16] = Point (0.,-1.,1.);
417  nodes[17] = Point (1.,0.,1.);
418  nodes[18] = Point (0.,1.,1.);
419  nodes[19] = Point (-1.,0.,1.);
420  return;
421  }
422  case HEX27:
423  {
424  nodes.resize(27);
425  nodes[0] = Point (-1.,-1.,-1.);
426  nodes[1] = Point (1.,-1.,-1.);
427  nodes[2] = Point (1.,1.,-1.);
428  nodes[3] = Point (-1.,1.,-1.);
429  nodes[4] = Point (-1.,-1.,1.);
430  nodes[5] = Point (1.,-1.,1.);
431  nodes[6] = Point (1.,1.,1.);
432  nodes[7] = Point (-1.,1.,1.);
433  nodes[8] = Point (0.,-1.,-1.);
434  nodes[9] = Point (1.,0.,-1.);
435  nodes[10] = Point (0.,1.,-1.);
436  nodes[11] = Point (-1.,0.,-1.);
437  nodes[12] = Point (-1.,-1.,0.);
438  nodes[13] = Point (1.,-1.,0.);
439  nodes[14] = Point (1.,1.,0.);
440  nodes[15] = Point (-1.,1.,0.);
441  nodes[16] = Point (0.,-1.,1.);
442  nodes[17] = Point (1.,0.,1.);
443  nodes[18] = Point (0.,1.,1.);
444  nodes[19] = Point (-1.,0.,1.);
445  nodes[20] = Point (0.,0.,-1.);
446  nodes[21] = Point (0.,-1.,0.);
447  nodes[22] = Point (1.,0.,0.);
448  nodes[23] = Point (0.,1.,0.);
449  nodes[24] = Point (-1.,0.,0.);
450  nodes[25] = Point (0.,0.,1.);
451  nodes[26] = Point (0.,0.,0.);
452  return;
453  }
454  case PRISM6:
455  {
456  nodes.resize(6);
457  nodes[0] = Point (0.,0.,-1.);
458  nodes[1] = Point (1.,0.,-1.);
459  nodes[2] = Point (0.,1.,-1.);
460  nodes[3] = Point (0.,0.,1.);
461  nodes[4] = Point (1.,0.,1.);
462  nodes[5] = Point (0.,1.,1.);
463  return;
464  }
465  case PRISM15:
466  {
467  nodes.resize(15);
468  nodes[0] = Point (0.,0.,-1.);
469  nodes[1] = Point (1.,0.,-1.);
470  nodes[2] = Point (0.,1.,-1.);
471  nodes[3] = Point (0.,0.,1.);
472  nodes[4] = Point (1.,0.,1.);
473  nodes[5] = Point (0.,1.,1.);
474  nodes[6] = Point (.5,0.,-1.);
475  nodes[7] = Point (.5,.5,-1.);
476  nodes[8] = Point (0.,.5,-1.);
477  nodes[9] = Point (0.,0.,0.);
478  nodes[10] = Point (1.,0.,0.);
479  nodes[11] = Point (0.,1.,0.);
480  nodes[12] = Point (.5,0.,1.);
481  nodes[13] = Point (.5,.5,1.);
482  nodes[14] = Point (0.,.5,1.);
483  return;
484  }
485  case PRISM18:
486  {
487  nodes.resize(18);
488  nodes[0] = Point (0.,0.,-1.);
489  nodes[1] = Point (1.,0.,-1.);
490  nodes[2] = Point (0.,1.,-1.);
491  nodes[3] = Point (0.,0.,1.);
492  nodes[4] = Point (1.,0.,1.);
493  nodes[5] = Point (0.,1.,1.);
494  nodes[6] = Point (.5,0.,-1.);
495  nodes[7] = Point (.5,.5,-1.);
496  nodes[8] = Point (0.,.5,-1.);
497  nodes[9] = Point (0.,0.,0.);
498  nodes[10] = Point (1.,0.,0.);
499  nodes[11] = Point (0.,1.,0.);
500  nodes[12] = Point (.5,0.,1.);
501  nodes[13] = Point (.5,.5,1.);
502  nodes[14] = Point (0.,.5,1.);
503  nodes[15] = Point (.5,0.,0.);
504  nodes[16] = Point (.5,.5,0.);
505  nodes[17] = Point (0.,.5,0.);
506  return;
507  }
508  case PYRAMID5:
509  {
510  nodes.resize(5);
511  nodes[0] = Point (-1.,-1.,0.);
512  nodes[1] = Point (1.,-1.,0.);
513  nodes[2] = Point (1.,1.,0.);
514  nodes[3] = Point (-1.,1.,0.);
515  nodes[4] = Point (0.,0.,1.);
516  return;
517  }
518  case PYRAMID13:
519  {
520  nodes.resize(13);
521 
522  // base corners
523  nodes[0] = Point (-1.,-1.,0.);
524  nodes[1] = Point (1.,-1.,0.);
525  nodes[2] = Point (1.,1.,0.);
526  nodes[3] = Point (-1.,1.,0.);
527 
528  // apex
529  nodes[4] = Point (0.,0.,1.);
530 
531  // base midedge
532  nodes[5] = Point (0.,-1.,0.);
533  nodes[6] = Point (1.,0.,0.);
534  nodes[7] = Point (0.,1.,0.);
535  nodes[8] = Point (-1,0.,0.);
536 
537  // lateral midedge
538  nodes[9] = Point (-.5,-.5,.5);
539  nodes[10] = Point (.5,-.5,.5);
540  nodes[11] = Point (.5,.5,.5);
541  nodes[12] = Point (-.5,.5,.5);
542 
543  return;
544  }
545  case PYRAMID14:
546  {
547  nodes.resize(14);
548 
549  // base corners
550  nodes[0] = Point (-1.,-1.,0.);
551  nodes[1] = Point (1.,-1.,0.);
552  nodes[2] = Point (1.,1.,0.);
553  nodes[3] = Point (-1.,1.,0.);
554 
555  // apex
556  nodes[4] = Point (0.,0.,1.);
557 
558  // base midedge
559  nodes[5] = Point (0.,-1.,0.);
560  nodes[6] = Point (1.,0.,0.);
561  nodes[7] = Point (0.,1.,0.);
562  nodes[8] = Point (-1,0.,0.);
563 
564  // lateral midedge
565  nodes[9] = Point (-.5,-.5,.5);
566  nodes[10] = Point (.5,-.5,.5);
567  nodes[11] = Point (.5,.5,.5);
568  nodes[12] = Point (-.5,.5,.5);
569 
570  // base center
571  nodes[13] = Point (0.,0.,0.);
572 
573  return;
574  }
575 
576  default:
577  libmesh_error_msg("ERROR: Unknown element type " << itemType);
578  }
579 }

◆ get_Sobolev_dweight()

const std::vector<RealGradient>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight ( ) const
inlineinherited
Returns
The first global derivative of the multiplicative weight at each quadrature point. See get_Sobolev_weight() for details. In case of FE initialized to all zero.

Definition at line 427 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::dweight.

428  { return dweight; }

◆ get_Sobolev_weight()

const std::vector<Real>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_weight ( ) const
inlineinherited
Returns
The multiplicative weight at each quadrature point. This weight is used for certain infinite element weak formulations, so that weighted Sobolev spaces are used for the trial function space. This renders the variational form easily computable.

In case of the general finite element class FE this field is initialized to all ones, so that the variational formulation for an infinite element produces correct element matrices for a mesh using both finite and infinite elements.

Definition at line 419 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::weight.

420  { return weight; }

◆ get_tangents()

const std::vector<std::vector<Point> >& libMesh::FEAbstract::get_tangents ( ) const
inlineinherited
Returns
The tangent vectors for face integration.

Definition at line 379 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

380  { return this->_fe_map->get_tangents(); }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ get_type()

ElemType libMesh::FEAbstract::get_type ( ) const
inlineinherited
Returns
The element type that the current shape functions have been calculated for. Useful in determining when shape functions must be recomputed.

Definition at line 418 of file fe_abstract.h.

References libMesh::FEAbstract::elem_type.

418 { return elem_type; }

◆ get_xyz()

◆ increment_constructor_count()

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 181 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ increment_destructor_count()

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 194 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ init_base_shape_functions()

void libMesh::FE< Dim, T >::init_base_shape_functions ( const std::vector< Point > &  qp,
const Elem e 
)
overrideprotectedvirtualinherited

Initialize the data fields for the base of an an infinite element.

Implements libMesh::FEGenericBase< FEOutputType< T >::type >.

Definition at line 550 of file fe.C.

552 {
553  this->elem_type = e->type();
554  this->_fe_map->template init_reference_to_physical_map<Dim>(qp, e);
555  init_shape_functions(qp, e);
556 }
virtual void init_shape_functions(const std::vector< Point > &qp, const Elem *e)
Definition: fe.C:294
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ init_shape_functions()

void libMesh::FE< Dim, T >::init_shape_functions ( const std::vector< Point > &  qp,
const Elem e 
)
protectedvirtualinherited

Update the various member data fields phi, dphidxi, dphideta, dphidzeta, etc. for the current element. These data will be computed at the points qp, which are generally (but need not be) the quadrature points.

Definition at line 294 of file fe.C.

296 {
297  // Start logging the shape function initialization
298  LOG_SCOPE("init_shape_functions()", "FE");
299 
300  // The number of quadrature points.
301  const unsigned int n_qp = cast_int<unsigned int>(qp.size());
302 
303  // Number of shape functions in the finite element approximation
304  // space.
305  const unsigned int n_approx_shape_functions =
306  this->n_shape_functions(this->get_type(),
307  this->get_order());
308 
309  // resize the vectors to hold current data
310  // Phi are the shape functions used for the FE approximation
311  // Phi_map are the shape functions used for the FE mapping
312  if (this->calculate_phi)
313  this->phi.resize (n_approx_shape_functions);
314 
315  if (this->calculate_dphi)
316  {
317  this->dphi.resize (n_approx_shape_functions);
318  this->dphidx.resize (n_approx_shape_functions);
319  this->dphidy.resize (n_approx_shape_functions);
320  this->dphidz.resize (n_approx_shape_functions);
321  }
322 
323  if (this->calculate_dphiref)
324  {
325  if (Dim > 0)
326  this->dphidxi.resize (n_approx_shape_functions);
327 
328  if (Dim > 1)
329  this->dphideta.resize (n_approx_shape_functions);
330 
331  if (Dim > 2)
332  this->dphidzeta.resize (n_approx_shape_functions);
333  }
334 
335  if (this->calculate_curl_phi && (FEInterface::field_type(T) == TYPE_VECTOR))
336  this->curl_phi.resize(n_approx_shape_functions);
337 
338  if (this->calculate_div_phi && (FEInterface::field_type(T) == TYPE_VECTOR))
339  this->div_phi.resize(n_approx_shape_functions);
340 
341 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
342  if (this->calculate_d2phi)
343  {
344  this->d2phi.resize (n_approx_shape_functions);
345  this->d2phidx2.resize (n_approx_shape_functions);
346  this->d2phidxdy.resize (n_approx_shape_functions);
347  this->d2phidxdz.resize (n_approx_shape_functions);
348  this->d2phidy2.resize (n_approx_shape_functions);
349  this->d2phidydz.resize (n_approx_shape_functions);
350  this->d2phidz2.resize (n_approx_shape_functions);
351 
352  if (Dim > 0)
353  this->d2phidxi2.resize (n_approx_shape_functions);
354 
355  if (Dim > 1)
356  {
357  this->d2phidxideta.resize (n_approx_shape_functions);
358  this->d2phideta2.resize (n_approx_shape_functions);
359  }
360  if (Dim > 2)
361  {
362  this->d2phidxidzeta.resize (n_approx_shape_functions);
363  this->d2phidetadzeta.resize (n_approx_shape_functions);
364  this->d2phidzeta2.resize (n_approx_shape_functions);
365  }
366  }
367 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
368 
369  for (unsigned int i=0; i<n_approx_shape_functions; i++)
370  {
371  if (this->calculate_phi)
372  this->phi[i].resize (n_qp);
373  if (this->calculate_dphi)
374  {
375  this->dphi[i].resize (n_qp);
376  this->dphidx[i].resize (n_qp);
377  this->dphidy[i].resize (n_qp);
378  this->dphidz[i].resize (n_qp);
379  }
380 
381  if (this->calculate_dphiref)
382  {
383  if (Dim > 0)
384  this->dphidxi[i].resize(n_qp);
385 
386  if (Dim > 1)
387  this->dphideta[i].resize(n_qp);
388 
389  if (Dim > 2)
390  this->dphidzeta[i].resize(n_qp);
391  }
392 
393  if (this->calculate_curl_phi && (FEInterface::field_type(T) == TYPE_VECTOR))
394  this->curl_phi[i].resize(n_qp);
395 
396  if (this->calculate_div_phi && (FEInterface::field_type(T) == TYPE_VECTOR))
397  this->div_phi[i].resize(n_qp);
398 
399 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
400  if (this->calculate_d2phi)
401  {
402  this->d2phi[i].resize (n_qp);
403  this->d2phidx2[i].resize (n_qp);
404  this->d2phidxdy[i].resize (n_qp);
405  this->d2phidxdz[i].resize (n_qp);
406  this->d2phidy2[i].resize (n_qp);
407  this->d2phidydz[i].resize (n_qp);
408  this->d2phidz2[i].resize (n_qp);
409  if (Dim > 0)
410  this->d2phidxi2[i].resize (n_qp);
411  if (Dim > 1)
412  {
413  this->d2phidxideta[i].resize (n_qp);
414  this->d2phideta2[i].resize (n_qp);
415  }
416  if (Dim > 2)
417  {
418  this->d2phidxidzeta[i].resize (n_qp);
419  this->d2phidetadzeta[i].resize (n_qp);
420  this->d2phidzeta2[i].resize (n_qp);
421  }
422  }
423 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
424  }
425 
426 
427 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
428  //------------------------------------------------------------
429  // Initialize the data fields, which should only be used for infinite
430  // elements, to some sensible values, so that using a FE with the
431  // variational formulation of an InfFE, correct element matrices are
432  // returned
433 
434  {
435  this->weight.resize (n_qp);
436  this->dweight.resize (n_qp);
437  this->dphase.resize (n_qp);
438 
439  for (unsigned int p=0; p<n_qp; p++)
440  {
441  this->weight[p] = 1.;
442  this->dweight[p].zero();
443  this->dphase[p].zero();
444  }
445 
446  }
447 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
448 
449  switch (Dim)
450  {
451 
452  //------------------------------------------------------------
453  // 0D
454  case 0:
455  {
456  break;
457  }
458 
459  //------------------------------------------------------------
460  // 1D
461  case 1:
462  {
463  // Compute the value of the approximation shape function i at quadrature point p
464  if (this->calculate_dphiref)
465  for (unsigned int i=0; i<n_approx_shape_functions; i++)
466  for (unsigned int p=0; p<n_qp; p++)
467  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
468 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
469  if (this->calculate_d2phi)
470  for (unsigned int i=0; i<n_approx_shape_functions; i++)
471  for (unsigned int p=0; p<n_qp; p++)
472  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
473 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
474 
475  break;
476  }
477 
478 
479 
480  //------------------------------------------------------------
481  // 2D
482  case 2:
483  {
484  // Compute the value of the approximation shape function i at quadrature point p
485  if (this->calculate_dphiref)
486  for (unsigned int i=0; i<n_approx_shape_functions; i++)
487  for (unsigned int p=0; p<n_qp; p++)
488  {
489  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
490  this->dphideta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 1, qp[p]);
491  }
492 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
493  if (this->calculate_d2phi)
494  for (unsigned int i=0; i<n_approx_shape_functions; i++)
495  for (unsigned int p=0; p<n_qp; p++)
496  {
497  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
498  this->d2phidxideta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 1, qp[p]);
499  this->d2phideta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 2, qp[p]);
500  }
501 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
502 
503 
504  break;
505  }
506 
507 
508 
509  //------------------------------------------------------------
510  // 3D
511  case 3:
512  {
513  // Compute the value of the approximation shape function i at quadrature point p
514  if (this->calculate_dphiref)
515  for (unsigned int i=0; i<n_approx_shape_functions; i++)
516  for (unsigned int p=0; p<n_qp; p++)
517  {
518  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
519  this->dphideta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 1, qp[p]);
520  this->dphidzeta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 2, qp[p]);
521  }
522 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
523  if (this->calculate_d2phi)
524  for (unsigned int i=0; i<n_approx_shape_functions; i++)
525  for (unsigned int p=0; p<n_qp; p++)
526  {
527  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
528  this->d2phidxideta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 1, qp[p]);
529  this->d2phideta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 2, qp[p]);
530  this->d2phidxidzeta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 3, qp[p]);
531  this->d2phidetadzeta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 4, qp[p]);
532  this->d2phidzeta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 5, qp[p]);
533  }
534 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
535 
536  break;
537  }
538 
539 
540  default:
541  libmesh_error_msg("Invalid dimension Dim = " << Dim);
542  }
543 }
Order get_order() const
Definition: fe_abstract.h:434
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:551
std::vector< std::vector< OutputShape > > dphidxi
Definition: fe_base.h:518
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:596
std::vector< std::vector< OutputShape > > dphidzeta
Definition: fe_base.h:528
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:606
ElemType get_type() const
Definition: fe_abstract.h:418
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:561
OrderWrapper order
Definition: fe_type.h:198
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:586
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:508
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:538
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:601
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:576
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:566
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:591
virtual unsigned int n_shape_functions() const override
Definition: fe.C:50
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:533
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:571
std::vector< OutputGradient > dphase
Definition: fe_base.h:629
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:513
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:611
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:556
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:581
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:543
std::vector< std::vector< OutputShape > > dphideta
Definition: fe_base.h:523

◆ inverse_map() [1/4]

Point libMesh::FE< Dim, T >::inverse_map ( const Elem elem,
const Point p,
const Real  tolerance = TOLERANCE,
const bool  secure = true 
)
staticinherited
Returns
The location (on the reference element) of the point p located in physical space. This function requires inverting the (possibly nonlinear) transformation map, so it is not trivial. The optional parameter tolerance defines how close is "good enough." The map inversion iteration computes the sequence $ \{ p_n \} $, and the iteration is terminated when $ \|p - p_n\| < \mbox{\texttt{tolerance}} $

Definition at line 1576 of file fe_map.C.

1580 {
1581  libmesh_assert(elem);
1582  libmesh_assert_greater_equal (tolerance, 0.);
1583 
1584 
1585  // Start logging the map inversion.
1586  LOG_SCOPE("inverse_map()", "FE");
1587 
1588  // How much did the point on the reference
1589  // element change by in this Newton step?
1590  Real inverse_map_error = 0.;
1591 
1592  // The point on the reference element. This is
1593  // the "initial guess" for Newton's method. The
1594  // centroid seems like a good idea, but computing
1595  // it is a little more intensive than, say taking
1596  // the zero point.
1597  //
1598  // Convergence should be insensitive of this choice
1599  // for "good" elements.
1600  Point p; // the zero point. No computation required
1601 
1602  // The number of iterations in the map inversion process.
1603  unsigned int cnt = 0;
1604 
1605  // The number of iterations after which we give up and declare
1606  // divergence
1607  const unsigned int max_cnt = 10;
1608 
1609  // The distance (in master element space) beyond which we give up
1610  // and declare divergence. This is no longer used...
1611  // Real max_step_length = 4.;
1612 
1613 
1614 
1615  // Newton iteration loop.
1616  do
1617  {
1618  // Where our current iterate \p p maps to.
1619  const Point physical_guess = FE<Dim,T>::map (elem, p);
1620 
1621  // How far our current iterate is from the actual point.
1622  const Point delta = physical_point - physical_guess;
1623 
1624  // Increment in current iterate \p p, will be computed.
1625  Point dp;
1626 
1627 
1628  // The form of the map and how we invert it depends
1629  // on the dimension that we are in.
1630  switch (Dim)
1631  {
1632  // ------------------------------------------------------------------
1633  // 0D map inversion is trivial
1634  case 0:
1635  {
1636  break;
1637  }
1638 
1639  // ------------------------------------------------------------------
1640  // 1D map inversion
1641  //
1642  // Here we find the point on a 1D reference element that maps to
1643  // the point \p physical_point in the domain. This is a bit tricky
1644  // since we do not want to assume that the point \p physical_point
1645  // is also in a 1D domain. In particular, this method might get
1646  // called on the edge of a 3D element, in which case
1647  // \p physical_point actually lives in 3D.
1648  case 1:
1649  {
1650  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1651 
1652  // Newton's method in this case looks like
1653  //
1654  // {X} - {X_n} = [J]*dp
1655  //
1656  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x1 matrix
1657  // d(x,y,z)/dxi, and we seek dp, a scalar. Since the above
1658  // system is either overdetermined or rank-deficient, we will
1659  // solve the normal equations for this system
1660  //
1661  // [J]^T ({X} - {X_n}) = [J]^T [J] {dp}
1662  //
1663  // which involves the trivial inversion of the scalar
1664  // G = [J]^T [J]
1665  const Real G = dxi*dxi;
1666 
1667  if (secure)
1668  libmesh_assert_greater (G, 0.);
1669 
1670  const Real Ginv = 1./G;
1671 
1672  const Real dxidelta = dxi*delta;
1673 
1674  dp(0) = Ginv*dxidelta;
1675 
1676  // No master elements have radius > 4, but sometimes we
1677  // can take a step that big while still converging
1678  // if (secure)
1679  // libmesh_assert_less (dp.size(), max_step_length);
1680 
1681  break;
1682  }
1683 
1684 
1685 
1686  // ------------------------------------------------------------------
1687  // 2D map inversion
1688  //
1689  // Here we find the point on a 2D reference element that maps to
1690  // the point \p physical_point in the domain. This is a bit tricky
1691  // since we do not want to assume that the point \p physical_point
1692  // is also in a 2D domain. In particular, this method might get
1693  // called on the face of a 3D element, in which case
1694  // \p physical_point actually lives in 3D.
1695  case 2:
1696  {
1697  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1698  const Point deta = FE<Dim,T>::map_eta (elem, p);
1699 
1700  // Newton's method in this case looks like
1701  //
1702  // {X} - {X_n} = [J]*{dp}
1703  //
1704  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x2 matrix
1705  // d(x,y,z)/d(xi,eta), and we seek {dp}, a 2x1 vector. Since
1706  // the above system is either over-determined or rank-deficient,
1707  // we will solve the normal equations for this system
1708  //
1709  // [J]^T ({X} - {X_n}) = [J]^T [J] {dp}
1710  //
1711  // which involves the inversion of the 2x2 matrix
1712  // [G] = [J]^T [J]
1713  const Real
1714  G11 = dxi*dxi, G12 = dxi*deta,
1715  G21 = dxi*deta, G22 = deta*deta;
1716 
1717 
1718  const Real det = (G11*G22 - G12*G21);
1719 
1720  if (secure)
1721  libmesh_assert_not_equal_to (det, 0.);
1722 
1723  const Real inv_det = 1./det;
1724 
1725  const Real
1726  Ginv11 = G22*inv_det,
1727  Ginv12 = -G12*inv_det,
1728 
1729  Ginv21 = -G21*inv_det,
1730  Ginv22 = G11*inv_det;
1731 
1732 
1733  const Real dxidelta = dxi*delta;
1734  const Real detadelta = deta*delta;
1735 
1736  dp(0) = (Ginv11*dxidelta + Ginv12*detadelta);
1737  dp(1) = (Ginv21*dxidelta + Ginv22*detadelta);
1738 
1739  // No master elements have radius > 4, but sometimes we
1740  // can take a step that big while still converging
1741  // if (secure)
1742  // libmesh_assert_less (dp.size(), max_step_length);
1743 
1744  break;
1745  }
1746 
1747 
1748 
1749  // ------------------------------------------------------------------
1750  // 3D map inversion
1751  //
1752  // Here we find the point in a 3D reference element that maps to
1753  // the point \p physical_point in a 3D domain. Nothing special
1754  // has to happen here, since (unless the map is singular because
1755  // you have a BAD element) the map will be invertible and we can
1756  // apply Newton's method directly.
1757  case 3:
1758  {
1759  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1760  const Point deta = FE<Dim,T>::map_eta (elem, p);
1761  const Point dzeta = FE<Dim,T>::map_zeta (elem, p);
1762 
1763  // Newton's method in this case looks like
1764  //
1765  // {X} = {X_n} + [J]*{dp}
1766  //
1767  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x3 matrix
1768  // d(x,y,z)/d(xi,eta,zeta), and we seek {dp}, a 3x1 vector.
1769  // Since the above system is nonsingular for invertible maps
1770  // we will solve
1771  //
1772  // {dp} = [J]^-1 ({X} - {X_n})
1773  //
1774  // which involves the inversion of the 3x3 matrix [J]
1775  libmesh_try
1776  {
1777  RealTensorValue(dxi(0), deta(0), dzeta(0),
1778  dxi(1), deta(1), dzeta(1),
1779  dxi(2), deta(2), dzeta(2)).solve(delta, dp);
1780  }
1781  libmesh_catch (ConvergenceFailure &)
1782  {
1783  // We encountered a singular Jacobian. The value of
1784  // dp is zero, since it was never changed during the
1785  // call to RealTensorValue::solve(). We don't want to
1786  // continue iterating until max_cnt since there is no
1787  // update to the Newton iterate, and we don't want to
1788  // print the inverse_map_error value since it will
1789  // confusingly be 0. Therefore, in the secure case we
1790  // need to throw an error message while in the !secure
1791  // case we can just return a far away point.
1792  if (secure)
1793  {
1794  libMesh::err << "ERROR: Newton scheme encountered a singular Jacobian in element: "
1795  << elem->id()
1796  << std::endl;
1797 
1798  elem->print_info(libMesh::err);
1799 
1800  libmesh_error_msg("Exiting...");
1801  }
1802  else
1803  {
1804  for (unsigned int i=0; i != Dim; ++i)
1805  p(i) = 1e6;
1806  return p;
1807  }
1808  }
1809 
1810  // No master elements have radius > 4, but sometimes we
1811  // can take a step that big while still converging
1812  // if (secure)
1813  // libmesh_assert_less (dp.size(), max_step_length);
1814 
1815  break;
1816  }
1817 
1818 
1819  // Some other dimension?
1820  default:
1821  libmesh_error_msg("Invalid Dim = " << Dim);
1822  } // end switch(Dim), dp now computed
1823 
1824 
1825 
1826  // ||P_n+1 - P_n||
1827  inverse_map_error = dp.norm();
1828 
1829  // P_n+1 = P_n + dp
1830  p.add (dp);
1831 
1832  // Increment the iteration count.
1833  cnt++;
1834 
1835  // Watch for divergence of Newton's
1836  // method. Here's how it goes:
1837  // (1) For good elements, we expect convergence in 10
1838  // iterations, with no too-large steps.
1839  // - If called with (secure == true) and we have not yet converged
1840  // print out a warning message.
1841  // - If called with (secure == true) and we have not converged in
1842  // 20 iterations abort
1843  // (2) This method may be called in cases when the target point is not
1844  // inside the element and we have no business expecting convergence.
1845  // For these cases if we have not converged in 10 iterations forget
1846  // about it.
1847  if (cnt > max_cnt)
1848  {
1849  // Warn about divergence when secure is true - this
1850  // shouldn't happen
1851  if (secure)
1852  {
1853  // Print every time in devel/dbg modes
1854 #ifndef NDEBUG
1855  libmesh_here();
1856  libMesh::err << "WARNING: Newton scheme has not converged in "
1857  << cnt << " iterations:" << std::endl
1858  << " physical_point="
1859  << physical_point
1860  << " physical_guess="
1861  << physical_guess
1862  << " dp="
1863  << dp
1864  << " p="
1865  << p
1866  << " error=" << inverse_map_error
1867  << " in element " << elem->id()
1868  << std::endl;
1869 
1870  elem->print_info(libMesh::err);
1871 #else
1872  // In optimized mode, just print once that an inverse_map() call
1873  // had trouble converging its Newton iteration.
1874  libmesh_do_once(libMesh::err << "WARNING: At least one element took more than "
1875  << max_cnt
1876  << " iterations to converge in inverse_map()...\n"
1877  << "Rerun in devel/dbg mode for more details."
1878  << std::endl;);
1879 
1880 #endif // NDEBUG
1881 
1882  if (cnt > 2*max_cnt)
1883  {
1884  libMesh::err << "ERROR: Newton scheme FAILED to converge in "
1885  << cnt
1886  << " iterations in element "
1887  << elem->id()
1888  << " for physical point = "
1889  << physical_point
1890  << std::endl;
1891 
1892  elem->print_info(libMesh::err);
1893 
1894  libmesh_error_msg("Exiting...");
1895  }
1896  }
1897  // Return a far off point when secure is false - this
1898  // should only happen when we're trying to map a point
1899  // that's outside the element
1900  else
1901  {
1902  for (unsigned int i=0; i != Dim; ++i)
1903  p(i) = 1e6;
1904 
1905  return p;
1906  }
1907  }
1908  }
1909  while (inverse_map_error > tolerance);
1910 
1911 
1912 
1913  // If we are in debug mode do two sanity checks.
1914 #ifdef DEBUG
1915 
1916  if (secure)
1917  {
1918  // Make sure the point \p p on the reference element actually
1919  // does map to the point \p physical_point within a tolerance.
1920 
1921  const Point check = FE<Dim,T>::map (elem, p);
1922  const Point diff = physical_point - check;
1923 
1924  if (diff.norm() > tolerance)
1925  {
1926  libmesh_here();
1927  libMesh::err << "WARNING: diff is "
1928  << diff.norm()
1929  << std::endl
1930  << " point="
1931  << physical_point;
1932  libMesh::err << " local=" << check;
1933  libMesh::err << " lref= " << p;
1934 
1935  elem->print_info(libMesh::err);
1936  }
1937 
1938  // Make sure the point \p p on the reference element actually
1939  // is
1940 
1941  if (!FEAbstract::on_reference_element(p, elem->type(), 2*tolerance))
1942  {
1943  libmesh_here();
1944  libMesh::err << "WARNING: inverse_map of physical point "
1945  << physical_point
1946  << " is not on element." << '\n';
1947  elem->print_info(libMesh::err);
1948  }
1949  }
1950 
1951 #endif
1952 
1953  return p;
1954 }
TensorValue< Real > RealTensorValue
OStreamProxy err(std::cerr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ inverse_map() [2/4]

void libMesh::FE< Dim, T >::inverse_map ( const Elem elem,
const std::vector< Point > &  physical_points,
std::vector< Point > &  reference_points,
const Real  tolerance = TOLERANCE,
const bool  secure = true 
)
staticinherited

Takes a number points in physical space (in the physical_points vector) and finds their location on the reference element for the input element elem. The values on the reference element are returned in the vector reference_points. The optional parameter tolerance defines how close is "good enough." The map inversion iteration computes the sequence $ \{ p_n \} $, and the iteration is terminated when $ \|p - p_n\| < \mbox{\texttt{tolerance}} $

Definition at line 1960 of file fe_map.C.

1965 {
1966  // The number of points to find the
1967  // inverse map of
1968  const std::size_t n_points = physical_points.size();
1969 
1970  // Resize the vector to hold the points
1971  // on the reference element
1972  reference_points.resize(n_points);
1973 
1974  // Find the coordinates on the reference
1975  // element of each point in physical space
1976  for (std::size_t p=0; p<n_points; p++)
1977  reference_points[p] =
1978  FE<Dim,T>::inverse_map (elem, physical_points[p], tolerance, secure);
1979 }

◆ inverse_map() [3/4]

Point libMesh::FE< 2, SUBDIVISION >::inverse_map ( const Elem ,
const Point ,
const Real  ,
const bool   
)
inherited

Definition at line 876 of file fe_subdivision_2D.C.

880 {
881  libmesh_not_implemented();
882 }

◆ inverse_map() [4/4]

void libMesh::FE< 2, SUBDIVISION >::inverse_map ( const Elem ,
const std::vector< Point > &  ,
std::vector< Point > &  ,
Real  ,
bool   
)
inherited

Definition at line 885 of file fe_subdivision_2D.C.

890 {
891  libmesh_not_implemented();
892 }

◆ is_hierarchic() [1/54]

bool libMesh::FE< 0, SCALAR >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 113 of file fe_scalar.C.

113 { return false; }

◆ is_hierarchic() [2/54]

bool libMesh::FE< 1, SCALAR >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 114 of file fe_scalar.C.

114 { return false; }

◆ is_hierarchic() [3/54]

bool libMesh::FE< 2, SCALAR >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 115 of file fe_scalar.C.

115 { return false; }

◆ is_hierarchic() [4/54]

bool libMesh::FE< 3, SCALAR >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 116 of file fe_scalar.C.

116 { return false; }

◆ is_hierarchic() [5/54]

bool libMesh::FE< 0, L2_HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 199 of file fe_l2_hierarchic.C.

199 { return true; }

◆ is_hierarchic() [6/54]

bool libMesh::FE< 1, L2_HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 200 of file fe_l2_hierarchic.C.

200 { return true; }

◆ is_hierarchic() [7/54]

bool libMesh::FE< 2, L2_HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 201 of file fe_l2_hierarchic.C.

201 { return true; }

◆ is_hierarchic() [8/54]

bool libMesh::FE< 3, L2_HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 202 of file fe_l2_hierarchic.C.

202 { return true; }

◆ is_hierarchic() [9/54]

virtual bool libMesh::FE< Dim, T >::is_hierarchic ( ) const
overridevirtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

◆ is_hierarchic() [10/54]

bool libMesh::FE< 0, CLOUGH >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 296 of file fe_clough.C.

296 { return false; } // FIXME - this will be changed

◆ is_hierarchic() [11/54]

bool libMesh::FE< 1, CLOUGH >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 297 of file fe_clough.C.

297 { return false; } // FIXME - this will be changed

◆ is_hierarchic() [12/54]

bool libMesh::FE< 2, CLOUGH >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 298 of file fe_clough.C.

298 { return false; } // FIXME - this will be changed

◆ is_hierarchic() [13/54]

bool libMesh::FE< 3, CLOUGH >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 299 of file fe_clough.C.

299 { return false; } // FIXME - this will be changed

◆ is_hierarchic() [14/54]

bool libMesh::FE< 0, HERMITE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 346 of file fe_hermite.C.

346 { return true; }

◆ is_hierarchic() [15/54]

bool libMesh::FE< 1, HERMITE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 347 of file fe_hermite.C.

347 { return true; }

◆ is_hierarchic() [16/54]

bool libMesh::FE< 2, HERMITE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 348 of file fe_hermite.C.

348 { return true; }

◆ is_hierarchic() [17/54]

bool libMesh::FE< 3, HERMITE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 349 of file fe_hermite.C.

349 { return true; }

◆ is_hierarchic() [18/54]

bool libMesh::FE< 0, HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 375 of file fe_hierarchic.C.

375 { return true; }

◆ is_hierarchic() [19/54]

bool libMesh::FE< 1, HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 376 of file fe_hierarchic.C.

376 { return true; }

◆ is_hierarchic() [20/54]

bool libMesh::FE< 2, HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 377 of file fe_hierarchic.C.

377 { return true; }

◆ is_hierarchic() [21/54]

bool libMesh::FE< 3, HIERARCHIC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 378 of file fe_hierarchic.C.

378 { return true; }

◆ is_hierarchic() [22/54]

bool libMesh::FE< 0, MONOMIAL >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 409 of file fe_monomial.C.

409 { return true; }

◆ is_hierarchic() [23/54]

bool libMesh::FE< 1, MONOMIAL >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 410 of file fe_monomial.C.

410 { return true; }

◆ is_hierarchic() [24/54]

bool libMesh::FE< 2, MONOMIAL >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 411 of file fe_monomial.C.

411 { return true; }

◆ is_hierarchic() [25/54]

bool libMesh::FE< 3, MONOMIAL >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 412 of file fe_monomial.C.

412 { return true; }

◆ is_hierarchic() [26/54]

bool libMesh::FE< 0, BERNSTEIN >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 442 of file fe_bernstein.C.

442 { return false; }

◆ is_hierarchic() [27/54]

bool libMesh::FE< 1, BERNSTEIN >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 443 of file fe_bernstein.C.

443 { return false; }

◆ is_hierarchic() [28/54]

bool libMesh::FE< 2, BERNSTEIN >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 444 of file fe_bernstein.C.

444 { return false; }

◆ is_hierarchic() [29/54]

bool libMesh::FE< 3, BERNSTEIN >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 445 of file fe_bernstein.C.

445 { return false; }

◆ is_hierarchic() [30/54]

bool libMesh::FE< 0, L2_LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 480 of file fe_l2_lagrange.C.

480 { return false; }

◆ is_hierarchic() [31/54]

bool libMesh::FE< 1, L2_LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 481 of file fe_l2_lagrange.C.

481 { return false; }

◆ is_hierarchic() [32/54]

bool libMesh::FE< 2, L2_LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 482 of file fe_l2_lagrange.C.

482 { return false; }

◆ is_hierarchic() [33/54]

bool libMesh::FE< 3, L2_LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 483 of file fe_l2_lagrange.C.

483 { return false; }

◆ is_hierarchic() [34/54]

bool libMesh::FE< 0, NEDELEC_ONE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 550 of file fe_nedelec_one.C.

550 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ is_hierarchic() [35/54]

bool libMesh::FE< 1, NEDELEC_ONE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 551 of file fe_nedelec_one.C.

551 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ is_hierarchic() [36/54]

bool libMesh::FE< 2, NEDELEC_ONE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 552 of file fe_nedelec_one.C.

552 { return false; }

◆ is_hierarchic() [37/54]

bool libMesh::FE< 3, NEDELEC_ONE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 553 of file fe_nedelec_one.C.

553 { return false; }

◆ is_hierarchic() [38/54]

bool libMesh::FE< 0, LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 883 of file fe_lagrange.C.

883 { return false; }

◆ is_hierarchic() [39/54]

bool libMesh::FE< 1, LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 884 of file fe_lagrange.C.

884 { return false; }

◆ is_hierarchic() [40/54]

bool libMesh::FE< 2, LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 885 of file fe_lagrange.C.

885 { return false; }

◆ is_hierarchic() [41/54]

bool libMesh::FE< 3, LAGRANGE >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 886 of file fe_lagrange.C.

886 { return false; }

◆ is_hierarchic() [42/54]

bool libMesh::FE< 2, SUBDIVISION >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 913 of file fe_subdivision_2D.C.

913 { return false; }

◆ is_hierarchic() [43/54]

bool libMesh::FE< 0, XYZ >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 932 of file fe_xyz.C.

932 { return true; }

◆ is_hierarchic() [44/54]

bool libMesh::FE< 0, LAGRANGE_VEC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 933 of file fe_lagrange_vec.C.

933 { return false; }

◆ is_hierarchic() [45/54]

bool libMesh::FE< 1, XYZ >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 933 of file fe_xyz.C.

933 { return true; }

◆ is_hierarchic() [46/54]

bool libMesh::FE< 1, LAGRANGE_VEC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 934 of file fe_lagrange_vec.C.

934 { return false; }

◆ is_hierarchic() [47/54]

bool libMesh::FE< 2, XYZ >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 934 of file fe_xyz.C.

934 { return true; }

◆ is_hierarchic() [48/54]

bool libMesh::FE< 2, LAGRANGE_VEC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 935 of file fe_lagrange_vec.C.

935 { return false; }

◆ is_hierarchic() [49/54]

bool libMesh::FE< 3, XYZ >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 935 of file fe_xyz.C.

935 { return true; }

◆ is_hierarchic() [50/54]

bool libMesh::FE< 3, LAGRANGE_VEC >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 936 of file fe_lagrange_vec.C.

936 { return false; }

◆ is_hierarchic() [51/54]

bool libMesh::FE< 0, SZABAB >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1279 of file fe_szabab.C.

1279 { return true; }

◆ is_hierarchic() [52/54]

bool libMesh::FE< 1, SZABAB >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1280 of file fe_szabab.C.

1280 { return true; }

◆ is_hierarchic() [53/54]

bool libMesh::FE< 2, SZABAB >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1281 of file fe_szabab.C.

1281 { return true; }

◆ is_hierarchic() [54/54]

bool libMesh::FE< 3, SZABAB >::is_hierarchic ( ) const
virtualinherited
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1282 of file fe_szabab.C.

1282 { return true; }

◆ map()

Point libMesh::FE< Dim, T >::map ( const Elem elem,
const Point reference_point 
)
staticinherited
Returns
The location (in physical space) of the point p located on the reference element.

Definition at line 1985 of file fe_map.C.

1987 {
1988  libmesh_assert(elem);
1989 
1990  Point p;
1991 
1992  const ElemType type = elem->type();
1993  const Order order = elem->default_order();
1994  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
1995 
1996  // Lagrange basis functions are used for mapping
1997  for (unsigned int i=0; i<n_sf; i++)
1998  p.add_scaled (elem->point(i),
2000  order,
2001  i,
2002  reference_point)
2003  );
2004 
2005  return p;
2006 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
virtual unsigned int n_shape_functions() const override
Definition: fe.C:50

◆ map_eta()

Point libMesh::FE< Dim, T >::map_eta ( const Elem elem,
const Point reference_point 
)
staticinherited
Returns
d(xyz)/deta (in physical space) of the point p located on the reference element.

Definition at line 2040 of file fe_map.C.

2042 {
2043  libmesh_assert(elem);
2044 
2045  Point p;
2046 
2047  const ElemType type = elem->type();
2048  const Order order = elem->default_order();
2049  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2050 
2051  // Lagrange basis functions are used for mapping
2052  for (unsigned int i=0; i<n_sf; i++)
2053  p.add_scaled (elem->point(i),
2055  order,
2056  i,
2057  1,
2058  reference_point)
2059  );
2060 
2061  return p;
2062 }
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const override
Definition: fe.C:50

◆ map_xi()

Point libMesh::FE< Dim, T >::map_xi ( const Elem elem,
const Point reference_point 
)
staticinherited
Returns
d(xyz)/dxi (in physical space) of the point p located on the reference element.

Definition at line 2012 of file fe_map.C.

2014 {
2015  libmesh_assert(elem);
2016 
2017  Point p;
2018 
2019  const ElemType type = elem->type();
2020  const Order order = elem->default_order();
2021  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2022 
2023  // Lagrange basis functions are used for mapping
2024  for (unsigned int i=0; i<n_sf; i++)
2025  p.add_scaled (elem->point(i),
2027  order,
2028  i,
2029  0,
2030  reference_point)
2031  );
2032 
2033  return p;
2034 }
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const override
Definition: fe.C:50

◆ map_zeta()

Point libMesh::FE< Dim, T >::map_zeta ( const Elem elem,
const Point reference_point 
)
staticinherited
Returns
d(xyz)/dzeta (in physical space) of the point p located on the reference element.

Definition at line 2068 of file fe_map.C.

2070 {
2071  libmesh_assert(elem);
2072 
2073  Point p;
2074 
2075  const ElemType type = elem->type();
2076  const Order order = elem->default_order();
2077  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2078 
2079  // Lagrange basis functions are used for mapping
2080  for (unsigned int i=0; i<n_sf; i++)
2081  p.add_scaled (elem->point(i),
2083  order,
2084  i,
2085  2,
2086  reference_point)
2087  );
2088 
2089  return p;
2090 }
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const override
Definition: fe.C:50

◆ n_dofs() [1/54]

unsigned int libMesh::FE< 0, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)
inherited

Definition at line 87 of file fe_scalar.C.

87 { return o; }

◆ n_dofs() [2/54]

unsigned int libMesh::FE< 1, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)
inherited

Definition at line 88 of file fe_scalar.C.

88 { return o; }

◆ n_dofs() [3/54]

unsigned int libMesh::FE< 2, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)
inherited

Definition at line 89 of file fe_scalar.C.

89 { return o; }

◆ n_dofs() [4/54]

unsigned int libMesh::FE< 3, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)
inherited

Definition at line 90 of file fe_scalar.C.

90 { return o; }

◆ n_dofs() [5/54]

unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 174 of file fe_l2_hierarchic.C.

174 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs() [6/54]

unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 175 of file fe_l2_hierarchic.C.

175 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs() [7/54]

unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 176 of file fe_l2_hierarchic.C.

176 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs() [8/54]

unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 177 of file fe_l2_hierarchic.C.

177 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs() [9/54]

static unsigned int libMesh::FE< Dim, T >::n_dofs ( const ElemType  t,
const Order  o 
)
staticinherited
Returns
The number of shape functions associated with this finite element.

On a p-refined element, o should be the total order of the element.

◆ n_dofs() [10/54]

unsigned int libMesh::FE< 0, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 271 of file fe_clough.C.

271 { return clough_n_dofs(t, o); }

◆ n_dofs() [11/54]

unsigned int libMesh::FE< 1, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 272 of file fe_clough.C.

272 { return clough_n_dofs(t, o); }

◆ n_dofs() [12/54]

unsigned int libMesh::FE< 2, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 273 of file fe_clough.C.

273 { return clough_n_dofs(t, o); }

◆ n_dofs() [13/54]

unsigned int libMesh::FE< 3, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 274 of file fe_clough.C.

274 { return clough_n_dofs(t, o); }

◆ n_dofs() [14/54]

unsigned int libMesh::FE< 0, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 321 of file fe_hermite.C.

321 { return hermite_n_dofs(t, o); }

◆ n_dofs() [15/54]

unsigned int libMesh::FE< 1, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 322 of file fe_hermite.C.

322 { return hermite_n_dofs(t, o); }

◆ n_dofs() [16/54]

unsigned int libMesh::FE< 2, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 323 of file fe_hermite.C.

323 { return hermite_n_dofs(t, o); }

◆ n_dofs() [17/54]

unsigned int libMesh::FE< 3, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 324 of file fe_hermite.C.

324 { return hermite_n_dofs(t, o); }

◆ n_dofs() [18/54]

unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 351 of file fe_hierarchic.C.

351 { return hierarchic_n_dofs(t, o); }

◆ n_dofs() [19/54]

unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 352 of file fe_hierarchic.C.

352 { return hierarchic_n_dofs(t, o); }

◆ n_dofs() [20/54]

unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 353 of file fe_hierarchic.C.

353 { return hierarchic_n_dofs(t, o); }

◆ n_dofs() [21/54]

unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 354 of file fe_hierarchic.C.

354 { return hierarchic_n_dofs(t, o); }

◆ n_dofs() [22/54]

unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 382 of file fe_monomial.C.

382 { return monomial_n_dofs(t, o); }

◆ n_dofs() [23/54]

unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 383 of file fe_monomial.C.

383 { return monomial_n_dofs(t, o); }

◆ n_dofs() [24/54]

unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 384 of file fe_monomial.C.

384 { return monomial_n_dofs(t, o); }

◆ n_dofs() [25/54]

unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 385 of file fe_monomial.C.

385 { return monomial_n_dofs(t, o); }

◆ n_dofs() [26/54]

unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 418 of file fe_bernstein.C.

418 { return bernstein_n_dofs(t, o); }

◆ n_dofs() [27/54]

unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 419 of file fe_bernstein.C.

419 { return bernstein_n_dofs(t, o); }

◆ n_dofs() [28/54]

unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 420 of file fe_bernstein.C.

420 { return bernstein_n_dofs(t, o); }

◆ n_dofs() [29/54]

unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 421 of file fe_bernstein.C.

421 { return bernstein_n_dofs(t, o); }

◆ n_dofs() [30/54]

unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 454 of file fe_l2_lagrange.C.

454 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs() [31/54]

unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 455 of file fe_l2_lagrange.C.

455 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs() [32/54]

unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 456 of file fe_l2_lagrange.C.

456 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs() [33/54]

unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 457 of file fe_l2_lagrange.C.

457 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs() [34/54]

unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs ( const ElemType  ,
const Order   
)
inherited

Definition at line 522 of file fe_nedelec_one.C.

522 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs() [35/54]

unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs ( const ElemType  ,
const Order   
)
inherited

Definition at line 523 of file fe_nedelec_one.C.

523 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs() [36/54]

unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 524 of file fe_nedelec_one.C.

524 { return nedelec_one_n_dofs(t, o); }

◆ n_dofs() [37/54]

unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 525 of file fe_nedelec_one.C.

525 { return nedelec_one_n_dofs(t, o); }

◆ n_dofs() [38/54]

unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 855 of file fe_lagrange.C.

855 { return lagrange_n_dofs(t, o); }

◆ n_dofs() [39/54]

unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 856 of file fe_lagrange.C.

856 { return lagrange_n_dofs(t, o); }

◆ n_dofs() [40/54]

unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 857 of file fe_lagrange.C.

857 { return lagrange_n_dofs(t, o); }

◆ n_dofs() [41/54]

unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 858 of file fe_lagrange.C.

858 { return lagrange_n_dofs(t, o); }

◆ n_dofs() [42/54]

unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs ( const ElemType  ,
const Order   
)
inherited

Definition at line 897 of file fe_subdivision_2D.C.

897 { libmesh_not_implemented(); return 0; }

◆ n_dofs() [43/54]

unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 905 of file fe_lagrange_vec.C.

905 { return FE<0,LAGRANGE>::n_dofs(t,o); }

◆ n_dofs() [44/54]

unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 906 of file fe_lagrange_vec.C.

906 { return FE<1,LAGRANGE>::n_dofs(t,o); }

◆ n_dofs() [45/54]

unsigned int libMesh::FE< 0, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 906 of file fe_xyz.C.

906 { return xyz_n_dofs(t, o); }

◆ n_dofs() [46/54]

unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 907 of file fe_lagrange_vec.C.

907 { return 2*FE<2,LAGRANGE>::n_dofs(t,o); }

◆ n_dofs() [47/54]

unsigned int libMesh::FE< 1, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 907 of file fe_xyz.C.

907 { return xyz_n_dofs(t, o); }

◆ n_dofs() [48/54]

unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 908 of file fe_lagrange_vec.C.

908 { return 3*FE<3,LAGRANGE>::n_dofs(t,o); }

◆ n_dofs() [49/54]

unsigned int libMesh::FE< 2, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 908 of file fe_xyz.C.

908 { return xyz_n_dofs(t, o); }

◆ n_dofs() [50/54]

unsigned int libMesh::FE< 3, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 909 of file fe_xyz.C.

909 { return xyz_n_dofs(t, o); }

◆ n_dofs() [51/54]

unsigned int libMesh::FE< 0, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1255 of file fe_szabab.C.

1255 { return szabab_n_dofs(t, o); }

◆ n_dofs() [52/54]

unsigned int libMesh::FE< 1, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1256 of file fe_szabab.C.

1256 { return szabab_n_dofs(t, o); }

◆ n_dofs() [53/54]

unsigned int libMesh::FE< 2, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1257 of file fe_szabab.C.

1257 { return szabab_n_dofs(t, o); }

◆ n_dofs() [54/54]

unsigned int libMesh::FE< 3, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1258 of file fe_szabab.C.

1258 { return szabab_n_dofs(t, o); }

◆ n_dofs_at_node() [1/54]

unsigned int libMesh::FE< 0, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 94 of file fe_scalar.C.

94 { return 0; }

◆ n_dofs_at_node() [2/54]

unsigned int libMesh::FE< 1, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 95 of file fe_scalar.C.

95 { return 0; }

◆ n_dofs_at_node() [3/54]

unsigned int libMesh::FE< 2, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 96 of file fe_scalar.C.

96 { return 0; }

◆ n_dofs_at_node() [4/54]

unsigned int libMesh::FE< 3, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 97 of file fe_scalar.C.

97 { return 0; }

◆ n_dofs_at_node() [5/54]

unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 181 of file fe_l2_hierarchic.C.

181 { return 0; }

◆ n_dofs_at_node() [6/54]

unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 182 of file fe_l2_hierarchic.C.

182 { return 0; }

◆ n_dofs_at_node() [7/54]

unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 183 of file fe_l2_hierarchic.C.

183 { return 0; }

◆ n_dofs_at_node() [8/54]

unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 184 of file fe_l2_hierarchic.C.

184 { return 0; }

◆ n_dofs_at_node() [9/54]

static unsigned int libMesh::FE< Dim, T >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
staticinherited
Returns
The number of dofs at node n for a finite element of type t and order o.

On a p-refined element, o should be the total order of the element.

◆ n_dofs_at_node() [10/54]

unsigned int libMesh::FE< 0, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 278 of file fe_clough.C.

278 { return clough_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [11/54]

unsigned int libMesh::FE< 1, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 279 of file fe_clough.C.

279 { return clough_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [12/54]

unsigned int libMesh::FE< 2, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 280 of file fe_clough.C.

280 { return clough_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [13/54]

unsigned int libMesh::FE< 3, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 281 of file fe_clough.C.

281 { return clough_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [14/54]

unsigned int libMesh::FE< 0, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 328 of file fe_hermite.C.

328 { return hermite_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [15/54]

unsigned int libMesh::FE< 1, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 329 of file fe_hermite.C.

329 { return hermite_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [16/54]

unsigned int libMesh::FE< 2, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 330 of file fe_hermite.C.

330 { return hermite_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [17/54]

unsigned int libMesh::FE< 3, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 331 of file fe_hermite.C.

331 { return hermite_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [18/54]

unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 357 of file fe_hierarchic.C.

357 { return hierarchic_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [19/54]

unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 358 of file fe_hierarchic.C.

358 { return hierarchic_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [20/54]

unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 359 of file fe_hierarchic.C.

359 { return hierarchic_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [21/54]

unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 360 of file fe_hierarchic.C.

360 { return hierarchic_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [22/54]

unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 389 of file fe_monomial.C.

389 { return 0; }

◆ n_dofs_at_node() [23/54]

unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 390 of file fe_monomial.C.

390 { return 0; }

◆ n_dofs_at_node() [24/54]

unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 391 of file fe_monomial.C.

391 { return 0; }

◆ n_dofs_at_node() [25/54]

unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 392 of file fe_monomial.C.

392 { return 0; }

◆ n_dofs_at_node() [26/54]

unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 424 of file fe_bernstein.C.

424 { return bernstein_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [27/54]

unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 425 of file fe_bernstein.C.

425 { return bernstein_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [28/54]

unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 426 of file fe_bernstein.C.

426 { return bernstein_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [29/54]

unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 427 of file fe_bernstein.C.

427 { return bernstein_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [30/54]

unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 461 of file fe_l2_lagrange.C.

461 { return 0; }

◆ n_dofs_at_node() [31/54]

unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 462 of file fe_l2_lagrange.C.

462 { return 0; }

◆ n_dofs_at_node() [32/54]

unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 463 of file fe_l2_lagrange.C.

463 { return 0; }

◆ n_dofs_at_node() [33/54]

unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 464 of file fe_l2_lagrange.C.

464 { return 0; }

◆ n_dofs_at_node() [34/54]

unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 530 of file fe_nedelec_one.C.

530 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs_at_node() [35/54]

unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 531 of file fe_nedelec_one.C.

531 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs_at_node() [36/54]

unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 532 of file fe_nedelec_one.C.

532 { return nedelec_one_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [37/54]

unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 533 of file fe_nedelec_one.C.

533 { return nedelec_one_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [38/54]

unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 863 of file fe_lagrange.C.

863 { return lagrange_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [39/54]

unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 864 of file fe_lagrange.C.

864 { return lagrange_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [40/54]

unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 865 of file fe_lagrange.C.

865 { return lagrange_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [41/54]

unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 866 of file fe_lagrange.C.

866 { return lagrange_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [42/54]

unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 900 of file fe_subdivision_2D.C.

900 { return 1; }

◆ n_dofs_at_node() [43/54]

unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 913 of file fe_lagrange_vec.C.

913 { return FE<0,LAGRANGE>::n_dofs_at_node(t,o,n); }

◆ n_dofs_at_node() [44/54]

unsigned int libMesh::FE< 0, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 913 of file fe_xyz.C.

913 { return 0; }

◆ n_dofs_at_node() [45/54]

unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 914 of file fe_lagrange_vec.C.

914 { return FE<1,LAGRANGE>::n_dofs_at_node(t,o,n); }

◆ n_dofs_at_node() [46/54]

unsigned int libMesh::FE< 1, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 914 of file fe_xyz.C.

914 { return 0; }

◆ n_dofs_at_node() [47/54]

unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 915 of file fe_lagrange_vec.C.

915 { return 2*FE<2,LAGRANGE>::n_dofs_at_node(t,o,n); }

◆ n_dofs_at_node() [48/54]

unsigned int libMesh::FE< 2, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 915 of file fe_xyz.C.

915 { return 0; }

◆ n_dofs_at_node() [49/54]

unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 916 of file fe_lagrange_vec.C.

916 { return 3*FE<2,LAGRANGE>::n_dofs_at_node(t,o,n); }

◆ n_dofs_at_node() [50/54]

unsigned int libMesh::FE< 3, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)
inherited

Definition at line 916 of file fe_xyz.C.

916 { return 0; }

◆ n_dofs_at_node() [51/54]

unsigned int libMesh::FE< 0, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 1261 of file fe_szabab.C.

1261 { return szabab_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [52/54]

unsigned int libMesh::FE< 1, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 1262 of file fe_szabab.C.

1262 { return szabab_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [53/54]

unsigned int libMesh::FE< 2, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 1263 of file fe_szabab.C.

1263 { return szabab_n_dofs_at_node(t, o, n); }

◆ n_dofs_at_node() [54/54]

unsigned int libMesh::FE< 3, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
inherited

Definition at line 1264 of file fe_szabab.C.

1264 { return szabab_n_dofs_at_node(t, o, n); }

◆ n_dofs_per_elem() [1/54]

unsigned int libMesh::FE< 0, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 101 of file fe_scalar.C.

101 { return 0; }

◆ n_dofs_per_elem() [2/54]

unsigned int libMesh::FE< 1, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 102 of file fe_scalar.C.

102 { return 0; }

◆ n_dofs_per_elem() [3/54]

unsigned int libMesh::FE< 2, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 103 of file fe_scalar.C.

103 { return 0; }

◆ n_dofs_per_elem() [4/54]

unsigned int libMesh::FE< 3, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 104 of file fe_scalar.C.

104 { return 0; }

◆ n_dofs_per_elem() [5/54]

unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 187 of file fe_l2_hierarchic.C.

187 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs_per_elem() [6/54]

unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 188 of file fe_l2_hierarchic.C.

188 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs_per_elem() [7/54]

unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 189 of file fe_l2_hierarchic.C.

189 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs_per_elem() [8/54]

unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 190 of file fe_l2_hierarchic.C.

190 { return l2_hierarchic_n_dofs(t, o); }

◆ n_dofs_per_elem() [9/54]

static unsigned int libMesh::FE< Dim, T >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
staticinherited
Returns
The number of dofs interior to the element, not associated with any interior nodes.

On a p-refined element, o should be the total order of the element.

◆ n_dofs_per_elem() [10/54]

unsigned int libMesh::FE< 0, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 284 of file fe_clough.C.

284 { return clough_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [11/54]

unsigned int libMesh::FE< 1, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 285 of file fe_clough.C.

285 { return clough_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [12/54]

unsigned int libMesh::FE< 2, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 286 of file fe_clough.C.

286 { return clough_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [13/54]

unsigned int libMesh::FE< 3, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 287 of file fe_clough.C.

287 { return clough_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [14/54]

unsigned int libMesh::FE< 0, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 334 of file fe_hermite.C.

334 { return hermite_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [15/54]

unsigned int libMesh::FE< 1, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 335 of file fe_hermite.C.

335 { return hermite_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [16/54]

unsigned int libMesh::FE< 2, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 336 of file fe_hermite.C.

336 { return hermite_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [17/54]

unsigned int libMesh::FE< 3, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 337 of file fe_hermite.C.

337 { return hermite_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [18/54]

unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 363 of file fe_hierarchic.C.

363 { return hierarchic_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [19/54]

unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 364 of file fe_hierarchic.C.

364 { return hierarchic_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [20/54]

unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 365 of file fe_hierarchic.C.

365 { return hierarchic_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [21/54]

unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 366 of file fe_hierarchic.C.

366 { return hierarchic_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [22/54]

unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 395 of file fe_monomial.C.

395 { return monomial_n_dofs(t, o); }

◆ n_dofs_per_elem() [23/54]

unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 396 of file fe_monomial.C.

396 { return monomial_n_dofs(t, o); }

◆ n_dofs_per_elem() [24/54]

unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 397 of file fe_monomial.C.

397 { return monomial_n_dofs(t, o); }

◆ n_dofs_per_elem() [25/54]

unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 398 of file fe_monomial.C.

398 { return monomial_n_dofs(t, o); }

◆ n_dofs_per_elem() [26/54]

unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 430 of file fe_bernstein.C.

430 { return bernstein_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [27/54]

unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 431 of file fe_bernstein.C.

431 { return bernstein_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [28/54]

unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 432 of file fe_bernstein.C.

432 { return bernstein_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [29/54]

unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 433 of file fe_bernstein.C.

433 { return bernstein_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [30/54]

unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 468 of file fe_l2_lagrange.C.

468 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs_per_elem() [31/54]

unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 469 of file fe_l2_lagrange.C.

469 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs_per_elem() [32/54]

unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 470 of file fe_l2_lagrange.C.

470 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs_per_elem() [33/54]

unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 471 of file fe_l2_lagrange.C.

471 { return l2_lagrange_n_dofs(t, o); }

◆ n_dofs_per_elem() [34/54]

unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 538 of file fe_nedelec_one.C.

538 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs_per_elem() [35/54]

unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 539 of file fe_nedelec_one.C.

539 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ n_dofs_per_elem() [36/54]

unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 540 of file fe_nedelec_one.C.

540 { return 0; }

◆ n_dofs_per_elem() [37/54]

unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 541 of file fe_nedelec_one.C.

541 { return 0; }

◆ n_dofs_per_elem() [38/54]

unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 871 of file fe_lagrange.C.

871 { return 0; }

◆ n_dofs_per_elem() [39/54]

unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 872 of file fe_lagrange.C.

872 { return 0; }

◆ n_dofs_per_elem() [40/54]

unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 873 of file fe_lagrange.C.

873 { return 0; }

◆ n_dofs_per_elem() [41/54]

unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 874 of file fe_lagrange.C.

874 { return 0; }

◆ n_dofs_per_elem() [42/54]

unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 903 of file fe_subdivision_2D.C.

903 { return 0; }

◆ n_dofs_per_elem() [43/54]

unsigned int libMesh::FE< 0, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 919 of file fe_xyz.C.

919 { return xyz_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [44/54]

unsigned int libMesh::FE< 1, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 920 of file fe_xyz.C.

920 { return xyz_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [45/54]

unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 921 of file fe_lagrange_vec.C.

921 { return 0; }

◆ n_dofs_per_elem() [46/54]

unsigned int libMesh::FE< 2, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 921 of file fe_xyz.C.

921 { return xyz_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [47/54]

unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 922 of file fe_lagrange_vec.C.

922 { return 0; }

◆ n_dofs_per_elem() [48/54]

unsigned int libMesh::FE< 3, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 922 of file fe_xyz.C.

922 { return xyz_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [49/54]

unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 923 of file fe_lagrange_vec.C.

923 { return 0; }

◆ n_dofs_per_elem() [50/54]

unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)
inherited

Definition at line 924 of file fe_lagrange_vec.C.

924 { return 0; }

◆ n_dofs_per_elem() [51/54]

unsigned int libMesh::FE< 0, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1267 of file fe_szabab.C.

1267 { return szabab_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [52/54]

unsigned int libMesh::FE< 1, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1268 of file fe_szabab.C.

1268 { return szabab_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [53/54]

unsigned int libMesh::FE< 2, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1269 of file fe_szabab.C.

1269 { return szabab_n_dofs_per_elem(t, o); }

◆ n_dofs_per_elem() [54/54]

unsigned int libMesh::FE< 3, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
inherited

Definition at line 1270 of file fe_szabab.C.

1270 { return szabab_n_dofs_per_elem(t, o); }

◆ n_objects()

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

84  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects

◆ n_quadrature_points()

unsigned int libMesh::FE< Dim, T >::n_quadrature_points ( ) const
overridevirtualinherited
Returns
The total number of quadrature points. Call this to get an upper bound for the for loop in your simulation for matrix assembly of the current element.

Implements libMesh::FEAbstract.

Definition at line 69 of file fe.C.

70 {
71  libmesh_assert(this->qrule);
72  return this->qrule->n_points();
73 }
unsigned int n_points() const
Definition: quadrature.h:127

◆ n_shape_functions() [1/2]

unsigned int libMesh::FE< Dim, T >::n_shape_functions ( ) const
overridevirtualinherited
Returns
The number of shape functions associated with this finite element.

Implements libMesh::FEAbstract.

Definition at line 50 of file fe.C.

51 {
52  return FE<Dim,T>::n_dofs (this->elem_type,
53  static_cast<Order>(this->fe_type.order + this->_p_level));
54 }
OrderWrapper order
Definition: fe_type.h:198

◆ n_shape_functions() [2/2]

static unsigned int libMesh::FE< Dim, T >::n_shape_functions ( const ElemType  t,
const Order  o 
)
inlinestaticinherited
Returns
The number of shape functions associated with a finite element of type t and approximation order o.

On a p-refined element, o should be the total order of the element.

Definition at line 228 of file fe.h.

230  { return FE<Dim,T>::n_dofs (t,o); }

◆ nodal_soln() [1/54]

void libMesh::FE< 0, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 58 of file fe_scalar.C.

62 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [2/54]

void libMesh::FE< 1, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 65 of file fe_scalar.C.

69 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [3/54]

void libMesh::FE< 2, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 72 of file fe_scalar.C.

76 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [4/54]

void libMesh::FE< 3, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 79 of file fe_scalar.C.

83 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [5/54]

void libMesh::FE< 0, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 146 of file fe_l2_hierarchic.C.

150 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [6/54]

void libMesh::FE< 1, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 153 of file fe_l2_hierarchic.C.

157 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [7/54]

void libMesh::FE< 2, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 160 of file fe_l2_hierarchic.C.

164 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [8/54]

void libMesh::FE< 3, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 167 of file fe_l2_hierarchic.C.

171 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [9/54]

static void libMesh::FE< Dim, T >::nodal_soln ( const Elem elem,
const Order  o,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
staticinherited

Build the nodal soln from the element soln. This is the solution that will be plotted.

On a p-refined element, o should be the base order of the element.

◆ nodal_soln() [10/54]

void libMesh::FE< 0, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 242 of file fe_clough.C.

246 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [11/54]

void libMesh::FE< 1, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 249 of file fe_clough.C.

253 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [12/54]

void libMesh::FE< 2, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 256 of file fe_clough.C.

260 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [13/54]

void libMesh::FE< 3, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 263 of file fe_clough.C.

267 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [14/54]

void libMesh::FE< 0, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 288 of file fe_hermite.C.

292 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [15/54]

void libMesh::FE< 1, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 295 of file fe_hermite.C.

299 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [16/54]

void libMesh::FE< 2, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 302 of file fe_hermite.C.

306 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [17/54]

void libMesh::FE< 3, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 309 of file fe_hermite.C.

313 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [18/54]

void libMesh::FE< 0, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 322 of file fe_hierarchic.C.

326 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [19/54]

void libMesh::FE< 1, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 329 of file fe_hierarchic.C.

333 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [20/54]

void libMesh::FE< 2, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 336 of file fe_hierarchic.C.

340 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [21/54]

void libMesh::FE< 3, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 343 of file fe_hierarchic.C.

347 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [22/54]

void libMesh::FE< 0, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 353 of file fe_monomial.C.

357 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [23/54]

void libMesh::FE< 1, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 360 of file fe_monomial.C.

364 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [24/54]

void libMesh::FE< 2, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 367 of file fe_monomial.C.

371 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [25/54]

void libMesh::FE< 3, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 374 of file fe_monomial.C.

378 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [26/54]

void libMesh::FE< 0, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 389 of file fe_bernstein.C.

393 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [27/54]

void libMesh::FE< 1, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 396 of file fe_bernstein.C.

400 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [28/54]

void libMesh::FE< 2, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 403 of file fe_bernstein.C.

407 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [29/54]

void libMesh::FE< 3, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 410 of file fe_bernstein.C.

414 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [30/54]

void libMesh::FE< 0, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 423 of file fe_l2_lagrange.C.

427 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [31/54]

void libMesh::FE< 1, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 430 of file fe_l2_lagrange.C.

434 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [32/54]

void libMesh::FE< 2, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 437 of file fe_l2_lagrange.C.

441 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [33/54]

void libMesh::FE< 3, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 444 of file fe_l2_lagrange.C.

448 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [34/54]

void libMesh::FE< 0, NEDELEC_ONE >::nodal_soln ( const Elem ,
const Order  ,
const std::vector< Number > &  ,
std::vector< Number > &   
)
inherited

Definition at line 491 of file fe_nedelec_one.C.

495 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ nodal_soln() [35/54]

void libMesh::FE< 1, NEDELEC_ONE >::nodal_soln ( const Elem ,
const Order  ,
const std::vector< Number > &  ,
std::vector< Number > &   
)
inherited

Definition at line 498 of file fe_nedelec_one.C.

502 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ nodal_soln() [36/54]

void libMesh::FE< 2, NEDELEC_ONE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 505 of file fe_nedelec_one.C.

509 { nedelec_one_nodal_soln(elem, order, elem_soln, 2 /*dim*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [37/54]

void libMesh::FE< 0, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 507 of file fe_lagrange_vec.C.

511 { FE<0,LAGRANGE>::nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [38/54]

void libMesh::FE< 3, NEDELEC_ONE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 512 of file fe_nedelec_one.C.

516 { nedelec_one_nodal_soln(elem, order, elem_soln, 3 /*dim*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [39/54]

void libMesh::FE< 1, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 514 of file fe_lagrange_vec.C.

518 { FE<1,LAGRANGE>::nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [40/54]

void libMesh::FE< 2, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 521 of file fe_lagrange_vec.C.

525 { lagrange_vec_nodal_soln(elem, order, elem_soln, 2 /*dimension*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [41/54]

void libMesh::FE< 3, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 528 of file fe_lagrange_vec.C.

532 { lagrange_vec_nodal_soln(elem, order, elem_soln, 3 /*dimension*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [42/54]

void libMesh::FE< 2, SUBDIVISION >::nodal_soln ( const Elem elem,
const Order  ,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 818 of file fe_subdivision_2D.C.

822 {
823  libmesh_assert(elem);
824  libmesh_assert_equal_to(elem->type(), TRI3SUBDIVISION);
825  const Tri3Subdivision * sd_elem = static_cast<const Tri3Subdivision *>(elem);
826 
827  nodal_soln.resize(3); // three nodes per element
828 
829  // Ghost nodes are auxiliary.
830  if (sd_elem->is_ghost())
831  {
832  nodal_soln[0] = 0;
833  nodal_soln[1] = 0;
834  nodal_soln[2] = 0;
835  return;
836  }
837 
838  // First node (node 0 in the element patch):
839  unsigned int j = sd_elem->local_node_number(sd_elem->get_ordered_node(0)->id());
840  nodal_soln[j] = elem_soln[0];
841 
842  // Second node (node 1 in the element patch):
843  j = sd_elem->local_node_number(sd_elem->get_ordered_node(1)->id());
844  nodal_soln[j] = elem_soln[1];
845 
846  // Third node (node 'valence' in the element patch):
847  j = sd_elem->local_node_number(sd_elem->get_ordered_node(2)->id());
848  nodal_soln[j] = elem_soln[sd_elem->get_ordered_valence(0)];
849 }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [43/54]

void libMesh::FE< 0, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 824 of file fe_lagrange.C.

828 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [44/54]

void libMesh::FE< 1, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 831 of file fe_lagrange.C.

835 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [45/54]

void libMesh::FE< 2, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 838 of file fe_lagrange.C.

842 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [46/54]

void libMesh::FE< 3, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 845 of file fe_lagrange.C.

849 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [47/54]

void libMesh::FE< 0, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 876 of file fe_xyz.C.

880 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [48/54]

void libMesh::FE< 1, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 883 of file fe_xyz.C.

887 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [49/54]

void libMesh::FE< 2, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 890 of file fe_xyz.C.

894 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [50/54]

void libMesh::FE< 3, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 897 of file fe_xyz.C.

901 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [51/54]

void libMesh::FE< 0, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 1226 of file fe_szabab.C.

1230 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [52/54]

void libMesh::FE< 1, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 1233 of file fe_szabab.C.

1237 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [53/54]

void libMesh::FE< 2, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 1240 of file fe_szabab.C.

1244 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ nodal_soln() [54/54]

void libMesh::FE< 3, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
inherited

Definition at line 1247 of file fe_szabab.C.

1251 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)

◆ on_reference_element()

bool libMesh::FEAbstract::on_reference_element ( const Point p,
const ElemType  t,
const Real  eps = TOLERANCE 
)
staticinherited
Returns
true if the point p is located on the reference element for element type t, false otherwise. Since we are doing floating point comparisons here the parameter eps can be specified to indicate a tolerance. For example, $ x \le 1 $ becomes $ x \le 1 + \epsilon $.

Definition at line 581 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::Real, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::FEInterface::ifem_on_reference_element(), libMesh::FE< Dim, LAGRANGE_VEC >::inverse_map(), and libMesh::FEInterface::on_reference_element().

582 {
583  libmesh_assert_greater_equal (eps, 0.);
584 
585  const Real xi = p(0);
586 #if LIBMESH_DIM > 1
587  const Real eta = p(1);
588 #else
589  const Real eta = 0.;
590 #endif
591 #if LIBMESH_DIM > 2
592  const Real zeta = p(2);
593 #else
594  const Real zeta = 0.;
595 #endif
596 
597  switch (t)
598  {
599  case NODEELEM:
600  {
601  return (!xi && !eta && !zeta);
602  }
603  case EDGE2:
604  case EDGE3:
605  case EDGE4:
606  {
607  // The reference 1D element is [-1,1].
608  if ((xi >= -1.-eps) &&
609  (xi <= 1.+eps))
610  return true;
611 
612  return false;
613  }
614 
615 
616  case TRI3:
617  case TRISHELL3:
618  case TRI6:
619  {
620  // The reference triangle is isosceles
621  // and is bound by xi=0, eta=0, and xi+eta=1.
622  if ((xi >= 0.-eps) &&
623  (eta >= 0.-eps) &&
624  ((xi + eta) <= 1.+eps))
625  return true;
626 
627  return false;
628  }
629 
630 
631  case QUAD4:
632  case QUADSHELL4:
633  case QUAD8:
634  case QUADSHELL8:
635  case QUAD9:
636  {
637  // The reference quadrilateral element is [-1,1]^2.
638  if ((xi >= -1.-eps) &&
639  (xi <= 1.+eps) &&
640  (eta >= -1.-eps) &&
641  (eta <= 1.+eps))
642  return true;
643 
644  return false;
645  }
646 
647 
648  case TET4:
649  case TET10:
650  {
651  // The reference tetrahedral is isosceles
652  // and is bound by xi=0, eta=0, zeta=0,
653  // and xi+eta+zeta=1.
654  if ((xi >= 0.-eps) &&
655  (eta >= 0.-eps) &&
656  (zeta >= 0.-eps) &&
657  ((xi + eta + zeta) <= 1.+eps))
658  return true;
659 
660  return false;
661  }
662 
663 
664  case HEX8:
665  case HEX20:
666  case HEX27:
667  {
668  /*
669  if ((xi >= -1.) &&
670  (xi <= 1.) &&
671  (eta >= -1.) &&
672  (eta <= 1.) &&
673  (zeta >= -1.) &&
674  (zeta <= 1.))
675  return true;
676  */
677 
678  // The reference hexahedral element is [-1,1]^3.
679  if ((xi >= -1.-eps) &&
680  (xi <= 1.+eps) &&
681  (eta >= -1.-eps) &&
682  (eta <= 1.+eps) &&
683  (zeta >= -1.-eps) &&
684  (zeta <= 1.+eps))
685  {
686  // libMesh::out << "Strange Point:\n";
687  // p.print();
688  return true;
689  }
690 
691  return false;
692  }
693 
694  case PRISM6:
695  case PRISM15:
696  case PRISM18:
697  {
698  // Figure this one out...
699  // inside the reference triangle with zeta in [-1,1]
700  if ((xi >= 0.-eps) &&
701  (eta >= 0.-eps) &&
702  (zeta >= -1.-eps) &&
703  (zeta <= 1.+eps) &&
704  ((xi + eta) <= 1.+eps))
705  return true;
706 
707  return false;
708  }
709 
710 
711  case PYRAMID5:
712  case PYRAMID13:
713  case PYRAMID14:
714  {
715  // Check that the point is on the same side of all the faces
716  // by testing whether:
717  //
718  // n_i.(x - x_i) <= 0
719  //
720  // for each i, where:
721  // n_i is the outward normal of face i,
722  // x_i is a point on face i.
723  if ((-eta - 1. + zeta <= 0.+eps) &&
724  ( xi - 1. + zeta <= 0.+eps) &&
725  ( eta - 1. + zeta <= 0.+eps) &&
726  ( -xi - 1. + zeta <= 0.+eps) &&
727  ( zeta >= 0.-eps))
728  return true;
729 
730  return false;
731  }
732 
733 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
734  case INFHEX8:
735  case INFHEX16:
736  case INFHEX18:
737  {
738  // The reference infhex8 is a [-1,1]^3.
739  if ((xi >= -1.-eps) &&
740  (xi <= 1.+eps) &&
741  (eta >= -1.-eps) &&
742  (eta <= 1.+eps) &&
743  (zeta >= -1.-eps) &&
744  (zeta <= 1.+eps))
745  {
746  return true;
747  }
748  return false;
749  }
750 
751  case INFPRISM6:
752  case INFPRISM12:
753  {
754  // inside the reference triangle with zeta in [-1,1]
755  if ((xi >= 0.-eps) &&
756  (eta >= 0.-eps) &&
757  (zeta >= -1.-eps) &&
758  (zeta <= 1.+eps) &&
759  ((xi + eta) <= 1.+eps))
760  {
761  return true;
762  }
763 
764  return false;
765  }
766 #endif
767 
768  default:
769  libmesh_error_msg("ERROR: Unknown element type " << t);
770  }
771 
772  // If we get here then the point is _not_ in the
773  // reference element. Better return false.
774 
775  return false;
776 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ print_d2phi()

void libMesh::FEGenericBase< FEOutputType< T >::type >::print_d2phi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function's second derivatives at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 776 of file fe_base.C.

References libMesh::index_range().

777 {
778  for (auto i : index_range(dphi))
779  for (auto j : index_range(dphi[i]))
780  os << " d2phi[" << i << "][" << j << "]=" << d2phi[i][j];
781 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:551
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Definition: int_range.h:104
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503

◆ print_dphi()

void libMesh::FEGenericBase< FEOutputType< T >::type >::print_dphi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function's derivative at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 718 of file fe_base.C.

References libMesh::index_range().

719 {
720  for (auto i : index_range(dphi))
721  for (auto j : index_range(dphi[i]))
722  os << " dphi[" << i << "][" << j << "]=" << dphi[i][j];
723 }
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Definition: int_range.h:104
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:503

◆ print_info() [1/2]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 87 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

88 {
90  out_stream << ReferenceCounter::get_info();
91 }
static std::string get_info()

◆ print_info() [2/2]

void libMesh::FEAbstract::print_info ( std::ostream &  os) const
inherited

Prints all the relevant information about the current element.

Definition at line 793 of file fe_abstract.C.

References libMesh::FEAbstract::print_dphi(), libMesh::FEAbstract::print_JxW(), libMesh::FEAbstract::print_phi(), and libMesh::FEAbstract::print_xyz().

Referenced by libMesh::operator<<().

794 {
795  os << "phi[i][j]: Shape function i at quadrature pt. j" << std::endl;
796  this->print_phi(os);
797 
798  os << "dphi[i][j]: Shape function i's gradient at quadrature pt. j" << std::endl;
799  this->print_dphi(os);
800 
801  os << "XYZ locations of the quadrature pts." << std::endl;
802  this->print_xyz(os);
803 
804  os << "Values of JxW at the quadrature pts." << std::endl;
805  this->print_JxW(os);
806 }
virtual void print_phi(std::ostream &os) const =0
virtual void print_dphi(std::ostream &os) const =0
void print_xyz(std::ostream &os) const
Definition: fe_abstract.C:787
void print_JxW(std::ostream &os) const
Definition: fe_abstract.C:780

◆ print_JxW()

void libMesh::FEAbstract::print_JxW ( std::ostream &  os) const
inherited

Prints the Jacobian times the weight for each quadrature point.

Definition at line 780 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::print_info().

781 {
782  this->_fe_map->print_JxW(os);
783 }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ print_phi()

void libMesh::FEGenericBase< FEOutputType< T >::type >::print_phi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function at each quadrature point.

Implements libMesh::FEAbstract.

Definition at line 707 of file fe_base.C.

References libMesh::index_range().

708 {
709  for (auto i : index_range(phi))
710  for (auto j : index_range(phi[i]))
711  os << " phi[" << i << "][" << j << "]=" << phi[i][j] << std::endl;
712 }
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Definition: int_range.h:104
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:498

◆ print_xyz()

void libMesh::FEAbstract::print_xyz ( std::ostream &  os) const
inherited

Prints the spatial location of each quadrature point (on the physical element).

Definition at line 787 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::print_info().

788 {
789  this->_fe_map->print_xyz(os);
790 }
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ reinit() [1/2]

void libMesh::FE< Dim, T >::reinit ( const Elem elem,
const std::vector< Point > *const  pts = nullptr,
const std::vector< Real > *const  weights = nullptr 
)
overridevirtualinherited

This is at the core of this class. Use this for each new element in the mesh. Reinitializes all the physical element-dependent data based on the current element elem. By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 129 of file fe.C.

132 {
133  // We can be called with no element. If we're evaluating SCALAR
134  // dofs we'll still have work to do.
135  // libmesh_assert(elem);
136 
137  // We're calculating now! Time to determine what.
138  this->determine_calculations();
139 
140  // Try to avoid calling init_shape_functions
141  // even when shapes_need_reinit
142  bool cached_nodes_still_fit = false;
143 
144  // Most of the hard work happens when we have an actual element
145  if (elem)
146  {
147  // Initialize the shape functions at the user-specified
148  // points
149  if (pts != nullptr)
150  {
151  // Set the type and p level for this element
152  this->elem_type = elem->type();
153  this->_p_level = elem->p_level();
154 
155  // Initialize the shape functions
156  this->_fe_map->template init_reference_to_physical_map<Dim>
157  (*pts, elem);
158  this->init_shape_functions (*pts, elem);
159 
160  // The shape functions do not correspond to the qrule
161  this->shapes_on_quadrature = false;
162  }
163 
164  // If there are no user specified points, we use the
165  // quadrature rule
166 
167  // update the type in accordance to the current cell
168  // and reinit if the cell type has changed or (as in
169  // the case of the hierarchics) the shape functions need
170  // reinit, since they depend on the particular element shape
171  else
172  {
173  libmesh_assert(this->qrule);
174  this->qrule->init(elem->type(), elem->p_level());
175 
176  if (this->qrule->shapes_need_reinit())
177  this->shapes_on_quadrature = false;
178 
179  if (this->elem_type != elem->type() ||
180  this->_p_level != elem->p_level() ||
181  !this->shapes_on_quadrature)
182  {
183  // Set the type and p level for this element
184  this->elem_type = elem->type();
185  this->_p_level = elem->p_level();
186  // Initialize the shape functions
187  this->_fe_map->template init_reference_to_physical_map<Dim>
188  (this->qrule->get_points(), elem);
189  this->init_shape_functions (this->qrule->get_points(), elem);
190 
191  if (this->shapes_need_reinit())
192  {
193  cached_nodes.resize(elem->n_nodes());
194  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
195  {
196  cached_nodes[n] = elem->point(n);
197  }
198  }
199  }
200  else
201  {
202  // libmesh_assert_greater (elem->n_nodes(), 1);
203 
204  cached_nodes_still_fit = true;
205  if (cached_nodes.size() != elem->n_nodes())
206  cached_nodes_still_fit = false;
207  else
208  for (unsigned int n = 1; n < elem->n_nodes(); ++n)
209  {
210  if (!(elem->point(n) - elem->point(0)).relative_fuzzy_equals
211  ((cached_nodes[n] - cached_nodes[0]), 1e-13))
212  {
213  cached_nodes_still_fit = false;
214  break;
215  }
216  }
217 
218  if (this->shapes_need_reinit() && !cached_nodes_still_fit)
219  {
220  this->_fe_map->template init_reference_to_physical_map<Dim>
221  (this->qrule->get_points(), elem);
222  this->init_shape_functions (this->qrule->get_points(), elem);
223  cached_nodes.resize(elem->n_nodes());
224  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
225  cached_nodes[n] = elem->point(n);
226  }
227  }
228 
229  // The shape functions correspond to the qrule
230  this->shapes_on_quadrature = true;
231  }
232  }
233  else // With no defined elem, so mapping or caching to
234  // be done, and our "quadrature rule" is one point for nonlocal
235  // (SCALAR) variables and zero points for local variables.
236  {
237  this->elem_type = INVALID_ELEM;
238  this->_p_level = 0;
239 
240  if (!pts)
241  {
242  if (T == SCALAR)
243  {
244  this->qrule->get_points() =
245  std::vector<Point>(1,Point(0));
246 
247  this->qrule->get_weights() =
248  std::vector<Real>(1,1);
249  }
250  else
251  {
252  this->qrule->get_points().clear();
253  this->qrule->get_weights().clear();
254  }
255 
256  this->init_shape_functions (this->qrule->get_points(), elem);
257  }
258  else
259  this->init_shape_functions (*pts, elem);
260  }
261 
262  // Compute the map for this element.
263  if (pts != nullptr)
264  {
265  if (weights != nullptr)
266  {
267  this->_fe_map->compute_map (this->dim, *weights, elem, this->calculate_d2phi);
268  }
269  else
270  {
271  std::vector<Real> dummy_weights (pts->size(), 1.);
272  this->_fe_map->compute_map (this->dim, dummy_weights, elem, this->calculate_d2phi);
273  }
274  }
275  else
276  {
277  this->_fe_map->compute_map (this->dim, this->qrule->get_weights(), elem, this->calculate_d2phi);
278  }
279 
280  // Compute the shape functions and the derivatives at all of the
281  // quadrature points.
282  if (!cached_nodes_still_fit)
283  {
284  if (pts != nullptr)
285  this->compute_shape_functions (elem,*pts);
286  else
287  this->compute_shape_functions(elem,this->qrule->get_points());
288  }
289 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:231
unsigned int _p_level
Definition: fe_abstract.h:587
virtual void compute_shape_functions(const Elem *elem, const std::vector< Point > &qp)
Definition: fe_base.C:669
const std::vector< Real > & get_weights() const
Definition: quadrature.h:154
virtual bool shapes_need_reinit() const override
const unsigned int dim
Definition: fe_abstract.h:531
const std::vector< Point > & get_points() const
Definition: quadrature.h:142
virtual void init_shape_functions(const std::vector< Point > &qp, const Elem *e)
Definition: fe.C:294
std::vector< Point > cached_nodes
Definition: fe.h:475
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525

◆ reinit() [2/2]

void libMesh::FE< Dim, T >::reinit ( const Elem elem,
const unsigned int  side,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *const  pts = nullptr,
const std::vector< Real > *const  weights = nullptr 
)
overridevirtualinherited

Reinitializes all the physical element-dependent data based on the side of face. The tolerance parameter is passed to the involved call to inverse_map(). By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference side element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 142 of file fe_boundary.C.

147 {
148  libmesh_assert(elem);
149  libmesh_assert (this->qrule != nullptr || pts != nullptr);
150  // We now do this for 1D elements!
151  // libmesh_assert_not_equal_to (Dim, 1);
152 
153  // We're (possibly re-) calculating now! FIXME - we currently
154  // expect to be able to use side_map and JxW later, but we could
155  // optimize further here.
156  this->_fe_map->calculations_started = false;
157  this->_fe_map->get_JxW();
158  this->_fe_map->get_xyz();
159  this->determine_calculations();
160 
161  // Build the side of interest
162  const std::unique_ptr<const Elem> side(elem->build_side_ptr(s));
163 
164  // Find the max p_level to select
165  // the right quadrature rule for side integration
166  unsigned int side_p_level = elem->p_level();
167  if (elem->neighbor_ptr(s) != nullptr)
168  side_p_level = std::max(side_p_level, elem->neighbor_ptr(s)->p_level());
169 
170  // Initialize the shape functions at the user-specified
171  // points
172  if (pts != nullptr)
173  {
174  // The shape functions do not correspond to the qrule
175  this->shapes_on_quadrature = false;
176 
177  // Initialize the face shape functions
178  this->_fe_map->template init_face_shape_functions<Dim>(*pts, side.get());
179 
180  // Compute the Jacobian*Weight on the face for integration
181  if (weights != nullptr)
182  {
183  this->_fe_map->compute_face_map (Dim, *weights, side.get());
184  }
185  else
186  {
187  std::vector<Real> dummy_weights (pts->size(), 1.);
188  this->_fe_map->compute_face_map (Dim, dummy_weights, side.get());
189  }
190  }
191  // If there are no user specified points, we use the
192  // quadrature rule
193  else
194  {
195  // initialize quadrature rule
196  this->qrule->init(side->type(), side_p_level);
197 
198  if (this->qrule->shapes_need_reinit())
199  this->shapes_on_quadrature = false;
200 
201  // FIXME - could this break if the same FE object was used
202  // for both volume and face integrals? - RHS
203  // We might not need to reinitialize the shape functions
204  if ((this->get_type() != elem->type()) ||
205  (side->type() != last_side) ||
206  (this->get_p_level() != side_p_level) ||
207  this->shapes_need_reinit() ||
208  !this->shapes_on_quadrature)
209  {
210  // Set the element type and p_level
211  this->elem_type = elem->type();
212 
213  // Set the last_side
214  last_side = side->type();
215 
216  // Set the last p level
217  this->_p_level = side_p_level;
218 
219  // Initialize the face shape functions
220  this->_fe_map->template init_face_shape_functions<Dim>(this->qrule->get_points(), side.get());
221  }
222 
223  // Compute the Jacobian*Weight on the face for integration
224  this->_fe_map->compute_face_map (Dim, this->qrule->get_weights(), side.get());
225 
226  // The shape functions correspond to the qrule
227  this->shapes_on_quadrature = true;
228  }
229 
230  // make a copy of the Jacobian for integration
231  const std::vector<Real> JxW_int(this->_fe_map->get_JxW());
232 
233  // make a copy of shape on quadrature info
234  bool shapes_on_quadrature_side = this->shapes_on_quadrature;
235 
236  // Find where the integration points are located on the
237  // full element.
238  const std::vector<Point> * ref_qp;
239  if (pts != nullptr)
240  ref_qp = pts;
241  else
242  ref_qp = &this->qrule->get_points();
243 
244  std::vector<Point> qp;
245  this->side_map(elem, side.get(), s, *ref_qp, qp);
246 
247  // compute the shape function and derivative values
248  // at the points qp
249  this->reinit (elem, &qp);
250 
251  this->shapes_on_quadrature = shapes_on_quadrature_side;
252 
253  // copy back old data
254  this->_fe_map->get_JxW() = JxW_int;
255 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:231
unsigned int get_p_level() const
Definition: fe_abstract.h:424
unsigned int _p_level
Definition: fe_abstract.h:587
virtual void side_map(const Elem *elem, const Elem *side, const unsigned int s, const std::vector< Point > &reference_side_points, std::vector< Point > &reference_points) override
Definition: fe_boundary.C:353
ElemType get_type() const
Definition: fe_abstract.h:418
unsigned short int side
Definition: xdr_io.C:50
const std::vector< Real > & get_weights() const
Definition: quadrature.h:154
virtual bool shapes_need_reinit() const override
long double max(long double a, double b)
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
Definition: fe.C:129
const std::vector< Point > & get_points() const
Definition: quadrature.h:142
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525
ElemType last_side
Definition: fe.h:480

◆ set_fe_order()

void libMesh::FEAbstract::set_fe_order ( int  new_order)
inlineinherited

Sets the base FE order of the finite element.

Definition at line 439 of file fe_abstract.h.

References libMesh::FEAbstract::fe_type, and libMesh::FEType::order.

439 { fe_type.order = new_order; }
OrderWrapper order
Definition: fe_type.h:198

◆ shape() [1/109]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_nedelec_one_shape_2D.C.

33 {
34  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
35  return RealGradient();
36 }
RealVectorValue RealGradient

◆ shape() [2/109]

Real libMesh::FE< 1, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_scalar_shape_1D.C.

33 {
34  return 1.;
35 }

◆ shape() [3/109]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_nedelec_one_shape_3D.C.

33 {
34  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
35  return RealGradient();
36 }
RealVectorValue RealGradient

◆ shape() [4/109]

Real libMesh::FE< 0, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_scalar_shape_0D.C.

33 {
34  return 1.;
35 }

◆ shape() [5/109]

Real libMesh::FE< 3, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_scalar_shape_3D.C.

33 {
34  return 1.;
35 }

◆ shape() [6/109]

Real libMesh::FE< 2, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 29 of file fe_scalar_shape_2D.C.

33 {
34  return 1.;
35 }

◆ shape() [7/109]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_l2_hierarchic_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [8/109]

Real libMesh::FE< 0, MONOMIAL >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_monomial_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [9/109]

Real libMesh::FE< 0, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_clough_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [10/109]

Real libMesh::FE< 1, MONOMIAL >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_monomial_shape_1D.C.

36 {
37  const Real xi = p(0);
38 
39  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
40 
41  // monomials. since they are hierarchic we only need one case block.
42  switch (i)
43  {
44  case 0:
45  return 1.;
46 
47  case 1:
48  return xi;
49 
50  case 2:
51  return xi*xi;
52 
53  case 3:
54  return xi*xi*xi;
55 
56  case 4:
57  return xi*xi*xi*xi;
58 
59  default:
60  Real val = 1.;
61  for (unsigned int index = 0; index != i; ++index)
62  val *= xi;
63  return val;
64  }
65 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [11/109]

Real libMesh::FE< 0, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_hierarchic_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [12/109]

Real libMesh::FE< 3, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_szabab_shape_3D.C.

36 {
37  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
38  return 0.;
39 }

◆ shape() [13/109]

Real libMesh::FE< 0, LAGRANGE >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_lagrange_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [14/109]

Real libMesh::FE< 2, MONOMIAL >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_monomial_shape_2D.C.

36 {
37 #if LIBMESH_DIM > 1
38 
39  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
40  (static_cast<unsigned int>(order)+2)/2);
41 
42  const Real xi = p(0);
43  const Real eta = p(1);
44 
45  switch (i)
46  {
47  // constant
48  case 0:
49  return 1.;
50 
51  // linear
52  case 1:
53  return xi;
54 
55  case 2:
56  return eta;
57 
58  // quadratics
59  case 3:
60  return xi*xi;
61 
62  case 4:
63  return xi*eta;
64 
65  case 5:
66  return eta*eta;
67 
68  // cubics
69  case 6:
70  return xi*xi*xi;
71 
72  case 7:
73  return xi*xi*eta;
74 
75  case 8:
76  return xi*eta*eta;
77 
78  case 9:
79  return eta*eta*eta;
80 
81  // quartics
82  case 10:
83  return xi*xi*xi*xi;
84 
85  case 11:
86  return xi*xi*xi*eta;
87 
88  case 12:
89  return xi*xi*eta*eta;
90 
91  case 13:
92  return xi*eta*eta*eta;
93 
94  case 14:
95  return eta*eta*eta*eta;
96 
97  default:
98  unsigned int o = 0;
99  for (; i >= (o+1)*(o+2)/2; o++) { }
100  unsigned int ny = i - (o*(o+1)/2);
101  unsigned int nx = o - ny;
102  Real val = 1.;
103  for (unsigned int index=0; index != nx; index++)
104  val *= xi;
105  for (unsigned int index=0; index != ny; index++)
106  val *= eta;
107  return val;
108  }
109 
110 #else
111  return 0.;
112 #endif
113 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [15/109]

Real libMesh::FE< 2, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_xyz_shape_2D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
38  return 0.;
39 }

◆ shape() [16/109]

Real libMesh::FE< 0, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_hermite_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [17/109]

Real libMesh::FE< 3, MONOMIAL >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_monomial_shape_3D.C.

36 {
37 #if LIBMESH_DIM == 3
38 
39  const Real xi = p(0);
40  const Real eta = p(1);
41  const Real zeta = p(2);
42 
43  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
44  (static_cast<unsigned int>(order)+2)*
45  (static_cast<unsigned int>(order)+3)/6);
46 
47  // monomials. since they are hierarchic we only need one case block.
48  switch (i)
49  {
50  // constant
51  case 0:
52  return 1.;
53 
54  // linears
55  case 1:
56  return xi;
57 
58  case 2:
59  return eta;
60 
61  case 3:
62  return zeta;
63 
64  // quadratics
65  case 4:
66  return xi*xi;
67 
68  case 5:
69  return xi*eta;
70 
71  case 6:
72  return eta*eta;
73 
74  case 7:
75  return xi*zeta;
76 
77  case 8:
78  return zeta*eta;
79 
80  case 9:
81  return zeta*zeta;
82 
83  // cubics
84  case 10:
85  return xi*xi*xi;
86 
87  case 11:
88  return xi*xi*eta;
89 
90  case 12:
91  return xi*eta*eta;
92 
93  case 13:
94  return eta*eta*eta;
95 
96  case 14:
97  return xi*xi*zeta;
98 
99  case 15:
100  return xi*eta*zeta;
101 
102  case 16:
103  return eta*eta*zeta;
104 
105  case 17:
106  return xi*zeta*zeta;
107 
108  case 18:
109  return eta*zeta*zeta;
110 
111  case 19:
112  return zeta*zeta*zeta;
113 
114  // quartics
115  case 20:
116  return xi*xi*xi*xi;
117 
118  case 21:
119  return xi*xi*xi*eta;
120 
121  case 22:
122  return xi*xi*eta*eta;
123 
124  case 23:
125  return xi*eta*eta*eta;
126 
127  case 24:
128  return eta*eta*eta*eta;
129 
130  case 25:
131  return xi*xi*xi*zeta;
132 
133  case 26:
134  return xi*xi*eta*zeta;
135 
136  case 27:
137  return xi*eta*eta*zeta;
138 
139  case 28:
140  return eta*eta*eta*zeta;
141 
142  case 29:
143  return xi*xi*zeta*zeta;
144 
145  case 30:
146  return xi*eta*zeta*zeta;
147 
148  case 31:
149  return eta*eta*zeta*zeta;
150 
151  case 32:
152  return xi*zeta*zeta*zeta;
153 
154  case 33:
155  return eta*zeta*zeta*zeta;
156 
157  case 34:
158  return zeta*zeta*zeta*zeta;
159 
160  default:
161  unsigned int o = 0;
162  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
163  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
164  unsigned int block=o, nz = 0;
165  for (; block < i2; block += (o-nz+1)) { nz++; }
166  const unsigned int nx = block - i2;
167  const unsigned int ny = o - nx - nz;
168  Real val = 1.;
169  for (unsigned int index=0; index != nx; index++)
170  val *= xi;
171  for (unsigned int index=0; index != ny; index++)
172  val *= eta;
173  for (unsigned int index=0; index != nz; index++)
174  val *= zeta;
175  return val;
176  }
177 
178 #else
179  return 0.;
180 #endif
181 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [18/109]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_l2_hierarchic_shape_2D.C.

36 {
37  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
38  return 0.;
39 }

◆ shape() [19/109]

Real libMesh::FE< 0, L2_LAGRANGE >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_l2_lagrange_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [20/109]

Real libMesh::FE< 0, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_bernstein_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [21/109]

Real libMesh::FE< 0, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_xyz_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [22/109]

Real libMesh::FE< 1, L2_LAGRANGE >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_l2_lagrange_shape_1D.C.

36 {
37  const Real xi = p(0);
38 
39 
40  switch (order)
41  {
42  // Lagrange linears
43  case FIRST:
44  {
45  libmesh_assert_less (i, 2);
46 
47  switch (i)
48  {
49  case 0:
50  return .5*(1. - xi);
51 
52  case 1:
53  return .5*(1. + xi);
54 
55  default:
56  libmesh_error_msg("Invalid shape function index i = " << i);
57  }
58  }
59 
60 
61 
62  // Lagrange quadratics
63  case SECOND:
64  {
65  libmesh_assert_less (i, 3);
66 
67  switch (i)
68  {
69  case 0:
70  return .5*xi*(xi - 1.);
71 
72  case 1:
73  return .5*xi*(xi + 1);
74 
75  case 2:
76  return (1. - xi*xi);
77 
78  default:
79  libmesh_error_msg("Invalid shape function index i = " << i);
80  }
81  }
82 
83 
84 
85  // Lagrange cubics
86  case THIRD:
87  {
88  libmesh_assert_less (i, 4);
89 
90  switch (i)
91  {
92  case 0:
93  return 9./16.*(1./9.-xi*xi)*(xi-1.);
94 
95  case 1:
96  return -9./16.*(1./9.-xi*xi)*(xi+1.);
97 
98  case 2:
99  return 27./16.*(1.-xi*xi)*(1./3.-xi);
100 
101  case 3:
102  return 27./16.*(1.-xi*xi)*(1./3.+xi);
103 
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107  }
108 
109  default:
110  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
111  }
112 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [23/109]

Real libMesh::FE< 0, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 32 of file fe_szabab_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }

◆ shape() [24/109]

Real libMesh::FE< 2, L2_LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_l2_lagrange_shape_2D.C.

36 {
37 #if LIBMESH_DIM > 1
38 
39  switch (order)
40  {
41  // linear Lagrange shape functions
42  case FIRST:
43  {
44  switch (type)
45  {
46  case QUAD4:
47  case QUADSHELL4:
48  case QUAD8:
49  case QUADSHELL8:
50  case QUAD9:
51  {
52  // Compute quad shape functions as a tensor-product
53  const Real xi = p(0);
54  const Real eta = p(1);
55 
56  libmesh_assert_less (i, 4);
57 
58  // 0 1 2 3
59  static const unsigned int i0[] = {0, 1, 1, 0};
60  static const unsigned int i1[] = {0, 0, 1, 1};
61 
62  return (FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
63  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta));
64  }
65 
66  case TRI3:
67  case TRISHELL3:
68  case TRI6:
69  {
70  const Real zeta1 = p(0);
71  const Real zeta2 = p(1);
72  const Real zeta0 = 1. - zeta1 - zeta2;
73 
74  libmesh_assert_less (i, 3);
75 
76  switch(i)
77  {
78  case 0:
79  return zeta0;
80 
81  case 1:
82  return zeta1;
83 
84  case 2:
85  return zeta2;
86 
87  default:
88  libmesh_error_msg("Invalid shape function index i = " << i);
89  }
90  }
91 
92  default:
93  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
94  }
95  }
96 
97 
98  // quadratic Lagrange shape functions
99  case SECOND:
100  {
101  switch (type)
102  {
103  case QUAD8:
104  case QUADSHELL8:
105  {
106  const Real xi = p(0);
107  const Real eta = p(1);
108 
109  libmesh_assert_less (i, 8);
110 
111  switch (i)
112  {
113  case 0:
114  return .25*(1. - xi)*(1. - eta)*(-1. - xi - eta);
115 
116  case 1:
117  return .25*(1. + xi)*(1. - eta)*(-1. + xi - eta);
118 
119  case 2:
120  return .25*(1. + xi)*(1. + eta)*(-1. + xi + eta);
121 
122  case 3:
123  return .25*(1. - xi)*(1. + eta)*(-1. - xi + eta);
124 
125  case 4:
126  return .5*(1. - xi*xi)*(1. - eta);
127 
128  case 5:
129  return .5*(1. + xi)*(1. - eta*eta);
130 
131  case 6:
132  return .5*(1. - xi*xi)*(1. + eta);
133 
134  case 7:
135  return .5*(1. - xi)*(1. - eta*eta);
136 
137  default:
138  libmesh_error_msg("Invalid shape function index i = " << i);
139  }
140  }
141 
142  case QUAD9:
143  {
144  // Compute quad shape functions as a tensor-product
145  const Real xi = p(0);
146  const Real eta = p(1);
147 
148  libmesh_assert_less (i, 9);
149 
150  // 0 1 2 3 4 5 6 7 8
151  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
152  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
153 
154  return (FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
155  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta));
156  }
157 
158  case TRI6:
159  {
160  const Real zeta1 = p(0);
161  const Real zeta2 = p(1);
162  const Real zeta0 = 1. - zeta1 - zeta2;
163 
164  libmesh_assert_less (i, 6);
165 
166  switch(i)
167  {
168  case 0:
169  return 2.*zeta0*(zeta0-0.5);
170 
171  case 1:
172  return 2.*zeta1*(zeta1-0.5);
173 
174  case 2:
175  return 2.*zeta2*(zeta2-0.5);
176 
177  case 3:
178  return 4.*zeta0*zeta1;
179 
180  case 4:
181  return 4.*zeta1*zeta2;
182 
183  case 5:
184  return 4.*zeta2*zeta0;
185 
186  default:
187  libmesh_error_msg("Invalid shape function index i = " << i);
188  }
189  }
190 
191  default:
192  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
193  }
194  }
195 
196 
197 
198  // unsupported order
199  default:
200  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
201  }
202 #endif
203 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [25/109]

Real libMesh::FE< 1, LAGRANGE >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_lagrange_shape_1D.C.

36 {
37  const Real xi = p(0);
38 
39 
40  switch (order)
41  {
42  // Lagrange linears
43  case FIRST:
44  {
45  libmesh_assert_less (i, 2);
46 
47  switch (i)
48  {
49  case 0:
50  return .5*(1. - xi);
51 
52  case 1:
53  return .5*(1. + xi);
54 
55  default:
56  libmesh_error_msg("Invalid shape function index i = " << i);
57  }
58  }
59 
60 
61 
62  // Lagrange quadratics
63  case SECOND:
64  {
65  libmesh_assert_less (i, 3);
66 
67  switch (i)
68  {
69  case 0:
70  return .5*xi*(xi - 1.);
71 
72  case 1:
73  return .5*xi*(xi + 1);
74 
75  case 2:
76  return (1. - xi*xi);
77 
78  default:
79  libmesh_error_msg("Invalid shape function index i = " << i);
80  }
81  }
82 
83 
84 
85  // Lagrange cubics
86  case THIRD:
87  {
88  libmesh_assert_less (i, 4);
89 
90  switch (i)
91  {
92  case 0:
93  return 9./16.*(1./9.-xi*xi)*(xi-1.);
94 
95  case 1:
96  return -9./16.*(1./9.-xi*xi)*(xi+1.);
97 
98  case 2:
99  return 27./16.*(1.-xi*xi)*(1./3.-xi);
100 
101  case 3:
102  return 27./16.*(1.-xi*xi)*(1./3.+xi);
103 
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107  }
108 
109  default:
110  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
111  }
112 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [26/109]

Real libMesh::FE< 3, L2_LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_l2_lagrange_shape_3D.C.

36 {
37 #if LIBMESH_DIM == 3
38 
39 
40  switch (order)
41  {
42  // linear Lagrange shape functions
43  case FIRST:
44  {
45  switch (type)
46  {
47  // trilinear hexahedral shape functions
48  case HEX8:
49  case HEX20:
50  case HEX27:
51  {
52  libmesh_assert_less (i, 8);
53 
54  // Compute hex shape functions as a tensor-product
55  const Real xi = p(0);
56  const Real eta = p(1);
57  const Real zeta = p(2);
58 
59  // 0 1 2 3 4 5 6 7
60  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
61  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
62  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
63 
64  return (FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
65  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta)*
66  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i2[i], zeta));
67  }
68 
69  // linear tetrahedral shape functions
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0:
84  return zeta0;
85 
86  case 1:
87  return zeta1;
88 
89  case 2:
90  return zeta2;
91 
92  case 3:
93  return zeta3;
94 
95  default:
96  libmesh_error_msg("Invalid i = " << i);
97  }
98  }
99 
100  // linear prism shape functions
101  case PRISM6:
102  case PRISM15:
103  case PRISM18:
104  {
105  libmesh_assert_less (i, 6);
106 
107  // Compute prism shape functions as a tensor-product
108  // of a triangle and an edge
109 
110  Point p2d(p(0),p(1));
111  Point p1d(p(2));
112 
113  // 0 1 2 3 4 5
114  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
115  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
116 
117  return (FE<2,L2_LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
118  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
119  }
120 
121  // linear pyramid shape functions
122  case PYRAMID5:
123  {
124  libmesh_assert_less (i, 5);
125 
126  const Real xi = p(0);
127  const Real eta = p(1);
128  const Real zeta = p(2);
129  const Real eps = 1.e-35;
130 
131  switch(i)
132  {
133  case 0:
134  return .25*(zeta + xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
135 
136  case 1:
137  return .25*(zeta - xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
138 
139  case 2:
140  return .25*(zeta - xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
141 
142  case 3:
143  return .25*(zeta + xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
144 
145  case 4:
146  return zeta;
147 
148  default:
149  libmesh_error_msg("Invalid i = " << i);
150  }
151  }
152 
153 
154  default:
155  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
156  }
157  }
158 
159 
160  // quadratic Lagrange shape functions
161  case SECOND:
162  {
163  switch (type)
164  {
165 
166  // serendipity hexahedral quadratic shape functions
167  case HEX20:
168  {
169  libmesh_assert_less (i, 20);
170 
171  const Real xi = p(0);
172  const Real eta = p(1);
173  const Real zeta = p(2);
174 
175  // these functions are defined for (x,y,z) in [0,1]^3
176  // so transform the locations
177  const Real x = .5*(xi + 1.);
178  const Real y = .5*(eta + 1.);
179  const Real z = .5*(zeta + 1.);
180 
181  switch (i)
182  {
183  case 0:
184  return (1. - x)*(1. - y)*(1. - z)*(1. - 2.*x - 2.*y - 2.*z);
185 
186  case 1:
187  return x*(1. - y)*(1. - z)*(2.*x - 2.*y - 2.*z - 1.);
188 
189  case 2:
190  return x*y*(1. - z)*(2.*x + 2.*y - 2.*z - 3.);
191 
192  case 3:
193  return (1. - x)*y*(1. - z)*(2.*y - 2.*x - 2.*z - 1.);
194 
195  case 4:
196  return (1. - x)*(1. - y)*z*(2.*z - 2.*x - 2.*y - 1.);
197 
198  case 5:
199  return x*(1. - y)*z*(2.*x - 2.*y + 2.*z - 3.);
200 
201  case 6:
202  return x*y*z*(2.*x + 2.*y + 2.*z - 5.);
203 
204  case 7:
205  return (1. - x)*y*z*(2.*y - 2.*x + 2.*z - 3.);
206 
207  case 8:
208  return 4.*x*(1. - x)*(1. - y)*(1. - z);
209 
210  case 9:
211  return 4.*x*y*(1. - y)*(1. - z);
212 
213  case 10:
214  return 4.*x*(1. - x)*y*(1. - z);
215 
216  case 11:
217  return 4.*(1. - x)*y*(1. - y)*(1. - z);
218 
219  case 12:
220  return 4.*(1. - x)*(1. - y)*z*(1. - z);
221 
222  case 13:
223  return 4.*x*(1. - y)*z*(1. - z);
224 
225  case 14:
226  return 4.*x*y*z*(1. - z);
227 
228  case 15:
229  return 4.*(1. - x)*y*z*(1. - z);
230 
231  case 16:
232  return 4.*x*(1. - x)*(1. - y)*z;
233 
234  case 17:
235  return 4.*x*y*(1. - y)*z;
236 
237  case 18:
238  return 4.*x*(1. - x)*y*z;
239 
240  case 19:
241  return 4.*(1. - x)*y*(1. - y)*z;
242 
243  default:
244  libmesh_error_msg("Invalid i = " << i);
245  }
246  }
247 
248  // triquadratic hexahedral shape functions
249  case HEX27:
250  {
251  libmesh_assert_less (i, 27);
252 
253  // Compute hex shape functions as a tensor-product
254  const Real xi = p(0);
255  const Real eta = p(1);
256  const Real zeta = p(2);
257 
258  // The only way to make any sense of this
259  // is to look at the mgflo/mg2/mgf documentation
260  // and make the cut-out cube!
261  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
262  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
263  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
264  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
265 
266  return (FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
267  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta)*
268  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i2[i], zeta));
269  }
270 
271  // quadratic tetrahedral shape functions
272  case TET10:
273  {
274  libmesh_assert_less (i, 10);
275 
276  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
277  const Real zeta1 = p(0);
278  const Real zeta2 = p(1);
279  const Real zeta3 = p(2);
280  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
281 
282  switch(i)
283  {
284  case 0:
285  return zeta0*(2.*zeta0 - 1.);
286 
287  case 1:
288  return zeta1*(2.*zeta1 - 1.);
289 
290  case 2:
291  return zeta2*(2.*zeta2 - 1.);
292 
293  case 3:
294  return zeta3*(2.*zeta3 - 1.);
295 
296  case 4:
297  return 4.*zeta0*zeta1;
298 
299  case 5:
300  return 4.*zeta1*zeta2;
301 
302  case 6:
303  return 4.*zeta2*zeta0;
304 
305  case 7:
306  return 4.*zeta0*zeta3;
307 
308  case 8:
309  return 4.*zeta1*zeta3;
310 
311  case 9:
312  return 4.*zeta2*zeta3;
313 
314  default:
315  libmesh_error_msg("Invalid i = " << i);
316  }
317  }
318 
319  // quadratic prism shape functions
320  case PRISM18:
321  {
322  libmesh_assert_less (i, 18);
323 
324  // Compute prism shape functions as a tensor-product
325  // of a triangle and an edge
326 
327  Point p2d(p(0),p(1));
328  Point p1d(p(2));
329 
330  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
331  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
332  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
333 
334  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
335  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
336  }
337 
338 
339  default:
340  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
341  }
342  }
343 
344 
345  // unsupported order
346  default:
347  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
348  }
349 
350 #endif
351 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [27/109]

Real libMesh::FE< 1, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_xyz_shape_1D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element \n because the centroid is needed.");
38  return 0.;
39 }

◆ shape() [28/109]

Real libMesh::FE< 3, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_xyz_shape_3D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element because the centroid is needed.");
38  return 0.;
39 }

◆ shape() [29/109]

Real libMesh::FE< 2, LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_lagrange_shape_2D.C.

36 {
37 #if LIBMESH_DIM > 1
38 
39  switch (order)
40  {
41  // linear Lagrange shape functions
42  case FIRST:
43  {
44  switch (type)
45  {
46  case QUAD4:
47  case QUADSHELL4:
48  case QUAD8:
49  case QUADSHELL8:
50  case QUAD9:
51  {
52  // Compute quad shape functions as a tensor-product
53  const Real xi = p(0);
54  const Real eta = p(1);
55 
56  libmesh_assert_less (i, 4);
57 
58  // 0 1 2 3
59  static const unsigned int i0[] = {0, 1, 1, 0};
60  static const unsigned int i1[] = {0, 0, 1, 1};
61 
62  return (FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
63  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta));
64  }
65 
66  case TRI3:
67  case TRISHELL3:
68  case TRI6:
69  {
70  const Real zeta1 = p(0);
71  const Real zeta2 = p(1);
72  const Real zeta0 = 1. - zeta1 - zeta2;
73 
74  libmesh_assert_less (i, 3);
75 
76  switch(i)
77  {
78  case 0:
79  return zeta0;
80 
81  case 1:
82  return zeta1;
83 
84  case 2:
85  return zeta2;
86 
87  default:
88  libmesh_error_msg("Invalid shape function index i = " << i);
89  }
90  }
91 
92  default:
93  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
94  }
95  }
96 
97 
98  // quadratic Lagrange shape functions
99  case SECOND:
100  {
101  switch (type)
102  {
103  case QUAD8:
104  case QUADSHELL8:
105  {
106  const Real xi = p(0);
107  const Real eta = p(1);
108 
109  libmesh_assert_less (i, 8);
110 
111  switch (i)
112  {
113  case 0:
114  return .25*(1. - xi)*(1. - eta)*(-1. - xi - eta);
115 
116  case 1:
117  return .25*(1. + xi)*(1. - eta)*(-1. + xi - eta);
118 
119  case 2:
120  return .25*(1. + xi)*(1. + eta)*(-1. + xi + eta);
121 
122  case 3:
123  return .25*(1. - xi)*(1. + eta)*(-1. - xi + eta);
124 
125  case 4:
126  return .5*(1. - xi*xi)*(1. - eta);
127 
128  case 5:
129  return .5*(1. + xi)*(1. - eta*eta);
130 
131  case 6:
132  return .5*(1. - xi*xi)*(1. + eta);
133 
134  case 7:
135  return .5*(1. - xi)*(1. - eta*eta);
136 
137  default:
138  libmesh_error_msg("Invalid shape function index i = " << i);
139  }
140  }
141 
142  case QUAD9:
143  {
144  // Compute quad shape functions as a tensor-product
145  const Real xi = p(0);
146  const Real eta = p(1);
147 
148  libmesh_assert_less (i, 9);
149 
150  // 0 1 2 3 4 5 6 7 8
151  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
152  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
153 
154  return (FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
155  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta));
156  }
157 
158  case TRI6:
159  {
160  const Real zeta1 = p(0);
161  const Real zeta2 = p(1);
162  const Real zeta0 = 1. - zeta1 - zeta2;
163 
164  libmesh_assert_less (i, 6);
165 
166  switch(i)
167  {
168  case 0:
169  return 2.*zeta0*(zeta0-0.5);
170 
171  case 1:
172  return 2.*zeta1*(zeta1-0.5);
173 
174  case 2:
175  return 2.*zeta2*(zeta2-0.5);
176 
177  case 3:
178  return 4.*zeta0*zeta1;
179 
180  case 4:
181  return 4.*zeta1*zeta2;
182 
183  case 5:
184  return 4.*zeta2*zeta0;
185 
186  default:
187  libmesh_error_msg("Invalid shape function index i = " << i);
188  }
189  }
190 
191  default:
192  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
193  }
194  }
195 
196 
197 
198  // unsupported order
199  default:
200  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
201  }
202 #else // LIBMESH_DIM > 1
203  return 0.;
204 #endif
205 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [30/109]

Real libMesh::FE< 2, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 32 of file fe_hierarchic_shape_2D.C.

36 {
37  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
38  return 0.;
39 }

◆ shape() [31/109]

Real libMesh::FE< 3, LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 32 of file fe_lagrange_shape_3D.C.

36 {
37 #if LIBMESH_DIM == 3
38 
39 
40  switch (order)
41  {
42  // linear Lagrange shape functions
43  case FIRST:
44  {
45  switch (type)
46  {
47  // trilinear hexahedral shape functions
48  case HEX8:
49  case HEX20:
50  case HEX27:
51  {
52  libmesh_assert_less (i, 8);
53 
54  // Compute hex shape functions as a tensor-product
55  const Real xi = p(0);
56  const Real eta = p(1);
57  const Real zeta = p(2);
58 
59  // 0 1 2 3 4 5 6 7
60  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
61  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
62  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
63 
64  return (FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
65  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta)*
66  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i2[i], zeta));
67  }
68 
69  // linear tetrahedral shape functions
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0:
84  return zeta0;
85 
86  case 1:
87  return zeta1;
88 
89  case 2:
90  return zeta2;
91 
92  case 3:
93  return zeta3;
94 
95  default:
96  libmesh_error_msg("Invalid i = " << i);
97  }
98  }
99 
100  // linear prism shape functions
101  case PRISM6:
102  case PRISM15:
103  case PRISM18:
104  {
105  libmesh_assert_less (i, 6);
106 
107  // Compute prism shape functions as a tensor-product
108  // of a triangle and an edge
109 
110  Point p2d(p(0),p(1));
111  Point p1d(p(2));
112 
113  // 0 1 2 3 4 5
114  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
115  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
116 
117  return (FE<2,LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
118  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
119  }
120 
121  // linear pyramid shape functions
122  case PYRAMID5:
123  case PYRAMID13:
124  case PYRAMID14:
125  {
126  libmesh_assert_less (i, 5);
127 
128  const Real xi = p(0);
129  const Real eta = p(1);
130  const Real zeta = p(2);
131  const Real eps = 1.e-35;
132 
133  switch(i)
134  {
135  case 0:
136  return .25*(zeta + xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
137 
138  case 1:
139  return .25*(zeta - xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
140 
141  case 2:
142  return .25*(zeta - xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
143 
144  case 3:
145  return .25*(zeta + xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
146 
147  case 4:
148  return zeta;
149 
150  default:
151  libmesh_error_msg("Invalid i = " << i);
152  }
153  }
154 
155 
156  default:
157  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
158  }
159  }
160 
161 
162  // quadratic Lagrange shape functions
163  case SECOND:
164  {
165  switch (type)
166  {
167 
168  // serendipity hexahedral quadratic shape functions
169  case HEX20:
170  {
171  libmesh_assert_less (i, 20);
172 
173  const Real xi = p(0);
174  const Real eta = p(1);
175  const Real zeta = p(2);
176 
177  // these functions are defined for (x,y,z) in [0,1]^3
178  // so transform the locations
179  const Real x = .5*(xi + 1.);
180  const Real y = .5*(eta + 1.);
181  const Real z = .5*(zeta + 1.);
182 
183  switch (i)
184  {
185  case 0:
186  return (1. - x)*(1. - y)*(1. - z)*(1. - 2.*x - 2.*y - 2.*z);
187 
188  case 1:
189  return x*(1. - y)*(1. - z)*(2.*x - 2.*y - 2.*z - 1.);
190 
191  case 2:
192  return x*y*(1. - z)*(2.*x + 2.*y - 2.*z - 3.);
193 
194  case 3:
195  return (1. - x)*y*(1. - z)*(2.*y - 2.*x - 2.*z - 1.);
196 
197  case 4:
198  return (1. - x)*(1. - y)*z*(2.*z - 2.*x - 2.*y - 1.);
199 
200  case 5:
201  return x*(1. - y)*z*(2.*x - 2.*y + 2.*z - 3.);
202 
203  case 6:
204  return x*y*z*(2.*x + 2.*y + 2.*z - 5.);
205 
206  case 7:
207  return (1. - x)*y*z*(2.*y - 2.*x + 2.*z - 3.);
208 
209  case 8:
210  return 4.*x*(1. - x)*(1. - y)*(1. - z);
211 
212  case 9:
213  return 4.*x*y*(1. - y)*(1. - z);
214 
215  case 10:
216  return 4.*x*(1. - x)*y*(1. - z);
217 
218  case 11:
219  return 4.*(1. - x)*y*(1. - y)*(1. - z);
220 
221  case 12:
222  return 4.*(1. - x)*(1. - y)*z*(1. - z);
223 
224  case 13:
225  return 4.*x*(1. - y)*z*(1. - z);
226 
227  case 14:
228  return 4.*x*y*z*(1. - z);
229 
230  case 15:
231  return 4.*(1. - x)*y*z*(1. - z);
232 
233  case 16:
234  return 4.*x*(1. - x)*(1. - y)*z;
235 
236  case 17:
237  return 4.*x*y*(1. - y)*z;
238 
239  case 18:
240  return 4.*x*(1. - x)*y*z;
241 
242  case 19:
243  return 4.*(1. - x)*y*(1. - y)*z;
244 
245  default:
246  libmesh_error_msg("Invalid i = " << i);
247  }
248  }
249 
250  // triquadratic hexahedral shape functions
251  case HEX27:
252  {
253  libmesh_assert_less (i, 27);
254 
255  // Compute hex shape functions as a tensor-product
256  const Real xi = p(0);
257  const Real eta = p(1);
258  const Real zeta = p(2);
259 
260  // The only way to make any sense of this
261  // is to look at the mgflo/mg2/mgf documentation
262  // and make the cut-out cube!
263  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
264  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
265  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
266  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
267 
268  return (FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
269  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta)*
270  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i2[i], zeta));
271  }
272 
273  // quadratic tetrahedral shape functions
274  case TET10:
275  {
276  libmesh_assert_less (i, 10);
277 
278  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
279  const Real zeta1 = p(0);
280  const Real zeta2 = p(1);
281  const Real zeta3 = p(2);
282  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
283 
284  switch(i)
285  {
286  case 0:
287  return zeta0*(2.*zeta0 - 1.);
288 
289  case 1:
290  return zeta1*(2.*zeta1 - 1.);
291 
292  case 2:
293  return zeta2*(2.*zeta2 - 1.);
294 
295  case 3:
296  return zeta3*(2.*zeta3 - 1.);
297 
298  case 4:
299  return 4.*zeta0*zeta1;
300 
301  case 5:
302  return 4.*zeta1*zeta2;
303 
304  case 6:
305  return 4.*zeta2*zeta0;
306 
307  case 7:
308  return 4.*zeta0*zeta3;
309 
310  case 8:
311  return 4.*zeta1*zeta3;
312 
313  case 9:
314  return 4.*zeta2*zeta3;
315 
316  default:
317  libmesh_error_msg("Invalid i = " << i);
318  }
319  }
320 
321  // "serendipity" prism
322  case PRISM15:
323  {
324  libmesh_assert_less (i, 15);
325 
326  const Real xi = p(0);
327  const Real eta = p(1);
328  const Real zeta = p(2);
329 
330  switch(i)
331  {
332  case 0:
333  return (1. - zeta)*(xi + eta - 1.)*(xi + eta + 0.5*zeta);
334 
335  case 1:
336  return (1. - zeta)*xi*(xi - 1. - 0.5*zeta);
337 
338  case 2: // phi1 with xi <- eta
339  return (1. - zeta)*eta*(eta - 1. - 0.5*zeta);
340 
341  case 3: // phi0 with zeta <- (-zeta)
342  return (1. + zeta)*(xi + eta - 1.)*(xi + eta - 0.5*zeta);
343 
344  case 4: // phi1 with zeta <- (-zeta)
345  return (1. + zeta)*xi*(xi - 1. + 0.5*zeta);
346 
347  case 5: // phi4 with xi <- eta
348  return (1. + zeta)*eta*(eta - 1. + 0.5*zeta);
349 
350  case 6:
351  return 2.*(1. - zeta)*xi*(1. - xi - eta);
352 
353  case 7:
354  return 2.*(1. - zeta)*xi*eta;
355 
356  case 8:
357  return 2.*(1. - zeta)*eta*(1. - xi - eta);
358 
359  case 9:
360  return (1. - zeta)*(1. + zeta)*(1. - xi - eta);
361 
362  case 10:
363  return (1. - zeta)*(1. + zeta)*xi;
364 
365  case 11: // phi10 with xi <-> eta
366  return (1. - zeta)*(1. + zeta)*eta;
367 
368  case 12: // phi6 with zeta <- (-zeta)
369  return 2.*(1. + zeta)*xi*(1. - xi - eta);
370 
371  case 13: // phi7 with zeta <- (-zeta)
372  return 2.*(1. + zeta)*xi*eta;
373 
374  case 14: // phi8 with zeta <- (-zeta)
375  return 2.*(1. + zeta)*eta*(1. - xi - eta);
376 
377  default:
378  libmesh_error_msg("Invalid i = " << i);
379  }
380  }
381 
382  // quadratic prism shape functions
383  case PRISM18:
384  {
385  libmesh_assert_less (i, 18);
386 
387  // Compute prism shape functions as a tensor-product
388  // of a triangle and an edge
389 
390  Point p2d(p(0),p(1));
391  Point p1d(p(2));
392 
393  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
394  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
395  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
396 
397  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
398  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
399  }
400 
401  // G. Bedrosian, "Shape functions and integration formulas for
402  // three-dimensional finite element analysis", Int. J. Numerical
403  // Methods Engineering, vol 35, p. 95-108, 1992.
404  case PYRAMID13:
405  {
406  libmesh_assert_less (i, 13);
407 
408  const Real xi = p(0);
409  const Real eta = p(1);
410  const Real zeta = p(2);
411  const Real eps = 1.e-35;
412 
413  // Denominators are perturbed by epsilon to avoid
414  // divide-by-zero issues.
415  Real den = (1. - zeta + eps);
416 
417  switch(i)
418  {
419  case 0:
420  return 0.25*(-xi - eta - 1.)*((1. - xi)*(1. - eta) - zeta + xi*eta*zeta/den);
421 
422  case 1:
423  return 0.25*(-eta + xi - 1.)*((1. + xi)*(1. - eta) - zeta - xi*eta*zeta/den);
424 
425  case 2:
426  return 0.25*(xi + eta - 1.)*((1. + xi)*(1. + eta) - zeta + xi*eta*zeta/den);
427 
428  case 3:
429  return 0.25*(eta - xi - 1.)*((1. - xi)*(1. + eta) - zeta - xi*eta*zeta/den);
430 
431  case 4:
432  return zeta*(2.*zeta - 1.);
433 
434  case 5:
435  return 0.5*(1. + xi - zeta)*(1. - xi - zeta)*(1. - eta - zeta)/den;
436 
437  case 6:
438  return 0.5*(1. + eta - zeta)*(1. - eta - zeta)*(1. + xi - zeta)/den;
439 
440  case 7:
441  return 0.5*(1. + xi - zeta)*(1. - xi - zeta)*(1. + eta - zeta)/den;
442 
443  case 8:
444  return 0.5*(1. + eta - zeta)*(1. - eta - zeta)*(1. - xi - zeta)/den;
445 
446  case 9:
447  return zeta*(1. - xi - zeta)*(1. - eta - zeta)/den;
448 
449  case 10:
450  return zeta*(1. + xi - zeta)*(1. - eta - zeta)/den;
451 
452  case 11:
453  return zeta*(1. + eta - zeta)*(1. + xi - zeta)/den;
454 
455  case 12:
456  return zeta*(1. - xi - zeta)*(1. + eta - zeta)/den;
457 
458  default:
459  libmesh_error_msg("Invalid i = " << i);
460  }
461  }
462 
463  // Quadratic shape functions, as defined in R. Graglia, "Higher order
464  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
465  // vol 47, no 5, May 1999.
466  case PYRAMID14:
467  {
468  libmesh_assert_less (i, 14);
469 
470  const Real xi = p(0);
471  const Real eta = p(1);
472  const Real zeta = p(2);
473  const Real eps = 1.e-35;
474 
475  // The "normalized coordinates" defined by Graglia. These are
476  // the planes which define the faces of the pyramid.
477  Real
478  p1 = 0.5*(1. - eta - zeta), // back
479  p2 = 0.5*(1. + xi - zeta), // left
480  p3 = 0.5*(1. + eta - zeta), // front
481  p4 = 0.5*(1. - xi - zeta); // right
482 
483  // Denominators are perturbed by epsilon to avoid
484  // divide-by-zero issues.
485  Real
486  den = (-1. + zeta + eps),
487  den2 = den*den;
488 
489  switch(i)
490  {
491  case 0:
492  return p4*p1*(xi*eta - zeta + zeta*zeta)/den2;
493 
494  case 1:
495  return -p1*p2*(xi*eta + zeta - zeta*zeta)/den2;
496 
497  case 2:
498  return p2*p3*(xi*eta - zeta + zeta*zeta)/den2;
499 
500  case 3:
501  return -p3*p4*(xi*eta + zeta - zeta*zeta)/den2;
502 
503  case 4:
504  return zeta*(2.*zeta - 1.);
505 
506  case 5:
507  return -4.*p2*p1*p4*eta/den2;
508 
509  case 6:
510  return 4.*p1*p2*p3*xi/den2;
511 
512  case 7:
513  return 4.*p2*p3*p4*eta/den2;
514 
515  case 8:
516  return -4.*p3*p4*p1*xi/den2;
517 
518  case 9:
519  return -4.*p1*p4*zeta/den;
520 
521  case 10:
522  return -4.*p2*p1*zeta/den;
523 
524  case 11:
525  return -4.*p3*p2*zeta/den;
526 
527  case 12:
528  return -4.*p4*p3*zeta/den;
529 
530  case 13:
531  return 16.*p1*p2*p3*p4/den2;
532 
533  default:
534  libmesh_error_msg("Invalid i = " << i);
535  }
536  }
537 
538 
539  default:
540  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
541  }
542  }
543 
544 
545  // unsupported order
546  default:
547  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
548  }
549 
550 #else
551  return 0.;
552 #endif
553 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [32/109]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 33 of file fe_l2_hierarchic_shape_1D.C.

37 {
38  libmesh_assert_less (i, order+1u);
39 
40  // Declare that we are using our own special power function
41  // from the Utility namespace. This saves typing later.
42  using Utility::pow;
43 
44  const Real xi = p(0);
45 
46  Real returnval = 1.;
47 
48  switch (i)
49  {
50  case 0:
51  returnval = .5*(1. - xi);
52  break;
53  case 1:
54  returnval = .5*(1. + xi);
55  break;
56  // All even-terms have the same form.
57  // (xi^p - 1.)/p!
58  case 2:
59  returnval = (xi*xi - 1.)/2.;
60  break;
61  case 4:
62  returnval = (pow<4>(xi) - 1.)/24.;
63  break;
64  case 6:
65  returnval = (pow<6>(xi) - 1.)/720.;
66  break;
67 
68  // All odd-terms have the same form.
69  // (xi^p - xi)/p!
70  case 3:
71  returnval = (xi*xi*xi - xi)/6.;
72  break;
73  case 5:
74  returnval = (pow<5>(xi) - xi)/120.;
75  break;
76  case 7:
77  returnval = (pow<7>(xi) - xi)/5040.;
78  break;
79  default:
80  Real denominator = 1.;
81  for (unsigned int n=1; n <= i; ++n)
82  {
83  returnval *= xi;
84  denominator *= n;
85  }
86  // Odd:
87  if (i % 2)
88  returnval = (returnval - xi)/denominator;
89  // Even:
90  else
91  returnval = (returnval - 1.)/denominator;
92  break;
93  }
94 
95  return returnval;
96 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [33/109]

Real libMesh::FE< 3, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 33 of file fe_clough_shape_3D.C.

37 {
38  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
39  return 0.;
40 }

◆ shape() [34/109]

Real libMesh::FE< 1, HIERARCHIC >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 33 of file fe_hierarchic_shape_1D.C.

37 {
38  libmesh_assert_less (i, order+1u);
39 
40  // Declare that we are using our own special power function
41  // from the Utility namespace. This saves typing later.
42  using Utility::pow;
43 
44  const Real xi = p(0);
45 
46  Real returnval = 1.;
47 
48  switch (i)
49  {
50  case 0:
51  returnval = .5*(1. - xi);
52  break;
53  case 1:
54  returnval = .5*(1. + xi);
55  break;
56  // All even-terms have the same form.
57  // (xi^p - 1.)/p!
58  case 2:
59  returnval = (xi*xi - 1.)/2.;
60  break;
61  case 4:
62  returnval = (pow<4>(xi) - 1.)/24.;
63  break;
64  case 6:
65  returnval = (pow<6>(xi) - 1.)/720.;
66  break;
67 
68  // All odd-terms have the same form.
69  // (xi^p - xi)/p!
70  case 3:
71  returnval = (xi*xi*xi - xi)/6.;
72  break;
73  case 5:
74  returnval = (pow<5>(xi) - xi)/120.;
75  break;
76  case 7:
77  returnval = (pow<7>(xi) - xi)/5040.;
78  break;
79  default:
80  Real denominator = 1.;
81  for (unsigned int n=1; n <= i; ++n)
82  {
83  returnval *= xi;
84  denominator *= n;
85  }
86  // Odd:
87  if (i % 2)
88  returnval = (returnval - xi)/denominator;
89  // Even:
90  else
91  returnval = (returnval - 1.)/denominator;
92  break;
93  }
94 
95  return returnval;
96 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [35/109]

Real libMesh::FE< 2, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 34 of file fe_bernstein_shape_2D.C.

38 {
39  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge orientation is needed.");
40  return 0.;
41 }

◆ shape() [36/109]

Real libMesh::FE< 1, SZABAB >::shape ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 35 of file fe_szabab_shape_1D.C.

39 {
40  const Real xi = p(0);
41  const Real xi2 = xi*xi;
42 
43 
44  // Use this libmesh_assert rather than a switch with a single entry...
45  // It will go away in optimized mode, essentially has the same effect.
46  libmesh_assert_less_equal (order, SEVENTH);
47 
48  // switch (order)
49  // {
50  // case FIRST:
51  // case SECOND:
52  // case THIRD:
53  // case FOURTH:
54  // case FIFTH:
55  // case SIXTH:
56  // case SEVENTH:
57 
58  switch(i)
59  {
60  //nodal shape functions
61  case 0: return 1./2.-1./2.*xi;
62  case 1: return 1./2.+1./2.*xi;
63  case 2: return 1./4. *2.4494897427831780982*(xi2-1.);
64  case 3: return 1./4. *3.1622776601683793320*(xi2-1.)*xi;
65  case 4: return 1./16. *3.7416573867739413856*((5.*xi2-6.)*xi2+1.);
66  case 5: return 3./16. *1.4142135623730950488*(3.+(-10.+7.*xi2)*xi2)*xi;
67  case 6: return 1./32. *4.6904157598234295546*(-1.+(15.+(-35.+21.*xi2)*xi2)*xi2);
68  case 7: return 1./32. *5.0990195135927848300*(-5.+(35.+(-63.+33.*xi2)*xi2)*xi2)*xi;
69  case 8: return 1./256.*5.4772255750516611346*(5.+(-140.+(630.+(-924.+429.*xi2)*xi2)*xi2)*xi2);
70 
71  default:
72  libmesh_error_msg("Invalid shape function index!");
73  }
74 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [37/109]

Real libMesh::FE< 3, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 36 of file fe_bernstein_shape_3D.C.

40 {
41  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
42  return 0.;
43 }

◆ shape() [38/109]

Real libMesh::FE< 1, BERNSTEIN >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 38 of file fe_bernstein_shape_1D.C.

42 {
43  const Real xi = p(0);
44  using Utility::pow;
45 
46  switch (order)
47  {
48  case FIRST:
49 
50  switch(i)
51  {
52  case 0:
53  return (1.-xi)/2.;
54  case 1:
55  return (1.+xi)/2.;
56  default:
57  libmesh_error_msg("Invalid shape function index i = " << i);
58  }
59 
60  case SECOND:
61 
62  switch(i)
63  {
64  case 0:
65  return (1./4.)*pow<2>(1.-xi);
66  case 1:
67  return (1./4.)*pow<2>(1.+xi);
68  case 2:
69  return (1./2.)*(1.-xi)*(1.+xi);
70  default:
71  libmesh_error_msg("Invalid shape function index i = " << i);
72  }
73 
74  case THIRD:
75 
76  switch(i)
77  {
78  case 0:
79  return (1./8.)*pow<3>(1.-xi);
80  case 1:
81  return (1./8.)*pow<3>(1.+xi);
82  case 2:
83  return (3./8.)*(1.+xi)*pow<2>(1.-xi);
84  case 3:
85  return (3./8.)*pow<2>(1.+xi)*(1.-xi);
86  default:
87  libmesh_error_msg("Invalid shape function index i = " << i);
88  }
89 
90  case FOURTH:
91 
92  switch(i)
93  {
94  case 0:
95  return (1./16.)*pow<4>(1.-xi);
96  case 1:
97  return (1./16.)*pow<4>(1.+xi);
98  case 2:
99  return (1./ 4.)*(1.+xi)*pow<3>(1.-xi);
100  case 3:
101  return (3./ 8.)*pow<2>(1.+xi)*pow<2>(1.-xi);
102  case 4:
103  return (1./ 4.)*pow<3>(1.+xi)*(1.-xi);
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107 
108 
109  case FIFTH:
110 
111  switch(i)
112  {
113  case 0:
114  return (1./32.)*pow<5>(1.-xi);
115  case 1:
116  return (1./32.)*pow<5>(1.+xi);
117  case 2:
118  return (5./32.)*(1.+xi)*pow<4>(1.-xi);
119  case 3:
120  return (5./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
121  case 4:
122  return (5./16.)*pow<3>(1.+xi)*pow<2>(1.-xi);
123  case 5:
124  return (5./32.)*pow<4>(1.+xi)*(1.-xi);
125  default:
126  libmesh_error_msg("Invalid shape function index i = " << i);
127  }
128 
129 
130  case SIXTH:
131 
132  switch (i)
133  {
134  case 0:
135  return ( 1./64.)*pow<6>(1.-xi);
136  case 1:
137  return ( 1./64.)*pow<6>(1.+xi);
138  case 2:
139  return ( 3./32.)*(1.+xi)*pow<5>(1.-xi);
140  case 3:
141  return (15./64.)*pow<2>(1.+xi)*pow<4>(1.-xi);
142  case 4:
143  return ( 5./16.)*pow<3>(1.+xi)*pow<3>(1.-xi);
144  case 5:
145  return (15./64.)*pow<4>(1.+xi)*pow<2>(1.-xi);
146  case 6:
147  return ( 3./32.)*pow<5>(1.+xi)*(1.-xi);
148  default:
149  libmesh_error_msg("Invalid shape function index i = " << i);
150  }
151 
152  default:
153  {
154  libmesh_assert (order>6);
155 
156  // Use this for arbitrary orders.
157  // Note that this implementation is less efficient.
158  const int p_order = static_cast<int>(order);
159  const int m = p_order-i+1;
160  const int n = (i-1);
161 
162  Real binomial_p_i = 1;
163 
164  // the binomial coefficient (p choose n)
165  // Using an unsigned long here will work for any of the orders we support.
166  // Explicitly construct a Real to prevent conversion warnings
167  if (i>1)
168  binomial_p_i = Real(Utility::binomial(static_cast<unsigned long>(p_order),
169  static_cast<unsigned long>(n)));
170 
171  switch(i)
172  {
173  case 0:
174  return binomial_p_i * std::pow((1-xi)/2, p_order);
175  case 1:
176  return binomial_p_i * std::pow((1+xi)/2, p_order);
177  default:
178  {
179  return binomial_p_i * std::pow((1+xi)/2,n)
180  * std::pow((1-xi)/2,m);
181  }
182  }
183  }
184  }
185 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T binomial(T n, T k)
Definition: utility.h:224

◆ shape() [39/109]

Real libMesh::FE< 0, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 38 of file fe_scalar_shape_0D.C.

42 {
43  return 1.;
44 }

◆ shape() [40/109]

Real libMesh::FE< 1, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 38 of file fe_scalar_shape_1D.C.

42 {
43  return 1.;
44 }

◆ shape() [41/109]

Real libMesh::FE< 2, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 38 of file fe_scalar_shape_2D.C.

42 {
43  return 1.;
44 }

◆ shape() [42/109]

Real libMesh::FE< 3, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 38 of file fe_scalar_shape_3D.C.

42 {
43  return 1.;
44 }

◆ shape() [43/109]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 41 of file fe_nedelec_one_shape_3D.C.

45 {
46 #if LIBMESH_DIM == 3
47  libmesh_assert(elem);
48 
49  const Order totalorder = static_cast<Order>(order + elem->p_level());
50 
51  switch (totalorder)
52  {
53  // linear Lagrange shape functions
54  case FIRST:
55  {
56  switch (elem->type())
57  {
58  case HEX20:
59  case HEX27:
60  {
61  libmesh_assert_less (i, 12);
62 
63  const Real xi = p(0);
64  const Real eta = p(1);
65  const Real zeta = p(2);
66 
67  // Even with a loose inverse_map tolerance we ought to
68  // be nearly on the element interior in master
69  // coordinates
70  libmesh_assert_less_equal ( std::fabs(xi), 1.0+10*TOLERANCE );
71  libmesh_assert_less_equal ( std::fabs(eta), 1.0+10*TOLERANCE );
72  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+10*TOLERANCE );
73 
74  switch(i)
75  {
76  case 0:
77  {
78  if (elem->point(0) > elem->point(1))
79  return RealGradient( -0.125*(1.0-eta-zeta+eta*zeta), 0.0, 0.0 );
80  else
81  return RealGradient( 0.125*(1.0-eta-zeta+eta*zeta), 0.0, 0.0 );
82  }
83  case 1:
84  {
85  if (elem->point(1) > elem->point(2))
86  return RealGradient( 0.0, -0.125*(1.0+xi-zeta-xi*zeta), 0.0 );
87  else
88  return RealGradient( 0.0, 0.125*(1.0+xi-zeta-xi*zeta), 0.0 );
89  }
90  case 2:
91  {
92  if (elem->point(2) > elem->point(3))
93  return RealGradient( 0.125*(1.0+eta-zeta-eta*zeta), 0.0, 0.0 );
94  else
95  return RealGradient( -0.125*(1.0+eta-zeta-eta*zeta), 0.0, 0.0 );
96  }
97  case 3:
98  {
99  if (elem->point(3) > elem->point(0))
100  return RealGradient( 0.0, 0.125*(1.0-xi-zeta+xi*zeta), 0.0 );
101  else
102  return RealGradient( 0.0, -0.125*(1.0-xi-zeta+xi*zeta), 0.0 );
103  }
104  case 4:
105  {
106  if (elem->point(0) > elem->point(4))
107  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi-eta+xi*eta) );
108  else
109  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi-eta+xi*eta) );
110  }
111  case 5:
112  {
113  if (elem->point(1) > elem->point(5))
114  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi-eta-xi*eta) );
115  else
116  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi-eta-xi*eta) );
117  }
118  case 6:
119  {
120  if (elem->point(2) > elem->point(6))
121  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi+eta+xi*eta) );
122  else
123  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi+eta+xi*eta) );
124  }
125  case 7:
126  {
127  if (elem->point(3) > elem->point(7))
128  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi+eta-xi*eta) );
129  else
130  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi+eta-xi*eta) );
131  }
132  case 8:
133  {
134  if (elem->point(4) > elem->point(5))
135  return RealGradient( -0.125*(1.0-eta+zeta-eta*zeta), 0.0, 0.0 );
136  else
137  return RealGradient( 0.125*(1.0-eta+zeta-eta*zeta), 0.0, 0.0 );
138  }
139  case 9:
140  {
141  if (elem->point(5) > elem->point(6))
142  return RealGradient( 0.0, -0.125*(1.0+xi+zeta+xi*zeta), 0.0 );
143  else
144  return RealGradient( 0.0, 0.125*(1.0+xi+zeta+xi*zeta), 0.0 );
145  }
146  case 10:
147  {
148  if (elem->point(7) > elem->point(6))
149  return RealGradient( -0.125*(1.0+eta+zeta+eta*zeta), 0.0, 0.0 );
150  else
151  return RealGradient( 0.125*(1.0+eta+zeta+eta*zeta), 0.0, 0.0 );
152  }
153  case 11:
154  {
155  if (elem->point(4) > elem->point(7))
156  return RealGradient( 0.0, -0.125*(1.0-xi+zeta-xi*zeta), 0.0 );
157  else
158  return RealGradient( 0.0, 0.125*(1.0-xi+zeta-xi*zeta), 0.0 );
159  }
160 
161  default:
162  libmesh_error_msg("Invalid i = " << i);
163  }
164 
165  return RealGradient();
166  }
167 
168  case TET10:
169  {
170  libmesh_assert_less (i, 6);
171 
172  libmesh_not_implemented();
173  return RealGradient();
174  }
175 
176  default:
177  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
178  }
179  }
180 
181  // unsupported order
182  default:
183  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
184  }
185 #else
186  return RealGradient();
187 #endif
188 }
RealVectorValue RealGradient
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [44/109]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 42 of file fe_nedelec_one_shape_2D.C.

46 {
47 #if LIBMESH_DIM > 1
48  libmesh_assert(elem);
49 
50  const Order total_order = static_cast<Order>(order + elem->p_level());
51 
52  switch (total_order)
53  {
54  case FIRST:
55  {
56  switch (elem->type())
57  {
58  case QUAD8:
59  case QUAD9:
60  {
61  libmesh_assert_less (i, 4);
62 
63  const Real xi = p(0);
64  const Real eta = p(1);
65 
66  // Even with a loose inverse_map tolerance we ought to
67  // be nearly on the element interior in master
68  // coordinates
69  libmesh_assert_less_equal ( std::fabs(xi), 1.0+10*TOLERANCE );
70  libmesh_assert_less_equal ( std::fabs(eta), 1.0+10*TOLERANCE );
71 
72  switch(i)
73  {
74  case 0:
75  {
76  if (elem->point(0) > elem->point(1))
77  return RealGradient( -0.25*(1.0-eta), 0.0 );
78  else
79  return RealGradient( 0.25*(1.0-eta), 0.0 );
80  }
81  case 1:
82  {
83  if (elem->point(1) > elem->point(2))
84  return RealGradient( 0.0, -0.25*(1.0+xi) );
85  else
86  return RealGradient( 0.0, 0.25*(1.0+xi) );
87  }
88 
89  case 2:
90  {
91  if (elem->point(2) > elem->point(3))
92  return RealGradient( 0.25*(1.0+eta), 0.0 );
93  else
94  return RealGradient( -0.25*(1.0+eta), 0.0 );
95  }
96  case 3:
97  {
98  if (elem->point(3) > elem->point(0))
99  return RealGradient( 0.0, -0.25*(xi-1.0) );
100  else
101  return RealGradient( 0.0, 0.25*(xi-1.0) );
102  }
103 
104  default:
105  libmesh_error_msg("Invalid i = " << i);
106  }
107 
108  return RealGradient();
109  }
110 
111  case TRI6:
112  {
113  const Real xi = p(0);
114  const Real eta = p(1);
115 
116  libmesh_assert_less (i, 3);
117 
118  switch(i)
119  {
120  case 0:
121  {
122  if (elem->point(0) > elem->point(1))
123  return RealGradient( -1.0+eta, -xi );
124  else
125  return RealGradient( 1.0-eta, xi );
126  }
127  case 1:
128  {
129  if (elem->point(1) > elem->point(2))
130  return RealGradient( eta, -xi );
131  else
132  return RealGradient( -eta, xi );
133  }
134 
135  case 2:
136  {
137  if (elem->point(2) > elem->point(0))
138  return RealGradient( eta, -xi+1.0 );
139  else
140  return RealGradient( -eta, xi-1.0 );
141  }
142 
143  default:
144  libmesh_error_msg("Invalid i = " << i);
145  }
146  }
147 
148  default:
149  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
150  }
151  }
152 
153  // unsupported order
154  default:
155  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
156  }
157 #else // LIBMESH_DIM > 1
158  return RealGradient();
159 #endif
160 }
RealVectorValue RealGradient
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [45/109]

Real libMesh::FE< 2, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 44 of file fe_hierarchic_shape_2D.C.

48 {
49  libmesh_assert(elem);
50 
51  const Order totalorder = static_cast<Order>(order+elem->p_level());
52  libmesh_assert_greater (totalorder, 0);
53 
54  switch (elem->type())
55  {
56  case TRI3:
57  case TRISHELL3:
58  case TRI6:
59  {
60  const Real zeta1 = p(0);
61  const Real zeta2 = p(1);
62  const Real zeta0 = 1. - zeta1 - zeta2;
63 
64  libmesh_assert_less (i, (totalorder+1u)*(totalorder+2u)/2);
65  libmesh_assert (elem->type() == TRI6 || totalorder < 2);
66 
67  // Vertex DoFs
68  if (i == 0)
69  return zeta0;
70  else if (i == 1)
71  return zeta1;
72  else if (i == 2)
73  return zeta2;
74  // Edge DoFs
75  else if (i < totalorder + 2u)
76  {
77  // Avoid returning NaN on vertices!
78  if (zeta0 + zeta1 == 0.)
79  return 0.;
80 
81  const unsigned int basisorder = i - 1;
82  // Get factors to account for edge-flipping
83  Real f0 = 1;
84  if (basisorder%2 && (elem->point(0) > elem->point(1)))
85  f0 = -1.;
86 
87  Real edgeval = (zeta1 - zeta0) / (zeta1 + zeta0);
88  Real crossfunc = zeta0 + zeta1;
89  for (unsigned int n=1; n != basisorder; ++n)
90  crossfunc *= (zeta0 + zeta1);
91 
92  return f0 * crossfunc *
93  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
94  basisorder, edgeval);
95  }
96  else if (i < 2u*totalorder + 1)
97  {
98  // Avoid returning NaN on vertices!
99  if (zeta1 + zeta2 == 0.)
100  return 0.;
101 
102  const unsigned int basisorder = i - totalorder;
103  // Get factors to account for edge-flipping
104  Real f1 = 1;
105  if (basisorder%2 && (elem->point(1) > elem->point(2)))
106  f1 = -1.;
107 
108  Real edgeval = (zeta2 - zeta1) / (zeta2 + zeta1);
109  Real crossfunc = zeta2 + zeta1;
110  for (unsigned int n=1; n != basisorder; ++n)
111  crossfunc *= (zeta2 + zeta1);
112 
113  return f1 * crossfunc *
114  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
115  basisorder, edgeval);
116  }
117  else if (i < 3u*totalorder)
118  {
119  // Avoid returning NaN on vertices!
120  if (zeta0 + zeta2 == 0.)
121  return 0.;
122 
123  const unsigned int basisorder = i - (2u*totalorder) + 1;
124  // Get factors to account for edge-flipping
125  Real f2 = 1;
126  if (basisorder%2 && (elem->point(2) > elem->point(0)))
127  f2 = -1.;
128 
129  Real edgeval = (zeta0 - zeta2) / (zeta0 + zeta2);
130  Real crossfunc = zeta0 + zeta2;
131  for (unsigned int n=1; n != basisorder; ++n)
132  crossfunc *= (zeta0 + zeta2);
133 
134  return f2 * crossfunc *
135  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
136  basisorder, edgeval);
137  }
138  // Interior DoFs
139  else
140  {
141  const unsigned int basisnum = i - (3u*totalorder);
142  unsigned int exp0 = triangular_number_column[basisnum] + 1;
143  unsigned int exp1 = triangular_number_row[basisnum] + 1 -
144  triangular_number_column[basisnum];
145 
146  Real returnval = 1;
147  for (unsigned int n = 0; n != exp0; ++n)
148  returnval *= zeta0;
149  for (unsigned int n = 0; n != exp1; ++n)
150  returnval *= zeta1;
151  returnval *= zeta2;
152  return returnval;
153  }
154  }
155 
156  // Hierarchic shape functions on the quadrilateral.
157  case QUAD4:
158  case QUADSHELL4:
159  libmesh_assert_less (totalorder, 2);
160  libmesh_fallthrough();
161  case QUAD8:
162  case QUADSHELL8:
163  case QUAD9:
164  {
165  // Compute quad shape functions as a tensor-product
166  const Real xi = p(0);
167  const Real eta = p(1);
168 
169  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
170 
171  // Example i, i0, i1 values for totalorder = 5:
172  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
173  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
174  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
175 
176  unsigned int i0, i1;
177 
178  // Vertex DoFs
179  if (i == 0)
180  { i0 = 0; i1 = 0; }
181  else if (i == 1)
182  { i0 = 1; i1 = 0; }
183  else if (i == 2)
184  { i0 = 1; i1 = 1; }
185  else if (i == 3)
186  { i0 = 0; i1 = 1; }
187  // Edge DoFs
188  else if (i < totalorder + 3u)
189  { i0 = i - 2; i1 = 0; }
190  else if (i < 2u*totalorder + 2)
191  { i0 = 1; i1 = i - totalorder - 1; }
192  else if (i < 3u*totalorder + 1)
193  { i0 = i - 2u*totalorder; i1 = 1; }
194  else if (i < 4u*totalorder)
195  { i0 = 0; i1 = i - 3u*totalorder + 1; }
196  // Interior DoFs
197  else
198  {
199  unsigned int basisnum = i - 4*totalorder;
200  i0 = square_number_column[basisnum] + 2;
201  i1 = square_number_row[basisnum] + 2;
202  }
203 
204  // Flip odd degree of freedom values if necessary
205  // to keep continuity on sides
206  Real f = 1.;
207 
208  if ((i0%2) && (i0 > 2) && (i1 == 0))
209  f = (elem->point(0) > elem->point(1))?-1.:1.;
210  else if ((i0%2) && (i0>2) && (i1 == 1))
211  f = (elem->point(3) > elem->point(2))?-1.:1.;
212  else if ((i0 == 0) && (i1%2) && (i1>2))
213  f = (elem->point(0) > elem->point(3))?-1.:1.;
214  else if ((i0 == 1) && (i1%2) && (i1>2))
215  f = (elem->point(1) > elem->point(2))?-1.:1.;
216 
217  return f*(FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
218  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i1, eta));
219  }
220 
221  default:
222  libmesh_error_msg("ERROR: Unsupported element type = " << elem->type());
223  }
224 
225  return 0.;
226 }
const unsigned char triangular_number_row[]
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char triangular_number_column[]
const unsigned char square_number_row[]

◆ shape() [46/109]

Real libMesh::FE< 0, CLOUGH >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_clough_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [47/109]

Real libMesh::FE< 0, MONOMIAL >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_monomial_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [48/109]

Real libMesh::FE< 0, SZABAB >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_szabab_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [49/109]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_l2_hierarchic_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [50/109]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 44 of file fe_l2_hierarchic_shape_2D.C.

48 {
49  libmesh_assert(elem);
50 
51  const Order totalorder = static_cast<Order>(order+elem->p_level());
52  libmesh_assert_greater (totalorder, 0);
53 
54  switch (elem->type())
55  {
56  case TRI3:
57  case TRISHELL3:
58  case TRI6:
59  {
60  const Real zeta1 = p(0);
61  const Real zeta2 = p(1);
62  const Real zeta0 = 1. - zeta1 - zeta2;
63 
64  libmesh_assert_less (i, (totalorder+1u)*(totalorder+2u)/2);
65  libmesh_assert (elem->type() == TRI6 || totalorder < 2);
66 
67  // Vertex DoFs
68  if (i == 0)
69  return zeta0;
70  else if (i == 1)
71  return zeta1;
72  else if (i == 2)
73  return zeta2;
74  // Edge DoFs
75  else if (i < totalorder + 2u)
76  {
77  // Avoid returning NaN on vertices!
78  if (zeta0 + zeta1 == 0.)
79  return 0.;
80 
81  const unsigned int basisorder = i - 1;
82  // Get factors to account for edge-flipping
83  Real f0 = 1;
84  if (basisorder%2 && (elem->point(0) > elem->point(1)))
85  f0 = -1.;
86 
87  Real edgeval = (zeta1 - zeta0) / (zeta1 + zeta0);
88  Real crossfunc = zeta0 + zeta1;
89  for (unsigned int n=1; n != basisorder; ++n)
90  crossfunc *= (zeta0 + zeta1);
91 
92  return f0 * crossfunc *
93  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder,
94  basisorder, edgeval);
95  }
96  else if (i < 2u*totalorder + 1)
97  {
98  // Avoid returning NaN on vertices!
99  if (zeta1 + zeta2 == 0.)
100  return 0.;
101 
102  const unsigned int basisorder = i - totalorder;
103  // Get factors to account for edge-flipping
104  Real f1 = 1;
105  if (basisorder%2 && (elem->point(1) > elem->point(2)))
106  f1 = -1.;
107 
108  Real edgeval = (zeta2 - zeta1) / (zeta2 + zeta1);
109  Real crossfunc = zeta2 + zeta1;
110  for (unsigned int n=1; n != basisorder; ++n)
111  crossfunc *= (zeta2 + zeta1);
112 
113  return f1 * crossfunc *
114  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder,
115  basisorder, edgeval);
116  }
117  else if (i < 3u*totalorder)
118  {
119  // Avoid returning NaN on vertices!
120  if (zeta0 + zeta2 == 0.)
121  return 0.;
122 
123  const unsigned int basisorder = i - (2u*totalorder) + 1;
124  // Get factors to account for edge-flipping
125  Real f2 = 1;
126  if (basisorder%2 && (elem->point(2) > elem->point(0)))
127  f2 = -1.;
128 
129  Real edgeval = (zeta0 - zeta2) / (zeta0 + zeta2);
130  Real crossfunc = zeta0 + zeta2;
131  for (unsigned int n=1; n != basisorder; ++n)
132  crossfunc *= (zeta0 + zeta2);
133 
134  return f2 * crossfunc *
135  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder,
136  basisorder, edgeval);
137  }
138  // Interior DoFs
139  else
140  {
141  const unsigned int basisnum = i - (3u*totalorder);
142  unsigned int exp0 = triangular_number_column[basisnum] + 1;
143  unsigned int exp1 = triangular_number_row[basisnum] + 1 -
144  triangular_number_column[basisnum];
145 
146  Real returnval = 1;
147  for (unsigned int n = 0; n != exp0; ++n)
148  returnval *= zeta0;
149  for (unsigned int n = 0; n != exp1; ++n)
150  returnval *= zeta1;
151  returnval *= zeta2;
152  return returnval;
153  }
154  }
155 
156  // Hierarchic shape functions on the quadrilateral.
157  case QUAD4:
158  case QUADSHELL4:
159  libmesh_assert_less (totalorder, 2);
160  libmesh_fallthrough();
161  case QUAD8:
162  case QUADSHELL8:
163  case QUAD9:
164  {
165  // Compute quad shape functions as a tensor-product
166  const Real xi = p(0);
167  const Real eta = p(1);
168 
169  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
170 
171  // Example i, i0, i1 values for totalorder = 5:
172  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
173  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
174  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
175 
176  unsigned int i0, i1;
177 
178  // Vertex DoFs
179  if (i == 0)
180  { i0 = 0; i1 = 0; }
181  else if (i == 1)
182  { i0 = 1; i1 = 0; }
183  else if (i == 2)
184  { i0 = 1; i1 = 1; }
185  else if (i == 3)
186  { i0 = 0; i1 = 1; }
187  // Edge DoFs
188  else if (i < totalorder + 3u)
189  { i0 = i - 2; i1 = 0; }
190  else if (i < 2u*totalorder + 2)
191  { i0 = 1; i1 = i - totalorder - 1; }
192  else if (i < 3u*totalorder + 1)
193  { i0 = i - 2u*totalorder; i1 = 1; }
194  else if (i < 4u*totalorder)
195  { i0 = 0; i1 = i - 3u*totalorder + 1; }
196  // Interior DoFs
197  else
198  {
199  unsigned int basisnum = i - 4*totalorder;
200  i0 = square_number_column[basisnum] + 2;
201  i1 = square_number_row[basisnum] + 2;
202  }
203 
204  // Flip odd degree of freedom values if necessary
205  // to keep continuity on sides
206  Real f = 1.;
207 
208  if ((i0%2) && (i0 > 2) && (i1 == 0))
209  f = (elem->point(0) > elem->point(1))?-1.:1.;
210  else if ((i0%2) && (i0>2) && (i1 == 1))
211  f = (elem->point(3) > elem->point(2))?-1.:1.;
212  else if ((i0 == 0) && (i1%2) && (i1>2))
213  f = (elem->point(0) > elem->point(3))?-1.:1.;
214  else if ((i0 == 1) && (i1%2) && (i1>2))
215  f = (elem->point(1) > elem->point(2))?-1.:1.;
216 
217  return f*(FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
218  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i1, eta));
219  }
220 
221  default:
222  libmesh_error_msg("ERROR: Unsupported element type = " << elem->type());
223  }
224 
225  return 0.;
226 }
const unsigned char triangular_number_row[]
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char triangular_number_column[]
const unsigned char square_number_row[]

◆ shape() [51/109]

Real libMesh::FE< 0, XYZ >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_xyz_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [52/109]

Real libMesh::FE< 0, BERNSTEIN >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_bernstein_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [53/109]

Real libMesh::FE< 0, L2_LAGRANGE >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_l2_lagrange_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [54/109]

Real libMesh::FE< 0, HERMITE >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_hermite_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [55/109]

Real libMesh::FE< 3, SZABAB >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 44 of file fe_szabab_shape_3D.C.

48 {
49  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
50  return 0.;
51 }

◆ shape() [56/109]

Real libMesh::FE< 1, XYZ >::shape ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)
inherited

Definition at line 44 of file fe_xyz_shape_1D.C.

48 {
49  libmesh_assert(elem);
50  libmesh_assert_less_equal (i, order + elem->p_level());
51 
52  Point centroid = elem->centroid();
53  Real max_distance = 0.;
54  for (unsigned int p = 0; p < elem->n_nodes(); p++)
55  {
56  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
57  max_distance = std::max(distance, max_distance);
58  }
59 
60  const Real x = point_in(0);
61  const Real xc = centroid(0);
62  const Real dx = (x - xc)/max_distance;
63 
64  // monomials. since they are hierarchic we only need one case block.
65  switch (i)
66  {
67  case 0:
68  return 1.;
69 
70  case 1:
71  return dx;
72 
73  case 2:
74  return dx*dx;
75 
76  case 3:
77  return dx*dx*dx;
78 
79  case 4:
80  return dx*dx*dx*dx;
81 
82  default:
83  Real val = 1.;
84  for (unsigned int index = 0; index != i; ++index)
85  val *= dx;
86  return val;
87  }
88 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [57/109]

Real libMesh::FE< 2, XYZ >::shape ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)
inherited

Definition at line 44 of file fe_xyz_shape_2D.C.

48 {
49 #if LIBMESH_DIM > 1
50 
51  libmesh_assert(elem);
52 
53  Point centroid = elem->centroid();
54  Point max_distance = Point(0.,0.,0.);
55  for (unsigned int p = 0; p < elem->n_nodes(); p++)
56  for (unsigned int d = 0; d < 2; d++)
57  {
58  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
59  max_distance(d) = std::max(distance, max_distance(d));
60  }
61 
62  const Real x = point_in(0);
63  const Real y = point_in(1);
64  const Real xc = centroid(0);
65  const Real yc = centroid(1);
66  const Real distx = max_distance(0);
67  const Real disty = max_distance(1);
68  const Real dx = (x - xc)/distx;
69  const Real dy = (y - yc)/disty;
70 
71 #ifndef NDEBUG
72  // totalorder is only used in the assertion below, so
73  // we avoid declaring it when asserts are not active.
74  const unsigned int totalorder = order + elem->p_level();
75 #endif
76  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
77 
78 
79  // monomials. since they are hierarchic we only need one case block.
80  switch (i)
81  {
82  // constant
83  case 0:
84  return 1.;
85 
86  // linear
87  case 1:
88  return dx;
89 
90  case 2:
91  return dy;
92 
93  // quadratics
94  case 3:
95  return dx*dx;
96 
97  case 4:
98  return dx*dy;
99 
100  case 5:
101  return dy*dy;
102 
103  // cubics
104  case 6:
105  return dx*dx*dx;
106 
107  case 7:
108  return dx*dx*dy;
109 
110  case 8:
111  return dx*dy*dy;
112 
113  case 9:
114  return dy*dy*dy;
115 
116  // quartics
117  case 10:
118  return dx*dx*dx*dx;
119 
120  case 11:
121  return dx*dx*dx*dy;
122 
123  case 12:
124  return dx*dx*dy*dy;
125 
126  case 13:
127  return dx*dy*dy*dy;
128 
129  case 14:
130  return dy*dy*dy*dy;
131 
132  default:
133  unsigned int o = 0;
134  for (; i >= (o+1)*(o+2)/2; o++) { }
135  unsigned int i2 = i - (o*(o+1)/2);
136  Real val = 1.;
137  for (unsigned int index=i2; index != o; index++)
138  val *= dx;
139  for (unsigned int index=0; index != i2; index++)
140  val *= dy;
141  return val;
142  }
143 
144 #else
145  return 0.;
146 #endif
147 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [58/109]

Real libMesh::FE< 0, LAGRANGE >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_lagrange_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [59/109]

Real libMesh::FE< 3, XYZ >::shape ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)
inherited

Definition at line 44 of file fe_xyz_shape_3D.C.

48 {
49 #if LIBMESH_DIM == 3
50  libmesh_assert(elem);
51 
52  Point centroid = elem->centroid();
53  Point max_distance = Point(0.,0.,0.);
54  for (unsigned int p = 0; p < elem->n_nodes(); p++)
55  for (unsigned int d = 0; d < 3; d++)
56  {
57  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
58  max_distance(d) = std::max(distance, max_distance(d));
59  }
60 
61  const Real x = point_in(0);
62  const Real y = point_in(1);
63  const Real z = point_in(2);
64  const Real xc = centroid(0);
65  const Real yc = centroid(1);
66  const Real zc = centroid(2);
67  const Real distx = max_distance(0);
68  const Real disty = max_distance(1);
69  const Real distz = max_distance(2);
70  const Real dx = (x - xc)/distx;
71  const Real dy = (y - yc)/disty;
72  const Real dz = (z - zc)/distz;
73 
74 #ifndef NDEBUG
75  // totalorder is only used in the assertion below, so
76  // we avoid declaring it when asserts are not active.
77  const unsigned int totalorder = order + elem->p_level();
78 #endif
79  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
80  (static_cast<unsigned int>(totalorder)+2)*
81  (static_cast<unsigned int>(totalorder)+3)/6);
82 
83  // monomials. since they are hierarchic we only need one case block.
84  switch (i)
85  {
86  // constant
87  case 0:
88  return 1.;
89 
90  // linears
91  case 1:
92  return dx;
93 
94  case 2:
95  return dy;
96 
97  case 3:
98  return dz;
99 
100  // quadratics
101  case 4:
102  return dx*dx;
103 
104  case 5:
105  return dx*dy;
106 
107  case 6:
108  return dy*dy;
109 
110  case 7:
111  return dx*dz;
112 
113  case 8:
114  return dz*dy;
115 
116  case 9:
117  return dz*dz;
118 
119  // cubics
120  case 10:
121  return dx*dx*dx;
122 
123  case 11:
124  return dx*dx*dy;
125 
126  case 12:
127  return dx*dy*dy;
128 
129  case 13:
130  return dy*dy*dy;
131 
132  case 14:
133  return dx*dx*dz;
134 
135  case 15:
136  return dx*dy*dz;
137 
138  case 16:
139  return dy*dy*dz;
140 
141  case 17:
142  return dx*dz*dz;
143 
144  case 18:
145  return dy*dz*dz;
146 
147  case 19:
148  return dz*dz*dz;
149 
150  // quartics
151  case 20:
152  return dx*dx*dx*dx;
153 
154  case 21:
155  return dx*dx*dx*dy;
156 
157  case 22:
158  return dx*dx*dy*dy;
159 
160  case 23:
161  return dx*dy*dy*dy;
162 
163  case 24:
164  return dy*dy*dy*dy;
165 
166  case 25:
167  return dx*dx*dx*dz;
168 
169  case 26:
170  return dx*dx*dy*dz;
171 
172  case 27:
173  return dx*dy*dy*dz;
174 
175  case 28:
176  return dy*dy*dy*dz;
177 
178  case 29:
179  return dx*dx*dz*dz;
180 
181  case 30:
182  return dx*dy*dz*dz;
183 
184  case 31:
185  return dy*dy*dz*dz;
186 
187  case 32:
188  return dx*dz*dz*dz;
189 
190  case 33:
191  return dy*dz*dz*dz;
192 
193  case 34:
194  return dz*dz*dz*dz;
195 
196  default:
197  unsigned int o = 0;
198  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
199  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
200  unsigned int block=o, nz = 0;
201  for (; block < i2; block += (o-nz+1)) { nz++; }
202  const unsigned int nx = block - i2;
203  const unsigned int ny = o - nx - nz;
204  Real val = 1.;
205  for (unsigned int index=0; index != nx; index++)
206  val *= dx;
207  for (unsigned int index=0; index != ny; index++)
208  val *= dy;
209  for (unsigned int index=0; index != nz; index++)
210  val *= dz;
211  return val;
212  }
213 
214 #else
215  return 0.;
216 #endif
217 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [60/109]

Real libMesh::FE< 0, HIERARCHIC >::shape ( const Elem ,
const Order  ,
const unsigned int  libmesh_dbg_vari,
const Point  
)
inherited

Definition at line 44 of file fe_hierarchic_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }

◆ shape() [61/109]

Real libMesh::FE< 3, CLOUGH >::shape ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 45 of file fe_clough_shape_3D.C.

49 {
50  libmesh_assert(elem);
51 
52  libmesh_not_implemented();
53  return 0.;
54 }

◆ shape() [62/109]

Real libMesh::FE< 2, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 46 of file fe_bernstein_shape_2D.C.

50 {
51  libmesh_assert(elem);
52 
53  const ElemType type = elem->type();
54 
55  const Order totalorder = static_cast<Order>(order + elem->p_level());
56 
57  // Declare that we are using our own special power function
58  // from the Utility namespace. This saves typing later.
59  using Utility::pow;
60 
61  switch (type)
62  {
63  // Hierarchic shape functions on the quadrilateral.
64  case QUAD4:
65  case QUADSHELL4:
66  case QUAD9:
67  {
68  // Compute quad shape functions as a tensor-product
69  const Real xi = p(0);
70  const Real eta = p(1);
71 
72  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
73 
74  // Example i, i0, i1 values for totalorder = 5:
75  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
76  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
77  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
78 
79  unsigned int i0, i1;
80 
81  // Vertex DoFs
82  if (i == 0)
83  { i0 = 0; i1 = 0; }
84  else if (i == 1)
85  { i0 = 1; i1 = 0; }
86  else if (i == 2)
87  { i0 = 1; i1 = 1; }
88  else if (i == 3)
89  { i0 = 0; i1 = 1; }
90 
91 
92  // Edge DoFs
93  else if (i < totalorder + 3u)
94  { i0 = i - 2; i1 = 0; }
95  else if (i < 2u*totalorder + 2)
96  { i0 = 1; i1 = i - totalorder - 1; }
97  else if (i < 3u*totalorder + 1)
98  { i0 = i - 2u*totalorder; i1 = 1; }
99  else if (i < 4u*totalorder)
100  { i0 = 0; i1 = i - 3u*totalorder + 1; }
101  // Interior DoFs. Use Roy's number look up
102  else
103  {
104  unsigned int basisnum = i - 4*totalorder;
105  i0 = square_number_column[basisnum] + 2;
106  i1 = square_number_row[basisnum] + 2;
107  }
108 
109 
110  // Flip odd degree of freedom values if necessary
111  // to keep continuity on sides.
112  if ((i>= 4 && i<= 4+ totalorder-2u) && elem->point(0) > elem->point(1)) i0=totalorder+2-i0;//
113  else if ((i>= 4+ totalorder-1u && i<= 4+2*totalorder-3u) && elem->point(1) > elem->point(2)) i1=totalorder+2-i1;
114  else if ((i>= 4+2*totalorder-2u && i<= 4+3*totalorder-4u) && elem->point(3) > elem->point(2)) i0=totalorder+2-i0;
115  else if ((i>= 4+3*totalorder-3u && i<= 4+4*totalorder-5u) && elem->point(0) > elem->point(3)) i1=totalorder+2-i1;
116 
117 
118  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0, xi)*
119  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1, eta));
120  }
121  // handle serendipity QUAD8 element separately
122  case QUAD8:
123  case QUADSHELL8:
124  {
125  libmesh_assert_less (totalorder, 3);
126 
127  const Real xi = p(0);
128  const Real eta = p(1);
129 
130  libmesh_assert_less (i, 8);
131 
132  // 0 1 2 3 4 5 6 7 8
133  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
134  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
135  static const Real scal[] = {-0.25, -0.25, -0.25, -0.25, 0.5, 0.5, 0.5, 0.5};
136 
137  //B_t,i0(i)|xi * B_s,i1(i)|eta + scal(i) * B_t,2|xi * B_t,2|eta
138  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
139  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)
140  +scal[i]*
141  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[8], xi)*
142  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[8], eta));
143 
144  }
145 
146  case TRI3:
147  case TRISHELL3:
148  libmesh_assert_less (totalorder, 2);
149  libmesh_fallthrough();
150  case TRI6:
151  switch (totalorder)
152  {
153  case FIRST:
154  {
155  const Real x=p(0);
156  const Real y=p(1);
157  const Real r=1.-x-y;
158 
159  libmesh_assert_less (i, 3);
160 
161  switch(i)
162  {
163  case 0: return r; //f0,0,1
164  case 1: return x; //f0,1,1
165  case 2: return y; //f1,0,1
166 
167  default:
168  libmesh_error_msg("Invalid shape function index i = " << i);
169  }
170  }
171  case SECOND:
172  {
173  const Real x=p(0);
174  const Real y=p(1);
175  const Real r=1.-x-y;
176 
177  libmesh_assert_less (i, 6);
178 
179  switch(i)
180  {
181  case 0: return r*r;
182  case 1: return x*x;
183  case 2: return y*y;
184 
185  case 3: return 2.*x*r;
186  case 4: return 2.*x*y;
187  case 5: return 2.*r*y;
188 
189  default:
190  libmesh_error_msg("Invalid shape function index i = " << i);
191  }
192  }
193  case THIRD:
194  {
195  const Real x=p(0);
196  const Real y=p(1);
197  const Real r=1.-x-y;
198  libmesh_assert_less (i, 10);
199 
200  unsigned int shape=i;
201 
202 
203  if ((i==3||i==4) && elem->point(0) > elem->point(1)) shape=7-i;
204  if ((i==5||i==6) && elem->point(1) > elem->point(2)) shape=11-i;
205  if ((i==7||i==8) && elem->point(0) > elem->point(2)) shape=15-i;
206 
207  switch(shape)
208  {
209  case 0: return r*r*r;
210  case 1: return x*x*x;
211  case 2: return y*y*y;
212 
213  case 3: return 3.*x*r*r;
214  case 4: return 3.*x*x*r;
215 
216  case 5: return 3.*y*x*x;
217  case 6: return 3.*y*y*x;
218 
219  case 7: return 3.*y*r*r;
220  case 8: return 3.*y*y*r;
221 
222  case 9: return 6.*x*y*r;
223 
224  default:
225  libmesh_error_msg("Invalid shape function index shape = " << shape);
226  }
227  }
228  case FOURTH:
229  {
230  const Real x=p(0);
231  const Real y=p(1);
232  const Real r=1-x-y;
233  unsigned int shape=i;
234 
235  libmesh_assert_less (i, 15);
236 
237  if ((i==3||i== 5) && elem->point(0) > elem->point(1)) shape=8-i;
238  if ((i==6||i== 8) && elem->point(1) > elem->point(2)) shape=14-i;
239  if ((i==9||i==11) && elem->point(0) > elem->point(2)) shape=20-i;
240 
241 
242  switch(shape)
243  {
244  // point functions
245  case 0: return r*r*r*r;
246  case 1: return x*x*x*x;
247  case 2: return y*y*y*y;
248 
249  // edge functions
250  case 3: return 4.*x*r*r*r;
251  case 4: return 6.*x*x*r*r;
252  case 5: return 4.*x*x*x*r;
253 
254  case 6: return 4.*y*x*x*x;
255  case 7: return 6.*y*y*x*x;
256  case 8: return 4.*y*y*y*x;
257 
258  case 9: return 4.*y*r*r*r;
259  case 10: return 6.*y*y*r*r;
260  case 11: return 4.*y*y*y*r;
261 
262  // inner functions
263  case 12: return 12.*x*y*r*r;
264  case 13: return 12.*x*x*y*r;
265  case 14: return 12.*x*y*y*r;
266 
267  default:
268  libmesh_error_msg("Invalid shape function index shape = " << shape);
269  }
270  }
271  case FIFTH:
272  {
273  const Real x=p(0);
274  const Real y=p(1);
275  const Real r=1-x-y;
276  unsigned int shape=i;
277 
278  libmesh_assert_less (i, 21);
279 
280  if ((i>= 3&&i<= 6) && elem->point(0) > elem->point(1)) shape=9-i;
281  if ((i>= 7&&i<=10) && elem->point(1) > elem->point(2)) shape=17-i;
282  if ((i>=11&&i<=14) && elem->point(0) > elem->point(2)) shape=25-i;
283 
284  switch(shape)
285  {
286  //point functions
287  case 0: return pow<5>(r);
288  case 1: return pow<5>(x);
289  case 2: return pow<5>(y);
290 
291  //edge functions
292  case 3: return 5.*x *pow<4>(r);
293  case 4: return 10.*pow<2>(x)*pow<3>(r);
294  case 5: return 10.*pow<3>(x)*pow<2>(r);
295  case 6: return 5.*pow<4>(x)*r;
296 
297  case 7: return 5.*y *pow<4>(x);
298  case 8: return 10.*pow<2>(y)*pow<3>(x);
299  case 9: return 10.*pow<3>(y)*pow<2>(x);
300  case 10: return 5.*pow<4>(y)*x;
301 
302  case 11: return 5.*y *pow<4>(r);
303  case 12: return 10.*pow<2>(y)*pow<3>(r);
304  case 13: return 10.*pow<3>(y)*pow<2>(r);
305  case 14: return 5.*pow<4>(y)*r;
306 
307  //inner functions
308  case 15: return 20.*x*y*pow<3>(r);
309  case 16: return 30.*x*pow<2>(y)*pow<2>(r);
310  case 17: return 30.*pow<2>(x)*y*pow<2>(r);
311  case 18: return 20.*x*pow<3>(y)*r;
312  case 19: return 20.*pow<3>(x)*y*r;
313  case 20: return 30.*pow<2>(x)*pow<2>(y)*r;
314 
315  default:
316  libmesh_error_msg("Invalid shape function index shape = " << shape);
317  }
318  }
319  case SIXTH:
320  {
321  const Real x=p(0);
322  const Real y=p(1);
323  const Real r=1-x-y;
324  unsigned int shape=i;
325 
326  libmesh_assert_less (i, 28);
327 
328  if ((i>= 3&&i<= 7) && elem->point(0) > elem->point(1)) shape=10-i;
329  if ((i>= 8&&i<=12) && elem->point(1) > elem->point(2)) shape=20-i;
330  if ((i>=13&&i<=17) && elem->point(0) > elem->point(2)) shape=30-i;
331 
332  switch(shape)
333  {
334  //point functions
335  case 0: return pow<6>(r);
336  case 1: return pow<6>(x);
337  case 2: return pow<6>(y);
338 
339  //edge functions
340  case 3: return 6.*x *pow<5>(r);
341  case 4: return 15.*pow<2>(x)*pow<4>(r);
342  case 5: return 20.*pow<3>(x)*pow<3>(r);
343  case 6: return 15.*pow<4>(x)*pow<2>(r);
344  case 7: return 6.*pow<5>(x)*r;
345 
346  case 8: return 6.*y *pow<5>(x);
347  case 9: return 15.*pow<2>(y)*pow<4>(x);
348  case 10: return 20.*pow<3>(y)*pow<3>(x);
349  case 11: return 15.*pow<4>(y)*pow<2>(x);
350  case 12: return 6.*pow<5>(y)*x;
351 
352  case 13: return 6.*y *pow<5>(r);
353  case 14: return 15.*pow<2>(y)*pow<4>(r);
354  case 15: return 20.*pow<3>(y)*pow<3>(r);
355  case 16: return 15.*pow<4>(y)*pow<2>(r);
356  case 17: return 6.*pow<5>(y)*r;
357 
358  //inner functions
359  case 18: return 30.*x*y*pow<4>(r);
360  case 19: return 60.*x*pow<2>(y)*pow<3>(r);
361  case 20: return 60.* pow<2>(x)*y*pow<3>(r);
362  case 21: return 60.*x*pow<3>(y)*pow<2>(r);
363  case 22: return 60.*pow<3>(x)*y*pow<2>(r);
364  case 23: return 90.*pow<2>(x)*pow<2>(y)*pow<2>(r);
365  case 24: return 30.*x*pow<4>(y)*r;
366  case 25: return 60.*pow<2>(x)*pow<3>(y)*r;
367  case 26: return 60.*pow<3>(x)*pow<2>(y)*r;
368  case 27: return 30.*pow<4>(x)*y*r;
369 
370  default:
371  libmesh_error_msg("Invalid shape function index shape = " << shape);
372  } // switch shape
373  } // case TRI6
374  default:
375  libmesh_error_msg("Invalid totalorder = " << totalorder);
376  } // switch order
377 
378  default:
379  libmesh_error_msg("ERROR: Unsupported element type = " << type);
380  } // switch type
381 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
const unsigned char square_number_column[]
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]

◆ shape() [63/109]

Real libMesh::FE< 3, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 48 of file fe_bernstein_shape_3D.C.

52 {
53 
54 #if LIBMESH_DIM == 3
55 
56  libmesh_assert(elem);
57  const ElemType type = elem->type();
58 
59  const Order totalorder = static_cast<Order>(order + elem->p_level());
60 
61  switch (totalorder)
62  {
63  // 1st order Bernstein.
64  case FIRST:
65  {
66  switch (type)
67  {
68 
69  // Bernstein shape functions on the tetrahedron.
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0: return zeta0;
84  case 1: return zeta1;
85  case 2: return zeta2;
86  case 3: return zeta3;
87 
88  default:
89  libmesh_error_msg("Invalid shape function index i = " << i);
90  }
91  }
92 
93  // Bernstein shape functions on the hexahedral.
94  case HEX8:
95  case HEX20:
96  case HEX27:
97  {
98  libmesh_assert_less (i, 8);
99 
100  // Compute hex shape functions as a tensor-product
101  const Real xi = p(0);
102  const Real eta = p(1);
103  const Real zeta = p(2);
104 
105  // The only way to make any sense of this
106  // is to look at the mgflo/mg2/mgf documentation
107  // and make the cut-out cube!
108  // 0 1 2 3 4 5 6 7
109  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
110  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
111  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
112 
113  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
114  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
115  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta));
116  }
117 
118 
119  default:
120  libmesh_error_msg("Invalid element type = " << type);
121  }
122  }
123 
124 
125 
126 
127  case SECOND:
128  {
129  switch (type)
130  {
131 
132  // Bernstein shape functions on the tetrahedron.
133  case TET10:
134  {
135  libmesh_assert_less (i, 10);
136 
137  // Area coordinates
138  const Real zeta1 = p(0);
139  const Real zeta2 = p(1);
140  const Real zeta3 = p(2);
141  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
142 
143  switch(i)
144  {
145  case 0: return zeta0*zeta0;
146  case 1: return zeta1*zeta1;
147  case 2: return zeta2*zeta2;
148  case 3: return zeta3*zeta3;
149  case 4: return 2.*zeta0*zeta1;
150  case 5: return 2.*zeta1*zeta2;
151  case 6: return 2.*zeta0*zeta2;
152  case 7: return 2.*zeta3*zeta0;
153  case 8: return 2.*zeta1*zeta3;
154  case 9: return 2.*zeta2*zeta3;
155 
156  default:
157  libmesh_error_msg("Invalid shape function index i = " << i);
158  }
159  }
160 
161  // Bernstein shape functions on the 20-noded hexahedral.
162  case HEX20:
163  {
164  libmesh_assert_less (i, 20);
165 
166  // Compute hex shape functions as a tensor-product
167  const Real xi = p(0);
168  const Real eta = p(1);
169  const Real zeta = p(2);
170 
171  // The only way to make any sense of this
172  // is to look at the mgflo/mg2/mgf documentation
173  // and make the cut-out cube!
174  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
175  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
176  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
177  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
178  //To compute the hex20 shape functions the original shape functions for hex27 are used.
179  //scalx[i] tells how often the original x-th shape function has to be added to the original i-th shape function
180  //to compute the new i-th shape function for hex20
181  //example: B_0^HEX20 = B_0^HEX27 - 0.25*B_20^HEX27 - 0.25*B_21^HEX27 + 0*B_22^HEX27 + 0*B_23^HEX27 - 0.25*B_24^HEX27 + 0*B_25^HEX27 - 0.25*B_26^HEX27
182  // B_0^HEX20 = B_0^HEX27 + scal20[0]*B_20^HEX27 + scal21[0]*B_21^HEX27 + ...
183  static const Real scal20[] = {-0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0};
184  static const Real scal21[] = {-0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0};
185  static const Real scal22[] = {0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0};
186  static const Real scal23[] = {0, 0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0};
187  static const Real scal24[] = {-0.25, 0, 0, -0.25, -0.25, 0, 0, -0.25, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0, 0.5};
188  static const Real scal25[] = {0, 0, 0, 0, -0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5};
189  static const Real scal26[] = {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
190 
191  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
192  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
193  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta)
194  +scal20[i]*
195  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[20], xi)*
196  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[20], eta)*
197  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[20], zeta)
198  +scal21[i]*
199  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[21], xi)*
200  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[21], eta)*
201  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[21], zeta)
202  +scal22[i]*
203  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[22], xi)*
204  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[22], eta)*
205  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[22], zeta)
206  +scal23[i]*
207  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[23], xi)*
208  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[23], eta)*
209  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[23], zeta)
210  +scal24[i]*
211  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[24], xi)*
212  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[24], eta)*
213  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[24], zeta)
214  +scal25[i]*
215  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[25], xi)*
216  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[25], eta)*
217  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[25], zeta)
218  +scal26[i]*
219  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[26], xi)*
220  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[26], eta)*
221  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[26], zeta));
222  }
223 
224  // Bernstein shape functions on the hexahedral.
225  case HEX27:
226  {
227  libmesh_assert_less (i, 27);
228 
229  // Compute hex shape functions as a tensor-product
230  const Real xi = p(0);
231  const Real eta = p(1);
232  const Real zeta = p(2);
233 
234  // The only way to make any sense of this
235  // is to look at the mgflo/mg2/mgf documentation
236  // and make the cut-out cube!
237  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
238  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
239  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
240  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
241 
242  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
243  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
244  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta));
245  }
246 
247 
248  default:
249  libmesh_error_msg("Invalid element type = " << type);
250  }
251 
252  }
253 
254 
255 
256  // 3rd-order Bernstein.
257  case THIRD:
258  {
259  switch (type)
260  {
261 
262  // // Bernstein shape functions on the tetrahedron.
263  // case TET10:
264  // {
265  // libmesh_assert_less (i, 20);
266 
267  // // Area coordinates
268  // const Real zeta1 = p(0);
269  // const Real zeta2 = p(1);
270  // const Real zeta3 = p(2);
271  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
272 
273 
274  // unsigned int shape=i;
275 
276  // // handle the edge orientation
277 
278  // if ((i== 4||i== 5) && elem->node_id(0) > elem->node_id(1))shape= 9-i; //Edge 0
279  // if ((i== 6||i== 7) && elem->node_id(1) > elem->node_id(2))shape=13-i; //Edge 1
280  // if ((i== 8||i== 9) && elem->node_id(0) > elem->node_id(2))shape=17-i; //Edge 2
281  // if ((i==10||i==11) && elem->node_id(0) > elem->node_id(3))shape=21-i; //Edge 3
282  // if ((i==12||i==13) && elem->node_id(1) > elem->node_id(3))shape=25-i; //Edge 4
283  // if ((i==14||i==15) && elem->node_id(2) > elem->node_id(3))shape=29-i; //Edge 5
284 
285  // // No need to handle face orientation in 3rd order.
286 
287 
288  // switch(shape)
289  // {
290  // //point function
291  // case 0: return zeta0*zeta0*zeta0;
292  // case 1: return zeta1*zeta1*zeta1;
293  // case 2: return zeta2*zeta2*zeta2;
294  // case 3: return zeta3*zeta3*zeta3;
295 
296  // //edge functions
297  // case 4: return 3.*zeta0*zeta0*zeta1;
298  // case 5: return 3.*zeta1*zeta1*zeta0;
299 
300  // case 6: return 3.*zeta1*zeta1*zeta2;
301  // case 7: return 3.*zeta2*zeta2*zeta1;
302 
303  // case 8: return 3.*zeta0*zeta0*zeta2;
304  // case 9: return 3.*zeta2*zeta2*zeta0;
305 
306  // case 10: return 3.*zeta0*zeta0*zeta3;
307  // case 11: return 3.*zeta3*zeta3*zeta0;
308 
309  // case 12: return 3.*zeta1*zeta1*zeta3;
310  // case 13: return 3.*zeta3*zeta3*zeta1;
311 
312  // case 14: return 3.*zeta2*zeta2*zeta3;
313  // case 15: return 3.*zeta3*zeta3*zeta2;
314 
315  // //face functions
316  // case 16: return 6.*zeta0*zeta1*zeta2;
317  // case 17: return 6.*zeta0*zeta1*zeta3;
318  // case 18: return 6.*zeta1*zeta2*zeta3;
319  // case 19: return 6.*zeta2*zeta0*zeta3;
320 
321  // default:
322  // libmesh_error_msg("Invalid shape function index i = " << i);
323  // }
324  // }
325 
326 
327  // Bernstein shape functions on the hexahedral.
328  case HEX27:
329  {
330  libmesh_assert_less (i, 64);
331 
332  // Compute hex shape functions as a tensor-product
333  const Real xi = p(0);
334  const Real eta = p(1);
335  const Real zeta = p(2);
336  Real xi_mapped = p(0);
337  Real eta_mapped = p(1);
338  Real zeta_mapped = p(2);
339 
340  // The only way to make any sense of this
341  // is to look at the mgflo/mg2/mgf documentation
342  // and make the cut-out cube!
343  // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
344  // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63
345  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3};
346  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3};
347  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
348 
349 
350 
351  // handle the edge orientation
352  {
353  // Edge 0
354  if ((i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
355  {
356  if (elem->point(0) != std::min(elem->point(0), elem->point(1)))
357  xi_mapped = -xi;
358  }
359  // Edge 1
360  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
361  {
362  if (elem->point(1) != std::min(elem->point(1), elem->point(2)))
363  eta_mapped = -eta;
364  }
365  // Edge 2
366  else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
367  {
368  if (elem->point(3) != std::min(elem->point(3), elem->point(2)))
369  xi_mapped = -xi;
370  }
371  // Edge 3
372  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
373  {
374  if (elem->point(0) != std::min(elem->point(0), elem->point(3)))
375  eta_mapped = -eta;
376  }
377  // Edge 4
378  else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
379  {
380  if (elem->point(0) != std::min(elem->point(0), elem->point(4)))
381  zeta_mapped = -zeta;
382  }
383  // Edge 5
384  else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
385  {
386  if (elem->point(1) != std::min(elem->point(1), elem->point(5)))
387  zeta_mapped = -zeta;
388  }
389  // Edge 6
390  else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
391  {
392  if (elem->point(2) != std::min(elem->point(2), elem->point(6)))
393  zeta_mapped = -zeta;
394  }
395  // Edge 7
396  else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
397  {
398  if (elem->point(3) != std::min(elem->point(3), elem->point(7)))
399  zeta_mapped = -zeta;
400  }
401  // Edge 8
402  else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
403  {
404  if (elem->point(4) != std::min(elem->point(4), elem->point(5)))
405  xi_mapped = -xi;
406  }
407  // Edge 9
408  else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
409  {
410  if (elem->point(5) != std::min(elem->point(5), elem->point(6)))
411  eta_mapped = -eta;
412  }
413  // Edge 10
414  else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
415  {
416  if (elem->point(7) != std::min(elem->point(7), elem->point(6)))
417  xi_mapped = -xi;
418  }
419  // Edge 11
420  else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
421  {
422  if (elem->point(4) != std::min(elem->point(4), elem->point(7)))
423  eta_mapped = -eta;
424  }
425  }
426 
427 
428  // handle the face orientation
429  {
430  // Face 0
431  if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
432  {
433  const Point min_point = std::min(elem->point(1),
434  std::min(elem->point(2),
435  std::min(elem->point(0),
436  elem->point(3))));
437  if (elem->point(0) == min_point)
438  if (elem->point(1) == std::min(elem->point(1), elem->point(3)))
439  {
440  // Case 1
441  xi_mapped = xi;
442  eta_mapped = eta;
443  }
444  else
445  {
446  // Case 2
447  xi_mapped = eta;
448  eta_mapped = xi;
449  }
450 
451  else if (elem->point(3) == min_point)
452  if (elem->point(0) == std::min(elem->point(0), elem->point(2)))
453  {
454  // Case 3
455  xi_mapped = -eta;
456  eta_mapped = xi;
457  }
458  else
459  {
460  // Case 4
461  xi_mapped = xi;
462  eta_mapped = -eta;
463  }
464 
465  else if (elem->point(2) == min_point)
466  if (elem->point(3) == std::min(elem->point(3), elem->point(1)))
467  {
468  // Case 5
469  xi_mapped = -xi;
470  eta_mapped = -eta;
471  }
472  else
473  {
474  // Case 6
475  xi_mapped = -eta;
476  eta_mapped = -xi;
477  }
478 
479  else if (elem->point(1) == min_point)
480  {
481  if (elem->point(2) == std::min(elem->point(2), elem->point(0)))
482  {
483  // Case 7
484  xi_mapped = eta;
485  eta_mapped = -xi;
486  }
487  else
488  {
489  // Case 8
490  xi_mapped = -xi;
491  eta_mapped = eta;
492  }
493  }
494  }
495 
496 
497  // Face 1
498  else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
499  {
500  const Point min_point = std::min(elem->point(0),
501  std::min(elem->point(1),
502  std::min(elem->point(5),
503  elem->point(4))));
504  if (elem->point(0) == min_point)
505  if (elem->point(1) == std::min(elem->point(1), elem->point(4)))
506  {
507  // Case 1
508  xi_mapped = xi;
509  zeta_mapped = zeta;
510  }
511  else
512  {
513  // Case 2
514  xi_mapped = zeta;
515  zeta_mapped = xi;
516  }
517 
518  else if (elem->point(1) == min_point)
519  if (elem->point(5) == std::min(elem->point(5), elem->point(0)))
520  {
521  // Case 3
522  xi_mapped = zeta;
523  zeta_mapped = -xi;
524  }
525  else
526  {
527  // Case 4
528  xi_mapped = -xi;
529  zeta_mapped = zeta;
530  }
531 
532  else if (elem->point(5) == min_point)
533  if (elem->point(4) == std::min(elem->point(4), elem->point(1)))
534  {
535  // Case 5
536  xi_mapped = -xi;
537  zeta_mapped = -zeta;
538  }
539  else
540  {
541  // Case 6
542  xi_mapped = -zeta;
543  zeta_mapped = -xi;
544  }
545 
546  else if (elem->point(4) == min_point)
547  {
548  if (elem->point(0) == std::min(elem->point(0), elem->point(5)))
549  {
550  // Case 7
551  xi_mapped = -xi;
552  zeta_mapped = zeta;
553  }
554  else
555  {
556  // Case 8
557  xi_mapped = xi;
558  zeta_mapped = -zeta;
559  }
560  }
561  }
562 
563 
564  // Face 2
565  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
566  {
567  const Point min_point = std::min(elem->point(1),
568  std::min(elem->point(2),
569  std::min(elem->point(6),
570  elem->point(5))));
571  if (elem->point(1) == min_point)
572  if (elem->point(2) == std::min(elem->point(2), elem->point(5)))
573  {
574  // Case 1
575  eta_mapped = eta;
576  zeta_mapped = zeta;
577  }
578  else
579  {
580  // Case 2
581  eta_mapped = zeta;
582  zeta_mapped = eta;
583  }
584 
585  else if (elem->point(2) == min_point)
586  if (elem->point(6) == std::min(elem->point(6), elem->point(1)))
587  {
588  // Case 3
589  eta_mapped = zeta;
590  zeta_mapped = -eta;
591  }
592  else
593  {
594  // Case 4
595  eta_mapped = -eta;
596  zeta_mapped = zeta;
597  }
598 
599  else if (elem->point(6) == min_point)
600  if (elem->point(5) == std::min(elem->point(5), elem->point(2)))
601  {
602  // Case 5
603  eta_mapped = -eta;
604  zeta_mapped = -zeta;
605  }
606  else
607  {
608  // Case 6
609  eta_mapped = -zeta;
610  zeta_mapped = -eta;
611  }
612 
613  else if (elem->point(5) == min_point)
614  {
615  if (elem->point(1) == std::min(elem->point(1), elem->point(6)))
616  {
617  // Case 7
618  eta_mapped = -zeta;
619  zeta_mapped = eta;
620  }
621  else
622  {
623  // Case 8
624  eta_mapped = eta;
625  zeta_mapped = -zeta;
626  }
627  }
628  }
629 
630 
631  // Face 3
632  else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
633  {
634  const Point min_point = std::min(elem->point(2),
635  std::min(elem->point(3),
636  std::min(elem->point(7),
637  elem->point(6))));
638  if (elem->point(3) == min_point)
639  if (elem->point(2) == std::min(elem->point(2), elem->point(7)))
640  {
641  // Case 1
642  xi_mapped = xi;
643  zeta_mapped = zeta;
644  }
645  else
646  {
647  // Case 2
648  xi_mapped = zeta;
649  zeta_mapped = xi;
650  }
651 
652  else if (elem->point(7) == min_point)
653  if (elem->point(3) == std::min(elem->point(3), elem->point(6)))
654  {
655  // Case 3
656  xi_mapped = -zeta;
657  zeta_mapped = xi;
658  }
659  else
660  {
661  // Case 4
662  xi_mapped = xi;
663  zeta_mapped = -zeta;
664  }
665 
666  else if (elem->point(6) == min_point)
667  if (elem->point(7) == std::min(elem->point(7), elem->point(2)))
668  {
669  // Case 5
670  xi_mapped = -xi;
671  zeta_mapped = -zeta;
672  }
673  else
674  {
675  // Case 6
676  xi_mapped = -zeta;
677  zeta_mapped = -xi;
678  }
679 
680  else if (elem->point(2) == min_point)
681  {
682  if (elem->point(6) == std::min(elem->point(3), elem->point(6)))
683  {
684  // Case 7
685  xi_mapped = zeta;
686  zeta_mapped = -xi;
687  }
688  else
689  {
690  // Case 8
691  xi_mapped = -xi;
692  zeta_mapped = zeta;
693  }
694  }
695  }
696 
697 
698  // Face 4
699  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
700  {
701  const Point min_point = std::min(elem->point(3),
702  std::min(elem->point(0),
703  std::min(elem->point(4),
704  elem->point(7))));
705  if (elem->point(0) == min_point)
706  if (elem->point(3) == std::min(elem->point(3), elem->point(4)))
707  {
708  // Case 1
709  eta_mapped = eta;
710  zeta_mapped = zeta;
711  }
712  else
713  {
714  // Case 2
715  eta_mapped = zeta;
716  zeta_mapped = eta;
717  }
718 
719  else if (elem->point(4) == min_point)
720  if (elem->point(0) == std::min(elem->point(0), elem->point(7)))
721  {
722  // Case 3
723  eta_mapped = -zeta;
724  zeta_mapped = eta;
725  }
726  else
727  {
728  // Case 4
729  eta_mapped = eta;
730  zeta_mapped = -zeta;
731  }
732 
733  else if (elem->point(7) == min_point)
734  if (elem->point(4) == std::min(elem->point(4), elem->point(3)))
735  {
736  // Case 5
737  eta_mapped = -eta;
738  zeta_mapped = -zeta;
739  }
740  else
741  {
742  // Case 6
743  eta_mapped = -zeta;
744  zeta_mapped = -eta;
745  }
746 
747  else if (elem->point(3) == min_point)
748  {
749  if (elem->point(7) == std::min(elem->point(7), elem->point(0)))
750  {
751  // Case 7
752  eta_mapped = zeta;
753  zeta_mapped = -eta;
754  }
755  else
756  {
757  // Case 8
758  eta_mapped = -eta;
759  zeta_mapped = zeta;
760  }
761  }
762  }
763 
764 
765  // Face 5
766  else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
767  {
768  const Point min_point = std::min(elem->point(4),
769  std::min(elem->point(5),
770  std::min(elem->point(6),
771  elem->point(7))));
772  if (elem->point(4) == min_point)
773  if (elem->point(5) == std::min(elem->point(5), elem->point(7)))
774  {
775  // Case 1
776  xi_mapped = xi;
777  eta_mapped = eta;
778  }
779  else
780  {
781  // Case 2
782  xi_mapped = eta;
783  eta_mapped = xi;
784  }
785 
786  else if (elem->point(5) == min_point)
787  if (elem->point(6) == std::min(elem->point(6), elem->point(4)))
788  {
789  // Case 3
790  xi_mapped = eta;
791  eta_mapped = -xi;
792  }
793  else
794  {
795  // Case 4
796  xi_mapped = -xi;
797  eta_mapped = eta;
798  }
799 
800  else if (elem->point(6) == min_point)
801  if (elem->point(7) == std::min(elem->point(7), elem->point(5)))
802  {
803  // Case 5
804  xi_mapped = -xi;
805  eta_mapped = -eta;
806  }
807  else
808  {
809  // Case 6
810  xi_mapped = -eta;
811  eta_mapped = -xi;
812  }
813 
814  else if (elem->point(7) == min_point)
815  {
816  if (elem->point(4) == std::min(elem->point(4), elem->point(6)))
817  {
818  // Case 7
819  xi_mapped = -eta;
820  eta_mapped = xi;
821  }
822  else
823  {
824  // Case 8
825  xi_mapped = xi;
826  eta_mapped = eta;
827  }
828  }
829  }
830  }
831 
832  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi_mapped)*
833  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta_mapped)*
834  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta_mapped));
835  }
836 
837 
838  default:
839  libmesh_error_msg("Invalid element type = " << type);
840  } //case HEX27
841 
842  }//case THIRD
843 
844 
845  // 4th-order Bernstein.
846  case FOURTH:
847  {
848  switch (type)
849  {
850 
851  // Bernstein shape functions on the hexahedral.
852  case HEX27:
853  {
854  libmesh_assert_less (i, 125);
855 
856  // Compute hex shape functions as a tensor-product
857  const Real xi = p(0);
858  const Real eta = p(1);
859  const Real zeta = p(2);
860  Real xi_mapped = p(0);
861  Real eta_mapped = p(1);
862  Real zeta_mapped = p(2);
863 
864  // The only way to make any sense of this
865  // is to look at the mgflo/mg2/mgf documentation
866  // and make the cut-out cube!
867  // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
868  // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
869  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4};
870  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
871  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4};
872 
873 
874 
875  // handle the edge orientation
876  {
877  // Edge 0
878  if ((i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
879  {
880  if (elem->point(0) != std::min(elem->point(0), elem->point(1)))
881  xi_mapped = -xi;
882  }
883  // Edge 1
884  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
885  {
886  if (elem->point(1) != std::min(elem->point(1), elem->point(2)))
887  eta_mapped = -eta;
888  }
889  // Edge 2
890  else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
891  {
892  if (elem->point(3) != std::min(elem->point(3), elem->point(2)))
893  xi_mapped = -xi;
894  }
895  // Edge 3
896  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
897  {
898  if (elem->point(0) != std::min(elem->point(0), elem->point(3)))
899  eta_mapped = -eta;
900  }
901  // Edge 4
902  else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
903  {
904  if (elem->point(0) != std::min(elem->point(0), elem->point(4)))
905  zeta_mapped = -zeta;
906  }
907  // Edge 5
908  else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
909  {
910  if (elem->point(1) != std::min(elem->point(1), elem->point(5)))
911  zeta_mapped = -zeta;
912  }
913  // Edge 6
914  else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
915  {
916  if (elem->point(2) != std::min(elem->point(2), elem->point(6)))
917  zeta_mapped = -zeta;
918  }
919  // Edge 7
920  else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
921  {
922  if (elem->point(3) != std::min(elem->point(3), elem->point(7)))
923  zeta_mapped = -zeta;
924  }
925  // Edge 8
926  else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
927  {
928  if (elem->point(4) != std::min(elem->point(4), elem->point(5)))
929  xi_mapped = -xi;
930  }
931  // Edge 9
932  else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
933  {
934  if (elem->point(5) != std::min(elem->point(5), elem->point(6)))
935  eta_mapped = -eta;
936  }
937  // Edge 10
938  else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
939  {
940  if (elem->point(7) != std::min(elem->point(7), elem->point(6)))
941  xi_mapped = -xi;
942  }
943  // Edge 11
944  else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
945  {
946  if (elem->point(4) != std::min(elem->point(4), elem->point(7)))
947  eta_mapped = -eta;
948  }
949  }
950 
951 
952  // handle the face orientation
953  {
954  // Face 0
955  if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
956  {
957  const Point min_point = std::min(elem->point(1),
958  std::min(elem->point(2),
959  std::min(elem->point(0),
960  elem->point(3))));
961  if (elem->point(0) == min_point)
962  if (elem->point(1) == std::min(elem->point(1), elem->point(3)))
963  {
964  // Case 1
965  xi_mapped = xi;
966  eta_mapped = eta;
967  }
968  else
969  {
970  // Case 2
971  xi_mapped = eta;
972  eta_mapped = xi;
973  }
974 
975  else if (elem->point(3) == min_point)
976  if (elem->point(0) == std::min(elem->point(0), elem->point(2)))
977  {
978  // Case 3
979  xi_mapped = -eta;
980  eta_mapped = xi;
981  }
982  else
983  {
984  // Case 4
985  xi_mapped = xi;
986  eta_mapped = -eta;
987  }
988 
989  else if (elem->point(2) == min_point)
990  if (elem->point(3) == std::min(elem->point(3), elem->point(1)))
991  {
992  // Case 5
993  xi_mapped = -xi;
994  eta_mapped = -eta;
995  }
996  else
997  {
998  // Case 6
999  xi_mapped = -eta;
1000  eta_mapped = -xi;
1001  }
1002 
1003  else if (elem->point(1) == min_point)
1004  {
1005  if (elem->point(2) == std::min(elem->point(2), elem->point(0)))
1006  {
1007  // Case 7
1008  xi_mapped = eta;
1009  eta_mapped = -xi;
1010  }
1011  else
1012  {
1013  // Case 8
1014  xi_mapped = -xi;
1015  eta_mapped = eta;
1016  }
1017  }
1018  }
1019 
1020 
1021  // Face 1
1022  else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
1023  {
1024  const Point min_point = std::min(elem->point(0),
1025  std::min(elem->point(1),
1026  std::min(elem->point(5),
1027  elem->point(4))));
1028  if (elem->point(0) == min_point)
1029  if (elem->point(1) == std::min(elem->point(1), elem->point(4)))
1030  {
1031  // Case 1
1032  xi_mapped = xi;
1033  zeta_mapped = zeta;
1034  }
1035  else
1036  {
1037  // Case 2
1038  xi_mapped = zeta;
1039  zeta_mapped = xi;
1040  }
1041 
1042  else if (elem->point(1) == min_point)
1043  if (elem->point(5) == std::min(elem->point(5), elem->point(0)))
1044  {
1045  // Case 3
1046  xi_mapped = zeta;
1047  zeta_mapped = -xi;
1048  }
1049  else
1050  {
1051  // Case 4
1052  xi_mapped = -xi;
1053  zeta_mapped = zeta;
1054  }
1055 
1056  else if (elem->point(5) == min_point)
1057  if (elem->point(4) == std::min(elem->point(4), elem->point(1)))
1058  {
1059  // Case 5
1060  xi_mapped = -xi;
1061  zeta_mapped = -zeta;
1062  }
1063  else
1064  {
1065  // Case 6
1066  xi_mapped = -zeta;
1067  zeta_mapped = -xi;
1068  }
1069 
1070  else if (elem->point(4) == min_point)
1071  {
1072  if (elem->point(0) == std::min(elem->point(0), elem->point(5)))
1073  {
1074  // Case 7
1075  xi_mapped = -xi;
1076  zeta_mapped = zeta;
1077  }
1078  else
1079  {
1080  // Case 8
1081  xi_mapped = xi;
1082  zeta_mapped = -zeta;
1083  }
1084  }
1085  }
1086 
1087 
1088  // Face 2
1089  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
1090  {
1091  const Point min_point = std::min(elem->point(1),
1092  std::min(elem->point(2),
1093  std::min(elem->point(6),
1094  elem->point(5))));
1095  if (elem->point(1) == min_point)
1096  if (elem->point(2) == std::min(elem->point(2), elem->point(5)))
1097  {
1098  // Case 1
1099  eta_mapped = eta;
1100  zeta_mapped = zeta;
1101  }
1102  else
1103  {
1104  // Case 2
1105  eta_mapped = zeta;
1106  zeta_mapped = eta;
1107  }
1108 
1109  else if (elem->point(2) == min_point)
1110  if (elem->point(6) == std::min(elem->point(6), elem->point(1)))
1111  {
1112  // Case 3
1113  eta_mapped = zeta;
1114  zeta_mapped = -eta;
1115  }
1116  else
1117  {
1118  // Case 4
1119  eta_mapped = -eta;
1120  zeta_mapped = zeta;
1121  }
1122 
1123  else if (elem->point(6) == min_point)
1124  if (elem->point(5) == std::min(elem->point(5), elem->point(2)))
1125  {
1126  // Case 5
1127  eta_mapped = -eta;
1128  zeta_mapped = -zeta;
1129  }
1130  else
1131  {
1132  // Case 6
1133  eta_mapped = -zeta;
1134  zeta_mapped = -eta;
1135  }
1136 
1137  else if (elem->point(5) == min_point)
1138  {
1139  if (elem->point(1) == std::min(elem->point(1), elem->point(6)))
1140  {
1141  // Case 7
1142  eta_mapped = -zeta;
1143  zeta_mapped = eta;
1144  }
1145  else
1146  {
1147  // Case 8
1148  eta_mapped = eta;
1149  zeta_mapped = -zeta;
1150  }
1151  }
1152  }
1153 
1154 
1155  // Face 3
1156  else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
1157  {
1158  const Point min_point = std::min(elem->point(2),
1159  std::min(elem->point(3),
1160  std::min(elem->point(7),
1161  elem->point(6))));
1162  if (elem->point(3) == min_point)
1163  if (elem->point(2) == std::min(elem->point(2), elem->point(7)))
1164  {
1165  // Case 1
1166  xi_mapped = xi;
1167  zeta_mapped = zeta;
1168  }
1169  else
1170  {
1171  // Case 2
1172  xi_mapped = zeta;
1173  zeta_mapped = xi;
1174  }
1175 
1176  else if (elem->point(7) == min_point)
1177  if (elem->point(3) == std::min(elem->point(3), elem->point(6)))
1178  {
1179  // Case 3
1180  xi_mapped = -zeta;
1181  zeta_mapped = xi;
1182  }
1183  else
1184  {
1185  // Case 4
1186  xi_mapped = xi;
1187  zeta_mapped = -zeta;
1188  }
1189 
1190  else if (elem->point(6) == min_point)
1191  if (elem->point(7) == std::min(elem->point(7), elem->point(2)))
1192  {
1193  // Case 5
1194  xi_mapped = -xi;
1195  zeta_mapped = -zeta;
1196  }
1197  else
1198  {
1199  // Case 6
1200  xi_mapped = -zeta;
1201  zeta_mapped = -xi;
1202  }
1203 
1204  else if (elem->point(2) == min_point)
1205  {
1206  if (elem->point(6) == std::min(elem->point(3), elem->point(6)))
1207  {
1208  // Case 7
1209  xi_mapped = zeta;
1210  zeta_mapped = -xi;
1211  }
1212  else
1213  {
1214  // Case 8
1215  xi_mapped = -xi;
1216  zeta_mapped = zeta;
1217  }
1218  }
1219  }
1220 
1221 
1222  // Face 4
1223  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
1224  {
1225  const Point min_point = std::min(elem->point(3),
1226  std::min(elem->point(0),
1227  std::min(elem->point(4),
1228  elem->point(7))));
1229  if (elem->point(0) == min_point)
1230  if (elem->point(3) == std::min(elem->point(3), elem->point(4)))
1231  {
1232  // Case 1
1233  eta_mapped = eta;
1234  zeta_mapped = zeta;
1235  }
1236  else
1237  {
1238  // Case 2
1239  eta_mapped = zeta;
1240  zeta_mapped = eta;
1241  }
1242 
1243  else if (elem->point(4) == min_point)
1244  if (elem->point(0) == std::min(elem->point(0), elem->point(7)))
1245  {
1246  // Case 3
1247  eta_mapped = -zeta;
1248  zeta_mapped = eta;
1249  }
1250  else
1251  {
1252  // Case 4
1253  eta_mapped = eta;
1254  zeta_mapped = -zeta;
1255  }
1256 
1257  else if (elem->point(7) == min_point)
1258  if (elem->point(4) == std::min(elem->point(4), elem->point(3)))
1259  {
1260  // Case 5
1261  eta_mapped = -eta;
1262  zeta_mapped = -zeta;
1263  }
1264  else
1265  {
1266  // Case 6
1267  eta_mapped = -zeta;
1268  zeta_mapped = -eta;
1269  }
1270 
1271  else if (elem->point(3) == min_point)
1272  {
1273  if (elem->point(7) == std::min(elem->point(7), elem->point(0)))
1274  {
1275  // Case 7
1276  eta_mapped = zeta;
1277  zeta_mapped = -eta;
1278  }
1279  else
1280  {
1281  // Case 8
1282  eta_mapped = -eta;
1283  zeta_mapped = zeta;
1284  }
1285  }
1286  }
1287 
1288 
1289  // Face 5
1290  else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
1291  {
1292  const Point min_point = std::min(elem->point(4),
1293  std::min(elem->point(5),
1294  std::min(elem->point(6),
1295  elem->point(7))));
1296  if (elem->point(4) == min_point)
1297  if (elem->point(5) == std::min(elem->point(5), elem->point(7)))
1298  {
1299  // Case 1
1300  xi_mapped = xi;
1301  eta_mapped = eta;
1302  }
1303  else
1304  {
1305  // Case 2
1306  xi_mapped = eta;
1307  eta_mapped = xi;
1308  }
1309 
1310  else if (elem->point(5) == min_point)
1311  if (elem->point(6) == std::min(elem->point(6), elem->point(4)))
1312  {
1313  // Case 3
1314  xi_mapped = eta;
1315  eta_mapped = -xi;
1316  }
1317  else
1318  {
1319  // Case 4
1320  xi_mapped = -xi;
1321  eta_mapped = eta;
1322  }
1323 
1324  else if (elem->point(6) == min_point)
1325  if (elem->point(7) == std::min(elem->point(7), elem->point(5)))
1326  {
1327  // Case 5
1328  xi_mapped = -xi;
1329  eta_mapped = -eta;
1330  }
1331  else
1332  {
1333  // Case 6
1334  xi_mapped = -eta;
1335  eta_mapped = -xi;
1336  }
1337 
1338  else if (elem->point(7) == min_point)
1339  {
1340  if (elem->point(4) == std::min(elem->point(4), elem->point(6)))
1341  {
1342  // Case 7
1343  xi_mapped = -eta;
1344  eta_mapped = xi;
1345  }
1346  else
1347  {
1348  // Case 8
1349  xi_mapped = xi;
1350  eta_mapped = eta;
1351  }
1352  }
1353  }
1354 
1355 
1356  }
1357 
1358 
1359  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi_mapped)*
1360  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta_mapped)*
1361  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta_mapped));
1362  }
1363 
1364 
1365  default:
1366  libmesh_error_msg("Invalid element type = " << type);
1367  }
1368  }
1369 
1370 
1371  default:
1372  libmesh_error_msg("Invalid totalorder = " << totalorder);
1373  }
1374 
1375 #endif
1376 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
long double min(long double a, double b)

◆ shape() [64/109]

Real libMesh::FE< 2, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 53 of file fe_szabab_shape_2D.C.

57 {
58  libmesh_error_msg("Szabo-Babuska polynomials require the element type \nbecause edge orientation is needed.");
59  return 0.;
60 }

◆ shape() [65/109]

Real libMesh::FE< 2, SZABAB >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 65 of file fe_szabab_shape_2D.C.

69 {
70  libmesh_assert(elem);
71 
72  const ElemType type = elem->type();
73 
74  const Order totalorder = static_cast<Order>(order + elem->p_level());
75 
76  // Declare that we are using our own special power function
77  // from the Utility namespace. This saves typing later.
78  using Utility::pow;
79 
80  switch (totalorder)
81  {
82  // 1st & 2nd-order Szabo-Babuska.
83  case FIRST:
84  case SECOND:
85  {
86  switch (type)
87  {
88 
89  // Szabo-Babuska shape functions on the triangle.
90  case TRI3:
91  case TRI6:
92  {
93  const Real l1 = 1-p(0)-p(1);
94  const Real l2 = p(0);
95  const Real l3 = p(1);
96 
97  libmesh_assert_less (i, 6);
98 
99  switch (i)
100  {
101  case 0: return l1;
102  case 1: return l2;
103  case 2: return l3;
104 
105  case 3: return l1*l2*(-4.*sqrt6);
106  case 4: return l2*l3*(-4.*sqrt6);
107  case 5: return l3*l1*(-4.*sqrt6);
108 
109  default:
110  libmesh_error_msg("Invalid i = " << i);
111  }
112  }
113 
114 
115  // Szabo-Babuska shape functions on the quadrilateral.
116  case QUAD4:
117  case QUAD8:
118  case QUAD9:
119  {
120  // Compute quad shape functions as a tensor-product
121  const Real xi = p(0);
122  const Real eta = p(1);
123 
124  libmesh_assert_less (i, 9);
125 
126  // 0 1 2 3 4 5 6 7 8
127  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
128  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
129 
130  return (FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
131  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
132 
133  }
134 
135  default:
136  libmesh_error_msg("Invalid element type = " << type);
137  }
138  }
139 
140 
141  // 3rd-order Szabo-Babuska.
142  case THIRD:
143  {
144  switch (type)
145  {
146 
147  // Szabo-Babuska shape functions on the triangle.
148  case TRI6:
149  {
150  Real l1 = 1-p(0)-p(1);
151  Real l2 = p(0);
152  Real l3 = p(1);
153 
154  Real f=1;
155 
156  libmesh_assert_less (i, 10);
157 
158 
159  if (i==4 && (elem->point(0) > elem->point(1)))f=-1;
160  if (i==6 && (elem->point(1) > elem->point(2)))f=-1;
161  if (i==8 && (elem->point(2) > elem->point(0)))f=-1;
162 
163 
164  switch (i)
165  {
166  //nodal modes
167  case 0: return l1;
168  case 1: return l2;
169  case 2: return l3;
170 
171  //side modes
172  case 3: return l1*l2*(-4.*sqrt6);
173  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
174 
175  case 5: return l2*l3*(-4.*sqrt6);
176  case 6: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
177 
178  case 7: return l3*l1*(-4.*sqrt6);
179  case 8: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
180 
181  //internal modes
182  case 9: return l1*l2*l3;
183 
184  default:
185  libmesh_error_msg("Invalid i = " << i);
186  }
187  }
188 
189 
190  // Szabo-Babuska shape functions on the quadrilateral.
191  case QUAD8:
192  case QUAD9:
193  {
194  // Compute quad shape functions as a tensor-product
195  const Real xi = p(0);
196  const Real eta = p(1);
197 
198  libmesh_assert_less (i, 16);
199 
200  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
201  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3};
202  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3};
203 
204  Real f=1.;
205 
206  // take care of edge orientation, this is needed at
207  // edge shapes with (y=0)-asymmetric 1D shapes, these have
208  // one 1D shape index being 0 or 1, the other one being odd and >=3
209 
210  switch(i)
211  {
212  case 5: // edge 0 points
213  if (elem->point(0) > elem->point(1))f = -1.;
214  break;
215  case 7: // edge 1 points
216  if (elem->point(1) > elem->point(2))f = -1.;
217  break;
218  case 9: // edge 2 points
219  if (elem->point(3) > elem->point(2))f = -1.;
220  break;
221  case 11: // edge 3 points
222  if (elem->point(0) > elem->point(3))f = -1.;
223  break;
224 
225  default:
226  // Everything else keeps f=1
227  break;
228  }
229 
230  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
231  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
232  }
233 
234  default:
235  libmesh_error_msg("Invalid element type = " << type);
236  }
237  }
238 
239 
240 
241 
242  // 4th-order Szabo-Babuska.
243  case FOURTH:
244  {
245  switch (type)
246  {
247  // Szabo-Babuska shape functions on the triangle.
248  case TRI6:
249  {
250  Real l1 = 1-p(0)-p(1);
251  Real l2 = p(0);
252  Real l3 = p(1);
253 
254  Real f=1;
255 
256  libmesh_assert_less (i, 15);
257 
258 
259  if (i== 4 && (elem->point(0) > elem->point(1)))f=-1;
260  if (i== 7 && (elem->point(1) > elem->point(2)))f=-1;
261  if (i==10 && (elem->point(2) > elem->point(0)))f=-1;
262 
263 
264  switch (i)
265  {
266  //nodal modes
267  case 0: return l1;
268  case 1: return l2;
269  case 2: return l3;
270 
271  //side modes
272  case 3: return l1*l2*(-4.*sqrt6);
273  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
274  case 5: return l1*l2*(-sqrt14)*(5.*pow<2>(l2-l1)-1);
275 
276  case 6: return l2*l3*(-4.*sqrt6);
277  case 7: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
278  case 8: return l2*l3*(-sqrt14)*(5.*pow<2>(l3-l2)-1);
279 
280  case 9: return l3*l1*(-4.*sqrt6);
281  case 10: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
282  case 11: return l3*l1*(-sqrt14)*(5.*pow<2>(l1-l3)-1);
283 
284  //internal modes
285  case 12: return l1*l2*l3;
286 
287  case 13: return l1*l2*l3*(l2-l1);
288  case 14: return l1*l2*l3*(2*l3-1);
289 
290  default:
291  libmesh_error_msg("Invalid i = " << i);
292  }
293  }
294 
295 
296  // Szabo-Babuska shape functions on the quadrilateral.
297  case QUAD8:
298  case QUAD9:
299  {
300  // Compute quad shape functions as a tensor-product
301  const Real xi = p(0);
302  const Real eta = p(1);
303 
304  libmesh_assert_less (i, 25);
305 
306  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
307  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4};
308  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
309 
310  Real f=1.;
311 
312  switch(i)
313  {
314  case 5: // edge 0 points
315  if (elem->point(0) > elem->point(1))f = -1.;
316  break;
317  case 8: // edge 1 points
318  if (elem->point(1) > elem->point(2))f = -1.;
319  break;
320  case 11: // edge 2 points
321  if (elem->point(3) > elem->point(2))f = -1.;
322  break;
323  case 14: // edge 3 points
324  if (elem->point(0) > elem->point(3))f = -1.;
325  break;
326 
327  default:
328  // Everything else keeps f=1
329  break;
330  }
331 
332  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
333  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
334  }
335 
336  default:
337  libmesh_error_msg("Invalid element type = " << type);
338  }
339  }
340 
341 
342 
343 
344  // 5th-order Szabo-Babuska.
345  case FIFTH:
346  {
347  switch (type)
348  {
349  // Szabo-Babuska shape functions on the triangle.
350  case TRI6:
351  {
352  Real l1 = 1-p(0)-p(1);
353  Real l2 = p(0);
354  Real l3 = p(1);
355 
356  const Real x=l2-l1;
357  const Real y=2.*l3-1;
358 
359  Real f=1;
360 
361  libmesh_assert_less (i, 21);
362 
363 
364  if ((i== 4||i== 6) && (elem->point(0) > elem->point(1)))f=-1;
365  if ((i== 8||i==10) && (elem->point(1) > elem->point(2)))f=-1;
366  if ((i==12||i==14) && (elem->point(2) > elem->point(0)))f=-1;
367 
368 
369  switch (i)
370  {
371  //nodal modes
372  case 0: return l1;
373  case 1: return l2;
374  case 2: return l3;
375 
376  //side modes
377  case 3: return l1*l2*(-4.*sqrt6);
378  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
379  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
380  case 6: return f*(-sqrt2)*l1*l2*((9.-21.*l1*l1)*l1+(-9.+63.*l1*l1+(-63.*l1+21.*l2)*l2)*l2);
381 
382  case 7: return l2*l3*(-4.*sqrt6);
383  case 8: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
384  case 9: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
385  case 10: return -f*sqrt2*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
386 
387  case 11: return l3*l1*(-4.*sqrt6);
388  case 12: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
389  case 13: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
390  case 14: return f*(-sqrt2)*l3*l1*((9.0-21.0*l3*l3)*l3+(-9.0+63.0*l3*l3+(-63.0*l3+21.0*l1)*l1)*l1);
391 
392  //internal modes
393  case 15: return l1*l2*l3;
394 
395  case 16: return l1*l2*l3*x;
396  case 17: return l1*l2*l3*y;
397 
398  case 18: return l1*l2*l3*(1.5*l1*l1-.5+(-3.0*l1+1.5*l2)*l2);
399  case 19: return l1*l2*l3*x*y;
400  case 20: return l1*l2*l3*(1.0+(-6.0+6.0*l3)*l3);
401 
402  default:
403  libmesh_error_msg("Invalid i = " << i);
404  }
405  } // case TRI6
406 
407  // Szabo-Babuska shape functions on the quadrilateral.
408  case QUAD8:
409  case QUAD9:
410  {
411  // Compute quad shape functions as a tensor-product
412  const Real xi = p(0);
413  const Real eta = p(1);
414 
415  libmesh_assert_less (i, 36);
416 
417  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
418  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
419  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
420 
421  Real f=1.;
422 
423  switch(i)
424  {
425  case 5: // edge 0 points
426  case 7:
427  if (elem->point(0) > elem->point(1))f = -1.;
428  break;
429  case 9: // edge 1 points
430  case 11:
431  if (elem->point(1) > elem->point(2))f = -1.;
432  break;
433  case 13: // edge 2 points
434  case 15:
435  if (elem->point(3) > elem->point(2))f = -1.;
436  break;
437  case 14: // edge 3 points
438  case 19:
439  if (elem->point(0) > elem->point(3))f = -1.;
440  break;
441 
442  default:
443  // Everything else keeps f=1
444  break;
445  }
446 
447  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
448  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
449 
450  } // case QUAD8/QUAD9
451 
452  default:
453  libmesh_error_msg("Invalid element type = " << type);
454 
455  } // switch type
456 
457  } // case FIFTH
458 
459  // 6th-order Szabo-Babuska.
460  case SIXTH:
461  {
462  switch (type)
463  {
464  // Szabo-Babuska shape functions on the triangle.
465  case TRI6:
466  {
467  Real l1 = 1-p(0)-p(1);
468  Real l2 = p(0);
469  Real l3 = p(1);
470 
471  const Real x=l2-l1;
472  const Real y=2.*l3-1;
473 
474  Real f=1;
475 
476  libmesh_assert_less (i, 28);
477 
478 
479  if ((i== 4||i== 6) && (elem->point(0) > elem->point(1)))f=-1;
480  if ((i== 9||i==11) && (elem->point(1) > elem->point(2)))f=-1;
481  if ((i==14||i==16) && (elem->point(2) > elem->point(0)))f=-1;
482 
483 
484  switch (i)
485  {
486  //nodal modes
487  case 0: return l1;
488  case 1: return l2;
489  case 2: return l3;
490 
491  //side modes
492  case 3: return l1*l2*(-4.*sqrt6);
493  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
494  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
495  case 6: return f*(-sqrt2)*l1*l2*((9.0-21.0*l1*l1)*l1+(-9.0+63.0*l1*l1+(-63.0*l1+21.0*l2)*l2)*l2);
496  case 7: return -sqrt22*l1*l2*(0.5+(-7.0+0.105E2*l1*l1)*l1*l1+((14.0-0.42E2*l1*l1)*l1+(-7.0+0.63E2*l1*l1+(-0.42E2*l1+0.105E2*l2)*l2)*l2)*l2);
497 
498  case 8: return l2*l3*(-4.*sqrt6);
499  case 9: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
500  case 10: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
501  case 11: return f*(-sqrt2)*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
502  case 12: return -sqrt22*l2*l3*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l2)*l2)*l2)*l2);
503 
504  case 13: return l3*l1*(-4.*sqrt6);
505  case 14: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
506  case 15: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
507  case 16: return f*(-sqrt2)*l3*l1*((9.0-21.0*l3*l3)*l3+(-9.0+63.0*l3*l3+(-63.0*l3+21.0*l1)*l1)*l1);
508  case 17: return -sqrt22*l3*l1*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l1)*l1)*l1)*l1);
509 
510 
511 
512  //internal modes
513  case 18: return l1*l2*l3;
514 
515  case 19: return l1*l2*l3*x;
516  case 20: return l1*l2*l3*y;
517 
518  case 21: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2);
519  case 22: return l1*l2*l3*(l2-l1)*(2.0*l3-1.0);
520  case 23: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3);
521  case 24: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2);
522  case 25: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0*l3-1.0);
523  case 26: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3)*(l2-l1);
524  case 27: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3);
525 
526 
527  default:
528  libmesh_error_msg("Invalid i = " << i);
529  }
530  } // case TRI6
531 
532  // Szabo-Babuska shape functions on the quadrilateral.
533  case QUAD8:
534  case QUAD9:
535  {
536  // Compute quad shape functions as a tensor-product
537  const Real xi = p(0);
538  const Real eta = p(1);
539 
540  libmesh_assert_less (i, 49);
541 
542  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
543  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6};
544  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6};
545 
546  Real f=1.;
547 
548  switch(i)
549  {
550  case 5: // edge 0 points
551  case 7:
552  if (elem->point(0) > elem->point(1))f = -1.;
553  break;
554  case 10: // edge 1 points
555  case 12:
556  if (elem->point(1) > elem->point(2))f = -1.;
557  break;
558  case 15: // edge 2 points
559  case 17:
560  if (elem->point(3) > elem->point(2))f = -1.;
561  break;
562  case 20: // edge 3 points
563  case 22:
564  if (elem->point(0) > elem->point(3))f = -1.;
565  break;
566 
567  default:
568  // Everything else keeps f=1
569  break;
570  }
571 
572  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
573  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
574 
575  } // case QUAD8/QUAD9
576 
577  default:
578  libmesh_error_msg("Invalid element type = " << type);
579 
580  } // switch type
581 
582  } // case SIXTH
583 
584 
585  // 7th-order Szabo-Babuska.
586  case SEVENTH:
587  {
588  switch (type)
589  {
590  // Szabo-Babuska shape functions on the triangle.
591  case TRI6:
592  {
593 
594  Real l1 = 1-p(0)-p(1);
595  Real l2 = p(0);
596  Real l3 = p(1);
597 
598  const Real x=l2-l1;
599  const Real y=2.*l3-1.;
600 
601  Real f=1;
602 
603  libmesh_assert_less (i, 36);
604 
605 
606  if ((i>= 4&&i<= 8) && (elem->point(0) > elem->point(1)))f=-1;
607  if ((i>=10&&i<=14) && (elem->point(1) > elem->point(2)))f=-1;
608  if ((i>=16&&i<=20) && (elem->point(2) > elem->point(0)))f=-1;
609 
610 
611  switch (i)
612  {
613  //nodal modes
614  case 0: return l1;
615  case 1: return l2;
616  case 2: return l3;
617 
618  //side modes
619  case 3: return l1*l2*(-4.*sqrt6);
620  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
621 
622  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
623  case 6: return f*-sqrt2*l1*l2*((9.0-21.0*l1*l1)*l1+(-9.0+63.0*l1*l1+(-63.0*l1+21.0*l2)*l2)*l2);
624  case 7: return -sqrt22*l1*l2*(0.5+(-7.0+0.105E2*l1*l1)*l1*l1+((14.0-0.42E2*l1*l1)*l1+(-7.0+0.63E2*l1*l1+(-0.42E2*l1+0.105E2*l2)*l2)*l2)*l2);
625  case 8: return f*-sqrt26*l1*l2*((-0.25E1+(15.0-0.165E2*l1*l1)*l1*l1)*l1+(0.25E1+(-45.0+0.825E2*l1*l1)*l1*l1+((45.0-0.165E3*l1*l1)*l1+(-15.0+0.165E3*l1*l1+(-0.825E2*l1+0.165E2*l2)*l2)*l2)*l2)*l2);
626 
627  case 9: return l2*l3*(-4.*sqrt6);
628  case 10: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
629 
630  case 11: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
631  case 12: return f*-sqrt2*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
632  case 13: return -sqrt22*l2*l3*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l2)*l2)*l2)*l2);
633  case 14: return f*-sqrt26*l2*l3*((0.25E1+(-15.0+0.165E2*l3*l3)*l3*l3)*l3+(-0.25E1+(45.0-0.825E2*l3*l3)*l3*l3+((-45.0+0.165E3*l3*l3)*l3+(15.0-0.165E3*l3*l3+(0.825E2*l3-0.165E2*l2)*l2)*l2)*l2)*l2);
634 
635  case 15: return l3*l1*(-4.*sqrt6);
636  case 16: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
637 
638  case 17: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
639  case 18: return -f*sqrt2*l3*l1*((9.-21.*l3*l3)*l3+(-9.+63.*l3*l3+(-63.*l3+21.*l1)*l1)*l1);
640  case 19: return -sqrt22*l3*l1*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l1)*l1)*l1)*l1);
641  case 20: return f*-sqrt26*l3*l1*((-0.25E1+(15.0-0.165E2*l3*l3)*l3*l3)*l3+(0.25E1+(-45.0+0.825E2*l3*l3)*l3*l3+((45.0-0.165E3*l3*l3)*l3+(-15.0+0.165E3*l3*l3+(-0.825E2*l3+0.165E2*l1)*l1)*l1)*l1)*l1);
642 
643 
644  //internal modes
645  case 21: return l1*l2*l3;
646 
647  case 22: return l1*l2*l3*x;
648  case 23: return l1*l2*l3*y;
649 
650  case 24: return l1*l2*l3*0.5*(3.*pow<2>(x)-1.);
651  case 25: return l1*l2*l3*x*y;
652  case 26: return l1*l2*l3*0.5*(3.*pow<2>(y)-1.);
653 
654  case 27: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2);
655  case 28: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0*l3-1.0);
656  case 29: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3)*(l2-l1);
657  case 30: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3);
658  case 31: return 0.125*l1*l2*l3*((-15.0+(70.0-63.0*l1*l1)*l1*l1)*l1+(15.0+(-210.0+315.0*l1*l1)*l1*l1+((210.0-630.0*l1*l1)*l1+(-70.0+630.0*l1*l1+(-315.0*l1+63.0*l2)*l2)*l2)*l2)*l2);
659  case 32: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2)*(2.0*l3-1.0);
660  case 33: return 0.25*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0+(-12.0+12.0*l3)*l3);
661  case 34: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3)*(l2-l1);
662  case 35: return 0.125*l1*l2*l3*(-8.0+(240.0+(-1680.0+(4480.0+(-5040.0+2016.0*l3)*l3)*l3)*l3)*l3);
663 
664  default:
665  libmesh_error_msg("Invalid i = " << i);
666  }
667  } // case TRI6
668 
669  // Szabo-Babuska shape functions on the quadrilateral.
670  case QUAD8:
671  case QUAD9:
672  {
673  // Compute quad shape functions as a tensor-product
674  const Real xi = p(0);
675  const Real eta = p(1);
676 
677  libmesh_assert_less (i, 64);
678 
679  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
680  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7};
681  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7};
682 
683  Real f=1.;
684 
685  switch(i)
686  {
687  case 5: // edge 0 points
688  case 7:
689  case 9:
690  if (elem->point(0) > elem->point(1))f = -1.;
691  break;
692  case 11: // edge 1 points
693  case 13:
694  case 15:
695  if (elem->point(1) > elem->point(2))f = -1.;
696  break;
697  case 17: // edge 2 points
698  case 19:
699  case 21:
700  if (elem->point(3) > elem->point(2))f = -1.;
701  break;
702  case 23: // edge 3 points
703  case 25:
704  case 27:
705  if (elem->point(0) > elem->point(3))f = -1.;
706  break;
707 
708  default:
709  // Everything else keeps f=1
710  break;
711  }
712 
713  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
714  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
715 
716  } // case QUAD8/QUAD9
717 
718  default:
719  libmesh_error_msg("Invalid element type = " << type);
720 
721  } // switch type
722 
723  } // case SEVENTH
724 
725 
726  // by default throw an error
727  default:
728  libmesh_error_msg("ERROR: Unsupported polynomial order!");
729  } // switch order
730 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [66/109]

Real libMesh::FE< 1, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 70 of file fe_monomial_shape_1D.C.

74 {
75  libmesh_assert(elem);
76 
77  return FE<1,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
78 }

◆ shape() [67/109]

Real libMesh::FE< 1, SZABAB >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 79 of file fe_szabab_shape_1D.C.

83 {
84  libmesh_assert(elem);
85 
86  return FE<1,SZABAB>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
87 }

◆ shape() [68/109]

Real libMesh::FE< 1, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 101 of file fe_hierarchic_shape_1D.C.

105 {
106  libmesh_assert(elem);
107 
108  return FE<1,HIERARCHIC>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
109 }

◆ shape() [69/109]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 101 of file fe_l2_hierarchic_shape_1D.C.

105 {
106  libmesh_assert(elem);
107 
108  return FE<1,L2_HIERARCHIC>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
109 }

◆ shape() [70/109]

static OutputShape libMesh::FE< Dim, T >::shape ( const ElemType  t,
const Order  o,
const unsigned int  i,
const Point p 
)
staticinherited
Returns
The value of the $ i^{th} $ shape function at point p. This method allows you to specify the dimension, element type, and order directly. This allows the method to be static.

On a p-refined element, o should be the total order of the element.

◆ shape() [71/109]

Real libMesh::FE< 1, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 117 of file fe_l2_lagrange_shape_1D.C.

121 {
122  libmesh_assert(elem);
123 
124  return FE<1,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
125 }

◆ shape() [72/109]

Real libMesh::FE< 1, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 117 of file fe_lagrange_shape_1D.C.

121 {
122  libmesh_assert(elem);
123 
124  return FE<1,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
125 }

◆ shape() [73/109]

Real libMesh::FE< 2, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 118 of file fe_monomial_shape_2D.C.

122 {
123  libmesh_assert(elem);
124 
125  // by default call the orientation-independent shape functions
126  return FE<2,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
127 }

◆ shape() [74/109]

static OutputShape libMesh::FE< Dim, T >::shape ( const Elem elem,
const Order  o,
const unsigned int  i,
const Point p 
)
staticinherited
Returns
The value of the $ i^{th} $ shape function at point p. This method allows you to specify the dimension, element type, and order directly. This allows the method to be static.

On a p-refined element, o should be the base order of the element.

◆ shape() [75/109]

Real libMesh::FE< 1, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 175 of file fe_hermite_shape_1D.C.

179 {
180  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
181  return 0.;
182 }

◆ shape() [76/109]

Real libMesh::FE< 3, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 186 of file fe_monomial_shape_3D.C.

190 {
191  libmesh_assert(elem);
192 
193  // call the orientation-independent shape functions
194  return FE<3,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
195 }

◆ shape() [77/109]

Real libMesh::FE< 1, HERMITE >::shape ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 187 of file fe_hermite_shape_1D.C.

191 {
192  libmesh_assert(elem);
193 
194  // Coefficient naming: d(1)d(2n) is the coefficient of the
195  // global shape function corresponding to value 1 in terms of the
196  // local shape function corresponding to normal derivative 2
197  Real d1xd1x, d2xd2x;
198 
199  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
200 
201  const ElemType type = elem->type();
202 
203 #ifndef NDEBUG
204  const unsigned int totalorder = order + elem->p_level();
205 #endif
206 
207  switch (type)
208  {
209  // C1 functions on the C1 cubic edge
210  case EDGE2:
211  case EDGE3:
212  {
213  libmesh_assert_less (i, totalorder+1);
214 
215  switch (i)
216  {
217  case 0:
218  return FEHermite<1>::hermite_raw_shape(0, p(0));
219  case 1:
220  return d1xd1x * FEHermite<1>::hermite_raw_shape(2, p(0));
221  case 2:
222  return FEHermite<1>::hermite_raw_shape(1, p(0));
223  case 3:
224  return d2xd2x * FEHermite<1>::hermite_raw_shape(3, p(0));
225  default:
226  return FEHermite<1>::hermite_raw_shape(i, p(0));
227  }
228  }
229  default:
230  libmesh_error_msg("ERROR: Unsupported element type = " << type);
231  }
232 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape() [78/109]

Real libMesh::FE< 2, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 189 of file fe_hermite_shape_2D.C.

193 {
194  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
195  return 0.;
196 }

◆ shape() [79/109]

Real libMesh::FE< 1, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 190 of file fe_bernstein_shape_1D.C.

194 {
195  libmesh_assert(elem);
196 
197  return FE<1,BERNSTEIN>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
198 }

◆ shape() [80/109]

Real libMesh::FE< 2, HERMITE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 201 of file fe_hermite_shape_2D.C.

205 {
206  libmesh_assert(elem);
207 
208  std::vector<std::vector<Real>> dxdxi(2, std::vector<Real>(2, 0));
209 
210 #ifdef DEBUG
211  std::vector<Real> dxdeta(2), dydxi(2);
212 #endif
213 
214  hermite_compute_coefs(elem,dxdxi
215 #ifdef DEBUG
216  ,dxdeta,dydxi
217 #endif
218  );
219 
220  const ElemType type = elem->type();
221 
222  const Order totalorder = static_cast<Order>(order + elem->p_level());
223 
224  switch (type)
225  {
226  case QUAD4:
227  case QUADSHELL4:
228  libmesh_assert_less (totalorder, 4);
229  libmesh_fallthrough();
230  case QUAD8:
231  case QUADSHELL8:
232  case QUAD9:
233  {
234  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
235 
236  std::vector<unsigned int> bases1D;
237 
238  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
239 
240  return coef * FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
241  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
242  }
243  default:
244  libmesh_error_msg("ERROR: Unsupported element type = " << type);
245  }
246 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape() [81/109]

Real libMesh::FE< 2, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 208 of file fe_l2_lagrange_shape_2D.C.

212 {
213  libmesh_assert(elem);
214 
215  // call the orientation-independent shape functions
216  return FE<2,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
217 }

◆ shape() [82/109]

Real libMesh::FE< 2, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 210 of file fe_lagrange_shape_2D.C.

214 {
215  libmesh_assert(elem);
216 
217  // call the orientation-independent shape functions
218  return FE<2,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
219 }

◆ shape() [83/109]

Real libMesh::FE< 1, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 211 of file fe_clough_shape_1D.C.

215 {
216  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
217  return 0.;
218 }

◆ shape() [84/109]

Real libMesh::FE< 1, CLOUGH >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 223 of file fe_clough_shape_1D.C.

227 {
228  libmesh_assert(elem);
229 
230  clough_compute_coefs(elem);
231 
232  const ElemType type = elem->type();
233 
234  const Order totalorder = static_cast<Order>(order + elem->p_level());
235 
236  switch (totalorder)
237  {
238  // 3rd-order C1 cubic element
239  case THIRD:
240  {
241  switch (type)
242  {
243  // C1 functions on the C1 cubic edge
244  case EDGE2:
245  case EDGE3:
246  {
247  libmesh_assert_less (i, 4);
248 
249  switch (i)
250  {
251  case 0:
252  return clough_raw_shape(0, p);
253  case 1:
254  return clough_raw_shape(1, p);
255  case 2:
256  return d1xd1x * clough_raw_shape(2, p);
257  case 3:
258  return d2xd2x * clough_raw_shape(3, p);
259  default:
260  libmesh_error_msg("Invalid shape function index i = " << i);
261  }
262  }
263  default:
264  libmesh_error_msg("ERROR: Unsupported element type = " << type);
265  }
266  }
267  // by default throw an error
268  default:
269  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
270  }
271 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape() [85/109]

Real libMesh::FE< 3, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 356 of file fe_l2_lagrange_shape_3D.C.

360 {
361  libmesh_assert(elem);
362 
363  // call the orientation-independent shape functions
364  return FE<3,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
365 }

◆ shape() [86/109]

Real libMesh::FE< 3, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 376 of file fe_hermite_shape_3D.C.

380 {
381  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
382  return 0.;
383 }

◆ shape() [87/109]

Real libMesh::FE< 3, HERMITE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 388 of file fe_hermite_shape_3D.C.

392 {
393  libmesh_assert(elem);
394 
395  std::vector<std::vector<Real>> dxdxi(3, std::vector<Real>(2, 0));
396 
397 #ifdef DEBUG
398  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
399  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
400 #endif //DEBUG
401 
402  hermite_compute_coefs(elem, dxdxi
403 #ifdef DEBUG
404  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
405 #endif
406  );
407 
408  const ElemType type = elem->type();
409 
410  const Order totalorder = static_cast<Order>(order + elem->p_level());
411 
412  switch (totalorder)
413  {
414  // 3rd-order tricubic Hermite functions
415  case THIRD:
416  {
417  switch (type)
418  {
419  case HEX8:
420  case HEX20:
421  case HEX27:
422  {
423  libmesh_assert_less (i, 64);
424 
425  std::vector<unsigned int> bases1D;
426 
427  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
428 
429  return coef *
430  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
431  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
432  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
433  }
434  default:
435  libmesh_error_msg("ERROR: Unsupported element type " << type);
436  }
437  }
438  // by default throw an error
439  default:
440  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
441  }
442 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape() [88/109]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 538 of file fe_lagrange_vec.C.

540 {
541  Real value = FE<0,LAGRANGE>::shape( type, order, i, p );
542  return libMesh::RealGradient( value );
543 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [89/109]

Real libMesh::FE< 2, SUBDIVISION >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Subdivision finite elements.

Template specialization prototypes are needed for calling from inside FESubdivision::init_shape_functions

◆ shape() [90/109]

Real libMesh::FE< 3, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 558 of file fe_lagrange_shape_3D.C.

562 {
563  libmesh_assert(elem);
564 
565  // call the orientation-independent shape functions
566  return FE<3,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
567 }

◆ shape() [91/109]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 560 of file fe_lagrange_vec.C.

562 {
563  Real value = FE<1,LAGRANGE>::shape( type, order, i, p );
564  return libMesh::RealGradient( value );
565 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [92/109]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 582 of file fe_lagrange_vec.C.

584 {
585  Real value = FE<2,LAGRANGE>::shape( type, order, i/2, p );
586 
587  switch( i%2 )
588  {
589  case 0:
590  return libMesh::RealGradient( value );
591 
592  case 1:
593  return libMesh::RealGradient( Real(0), value );
594 
595  default:
596  libmesh_error_msg("i%2 must be either 0 or 1!");
597  }
598 
599  //dummy
600  return libMesh::RealGradient();
601 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [93/109]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 593 of file fe_nedelec_one.C.

594 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape() [94/109]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 596 of file fe_nedelec_one.C.

597 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape() [95/109]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 616 of file fe_nedelec_one.C.

617 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape() [96/109]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 619 of file fe_nedelec_one.C.

620 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape() [97/109]

Real libMesh::FE< 3, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 645 of file fe_hierarchic_shape_3D.C.

649 {
650  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
651  return 0.;
652 }

◆ shape() [98/109]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 645 of file fe_l2_hierarchic_shape_3D.C.

649 {
650  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
651  return 0.;
652 }

◆ shape() [99/109]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 647 of file fe_lagrange_vec.C.

649 {
650  Real value = FE<3,LAGRANGE>::shape( type, order, i/3, p );
651 
652  switch( i%3 )
653  {
654  case 0:
655  return libMesh::RealGradient( value );
656 
657  case 1:
658  return libMesh::RealGradient( Real(0), value );
659 
660  case 2:
661  return libMesh::RealGradient( Real(0), Real(0), value );
662 
663  default:
664  libmesh_error_msg("i%3 must be 0, 1, or 2!");
665  }
666 
667  //dummy
668  return libMesh::RealGradient();
669 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [100/109]

Real libMesh::FE< 3, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 657 of file fe_hierarchic_shape_3D.C.

661 {
662 #if LIBMESH_DIM == 3
663 
664  libmesh_assert(elem);
665  const ElemType type = elem->type();
666 
667  const Order totalorder = static_cast<Order>(order+elem->p_level());
668 
669  switch (type)
670  {
671  case HEX8:
672  case HEX20:
673  libmesh_assert_less (totalorder, 2);
674  libmesh_fallthrough();
675  case HEX27:
676  {
677  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
678 
679  // Compute hex shape functions as a tensor-product
680  Real xi = p(0);
681  Real eta = p(1);
682  Real zeta = p(2);
683 
684  unsigned int i0, i1, i2;
685 
686  cube_indices(elem, totalorder, i, xi, eta, zeta, i0, i1, i2);
687 
688  return (FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
689  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i1, eta)*
690  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i2, zeta));
691  }
692 
693  default:
694  libmesh_error_msg("Invalid element type = " << type);
695  }
696 
697 #endif
698 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [101/109]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 657 of file fe_l2_hierarchic_shape_3D.C.

661 {
662 #if LIBMESH_DIM == 3
663 
664  libmesh_assert(elem);
665  const ElemType type = elem->type();
666 
667  const Order totalorder = static_cast<Order>(order+elem->p_level());
668 
669  switch (type)
670  {
671  case HEX8:
672  case HEX20:
673  libmesh_assert_less (totalorder, 2);
674  libmesh_fallthrough();
675  case HEX27:
676  {
677  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
678 
679  // Compute hex shape functions as a tensor-product
680  Real xi = p(0);
681  Real eta = p(1);
682  Real zeta = p(2);
683 
684  unsigned int i0, i1, i2;
685 
686  cube_indices(elem, totalorder, i, xi, eta, zeta, i0, i1, i2);
687 
688  return (FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
689  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i1, eta)*
690  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i2, zeta));
691  }
692 
693  default:
694  libmesh_error_msg("Invalid element type = " << type);
695  }
696 
697 #endif
698 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape() [102/109]

Real libMesh::FE< 2, SUBDIVISION >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 700 of file fe_subdivision_2D.C.

704 {
705  switch (order)
706  {
707  case FOURTH:
708  {
709  switch (type)
710  {
711  case TRI3SUBDIVISION:
712  libmesh_assert_less(i, 12);
713  return FESubdivision::regular_shape(i,p(0),p(1));
714  default:
715  libmesh_error_msg("ERROR: Unsupported element type!");
716  }
717  }
718  default:
719  libmesh_error_msg("ERROR: Unsupported polynomial order!");
720  }
721 }

◆ shape() [103/109]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 722 of file fe_lagrange_vec.C.

724 {
725  Real value = FE<0,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
726  return libMesh::RealGradient( value );
727 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [104/109]

Real libMesh::FE< 2, SUBDIVISION >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 726 of file fe_subdivision_2D.C.

730 {
731  libmesh_assert(elem);
732  return FE<2,SUBDIVISION>::shape(elem->type(), order, i, p);
733 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)

◆ shape() [105/109]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 744 of file fe_lagrange_vec.C.

746 {
747  Real value = FE<1,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
748  return libMesh::RealGradient( value );
749 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [106/109]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 766 of file fe_lagrange_vec.C.

768 {
769  Real value = FE<2,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, p );
770 
771  switch( i%2 )
772  {
773  case 0:
774  return libMesh::RealGradient( value );
775 
776  case 1:
777  return libMesh::RealGradient( Real(0), value );
778 
779  default:
780  libmesh_error_msg("i%2 must be either 0 or 1!");
781  }
782 
783  //dummy
784  return libMesh::RealGradient();
785 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [107/109]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 830 of file fe_lagrange_vec.C.

832 {
833  Real value = FE<3,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, p );
834 
835  switch( i%3 )
836  {
837  case 0:
838  return libMesh::RealGradient( value );
839 
840  case 1:
841  return libMesh::RealGradient( Real(0), value );
842 
843  case 2:
844  return libMesh::RealGradient( Real(0), Real(0), value );
845 
846  default:
847  libmesh_error_msg("i%3 must be 0, 1, or 2!");
848  }
849 
850  //dummy
851  return libMesh::RealGradient();
852 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape() [108/109]

Real libMesh::FE< 2, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)
inherited

Definition at line 1802 of file fe_clough_shape_2D.C.

1806 {
1807  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
1808  return 0.;
1809 }

◆ shape() [109/109]

Real libMesh::FE< 2, CLOUGH >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)
inherited

Definition at line 1814 of file fe_clough_shape_2D.C.

1818 {
1819  libmesh_assert(elem);
1820 
1821  clough_compute_coefs(elem);
1822 
1823  const ElemType type = elem->type();
1824 
1825  const Order totalorder = static_cast<Order>(order + elem->p_level());
1826 
1827  switch (totalorder)
1828  {
1829  // 2nd-order restricted Clough-Tocher element
1830  case SECOND:
1831  {
1832  // There may be a bug in the 2nd order case; the 3rd order
1833  // Clough-Tocher elements are pretty uniformly better anyways
1834  // so use those instead.
1835  libmesh_experimental();
1836  switch (type)
1837  {
1838  // C1 functions on the Clough-Tocher triangle.
1839  case TRI6:
1840  {
1841  libmesh_assert_less (i, 9);
1842  // FIXME: it would be nice to calculate (and cache)
1843  // clough_raw_shape(j,p) only once per triangle, not 1-7
1844  // times
1845  switch (i)
1846  {
1847  // Note: these DoF numbers are "scrambled" because my
1848  // initial numbering conventions didn't match libMesh
1849  case 0:
1850  return clough_raw_shape(0, p)
1851  + d1d2n * clough_raw_shape(10, p)
1852  + d1d3n * clough_raw_shape(11, p);
1853  case 3:
1854  return clough_raw_shape(1, p)
1855  + d2d3n * clough_raw_shape(11, p)
1856  + d2d1n * clough_raw_shape(9, p);
1857  case 6:
1858  return clough_raw_shape(2, p)
1859  + d3d1n * clough_raw_shape(9, p)
1860  + d3d2n * clough_raw_shape(10, p);
1861  case 1:
1862  return d1xd1x * clough_raw_shape(3, p)
1863  + d1xd1y * clough_raw_shape(4, p)
1864  + d1xd2n * clough_raw_shape(10, p)
1865  + d1xd3n * clough_raw_shape(11, p)
1866  + 0.5 * N01x * d3nd3n * clough_raw_shape(11, p)
1867  + 0.5 * N02x * d2nd2n * clough_raw_shape(10, p);
1868  case 2:
1869  return d1yd1y * clough_raw_shape(4, p)
1870  + d1yd1x * clough_raw_shape(3, p)
1871  + d1yd2n * clough_raw_shape(10, p)
1872  + d1yd3n * clough_raw_shape(11, p)
1873  + 0.5 * N01y * d3nd3n * clough_raw_shape(11, p)
1874  + 0.5 * N02y * d2nd2n * clough_raw_shape(10, p);
1875  case 4:
1876  return d2xd2x * clough_raw_shape(5, p)
1877  + d2xd2y * clough_raw_shape(6, p)
1878  + d2xd3n * clough_raw_shape(11, p)
1879  + d2xd1n * clough_raw_shape(9, p)
1880  + 0.5 * N10x * d3nd3n * clough_raw_shape(11, p)
1881  + 0.5 * N12x * d1nd1n * clough_raw_shape(9, p);
1882  case 5:
1883  return d2yd2y * clough_raw_shape(6, p)
1884  + d2yd2x * clough_raw_shape(5, p)
1885  + d2yd3n * clough_raw_shape(11, p)
1886  + d2yd1n * clough_raw_shape(9, p)
1887  + 0.5 * N10y * d3nd3n * clough_raw_shape(11, p)
1888  + 0.5 * N12y * d1nd1n * clough_raw_shape(9, p);
1889  case 7:
1890  return d3xd3x * clough_raw_shape(7, p)
1891  + d3xd3y * clough_raw_shape(8, p)
1892  + d3xd1n * clough_raw_shape(9, p)
1893  + d3xd2n * clough_raw_shape(10, p)
1894  + 0.5 * N20x * d2nd2n * clough_raw_shape(10, p)
1895  + 0.5 * N21x * d1nd1n * clough_raw_shape(9, p);
1896  case 8:
1897  return d3yd3y * clough_raw_shape(8, p)
1898  + d3yd3x * clough_raw_shape(7, p)
1899  + d3yd1n * clough_raw_shape(9, p)
1900  + d3yd2n * clough_raw_shape(10, p)
1901  + 0.5 * N20y * d2nd2n * clough_raw_shape(10, p)
1902  + 0.5 * N21y * d1nd1n * clough_raw_shape(9, p);
1903  default:
1904  libmesh_error_msg("Invalid shape function index i = " << i);
1905  }
1906  }
1907  default:
1908  libmesh_error_msg("ERROR: Unsupported element type = " << type);
1909  }
1910  }
1911  // 3rd-order Clough-Tocher element
1912  case THIRD:
1913  {
1914  switch (type)
1915  {
1916  // C1 functions on the Clough-Tocher triangle.
1917  case TRI6:
1918  {
1919  libmesh_assert_less (i, 12);
1920 
1921  // FIXME: it would be nice to calculate (and cache)
1922  // clough_raw_shape(j,p) only once per triangle, not 1-7
1923  // times
1924  switch (i)
1925  {
1926  // Note: these DoF numbers are "scrambled" because my
1927  // initial numbering conventions didn't match libMesh
1928  case 0:
1929  return clough_raw_shape(0, p)
1930  + d1d2n * clough_raw_shape(10, p)
1931  + d1d3n * clough_raw_shape(11, p);
1932  case 3:
1933  return clough_raw_shape(1, p)
1934  + d2d3n * clough_raw_shape(11, p)
1935  + d2d1n * clough_raw_shape(9, p);
1936  case 6:
1937  return clough_raw_shape(2, p)
1938  + d3d1n * clough_raw_shape(9, p)
1939  + d3d2n * clough_raw_shape(10, p);
1940  case 1:
1941  return d1xd1x * clough_raw_shape(3, p)
1942  + d1xd1y * clough_raw_shape(4, p)
1943  + d1xd2n * clough_raw_shape(10, p)
1944  + d1xd3n * clough_raw_shape(11, p);
1945  case 2:
1946  return d1yd1y * clough_raw_shape(4, p)
1947  + d1yd1x * clough_raw_shape(3, p)
1948  + d1yd2n * clough_raw_shape(10, p)
1949  + d1yd3n * clough_raw_shape(11, p);
1950  case 4:
1951  return d2xd2x * clough_raw_shape(5, p)
1952  + d2xd2y * clough_raw_shape(6, p)
1953  + d2xd3n * clough_raw_shape(11, p)
1954  + d2xd1n * clough_raw_shape(9, p);
1955  case 5:
1956  return d2yd2y * clough_raw_shape(6, p)
1957  + d2yd2x * clough_raw_shape(5, p)
1958  + d2yd3n * clough_raw_shape(11, p)
1959  + d2yd1n * clough_raw_shape(9, p);
1960  case 7:
1961  return d3xd3x * clough_raw_shape(7, p)
1962  + d3xd3y * clough_raw_shape(8, p)
1963  + d3xd1n * clough_raw_shape(9, p)
1964  + d3xd2n * clough_raw_shape(10, p);
1965  case 8:
1966  return d3yd3y * clough_raw_shape(8, p)
1967  + d3yd3x * clough_raw_shape(7, p)
1968  + d3yd1n * clough_raw_shape(9, p)
1969  + d3yd2n * clough_raw_shape(10, p);
1970  case 10:
1971  return d1nd1n * clough_raw_shape(9, p);
1972  case 11:
1973  return d2nd2n * clough_raw_shape(10, p);
1974  case 9:
1975  return d3nd3n * clough_raw_shape(11, p);
1976 
1977  default:
1978  libmesh_error_msg("Invalid shape function index i = " << i);
1979  }
1980  }
1981  default:
1982  libmesh_error_msg("ERROR: Unsupported element type = " << type);
1983  }
1984  }
1985  // by default throw an error
1986  default:
1987  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
1988  }
1989 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape_deriv() [1/109]

Real libMesh::FE< 1, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 47 of file fe_scalar_shape_1D.C.

52 {
53  return 0.;
54 }

◆ shape_deriv() [2/109]

Real libMesh::FE< 0, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 47 of file fe_scalar_shape_0D.C.

52 {
53  return 0.;
54 }

◆ shape_deriv() [3/109]

Real libMesh::FE< 3, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 47 of file fe_scalar_shape_3D.C.

52 {
53  return 0.;
54 }

◆ shape_deriv() [4/109]

Real libMesh::FE< 2, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 48 of file fe_scalar_shape_2D.C.

53 {
54  return 0.;
55 }

◆ shape_deriv() [5/109]

Real libMesh::FE< 3, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 55 of file fe_szabab_shape_3D.C.

60 {
61  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
62  return 0.;
63 }

◆ shape_deriv() [6/109]

Real libMesh::FE< 0, L2_LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_l2_lagrange_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [7/109]

Real libMesh::FE< 0, LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_lagrange_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [8/109]

Real libMesh::FE< 0, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_xyz_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [9/109]

Real libMesh::FE< 0, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_szabab_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [10/109]

Real libMesh::FE< 0, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_monomial_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [11/109]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_l2_hierarchic_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [12/109]

Real libMesh::FE< 0, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_hierarchic_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [13/109]

Real libMesh::FE< 0, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_bernstein_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [14/109]

Real libMesh::FE< 0, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_hermite_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [15/109]

Real libMesh::FE< 0, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 56 of file fe_clough_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }

◆ shape_deriv() [16/109]

Real libMesh::FE< 0, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 57 of file fe_scalar_shape_0D.C.

62 {
63  return 0.;
64 }

◆ shape_deriv() [17/109]

Real libMesh::FE< 1, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 57 of file fe_scalar_shape_1D.C.

62 {
63  return 0.;
64 }

◆ shape_deriv() [18/109]

Real libMesh::FE< 3, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 57 of file fe_scalar_shape_3D.C.

62 {
63  return 0.;
64 }

◆ shape_deriv() [19/109]

Real libMesh::FE< 2, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 58 of file fe_scalar_shape_2D.C.

63 {
64  return 0.;
65 }

◆ shape_deriv() [20/109]

Real libMesh::FE< 3, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 59 of file fe_clough_shape_3D.C.

64 {
65  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
66  return 0.;
67 }

◆ shape_deriv() [21/109]

Real libMesh::FE< 3, SZABAB >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 68 of file fe_szabab_shape_3D.C.

73 {
74  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
75  return 0.;
76 }

◆ shape_deriv() [22/109]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_l2_hierarchic_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [23/109]

Real libMesh::FE< 0, LAGRANGE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_lagrange_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [24/109]

Real libMesh::FE< 0, L2_LAGRANGE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_l2_lagrange_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [25/109]

Real libMesh::FE< 0, MONOMIAL >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_monomial_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [26/109]

Real libMesh::FE< 0, XYZ >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_xyz_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [27/109]

Real libMesh::FE< 0, SZABAB >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_szabab_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [28/109]

Real libMesh::FE< 0, BERNSTEIN >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_bernstein_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [29/109]

Real libMesh::FE< 0, HIERARCHIC >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_hierarchic_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [30/109]

Real libMesh::FE< 0, HERMITE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_hermite_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [31/109]

Real libMesh::FE< 0, CLOUGH >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_clough_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }

◆ shape_deriv() [32/109]

Real libMesh::FE< 3, CLOUGH >::shape_deriv ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 72 of file fe_clough_shape_3D.C.

77 {
78  libmesh_assert(elem);
79  libmesh_not_implemented();
80  return 0.;
81 }

◆ shape_deriv() [33/109]

Real libMesh::FE< 1, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 83 of file fe_monomial_shape_1D.C.

88 {
89  // only d()/dxi in 1D!
90 
91  libmesh_assert_equal_to (j, 0);
92 
93  const Real xi = p(0);
94 
95  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
96 
97  // monomials. since they are hierarchic we only need one case block.
98  switch (i)
99  {
100  case 0:
101  return 0.;
102 
103  case 1:
104  return 1.;
105 
106  case 2:
107  return 2.*xi;
108 
109  case 3:
110  return 3.*xi*xi;
111 
112  case 4:
113  return 4.*xi*xi*xi;
114 
115  default:
116  Real val = i;
117  for (unsigned int index = 1; index != i; ++index)
118  val *= xi;
119  return val;
120  }
121 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [34/109]

Real libMesh::FE< 1, SZABAB >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 92 of file fe_szabab_shape_1D.C.

97 {
98  // only d()/dxi in 1D!
99  libmesh_assert_equal_to (j, 0);
100 
101  const Real xi = p(0);
102  const Real xi2 = xi*xi;
103 
104  // Use this libmesh_assert rather than a switch with a single entry...
105  // It will go away in optimized mode, essentially has the same effect.
106  libmesh_assert_less_equal (order, SEVENTH);
107 
108  // switch (order)
109  // {
110  // case FIRST:
111  // case SECOND:
112  // case THIRD:
113  // case FOURTH:
114  // case FIFTH:
115  // case SIXTH:
116  // case SEVENTH:
117 
118  switch(i)
119  {
120  case 0:return -1./2.;
121  case 1:return 1./2.;
122  case 2:return 1./2.*2.4494897427831780982*xi;
123  case 3:return -1./4.*3.1622776601683793320+3./4.*3.1622776601683793320*xi2;
124  case 4:return 1./16.*3.7416573867739413856*(-12.+20*xi2)*xi;
125  case 5:return 9./16.*1.4142135623730950488+(-45./8.*1.4142135623730950488+105./16.*1.4142135623730950488*xi2)*xi2;
126  case 6:return 1./32.*4.6904157598234295546*(30.+(-140.+126.*xi2)*xi2)*xi;
127  case 7:return -5./32.*5.0990195135927848300+(105./32.*5.0990195135927848300+(-315./32.*5.0990195135927848300+231./32.*5.0990195135927848300*xi2)*xi2)*xi2;
128  case 8:return 1./256.*5.4772255750516611346*(-280.+(2520.+(-5544.+3432.*xi2)*xi2)*xi2)*xi;
129 
130  default:
131  libmesh_error_msg("Invalid shape function index!");
132  }
133 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [35/109]

Real libMesh::FE< 1, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 93 of file fe_xyz_shape_1D.C.

98 {
99  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
100  return 0.;
101 }

◆ shape_deriv() [36/109]

Real libMesh::FE< 1, XYZ >::shape_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point point_in 
)
inherited

Definition at line 106 of file fe_xyz_shape_1D.C.

111 {
112  libmesh_assert(elem);
113  libmesh_assert_less_equal (i, order + elem->p_level());
114 
115  // only d()/dxi in 1D!
116 
117  libmesh_assert_equal_to (j, 0);
118 
119  Point centroid = elem->centroid();
120  Real max_distance = 0.;
121  for (unsigned int p = 0; p < elem->n_nodes(); p++)
122  {
123  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
124  max_distance = std::max(distance, max_distance);
125  }
126 
127  const Real x = point_in(0);
128  const Real xc = centroid(0);
129  const Real dx = (x - xc)/max_distance;
130 
131  // monomials. since they are hierarchic we only need one case block.
132  switch (i)
133  {
134  case 0:
135  return 0.;
136 
137  case 1:
138  return 1.;
139 
140  case 2:
141  return 2.*dx/max_distance;
142 
143  case 3:
144  return 3.*dx*dx/max_distance;
145 
146  case 4:
147  return 4.*dx*dx*dx/max_distance;
148 
149  default:
150  Real val = i;
151  for (unsigned int index = 1; index != i; ++index)
152  val *= dx;
153  return val/max_distance;
154  }
155 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [37/109]

Real libMesh::FE< 1, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 114 of file fe_hierarchic_shape_1D.C.

119 {
120  // only d()/dxi in 1D!
121 
122  libmesh_assert_equal_to (j, 0);
123  libmesh_assert_less (i, order+1u);
124 
125  // Declare that we are using our own special power function
126  // from the Utility namespace. This saves typing later.
127  using Utility::pow;
128 
129  const Real xi = p(0);
130 
131  Real returnval = 1.;
132 
133  switch (i)
134  {
135  case 0:
136  returnval = -.5;
137  break;
138  case 1:
139  returnval = .5;
140  break;
141  // All even-terms have the same form.
142  // xi^(p-1)/(p-1)!
143  case 2:
144  returnval = xi;
145  break;
146  case 4:
147  returnval = pow<3>(xi)/6.;
148  break;
149  case 6:
150  returnval = pow<5>(xi)/120.;
151  break;
152  // All odd-terms have the same form.
153  // (p*xi^(p-1) - 1.)/p!
154  case 3:
155  returnval = (3*xi*xi - 1.)/6.;
156  break;
157  case 5:
158  returnval = (5.*pow<4>(xi) - 1.)/120.;
159  break;
160  case 7:
161  returnval = (7.*pow<6>(xi) - 1.)/5040.;
162  break;
163  default:
164  Real denominator = 1.;
165  for (unsigned int n=1; n != i; ++n)
166  {
167  returnval *= xi;
168  denominator *= n;
169  }
170  // Odd:
171  if (i % 2)
172  returnval = (i * returnval - 1.)/denominator/i;
173  // Even:
174  else
175  returnval = returnval/denominator;
176  break;
177  }
178 
179  return returnval;
180 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [38/109]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 114 of file fe_l2_hierarchic_shape_1D.C.

119 {
120  // only d()/dxi in 1D!
121 
122  libmesh_assert_equal_to (j, 0);
123  libmesh_assert_less (i, order+1u);
124 
125  // Declare that we are using our own special power function
126  // from the Utility namespace. This saves typing later.
127  using Utility::pow;
128 
129  const Real xi = p(0);
130 
131  Real returnval = 1.;
132 
133  switch (i)
134  {
135  case 0:
136  returnval = -.5;
137  break;
138  case 1:
139  returnval = .5;
140  break;
141  // All even-terms have the same form.
142  // xi^(p-1)/(p-1)!
143  case 2:
144  returnval = xi;
145  break;
146  case 4:
147  returnval = pow<3>(xi)/6.;
148  break;
149  case 6:
150  returnval = pow<5>(xi)/120.;
151  break;
152  // All odd-terms have the same form.
153  // (p*xi^(p-1) - 1.)/p!
154  case 3:
155  returnval = (3*xi*xi - 1.)/6.;
156  break;
157  case 5:
158  returnval = (5.*pow<4>(xi) - 1.)/120.;
159  break;
160  case 7:
161  returnval = (7.*pow<6>(xi) - 1.)/5040.;
162  break;
163  default:
164  Real denominator = 1.;
165  for (unsigned int n=1; n != i; ++n)
166  {
167  returnval *= xi;
168  denominator *= n;
169  }
170  // Odd:
171  if (i % 2)
172  returnval = (i * returnval - 1.)/denominator/i;
173  // Even:
174  else
175  returnval = returnval/denominator;
176  break;
177  }
178 
179  return returnval;
180 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [39/109]

Real libMesh::FE< 1, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 126 of file fe_monomial_shape_1D.C.

131 {
132  libmesh_assert(elem);
133 
134  return FE<1,MONOMIAL>::shape_deriv(elem->type(),
135  static_cast<Order>(order + elem->p_level()), i, j, p);
136 }

◆ shape_deriv() [40/109]

Real libMesh::FE< 1, L2_LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 130 of file fe_l2_lagrange_shape_1D.C.

135 {
136  // only d()/dxi in 1D!
137 
138  libmesh_assert_equal_to (j, 0);
139 
140  const Real xi = p(0);
141 
142 
143  switch (order)
144  {
145  // Lagrange linear shape function derivatives
146  case FIRST:
147  {
148  libmesh_assert_less (i, 2);
149 
150  switch (i)
151  {
152  case 0:
153  return -.5;
154 
155  case 1:
156  return .5;
157 
158  default:
159  libmesh_error_msg("Invalid shape function index i = " << i);
160  }
161  }
162 
163 
164  // Lagrange quadratic shape function derivatives
165  case SECOND:
166  {
167  libmesh_assert_less (i, 3);
168 
169  switch (i)
170  {
171  case 0:
172  return xi-.5;
173 
174  case 1:
175  return xi+.5;
176 
177  case 2:
178  return -2.*xi;
179 
180  default:
181  libmesh_error_msg("Invalid shape function index i = " << i);
182  }
183  }
184 
185 
186  // Lagrange cubic shape function derivatives
187  case THIRD:
188  {
189  libmesh_assert_less (i, 4);
190 
191  switch (i)
192  {
193  case 0:
194  return -9./16.*(3.*xi*xi-2.*xi-1./9.);
195 
196  case 1:
197  return -9./16.*(-3.*xi*xi-2.*xi+1./9.);
198 
199  case 2:
200  return 27./16.*(3.*xi*xi-2./3.*xi-1.);
201 
202  case 3:
203  return 27./16.*(-3.*xi*xi-2./3.*xi+1.);
204 
205  default:
206  libmesh_error_msg("Invalid shape function index i = " << i);
207  }
208  }
209 
210 
211  default:
212  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
213  }
214 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [41/109]

Real libMesh::FE< 1, LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 130 of file fe_lagrange_shape_1D.C.

135 {
136  // only d()/dxi in 1D!
137 
138  libmesh_assert_equal_to (j, 0);
139 
140  const Real xi = p(0);
141 
142 
143  switch (order)
144  {
145  // Lagrange linear shape function derivatives
146  case FIRST:
147  {
148  libmesh_assert_less (i, 2);
149 
150  switch (i)
151  {
152  case 0:
153  return -.5;
154 
155  case 1:
156  return .5;
157 
158  default:
159  libmesh_error_msg("Invalid shape function index i = " << i);
160  }
161  }
162 
163 
164  // Lagrange quadratic shape function derivatives
165  case SECOND:
166  {
167  libmesh_assert_less (i, 3);
168 
169  switch (i)
170  {
171  case 0:
172  return xi-.5;
173 
174  case 1:
175  return xi+.5;
176 
177  case 2:
178  return -2.*xi;
179 
180  default:
181  libmesh_error_msg("Invalid shape function index i = " << i);
182  }
183  }
184 
185 
186  // Lagrange cubic shape function derivatives
187  case THIRD:
188  {
189  libmesh_assert_less (i, 4);
190 
191  switch (i)
192  {
193  case 0:
194  return -9./16.*(3.*xi*xi-2.*xi-1./9.);
195 
196  case 1:
197  return -9./16.*(-3.*xi*xi-2.*xi+1./9.);
198 
199  case 2:
200  return 27./16.*(3.*xi*xi-2./3.*xi-1.);
201 
202  case 3:
203  return 27./16.*(-3.*xi*xi-2./3.*xi+1.);
204 
205  default:
206  libmesh_error_msg("Invalid shape function index i = " << i);
207  }
208  }
209 
210 
211  default:
212  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
213  }
214 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [42/109]

Real libMesh::FE< 2, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 132 of file fe_monomial_shape_2D.C.

137 {
138 #if LIBMESH_DIM > 1
139 
140 
141  libmesh_assert_less (j, 2);
142 
143  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
144  (static_cast<unsigned int>(order)+2)/2);
145 
146  const Real xi = p(0);
147  const Real eta = p(1);
148 
149  // monomials. since they are hierarchic we only need one case block.
150 
151  switch (j)
152  {
153  // d()/dxi
154  case 0:
155  {
156  switch (i)
157  {
158  // constants
159  case 0:
160  return 0.;
161 
162  // linears
163  case 1:
164  return 1.;
165 
166  case 2:
167  return 0.;
168 
169  // quadratics
170  case 3:
171  return 2.*xi;
172 
173  case 4:
174  return eta;
175 
176  case 5:
177  return 0.;
178 
179  // cubics
180  case 6:
181  return 3.*xi*xi;
182 
183  case 7:
184  return 2.*xi*eta;
185 
186  case 8:
187  return eta*eta;
188 
189  case 9:
190  return 0.;
191 
192  // quartics
193  case 10:
194  return 4.*xi*xi*xi;
195 
196  case 11:
197  return 3.*xi*xi*eta;
198 
199  case 12:
200  return 2.*xi*eta*eta;
201 
202  case 13:
203  return eta*eta*eta;
204 
205  case 14:
206  return 0.;
207 
208  default:
209  unsigned int o = 0;
210  for (; i >= (o+1)*(o+2)/2; o++) { }
211  unsigned int ny = i - (o*(o+1)/2);
212  unsigned int nx = o - ny;
213  Real val = nx;
214  for (unsigned int index=1; index < nx; index++)
215  val *= xi;
216  for (unsigned int index=0; index != ny; index++)
217  val *= eta;
218  return val;
219  }
220  }
221 
222 
223  // d()/deta
224  case 1:
225  {
226  switch (i)
227  {
228  // constants
229  case 0:
230  return 0.;
231 
232  // linears
233  case 1:
234  return 0.;
235 
236  case 2:
237  return 1.;
238 
239  // quadratics
240  case 3:
241  return 0.;
242 
243  case 4:
244  return xi;
245 
246  case 5:
247  return 2.*eta;
248 
249  // cubics
250  case 6:
251  return 0.;
252 
253  case 7:
254  return xi*xi;
255 
256  case 8:
257  return 2.*xi*eta;
258 
259  case 9:
260  return 3.*eta*eta;
261 
262  // quartics
263  case 10:
264  return 0.;
265 
266  case 11:
267  return xi*xi*xi;
268 
269  case 12:
270  return 2.*xi*xi*eta;
271 
272  case 13:
273  return 3.*xi*eta*eta;
274 
275  case 14:
276  return 4.*eta*eta*eta;
277 
278  default:
279  unsigned int o = 0;
280  for (; i >= (o+1)*(o+2)/2; o++) { }
281  unsigned int ny = i - (o*(o+1)/2);
282  unsigned int nx = o - ny;
283  Real val = ny;
284  for (unsigned int index=0; index != nx; index++)
285  val *= xi;
286  for (unsigned int index=1; index < ny; index++)
287  val *= eta;
288  return val;
289  }
290  }
291 
292  default:
293  libmesh_error_msg("Invalid shape function derivative j = " << j);
294  }
295 
296 #else
297  return 0.;
298 #endif
299 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [43/109]

static OutputShape libMesh::FE< Dim, T >::shape_deriv ( const ElemType  t,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
staticinherited
Returns
The $ j^{th} $ derivative of the $ i^{th} $ shape function at point p. This method allows you to specify the dimension, element type, and order directly.

On a p-refined element, o should be the total order of the element.

◆ shape_deriv() [44/109]

Real libMesh::FE< 1, SZABAB >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 138 of file fe_szabab_shape_1D.C.

143 {
144  libmesh_assert(elem);
145 
146  return FE<1,SZABAB>::shape_deriv(elem->type(),
147  static_cast<Order>(order + elem->p_level()), i, j, p);
148 }

◆ shape_deriv() [45/109]

static OutputShape libMesh::FE< Dim, T >::shape_deriv ( const Elem elem,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
staticinherited
Returns
The $ j^{th} $ derivative of the $ i^{th} $ shape function. You must specify element type, and order directly.

On a p-refined element, o should be the base order of the element.

◆ shape_deriv() [46/109]

Real libMesh::FE< 2, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 152 of file fe_xyz_shape_2D.C.

157 {
158  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
159  return 0.;
160 }

◆ shape_deriv() [47/109]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 165 of file fe_nedelec_one_shape_2D.C.

170 {
171  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
172  return RealGradient();
173 }
RealVectorValue RealGradient

◆ shape_deriv() [48/109]

Real libMesh::FE< 2, XYZ >::shape_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)
inherited

Definition at line 165 of file fe_xyz_shape_2D.C.

170 {
171 #if LIBMESH_DIM > 1
172 
173 
174  libmesh_assert_less (j, 2);
175  libmesh_assert(elem);
176 
177  Point centroid = elem->centroid();
178  Point max_distance = Point(0.,0.,0.);
179  for (unsigned int p = 0; p < elem->n_nodes(); p++)
180  for (unsigned int d = 0; d < 2; d++)
181  {
182  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
183  max_distance(d) = std::max(distance, max_distance(d));
184  }
185 
186  const Real x = point_in(0);
187  const Real y = point_in(1);
188  const Real xc = centroid(0);
189  const Real yc = centroid(1);
190  const Real distx = max_distance(0);
191  const Real disty = max_distance(1);
192  const Real dx = (x - xc)/distx;
193  const Real dy = (y - yc)/disty;
194 
195 #ifndef NDEBUG
196  // totalorder is only used in the assertion below, so
197  // we avoid declaring it when asserts are not active.
198  const unsigned int totalorder = order + elem->p_level();
199 #endif
200  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
201 
202  // monomials. since they are hierarchic we only need one case block.
203 
204  switch (j)
205  {
206  // d()/dx
207  case 0:
208  {
209  switch (i)
210  {
211  // constants
212  case 0:
213  return 0.;
214 
215  // linears
216  case 1:
217  return 1./distx;
218 
219  case 2:
220  return 0.;
221 
222  // quadratics
223  case 3:
224  return 2.*dx/distx;
225 
226  case 4:
227  return dy/distx;
228 
229  case 5:
230  return 0.;
231 
232  // cubics
233  case 6:
234  return 3.*dx*dx/distx;
235 
236  case 7:
237  return 2.*dx*dy/distx;
238 
239  case 8:
240  return dy*dy/distx;
241 
242  case 9:
243  return 0.;
244 
245  // quartics
246  case 10:
247  return 4.*dx*dx*dx/distx;
248 
249  case 11:
250  return 3.*dx*dx*dy/distx;
251 
252  case 12:
253  return 2.*dx*dy*dy/distx;
254 
255  case 13:
256  return dy*dy*dy/distx;
257 
258  case 14:
259  return 0.;
260 
261  default:
262  unsigned int o = 0;
263  for (; i >= (o+1)*(o+2)/2; o++) { }
264  unsigned int i2 = i - (o*(o+1)/2);
265  Real val = o - i2;
266  for (unsigned int index=i2+1; index < o; index++)
267  val *= dx;
268  for (unsigned int index=0; index != i2; index++)
269  val *= dy;
270  return val/distx;
271  }
272  }
273 
274 
275  // d()/dy
276  case 1:
277  {
278  switch (i)
279  {
280  // constants
281  case 0:
282  return 0.;
283 
284  // linears
285  case 1:
286  return 0.;
287 
288  case 2:
289  return 1./disty;
290 
291  // quadratics
292  case 3:
293  return 0.;
294 
295  case 4:
296  return dx/disty;
297 
298  case 5:
299  return 2.*dy/disty;
300 
301  // cubics
302  case 6:
303  return 0.;
304 
305  case 7:
306  return dx*dx/disty;
307 
308  case 8:
309  return 2.*dx*dy/disty;
310 
311  case 9:
312  return 3.*dy*dy/disty;
313 
314  // quartics
315  case 10:
316  return 0.;
317 
318  case 11:
319  return dx*dx*dx/disty;
320 
321  case 12:
322  return 2.*dx*dx*dy/disty;
323 
324  case 13:
325  return 3.*dx*dy*dy/disty;
326 
327  case 14:
328  return 4.*dy*dy*dy/disty;
329 
330  default:
331  unsigned int o = 0;
332  for (; i >= (o+1)*(o+2)/2; o++) { }
333  unsigned int i2 = i - (o*(o+1)/2);
334  Real val = i2;
335  for (unsigned int index=i2; index != o; index++)
336  val *= dx;
337  for (unsigned int index=1; index <= i2; index++)
338  val *= dy;
339  return val/disty;
340  }
341  }
342 
343 
344  default:
345  libmesh_error_msg("Invalid j = " << j);
346  }
347 
348 #else
349  return 0.;
350 #endif
351 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [49/109]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point  
)
inherited

Definition at line 178 of file fe_nedelec_one_shape_2D.C.

183 {
184 #if LIBMESH_DIM > 1
185  libmesh_assert(elem);
186  libmesh_assert_less (j, 2);
187 
188  const Order total_order = static_cast<Order>(order + elem->p_level());
189 
190  switch (total_order)
191  {
192  // linear Lagrange shape functions
193  case FIRST:
194  {
195  switch (elem->type())
196  {
197  case QUAD8:
198  case QUAD9:
199  {
200  libmesh_assert_less (i, 4);
201 
202  switch (j)
203  {
204  // d()/dxi
205  case 0:
206  {
207  switch(i)
208  {
209  case 0:
210  case 2:
211  return RealGradient();
212  case 1:
213  {
214  if (elem->point(1) > elem->point(2))
215  return RealGradient( 0.0, -0.25 );
216  else
217  return RealGradient( 0.0, 0.25 );
218  }
219  case 3:
220  {
221  if (elem->point(3) > elem->point(0))
222  return RealGradient( 0.0, -0.25 );
223  else
224  return RealGradient( 0.0, 0.25 );
225  }
226  default:
227  libmesh_error_msg("Invalid i = " << i);
228  }
229  } // j=0
230 
231  // d()/deta
232  case 1:
233  {
234  switch(i)
235  {
236  case 1:
237  case 3:
238  return RealGradient();
239  case 0:
240  {
241  if (elem->point(0) > elem->point(1))
242  return RealGradient( 0.25 );
243  else
244  return RealGradient( -0.25 );
245  }
246  case 2:
247  {
248  if (elem->point(2) > elem->point(3))
249  return RealGradient( 0.25 );
250  else
251  return RealGradient( -0.25 );
252  }
253  default:
254  libmesh_error_msg("Invalid i = " << i);
255  }
256  } // j=1
257 
258  default:
259  libmesh_error_msg("Invalid j = " << j);
260  }
261 
262  return RealGradient();
263  }
264 
265  case TRI6:
266  {
267  libmesh_assert_less (i, 3);
268 
269  // Account for edge flipping
270  Real f = 1.0;
271 
272  switch(i)
273  {
274  case 0:
275  {
276  if (elem->point(0) > elem->point(1))
277  f = -1.0;
278  break;
279  }
280  case 1:
281  {
282  if (elem->point(1) > elem->point(2))
283  f = -1.0;
284  break;
285  }
286  case 2:
287  {
288  if (elem->point(2) > elem->point(0))
289  f = -1.0;
290  break;
291  }
292  default:
293  libmesh_error_msg("Invalid i = " << i);
294  }
295 
296  switch (j)
297  {
298  // d()/dxi
299  case 0:
300  {
301  return RealGradient( 0.0, f*1.0);
302  }
303  // d()/deta
304  case 1:
305  {
306  return RealGradient( f*(-1.0) );
307  }
308  default:
309  libmesh_error_msg("Invalid j = " << j);
310  }
311  }
312 
313  default:
314  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
315  }
316  }
317  // unsupported order
318  default:
319  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
320  }
321 #else // LIBMESH_DIM > 1
322  return RealGradient();
323 #endif
324 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [50/109]

Real libMesh::FE< 1, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 185 of file fe_hierarchic_shape_1D.C.

190 {
191  libmesh_assert(elem);
192 
193  return FE<1,HIERARCHIC>::shape_deriv(elem->type(),
194  static_cast<Order>(order + elem->p_level()), i, j, p);
195 }

◆ shape_deriv() [51/109]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 185 of file fe_l2_hierarchic_shape_1D.C.

190 {
191  libmesh_assert(elem);
192 
193  return FE<1,L2_HIERARCHIC>::shape_deriv(elem->type(),
194  static_cast<Order>(order + elem->p_level()), i, j, p);
195 }

◆ shape_deriv() [52/109]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 194 of file fe_nedelec_one_shape_3D.C.

199 {
200  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
201  return RealGradient();
202 }
RealVectorValue RealGradient

◆ shape_deriv() [53/109]

Real libMesh::FE< 3, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 200 of file fe_monomial_shape_3D.C.

205 {
206 #if LIBMESH_DIM == 3
207 
208  libmesh_assert_less (j, 3);
209 
210  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
211  (static_cast<unsigned int>(order)+2)*
212  (static_cast<unsigned int>(order)+3)/6);
213 
214 
215  const Real xi = p(0);
216  const Real eta = p(1);
217  const Real zeta = p(2);
218 
219  // monomials. since they are hierarchic we only need one case block.
220  switch (j)
221  {
222  // d()/dxi
223  case 0:
224  {
225  switch (i)
226  {
227  // constant
228  case 0:
229  return 0.;
230 
231  // linear
232  case 1:
233  return 1.;
234 
235  case 2:
236  return 0.;
237 
238  case 3:
239  return 0.;
240 
241  // quadratic
242  case 4:
243  return 2.*xi;
244 
245  case 5:
246  return eta;
247 
248  case 6:
249  return 0.;
250 
251  case 7:
252  return zeta;
253 
254  case 8:
255  return 0.;
256 
257  case 9:
258  return 0.;
259 
260  // cubic
261  case 10:
262  return 3.*xi*xi;
263 
264  case 11:
265  return 2.*xi*eta;
266 
267  case 12:
268  return eta*eta;
269 
270  case 13:
271  return 0.;
272 
273  case 14:
274  return 2.*xi*zeta;
275 
276  case 15:
277  return eta*zeta;
278 
279  case 16:
280  return 0.;
281 
282  case 17:
283  return zeta*zeta;
284 
285  case 18:
286  return 0.;
287 
288  case 19:
289  return 0.;
290 
291  // quartics
292  case 20:
293  return 4.*xi*xi*xi;
294 
295  case 21:
296  return 3.*xi*xi*eta;
297 
298  case 22:
299  return 2.*xi*eta*eta;
300 
301  case 23:
302  return eta*eta*eta;
303 
304  case 24:
305  return 0.;
306 
307  case 25:
308  return 3.*xi*xi*zeta;
309 
310  case 26:
311  return 2.*xi*eta*zeta;
312 
313  case 27:
314  return eta*eta*zeta;
315 
316  case 28:
317  return 0.;
318 
319  case 29:
320  return 2.*xi*zeta*zeta;
321 
322  case 30:
323  return eta*zeta*zeta;
324 
325  case 31:
326  return 0.;
327 
328  case 32:
329  return zeta*zeta*zeta;
330 
331  case 33:
332  return 0.;
333 
334  case 34:
335  return 0.;
336 
337  default:
338  unsigned int o = 0;
339  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
340  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
341  unsigned int block=o, nz = 0;
342  for (; block < i2; block += (o-nz+1)) { nz++; }
343  const unsigned int nx = block - i2;
344  const unsigned int ny = o - nx - nz;
345  Real val = nx;
346  for (unsigned int index=1; index < nx; index++)
347  val *= xi;
348  for (unsigned int index=0; index != ny; index++)
349  val *= eta;
350  for (unsigned int index=0; index != nz; index++)
351  val *= zeta;
352  return val;
353  }
354  }
355 
356 
357  // d()/deta
358  case 1:
359  {
360  switch (i)
361  {
362  // constant
363  case 0:
364  return 0.;
365 
366  // linear
367  case 1:
368  return 0.;
369 
370  case 2:
371  return 1.;
372 
373  case 3:
374  return 0.;
375 
376  // quadratic
377  case 4:
378  return 0.;
379 
380  case 5:
381  return xi;
382 
383  case 6:
384  return 2.*eta;
385 
386  case 7:
387  return 0.;
388 
389  case 8:
390  return zeta;
391 
392  case 9:
393  return 0.;
394 
395  // cubic
396  case 10:
397  return 0.;
398 
399  case 11:
400  return xi*xi;
401 
402  case 12:
403  return 2.*xi*eta;
404 
405  case 13:
406  return 3.*eta*eta;
407 
408  case 14:
409  return 0.;
410 
411  case 15:
412  return xi*zeta;
413 
414  case 16:
415  return 2.*eta*zeta;
416 
417  case 17:
418  return 0.;
419 
420  case 18:
421  return zeta*zeta;
422 
423  case 19:
424  return 0.;
425 
426  // quartics
427  case 20:
428  return 0.;
429 
430  case 21:
431  return xi*xi*xi;
432 
433  case 22:
434  return 2.*xi*xi*eta;
435 
436  case 23:
437  return 3.*xi*eta*eta;
438 
439  case 24:
440  return 4.*eta*eta*eta;
441 
442  case 25:
443  return 0.;
444 
445  case 26:
446  return xi*xi*zeta;
447 
448  case 27:
449  return 2.*xi*eta*zeta;
450 
451  case 28:
452  return 3.*eta*eta*zeta;
453 
454  case 29:
455  return 0.;
456 
457  case 30:
458  return xi*zeta*zeta;
459 
460  case 31:
461  return 2.*eta*zeta*zeta;
462 
463  case 32:
464  return 0.;
465 
466  case 33:
467  return zeta*zeta*zeta;
468 
469  case 34:
470  return 0.;
471 
472  default:
473  unsigned int o = 0;
474  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
475  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
476  unsigned int block=o, nz = 0;
477  for (; block < i2; block += (o-nz+1)) { nz++; }
478  const unsigned int nx = block - i2;
479  const unsigned int ny = o - nx - nz;
480  Real val = ny;
481  for (unsigned int index=0; index != nx; index++)
482  val *= xi;
483  for (unsigned int index=1; index < ny; index++)
484  val *= eta;
485  for (unsigned int index=0; index != nz; index++)
486  val *= zeta;
487  return val;
488  }
489  }
490 
491 
492  // d()/dzeta
493  case 2:
494  {
495  switch (i)
496  {
497  // constant
498  case 0:
499  return 0.;
500 
501  // linear
502  case 1:
503  return 0.;
504 
505  case 2:
506  return 0.;
507 
508  case 3:
509  return 1.;
510 
511  // quadratic
512  case 4:
513  return 0.;
514 
515  case 5:
516  return 0.;
517 
518  case 6:
519  return 0.;
520 
521  case 7:
522  return xi;
523 
524  case 8:
525  return eta;
526 
527  case 9:
528  return 2.*zeta;
529 
530  // cubic
531  case 10:
532  return 0.;
533 
534  case 11:
535  return 0.;
536 
537  case 12:
538  return 0.;
539 
540  case 13:
541  return 0.;
542 
543  case 14:
544  return xi*xi;
545 
546  case 15:
547  return xi*eta;
548 
549  case 16:
550  return eta*eta;
551 
552  case 17:
553  return 2.*xi*zeta;
554 
555  case 18:
556  return 2.*eta*zeta;
557 
558  case 19:
559  return 3.*zeta*zeta;
560 
561  // quartics
562  case 20:
563  return 0.;
564 
565  case 21:
566  return 0.;
567 
568  case 22:
569  return 0.;
570 
571  case 23:
572  return 0.;
573 
574  case 24:
575  return 0.;
576 
577  case 25:
578  return xi*xi*xi;
579 
580  case 26:
581  return xi*xi*eta;
582 
583  case 27:
584  return xi*eta*eta;
585 
586  case 28:
587  return eta*eta*eta;
588 
589  case 29:
590  return 2.*xi*xi*zeta;
591 
592  case 30:
593  return 2.*xi*eta*zeta;
594 
595  case 31:
596  return 2.*eta*eta*zeta;
597 
598  case 32:
599  return 3.*xi*zeta*zeta;
600 
601  case 33:
602  return 3.*eta*zeta*zeta;
603 
604  case 34:
605  return 4.*zeta*zeta*zeta;
606 
607  default:
608  unsigned int o = 0;
609  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
610  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
611  unsigned int block=o, nz = 0;
612  for (; block < i2; block += (o-nz+1)) { nz++; }
613  const unsigned int nx = block - i2;
614  const unsigned int ny = o - nx - nz;
615  Real val = nz;
616  for (unsigned int index=0; index != nx; index++)
617  val *= xi;
618  for (unsigned int index=0; index != ny; index++)
619  val *= eta;
620  for (unsigned int index=1; index < nz; index++)
621  val *= zeta;
622  return val;
623  }
624  }
625 
626  default:
627  libmesh_error_msg("Invalid shape function derivative j = " << j);
628  }
629 
630 #else
631  return 0.;
632 #endif
633 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [54/109]

Real libMesh::FE< 1, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 203 of file fe_bernstein_shape_1D.C.

208 {
209  // only d()/dxi in 1D!
210 
211  libmesh_assert_equal_to (j, 0);
212 
213  const Real xi = p(0);
214 
215  using Utility::pow;
216 
217  switch (order)
218  {
219  case FIRST:
220 
221  switch(i)
222  {
223  case 0:
224  return -.5;
225  case 1:
226  return .5;
227  default:
228  libmesh_error_msg("Invalid shape function index i = " << i);
229  }
230 
231  case SECOND:
232 
233  switch(i)
234  {
235  case 0:
236  return (xi-1.)*.5;
237  case 1:
238  return (xi+1.)*.5;
239  case 2:
240  return -xi;
241  default:
242  libmesh_error_msg("Invalid shape function index i = " << i);
243  }
244 
245  case THIRD:
246 
247  switch(i)
248  {
249  case 0:
250  return -0.375*pow<2>(1.-xi);
251  case 1:
252  return 0.375*pow<2>(1.+xi);
253  case 2:
254  return -0.375 -.75*xi +1.125*pow<2>(xi);
255  case 3:
256  return 0.375 -.75*xi -1.125*pow<2>(xi);
257  default:
258  libmesh_error_msg("Invalid shape function index i = " << i);
259  }
260 
261  case FOURTH:
262 
263  switch(i)
264  {
265  case 0:
266  return -0.25*pow<3>(1.-xi);
267  case 1:
268  return 0.25*pow<3>(1.+xi);
269  case 2:
270  return -0.5 +1.5*pow<2>(xi)-pow<3>(xi);
271  case 3:
272  return 1.5*(pow<3>(xi)-xi);
273  case 4:
274  return 0.5 -1.5*pow<2>(xi)-pow<3>(xi);
275  default:
276  libmesh_error_msg("Invalid shape function index i = " << i);
277  }
278 
279  case FIFTH:
280 
281  switch(i)
282  {
283  case 0:
284  return -(5./32.)*pow<4>(xi-1.);
285  case 1:
286  return (5./32.)*pow<4>(xi+1.);
287  case 2:
288  return (5./32.)*pow<4>(1.-xi) -(5./8.)*(1.+xi)*pow<3>(1.-xi);
289  case 3:
290  return (5./ 8.)*(1.+xi)*pow<3>(1.-xi) -(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
291  case 4:
292  return -(5./ 8.)*pow<3>(1.+xi)*(1.-xi) +(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
293  case 5:
294  return (5./ 8.)*pow<3>(1.+xi)*(1.-xi) -(5./32.)*pow<4>(1.+xi);
295  default:
296  libmesh_error_msg("Invalid shape function index i = " << i);
297  }
298 
299  case SIXTH:
300 
301  switch(i)
302  {
303  case 0:
304  return -( 3./32.)*pow<5>(1.-xi);
305  case 1:
306  return ( 3./32.)*pow<5>(1.+xi);
307  case 2:
308  return ( 3./32.)*pow<5>(1.-xi)-(15./32.)*(1.+xi)*pow<4>(1.-xi);
309  case 3:
310  return (15./32.)*(1.+xi)*pow<4>(1.-xi)-(15./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
311  case 4:
312  return -(15./ 8.)*xi +(15./4.)*pow<3>(xi)-(15./8.)*pow<5>(xi);
313  case 5:
314  return -(15./32.)*(1.-xi)*pow<4>(1.+xi)+(15./16.)*pow<2>(1.-xi)*pow<3>(1.+xi);
315  case 6:
316  return (15./32.)*pow<4>(1.+xi)*(1.-xi)-(3./32.)*pow<5>(1.+xi);
317  default:
318  libmesh_error_msg("Invalid shape function index i = " << i);
319  }
320 
321 
322  default:
323  {
324  libmesh_assert (order>6);
325 
326  // Use this for arbitrary orders
327  const int p_order = static_cast<int>(order);
328  const int m = p_order-(i-1);
329  const int n = (i-1);
330 
331  Real binomial_p_i = 1;
332 
333  // the binomial coefficient (p choose n)
334  // Using an unsigned long here will work for any of the orders we support.
335  // Explicitly construct a Real to prevent conversion warnings
336  if (i>1)
337  binomial_p_i = Real(Utility::binomial(static_cast<unsigned long>(p_order),
338  static_cast<unsigned long>(n)));
339 
340  switch(i)
341  {
342  case 0:
343  return binomial_p_i * (-1./2.) * p_order * std::pow((1-xi)/2, p_order-1);
344  case 1:
345  return binomial_p_i * ( 1./2.) * p_order * std::pow((1+xi)/2, p_order-1);
346 
347  default:
348  {
349  return binomial_p_i * (1./2. * n * std::pow((1+xi)/2,n-1) * std::pow((1-xi)/2,m)
350  - 1./2. * m * std::pow((1+xi)/2,n) * std::pow((1-xi)/2,m-1));
351  }
352  }
353  }
354 
355  }
356 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T binomial(T n, T k)
Definition: utility.h:224

◆ shape_deriv() [55/109]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 205 of file fe_nedelec_one_shape_3D.C.

210 {
211 #if LIBMESH_DIM == 3
212  libmesh_assert(elem);
213  libmesh_assert_less (j, 3);
214 
215  const Order totalorder = static_cast<Order>(order + elem->p_level());
216 
217  switch (totalorder)
218  {
219  case FIRST:
220  {
221  switch (elem->type())
222  {
223  case HEX20:
224  case HEX27:
225  {
226  libmesh_assert_less (i, 12);
227 
228  const Real xi = p(0);
229  const Real eta = p(1);
230  const Real zeta = p(2);
231 
232  // Even with a loose inverse_map tolerance we ought to
233  // be nearly on the element interior in master
234  // coordinates
235  libmesh_assert_less_equal ( std::fabs(xi), 1.0+TOLERANCE );
236  libmesh_assert_less_equal ( std::fabs(eta), 1.0+TOLERANCE );
237  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+TOLERANCE );
238 
239  switch (j)
240  {
241  // d()/dxi
242  case 0:
243  {
244  switch(i)
245  {
246  case 0:
247  case 2:
248  case 8:
249  case 10:
250  return RealGradient();
251  case 1:
252  {
253  if (elem->point(1) > elem->point(2))
254  return RealGradient( 0.0, -0.125*(1.0-zeta) );
255  else
256  return RealGradient( 0.0, 0.125*(1.0-zeta) );
257  }
258  case 3:
259  {
260  if (elem->point(3) > elem->point(0))
261  return RealGradient( 0.0, 0.125*(-1.0+zeta) );
262  else
263  return RealGradient( 0.0, -0.125*(-1.0+zeta) );
264  }
265  case 4:
266  {
267  if (elem->point(0) > elem->point(4))
268  return RealGradient( 0.0, 0.0, -0.125*(-1.0+eta) );
269  else
270  return RealGradient( 0.0, 0.0, 0.125*(-1.0+eta) );
271  }
272  case 5:
273  {
274  if (elem->point(1) > elem->point(5))
275  return RealGradient( 0.0, 0.0, -0.125*(1.0-eta) );
276  else
277  return RealGradient( 0.0, 0.0, 0.125*(1.0-eta) );
278  }
279  case 6:
280  {
281  if (elem->point(2) > elem->point(6))
282  return RealGradient( 0.0, 0.0, -0.125*(1.0+eta) );
283  else
284  return RealGradient( 0.0, 0.0, 0.125*(1.0+eta) );
285  }
286  case 7:
287  {
288  if (elem->point(3) > elem->point(7))
289  return RealGradient( 0.0, 0.0, -0.125*(-1.0-eta) );
290  else
291  return RealGradient( 0.0, 0.0, 0.125*(-1.0-eta) );
292  }
293  case 9:
294  {
295  if (elem->point(5) > elem->point(6))
296  return RealGradient( 0.0, -0.125*(1.0+zeta), 0.0 );
297  else
298  return RealGradient( 0.0, 0.125*(1.0+zeta), 0.0 );
299  }
300  case 11:
301  {
302  if (elem->point(4) > elem->point(7))
303  return RealGradient( 0.0, -0.125*(-1.0-zeta), 0.0 );
304  else
305  return RealGradient( 0.0, 0.125*(-1.0-zeta), 0.0 );
306  }
307  default:
308  libmesh_error_msg("Invalid i = " << i);
309  } // switch(i)
310 
311  } // j=0
312 
313  // d()/deta
314  case 1:
315  {
316  switch(i)
317  {
318  case 1:
319  case 3:
320  case 9:
321  case 11:
322  return RealGradient();
323  case 0:
324  {
325  if (elem->point(0) > elem->point(1))
326  return RealGradient( -0.125*(-1.0+zeta), 0.0, 0.0 );
327  else
328  return RealGradient( 0.125*(-1.0+zeta), 0.0, 0.0 );
329  }
330  case 2:
331  {
332  if (elem->point(2) > elem->point(3))
333  return RealGradient( 0.125*(1.0-zeta), 0.0, 0.0 );
334  else
335  return RealGradient( -0.125*(1.0-zeta), 0.0, 0.0 );
336  }
337  case 4:
338  {
339  if (elem->point(0) > elem->point(4))
340  return RealGradient( 0.0, 0.0, -0.125*(-1.0+xi) );
341  else
342  return RealGradient( 0.0, 0.0, 0.125*(-1.0+xi) );
343  }
344  case 5:
345  {
346  if (elem->point(1) > elem->point(5))
347  return RealGradient( 0.0, 0.0, -0.125*(-1.0-xi) );
348  else
349  return RealGradient( 0.0, 0.0, 0.125*(-1.0-xi) );
350  }
351  case 6:
352  {
353  if (elem->point(2) > elem->point(6))
354  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi) );
355  else
356  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi) );
357  }
358  case 7:
359  {
360  if (elem->point(3) > elem->point(7))
361  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi) );
362  else
363  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi) );
364  }
365  case 8:
366  {
367  if (elem->point(4) > elem->point(5))
368  return RealGradient( -0.125*(-1.0-zeta), 0.0, 0.0 );
369  else
370  return RealGradient( 0.125*(-1.0-zeta), 0.0, 0.0 );
371  }
372  case 10:
373  {
374  if (elem->point(7) > elem->point(6))
375  return RealGradient( -0.125*(1.0+zeta), 0.0, 0.0 );
376  else
377  return RealGradient( 0.125*(1.0+zeta), 0.0, 0.0 );
378  }
379  default:
380  libmesh_error_msg("Invalid i = " << i);
381  } // switch(i)
382 
383  } // j=1
384 
385  // d()/dzeta
386  case 2:
387  {
388  switch(i)
389  {
390  case 4:
391  case 5:
392  case 6:
393  case 7:
394  return RealGradient();
395 
396  case 0:
397  {
398  if (elem->point(0) > elem->point(1))
399  return RealGradient( -0.125*(-1.0+eta), 0.0, 0.0 );
400  else
401  return RealGradient( 0.125*(-1.0+eta), 0.0, 0.0 );
402  }
403  case 1:
404  {
405  if (elem->point(1) > elem->point(2))
406  return RealGradient( 0.0, -0.125*(-1.0-xi), 0.0 );
407  else
408  return RealGradient( 0.0, 0.125*(-1.0-xi), 0.0 );
409  }
410  case 2:
411  {
412  if (elem->point(2) > elem->point(3))
413  return RealGradient( 0.125*(-1.0-eta), 0.0, 0.0 );
414  else
415  return RealGradient( -0.125*(-1.0-eta), 0.0, 0.0 );
416  }
417  case 3:
418  {
419  if (elem->point(3) > elem->point(0))
420  return RealGradient( 0.0, 0.125*(-1.0+xi), 0.0 );
421  else
422  return RealGradient( 0.0, -0.125*(-1.0+xi), 0.0 );
423  }
424  case 8:
425  {
426  if (elem->point(4) > elem->point(5))
427  return RealGradient( -0.125*(1.0-eta), 0.0, 0.0 );
428  else
429  return RealGradient( 0.125*(1.0-eta), 0.0, 0.0 );
430  }
431  case 9:
432  {
433  if (elem->point(5) > elem->point(6))
434  return RealGradient( 0.0, -0.125*(1.0+xi), 0.0 );
435  else
436  return RealGradient( 0.0, 0.125*(1.0+xi), 0.0 );
437  }
438  case 10:
439  {
440  if (elem->point(7) > elem->point(6))
441  return RealGradient( -0.125*(1.0+eta), 0.0, 0.0 );
442  else
443  return RealGradient( 0.125*(1.0+eta), 0.0, 0.0 );
444  }
445  case 11:
446  {
447  if (elem->point(4) > elem->point(7))
448  return RealGradient( 0.0, -0.125*(1.0-xi), 0.0 );
449  else
450  return RealGradient( 0.0, 0.125*(1.0-xi), 0.0 );
451  }
452  default:
453  libmesh_error_msg("Invalid i = " << i);
454  } // switch(i)
455 
456  } // j = 2
457 
458  default:
459  libmesh_error_msg("Invalid j = " << j);
460  }
461 
462  return RealGradient();
463  }
464 
465  case TET10:
466  {
467  libmesh_assert_less (i, 6);
468 
469  libmesh_not_implemented();
470  return RealGradient();
471  }
472 
473  default:
474  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
475  }
476  }
477 
478  // unsupported order
479  default:
480  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
481  }
482 
483 #else
484  return RealGradient();
485 #endif
486 }
RealVectorValue RealGradient
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [56/109]

Real libMesh::FE< 1, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 219 of file fe_l2_lagrange_shape_1D.C.

224 {
225  libmesh_assert(elem);
226 
227  return FE<1,L2_LAGRANGE>::shape_deriv(elem->type(),
228  static_cast<Order>(order + elem->p_level()), i, j, p);
229 }

◆ shape_deriv() [57/109]

Real libMesh::FE< 1, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 219 of file fe_lagrange_shape_1D.C.

224 {
225  libmesh_assert(elem);
226 
227  return FE<1,LAGRANGE>::shape_deriv(elem->type(),
228  static_cast<Order>(order + elem->p_level()), i, j, p);
229 }

◆ shape_deriv() [58/109]

Real libMesh::FE< 2, L2_LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 222 of file fe_l2_lagrange_shape_2D.C.

227 {
228 #if LIBMESH_DIM > 1
229 
230 
231  libmesh_assert_less (j, 2);
232 
233  switch (order)
234  {
235  // linear Lagrange shape functions
236  case FIRST:
237  {
238  switch (type)
239  {
240  case QUAD4:
241  case QUADSHELL4:
242  case QUAD8:
243  case QUADSHELL8:
244  case QUAD9:
245  {
246  // Compute quad shape functions as a tensor-product
247  const Real xi = p(0);
248  const Real eta = p(1);
249 
250  libmesh_assert_less (i, 4);
251 
252  // 0 1 2 3
253  static const unsigned int i0[] = {0, 1, 1, 0};
254  static const unsigned int i1[] = {0, 0, 1, 1};
255 
256  switch (j)
257  {
258  // d()/dxi
259  case 0:
260  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
261  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta));
262 
263  // d()/deta
264  case 1:
265  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
266  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
267 
268  default:
269  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
270  }
271  }
272 
273  case TRI3:
274  case TRISHELL3:
275  case TRI6:
276  {
277  libmesh_assert_less (i, 3);
278 
279  const Real dzeta0dxi = -1.;
280  const Real dzeta1dxi = 1.;
281  const Real dzeta2dxi = 0.;
282 
283  const Real dzeta0deta = -1.;
284  const Real dzeta1deta = 0.;
285  const Real dzeta2deta = 1.;
286 
287  switch (j)
288  {
289  // d()/dxi
290  case 0:
291  {
292  switch(i)
293  {
294  case 0:
295  return dzeta0dxi;
296 
297  case 1:
298  return dzeta1dxi;
299 
300  case 2:
301  return dzeta2dxi;
302 
303  default:
304  libmesh_error_msg("Invalid shape function index i = " << i);
305  }
306  }
307  // d()/deta
308  case 1:
309  {
310  switch(i)
311  {
312  case 0:
313  return dzeta0deta;
314 
315  case 1:
316  return dzeta1deta;
317 
318  case 2:
319  return dzeta2deta;
320 
321  default:
322  libmesh_error_msg("Invalid shape function index i = " << i);
323  }
324  }
325  default:
326  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
327  }
328  }
329 
330  default:
331  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
332  }
333  }
334 
335 
336  // quadratic Lagrange shape functions
337  case SECOND:
338  {
339  switch (type)
340  {
341  case QUAD8:
342  case QUADSHELL8:
343  {
344  const Real xi = p(0);
345  const Real eta = p(1);
346 
347  libmesh_assert_less (i, 8);
348 
349  switch (j)
350  {
351  // d/dxi
352  case 0:
353  switch (i)
354  {
355  case 0:
356  return .25*(1. - eta)*((1. - xi)*(-1.) +
357  (-1.)*(-1. - xi - eta));
358 
359  case 1:
360  return .25*(1. - eta)*((1. + xi)*(1.) +
361  (1.)*(-1. + xi - eta));
362 
363  case 2:
364  return .25*(1. + eta)*((1. + xi)*(1.) +
365  (1.)*(-1. + xi + eta));
366 
367  case 3:
368  return .25*(1. + eta)*((1. - xi)*(-1.) +
369  (-1.)*(-1. - xi + eta));
370 
371  case 4:
372  return .5*(-2.*xi)*(1. - eta);
373 
374  case 5:
375  return .5*(1.)*(1. - eta*eta);
376 
377  case 6:
378  return .5*(-2.*xi)*(1. + eta);
379 
380  case 7:
381  return .5*(-1.)*(1. - eta*eta);
382 
383  default:
384  libmesh_error_msg("Invalid shape function index i = " << i);
385  }
386 
387  // d/deta
388  case 1:
389  switch (i)
390  {
391  case 0:
392  return .25*(1. - xi)*((1. - eta)*(-1.) +
393  (-1.)*(-1. - xi - eta));
394 
395  case 1:
396  return .25*(1. + xi)*((1. - eta)*(-1.) +
397  (-1.)*(-1. + xi - eta));
398 
399  case 2:
400  return .25*(1. + xi)*((1. + eta)*(1.) +
401  (1.)*(-1. + xi + eta));
402 
403  case 3:
404  return .25*(1. - xi)*((1. + eta)*(1.) +
405  (1.)*(-1. - xi + eta));
406 
407  case 4:
408  return .5*(1. - xi*xi)*(-1.);
409 
410  case 5:
411  return .5*(1. + xi)*(-2.*eta);
412 
413  case 6:
414  return .5*(1. - xi*xi)*(1.);
415 
416  case 7:
417  return .5*(1. - xi)*(-2.*eta);
418 
419  default:
420  libmesh_error_msg("Invalid shape function index i = " << i);
421  }
422 
423  default:
424  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
425  }
426  }
427 
428  case QUAD9:
429  {
430  // Compute quad shape functions as a tensor-product
431  const Real xi = p(0);
432  const Real eta = p(1);
433 
434  libmesh_assert_less (i, 9);
435 
436  // 0 1 2 3 4 5 6 7 8
437  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
438  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
439 
440  switch (j)
441  {
442  // d()/dxi
443  case 0:
444  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
445  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
446 
447  // d()/deta
448  case 1:
449  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
450  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
451 
452  default:
453  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
454  }
455  }
456 
457  case TRI6:
458  {
459  libmesh_assert_less (i, 6);
460 
461  const Real zeta1 = p(0);
462  const Real zeta2 = p(1);
463  const Real zeta0 = 1. - zeta1 - zeta2;
464 
465  const Real dzeta0dxi = -1.;
466  const Real dzeta1dxi = 1.;
467  const Real dzeta2dxi = 0.;
468 
469  const Real dzeta0deta = -1.;
470  const Real dzeta1deta = 0.;
471  const Real dzeta2deta = 1.;
472 
473  switch(j)
474  {
475  case 0:
476  {
477  switch(i)
478  {
479  case 0:
480  return (4.*zeta0-1.)*dzeta0dxi;
481 
482  case 1:
483  return (4.*zeta1-1.)*dzeta1dxi;
484 
485  case 2:
486  return (4.*zeta2-1.)*dzeta2dxi;
487 
488  case 3:
489  return 4.*zeta1*dzeta0dxi + 4.*zeta0*dzeta1dxi;
490 
491  case 4:
492  return 4.*zeta2*dzeta1dxi + 4.*zeta1*dzeta2dxi;
493 
494  case 5:
495  return 4.*zeta2*dzeta0dxi + 4*zeta0*dzeta2dxi;
496 
497  default:
498  libmesh_error_msg("Invalid shape function index i = " << i);
499  }
500  }
501 
502  case 1:
503  {
504  switch(i)
505  {
506  case 0:
507  return (4.*zeta0-1.)*dzeta0deta;
508 
509  case 1:
510  return (4.*zeta1-1.)*dzeta1deta;
511 
512  case 2:
513  return (4.*zeta2-1.)*dzeta2deta;
514 
515  case 3:
516  return 4.*zeta1*dzeta0deta + 4.*zeta0*dzeta1deta;
517 
518  case 4:
519  return 4.*zeta2*dzeta1deta + 4.*zeta1*dzeta2deta;
520 
521  case 5:
522  return 4.*zeta2*dzeta0deta + 4*zeta0*dzeta2deta;
523 
524  default:
525  libmesh_error_msg("Invalid shape function index i = " << i);
526  }
527  }
528  default:
529  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
530  }
531  }
532 
533  default:
534  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
535  }
536  }
537 
538 
539 
540  // unsupported order
541  default:
542  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
543  }
544 #endif
545 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [59/109]

Real libMesh::FE< 3, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 222 of file fe_xyz_shape_3D.C.

227 {
228  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
229  return 0.;
230 }

◆ shape_deriv() [60/109]

Real libMesh::FE< 2, LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 224 of file fe_lagrange_shape_2D.C.

229 {
230 #if LIBMESH_DIM > 1
231 
232 
233  libmesh_assert_less (j, 2);
234 
235  switch (order)
236  {
237  // linear Lagrange shape functions
238  case FIRST:
239  {
240  switch (type)
241  {
242  case QUAD4:
243  case QUADSHELL4:
244  case QUAD8:
245  case QUADSHELL8:
246  case QUAD9:
247  {
248  // Compute quad shape functions as a tensor-product
249  const Real xi = p(0);
250  const Real eta = p(1);
251 
252  libmesh_assert_less (i, 4);
253 
254  // 0 1 2 3
255  static const unsigned int i0[] = {0, 1, 1, 0};
256  static const unsigned int i1[] = {0, 0, 1, 1};
257 
258  switch (j)
259  {
260  // d()/dxi
261  case 0:
262  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
263  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta));
264 
265  // d()/deta
266  case 1:
267  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
268  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
269 
270  default:
271  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
272  }
273  }
274 
275  case TRI3:
276  case TRISHELL3:
277  case TRI6:
278  {
279  libmesh_assert_less (i, 3);
280 
281  const Real dzeta0dxi = -1.;
282  const Real dzeta1dxi = 1.;
283  const Real dzeta2dxi = 0.;
284 
285  const Real dzeta0deta = -1.;
286  const Real dzeta1deta = 0.;
287  const Real dzeta2deta = 1.;
288 
289  switch (j)
290  {
291  // d()/dxi
292  case 0:
293  {
294  switch(i)
295  {
296  case 0:
297  return dzeta0dxi;
298 
299  case 1:
300  return dzeta1dxi;
301 
302  case 2:
303  return dzeta2dxi;
304 
305  default:
306  libmesh_error_msg("Invalid shape function index i = " << i);
307  }
308  }
309  // d()/deta
310  case 1:
311  {
312  switch(i)
313  {
314  case 0:
315  return dzeta0deta;
316 
317  case 1:
318  return dzeta1deta;
319 
320  case 2:
321  return dzeta2deta;
322 
323  default:
324  libmesh_error_msg("Invalid shape function index i = " << i);
325  }
326  }
327  default:
328  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
329  }
330  }
331 
332  default:
333  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
334  }
335  }
336 
337 
338  // quadratic Lagrange shape functions
339  case SECOND:
340  {
341  switch (type)
342  {
343  case QUAD8:
344  case QUADSHELL8:
345  {
346  const Real xi = p(0);
347  const Real eta = p(1);
348 
349  libmesh_assert_less (i, 8);
350 
351  switch (j)
352  {
353  // d/dxi
354  case 0:
355  switch (i)
356  {
357  case 0:
358  return .25*(1. - eta)*((1. - xi)*(-1.) +
359  (-1.)*(-1. - xi - eta));
360 
361  case 1:
362  return .25*(1. - eta)*((1. + xi)*(1.) +
363  (1.)*(-1. + xi - eta));
364 
365  case 2:
366  return .25*(1. + eta)*((1. + xi)*(1.) +
367  (1.)*(-1. + xi + eta));
368 
369  case 3:
370  return .25*(1. + eta)*((1. - xi)*(-1.) +
371  (-1.)*(-1. - xi + eta));
372 
373  case 4:
374  return .5*(-2.*xi)*(1. - eta);
375 
376  case 5:
377  return .5*(1.)*(1. - eta*eta);
378 
379  case 6:
380  return .5*(-2.*xi)*(1. + eta);
381 
382  case 7:
383  return .5*(-1.)*(1. - eta*eta);
384 
385  default:
386  libmesh_error_msg("Invalid shape function index i = " << i);
387  }
388 
389  // d/deta
390  case 1:
391  switch (i)
392  {
393  case 0:
394  return .25*(1. - xi)*((1. - eta)*(-1.) +
395  (-1.)*(-1. - xi - eta));
396 
397  case 1:
398  return .25*(1. + xi)*((1. - eta)*(-1.) +
399  (-1.)*(-1. + xi - eta));
400 
401  case 2:
402  return .25*(1. + xi)*((1. + eta)*(1.) +
403  (1.)*(-1. + xi + eta));
404 
405  case 3:
406  return .25*(1. - xi)*((1. + eta)*(1.) +
407  (1.)*(-1. - xi + eta));
408 
409  case 4:
410  return .5*(1. - xi*xi)*(-1.);
411 
412  case 5:
413  return .5*(1. + xi)*(-2.*eta);
414 
415  case 6:
416  return .5*(1. - xi*xi)*(1.);
417 
418  case 7:
419  return .5*(1. - xi)*(-2.*eta);
420 
421  default:
422  libmesh_error_msg("Invalid shape function index i = " << i);
423  }
424 
425  default:
426  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
427  }
428  }
429 
430  case QUAD9:
431  {
432  // Compute quad shape functions as a tensor-product
433  const Real xi = p(0);
434  const Real eta = p(1);
435 
436  libmesh_assert_less (i, 9);
437 
438  // 0 1 2 3 4 5 6 7 8
439  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
440  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
441 
442  switch (j)
443  {
444  // d()/dxi
445  case 0:
446  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
447  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
448 
449  // d()/deta
450  case 1:
451  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
452  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
453 
454  default:
455  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
456  }
457  }
458 
459  case TRI6:
460  {
461  libmesh_assert_less (i, 6);
462 
463  const Real zeta1 = p(0);
464  const Real zeta2 = p(1);
465  const Real zeta0 = 1. - zeta1 - zeta2;
466 
467  const Real dzeta0dxi = -1.;
468  const Real dzeta1dxi = 1.;
469  const Real dzeta2dxi = 0.;
470 
471  const Real dzeta0deta = -1.;
472  const Real dzeta1deta = 0.;
473  const Real dzeta2deta = 1.;
474 
475  switch(j)
476  {
477  case 0:
478  {
479  switch(i)
480  {
481  case 0:
482  return (4.*zeta0-1.)*dzeta0dxi;
483 
484  case 1:
485  return (4.*zeta1-1.)*dzeta1dxi;
486 
487  case 2:
488  return (4.*zeta2-1.)*dzeta2dxi;
489 
490  case 3:
491  return 4.*zeta1*dzeta0dxi + 4.*zeta0*dzeta1dxi;
492 
493  case 4:
494  return 4.*zeta2*dzeta1dxi + 4.*zeta1*dzeta2dxi;
495 
496  case 5:
497  return 4.*zeta2*dzeta0dxi + 4*zeta0*dzeta2dxi;
498 
499  default:
500  libmesh_error_msg("Invalid shape function index i = " << i);
501  }
502  }
503 
504  case 1:
505  {
506  switch(i)
507  {
508  case 0:
509  return (4.*zeta0-1.)*dzeta0deta;
510 
511  case 1:
512  return (4.*zeta1-1.)*dzeta1deta;
513 
514  case 2:
515  return (4.*zeta2-1.)*dzeta2deta;
516 
517  case 3:
518  return 4.*zeta1*dzeta0deta + 4.*zeta0*dzeta1deta;
519 
520  case 4:
521  return 4.*zeta2*dzeta1deta + 4.*zeta1*dzeta2deta;
522 
523  case 5:
524  return 4.*zeta2*dzeta0deta + 4*zeta0*dzeta2deta;
525 
526  default:
527  libmesh_error_msg("Invalid shape function index i = " << i);
528  }
529  }
530  default:
531  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
532  }
533  }
534 
535  default:
536  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
537  }
538  }
539 
540  // unsupported order
541  default:
542  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
543  }
544 #else // LIBMESH_DIM > 1
545  return 0.;
546 #endif
547 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [61/109]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 231 of file fe_l2_hierarchic_shape_2D.C.

236 {
237  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
238  return 0.;
239 }

◆ shape_deriv() [62/109]

Real libMesh::FE< 2, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 231 of file fe_hierarchic_shape_2D.C.

236 {
237  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
238  return 0.;
239 }

◆ shape_deriv() [63/109]

Real libMesh::FE< 3, XYZ >::shape_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)
inherited

Definition at line 235 of file fe_xyz_shape_3D.C.

240 {
241 #if LIBMESH_DIM == 3
242 
243  libmesh_assert(elem);
244  libmesh_assert_less (j, 3);
245 
246  Point centroid = elem->centroid();
247  Point max_distance = Point(0.,0.,0.);
248  for (unsigned int p = 0; p < elem->n_nodes(); p++)
249  for (unsigned int d = 0; d < 3; d++)
250  {
251  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
252  max_distance(d) = std::max(distance, max_distance(d));
253  }
254 
255  const Real x = point_in(0);
256  const Real y = point_in(1);
257  const Real z = point_in(2);
258  const Real xc = centroid(0);
259  const Real yc = centroid(1);
260  const Real zc = centroid(2);
261  const Real distx = max_distance(0);
262  const Real disty = max_distance(1);
263  const Real distz = max_distance(2);
264  const Real dx = (x - xc)/distx;
265  const Real dy = (y - yc)/disty;
266  const Real dz = (z - zc)/distz;
267 
268 #ifndef NDEBUG
269  // totalorder is only used in the assertion below, so
270  // we avoid declaring it when asserts are not active.
271  const unsigned int totalorder = static_cast<Order>(order + elem->p_level());
272 #endif
273  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
274  (static_cast<unsigned int>(totalorder)+2)*
275  (static_cast<unsigned int>(totalorder)+3)/6);
276 
277  switch (j)
278  {
279  // d()/dx
280  case 0:
281  {
282  switch (i)
283  {
284  // constant
285  case 0:
286  return 0.;
287 
288  // linear
289  case 1:
290  return 1./distx;
291 
292  case 2:
293  return 0.;
294 
295  case 3:
296  return 0.;
297 
298  // quadratic
299  case 4:
300  return 2.*dx/distx;
301 
302  case 5:
303  return dy/distx;
304 
305  case 6:
306  return 0.;
307 
308  case 7:
309  return dz/distx;
310 
311  case 8:
312  return 0.;
313 
314  case 9:
315  return 0.;
316 
317  // cubic
318  case 10:
319  return 3.*dx*dx/distx;
320 
321  case 11:
322  return 2.*dx*dy/distx;
323 
324  case 12:
325  return dy*dy/distx;
326 
327  case 13:
328  return 0.;
329 
330  case 14:
331  return 2.*dx*dz/distx;
332 
333  case 15:
334  return dy*dz/distx;
335 
336  case 16:
337  return 0.;
338 
339  case 17:
340  return dz*dz/distx;
341 
342  case 18:
343  return 0.;
344 
345  case 19:
346  return 0.;
347 
348  // quartics
349  case 20:
350  return 4.*dx*dx*dx/distx;
351 
352  case 21:
353  return 3.*dx*dx*dy/distx;
354 
355  case 22:
356  return 2.*dx*dy*dy/distx;
357 
358  case 23:
359  return dy*dy*dy/distx;
360 
361  case 24:
362  return 0.;
363 
364  case 25:
365  return 3.*dx*dx*dz/distx;
366 
367  case 26:
368  return 2.*dx*dy*dz/distx;
369 
370  case 27:
371  return dy*dy*dz/distx;
372 
373  case 28:
374  return 0.;
375 
376  case 29:
377  return 2.*dx*dz*dz/distx;
378 
379  case 30:
380  return dy*dz*dz/distx;
381 
382  case 31:
383  return 0.;
384 
385  case 32:
386  return dz*dz*dz/distx;
387 
388  case 33:
389  return 0.;
390 
391  case 34:
392  return 0.;
393 
394  default:
395  unsigned int o = 0;
396  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
397  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
398  unsigned int block=o, nz = 0;
399  for (; block < i2; block += (o-nz+1)) { nz++; }
400  const unsigned int nx = block - i2;
401  const unsigned int ny = o - nx - nz;
402  Real val = nx;
403  for (unsigned int index=1; index < nx; index++)
404  val *= dx;
405  for (unsigned int index=0; index != ny; index++)
406  val *= dy;
407  for (unsigned int index=0; index != nz; index++)
408  val *= dz;
409  return val/distx;
410  }
411  }
412 
413 
414  // d()/dy
415  case 1:
416  {
417  switch (i)
418  {
419  // constant
420  case 0:
421  return 0.;
422 
423  // linear
424  case 1:
425  return 0.;
426 
427  case 2:
428  return 1./disty;
429 
430  case 3:
431  return 0.;
432 
433  // quadratic
434  case 4:
435  return 0.;
436 
437  case 5:
438  return dx/disty;
439 
440  case 6:
441  return 2.*dy/disty;
442 
443  case 7:
444  return 0.;
445 
446  case 8:
447  return dz/disty;
448 
449  case 9:
450  return 0.;
451 
452  // cubic
453  case 10:
454  return 0.;
455 
456  case 11:
457  return dx*dx/disty;
458 
459  case 12:
460  return 2.*dx*dy/disty;
461 
462  case 13:
463  return 3.*dy*dy/disty;
464 
465  case 14:
466  return 0.;
467 
468  case 15:
469  return dx*dz/disty;
470 
471  case 16:
472  return 2.*dy*dz/disty;
473 
474  case 17:
475  return 0.;
476 
477  case 18:
478  return dz*dz/disty;
479 
480  case 19:
481  return 0.;
482 
483  // quartics
484  case 20:
485  return 0.;
486 
487  case 21:
488  return dx*dx*dx/disty;
489 
490  case 22:
491  return 2.*dx*dx*dy/disty;
492 
493  case 23:
494  return 3.*dx*dy*dy/disty;
495 
496  case 24:
497  return 4.*dy*dy*dy/disty;
498 
499  case 25:
500  return 0.;
501 
502  case 26:
503  return dx*dx*dz/disty;
504 
505  case 27:
506  return 2.*dx*dy*dz/disty;
507 
508  case 28:
509  return 3.*dy*dy*dz/disty;
510 
511  case 29:
512  return 0.;
513 
514  case 30:
515  return dx*dz*dz/disty;
516 
517  case 31:
518  return 2.*dy*dz*dz/disty;
519 
520  case 32:
521  return 0.;
522 
523  case 33:
524  return dz*dz*dz/disty;
525 
526  case 34:
527  return 0.;
528 
529  default:
530  unsigned int o = 0;
531  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
532  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
533  unsigned int block=o, nz = 0;
534  for (; block < i2; block += (o-nz+1)) { nz++; }
535  const unsigned int nx = block - i2;
536  const unsigned int ny = o - nx - nz;
537  Real val = ny;
538  for (unsigned int index=0; index != nx; index++)
539  val *= dx;
540  for (unsigned int index=1; index < ny; index++)
541  val *= dy;
542  for (unsigned int index=0; index != nz; index++)
543  val *= dz;
544  return val/disty;
545  }
546  }
547 
548 
549  // d()/dz
550  case 2:
551  {
552  switch (i)
553  {
554  // constant
555  case 0:
556  return 0.;
557 
558  // linear
559  case 1:
560  return 0.;
561 
562  case 2:
563  return 0.;
564 
565  case 3:
566  return 1./distz;
567 
568  // quadratic
569  case 4:
570  return 0.;
571 
572  case 5:
573  return 0.;
574 
575  case 6:
576  return 0.;
577 
578  case 7:
579  return dx/distz;
580 
581  case 8:
582  return dy/distz;
583 
584  case 9:
585  return 2.*dz/distz;
586 
587  // cubic
588  case 10:
589  return 0.;
590 
591  case 11:
592  return 0.;
593 
594  case 12:
595  return 0.;
596 
597  case 13:
598  return 0.;
599 
600  case 14:
601  return dx*dx/distz;
602 
603  case 15:
604  return dx*dy/distz;
605 
606  case 16:
607  return dy*dy/distz;
608 
609  case 17:
610  return 2.*dx*dz/distz;
611 
612  case 18:
613  return 2.*dy*dz/distz;
614 
615  case 19:
616  return 3.*dz*dz/distz;
617 
618  // quartics
619  case 20:
620  return 0.;
621 
622  case 21:
623  return 0.;
624 
625  case 22:
626  return 0.;
627 
628  case 23:
629  return 0.;
630 
631  case 24:
632  return 0.;
633 
634  case 25:
635  return dx*dx*dx/distz;
636 
637  case 26:
638  return dx*dx*dy/distz;
639 
640  case 27:
641  return dx*dy*dy/distz;
642 
643  case 28:
644  return dy*dy*dy/distz;
645 
646  case 29:
647  return 2.*dx*dx*dz/distz;
648 
649  case 30:
650  return 2.*dx*dy*dz/distz;
651 
652  case 31:
653  return 2.*dy*dy*dz/distz;
654 
655  case 32:
656  return 3.*dx*dz*dz/distz;
657 
658  case 33:
659  return 3.*dy*dz*dz/distz;
660 
661  case 34:
662  return 4.*dz*dz*dz/distz;
663 
664  default:
665  unsigned int o = 0;
666  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
667  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
668  unsigned int block=o, nz = 0;
669  for (; block < i2; block += (o-nz+1)) { nz++; }
670  const unsigned int nx = block - i2;
671  const unsigned int ny = o - nx - nz;
672  Real val = nz;
673  for (unsigned int index=0; index != nx; index++)
674  val *= dx;
675  for (unsigned int index=0; index != ny; index++)
676  val *= dy;
677  for (unsigned int index=1; index < nz; index++)
678  val *= dz;
679  return val/distz;
680  }
681  }
682 
683 
684  default:
685  libmesh_error_msg("Invalid j = " << j);
686  }
687 
688 #else
689  return 0.;
690 #endif
691 }
double abs(double a)
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [64/109]

Real libMesh::FE< 1, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 237 of file fe_hermite_shape_1D.C.

242 {
243  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
244  return 0.;
245 }

◆ shape_deriv() [65/109]

Real libMesh::FE< 2, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 244 of file fe_hierarchic_shape_2D.C.

249 {
250  libmesh_assert(elem);
251 
252  const ElemType type = elem->type();
253 
254  const Order totalorder = static_cast<Order>(order+elem->p_level());
255 
256  libmesh_assert_greater (totalorder, 0);
257 
258  switch (type)
259  {
260  // 1st & 2nd-order Hierarchics.
261  case TRI3:
262  case TRISHELL3:
263  case TRI6:
264  {
265  const Real eps = 1.e-6;
266 
267  libmesh_assert_less (j, 2);
268 
269  switch (j)
270  {
271  // d()/dxi
272  case 0:
273  {
274  const Point pp(p(0)+eps, p(1));
275  const Point pm(p(0)-eps, p(1));
276 
277  return (FE<2,HIERARCHIC>::shape(elem, order, i, pp) -
278  FE<2,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
279  }
280 
281  // d()/deta
282  case 1:
283  {
284  const Point pp(p(0), p(1)+eps);
285  const Point pm(p(0), p(1)-eps);
286 
287  return (FE<2,HIERARCHIC>::shape(elem, order, i, pp) -
288  FE<2,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
289  }
290 
291  default:
292  libmesh_error_msg("Invalid derivative index j = " << j);
293  }
294  }
295 
296  case QUAD4:
297  case QUADSHELL4:
298  libmesh_assert_less (totalorder, 2);
299  libmesh_fallthrough();
300  case QUAD8:
301  case QUADSHELL8:
302  case QUAD9:
303  {
304  // Compute quad shape functions as a tensor-product
305  const Real xi = p(0);
306  const Real eta = p(1);
307 
308  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
309 
310  // Example i, i0, i1 values for totalorder = 5:
311  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
312  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
313  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
314 
315  unsigned int i0, i1;
316 
317  // Vertex DoFs
318  if (i == 0)
319  { i0 = 0; i1 = 0; }
320  else if (i == 1)
321  { i0 = 1; i1 = 0; }
322  else if (i == 2)
323  { i0 = 1; i1 = 1; }
324  else if (i == 3)
325  { i0 = 0; i1 = 1; }
326  // Edge DoFs
327  else if (i < totalorder + 3u)
328  { i0 = i - 2; i1 = 0; }
329  else if (i < 2u*totalorder + 2)
330  { i0 = 1; i1 = i - totalorder - 1; }
331  else if (i < 3u*totalorder + 1u)
332  { i0 = i - 2u*totalorder; i1 = 1; }
333  else if (i < 4u*totalorder)
334  { i0 = 0; i1 = i - 3u*totalorder + 1; }
335  // Interior DoFs
336  else
337  {
338  unsigned int basisnum = i - 4*totalorder;
339  i0 = square_number_column[basisnum] + 2;
340  i1 = square_number_row[basisnum] + 2;
341  }
342 
343  // Flip odd degree of freedom values if necessary
344  // to keep continuity on sides
345  Real f = 1.;
346 
347  if ((i0%2) && (i0 > 2) && (i1 == 0))
348  f = (elem->point(0) > elem->point(1))?-1.:1.;
349  else if ((i0%2) && (i0>2) && (i1 == 1))
350  f = (elem->point(3) > elem->point(2))?-1.:1.;
351  else if ((i0 == 0) && (i1%2) && (i1>2))
352  f = (elem->point(0) > elem->point(3))?-1.:1.;
353  else if ((i0 == 1) && (i1%2) && (i1>2))
354  f = (elem->point(1) > elem->point(2))?-1.:1.;
355 
356  switch (j)
357  {
358  // d()/dxi
359  case 0:
360  return f*(FE<1,HIERARCHIC>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
361  FE<1,HIERARCHIC>::shape (EDGE3, totalorder, i1, eta));
362 
363  // d()/deta
364  case 1:
365  return f*(FE<1,HIERARCHIC>::shape (EDGE3, totalorder, i0, xi)*
366  FE<1,HIERARCHIC>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
367 
368  default:
369  libmesh_error_msg("Invalid derivative index j = " << j);
370  }
371  }
372 
373  default:
374  libmesh_error_msg("ERROR: Unsupported element type = " << type);
375  }
376 
377  return 0.;
378 }
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]

◆ shape_deriv() [66/109]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 244 of file fe_l2_hierarchic_shape_2D.C.

249 {
250  libmesh_assert(elem);
251 
252  const ElemType type = elem->type();
253 
254  const Order totalorder = static_cast<Order>(order+elem->p_level());
255 
256  libmesh_assert_greater (totalorder, 0);
257 
258  switch (type)
259  {
260  // 1st & 2nd-order Hierarchics.
261  case TRI3:
262  case TRISHELL3:
263  case TRI6:
264  {
265  const Real eps = 1.e-6;
266 
267  libmesh_assert_less (j, 2);
268 
269  switch (j)
270  {
271  // d()/dxi
272  case 0:
273  {
274  const Point pp(p(0)+eps, p(1));
275  const Point pm(p(0)-eps, p(1));
276 
277  return (FE<2,L2_HIERARCHIC>::shape(elem, order, i, pp) -
278  FE<2,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
279  }
280 
281  // d()/deta
282  case 1:
283  {
284  const Point pp(p(0), p(1)+eps);
285  const Point pm(p(0), p(1)-eps);
286 
287  return (FE<2,L2_HIERARCHIC>::shape(elem, order, i, pp) -
288  FE<2,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
289  }
290 
291 
292  default:
293  libmesh_error_msg("Invalid derivative index j = " << j);
294  }
295  }
296 
297  case QUAD4:
298  case QUADSHELL4:
299  libmesh_assert_less (totalorder, 2);
300  libmesh_fallthrough();
301  case QUAD8:
302  case QUADSHELL8:
303  case QUAD9:
304  {
305  // Compute quad shape functions as a tensor-product
306  const Real xi = p(0);
307  const Real eta = p(1);
308 
309  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
310 
311  // Example i, i0, i1 values for totalorder = 5:
312  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
313  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
314  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
315 
316  unsigned int i0, i1;
317 
318  // Vertex DoFs
319  if (i == 0)
320  { i0 = 0; i1 = 0; }
321  else if (i == 1)
322  { i0 = 1; i1 = 0; }
323  else if (i == 2)
324  { i0 = 1; i1 = 1; }
325  else if (i == 3)
326  { i0 = 0; i1 = 1; }
327  // Edge DoFs
328  else if (i < totalorder + 3u)
329  { i0 = i - 2; i1 = 0; }
330  else if (i < 2u*totalorder + 2)
331  { i0 = 1; i1 = i - totalorder - 1; }
332  else if (i < 3u*totalorder + 1u)
333  { i0 = i - 2u*totalorder; i1 = 1; }
334  else if (i < 4u*totalorder)
335  { i0 = 0; i1 = i - 3u*totalorder + 1; }
336  // Interior DoFs
337  else
338  {
339  unsigned int basisnum = i - 4*totalorder;
340  i0 = square_number_column[basisnum] + 2;
341  i1 = square_number_row[basisnum] + 2;
342  }
343 
344  // Flip odd degree of freedom values if necessary
345  // to keep continuity on sides
346  Real f = 1.;
347 
348  if ((i0%2) && (i0 > 2) && (i1 == 0))
349  f = (elem->point(0) > elem->point(1))?-1.:1.;
350  else if ((i0%2) && (i0>2) && (i1 == 1))
351  f = (elem->point(3) > elem->point(2))?-1.:1.;
352  else if ((i0 == 0) && (i1%2) && (i1>2))
353  f = (elem->point(0) > elem->point(3))?-1.:1.;
354  else if ((i0 == 1) && (i1%2) && (i1>2))
355  f = (elem->point(1) > elem->point(2))?-1.:1.;
356 
357  switch (j)
358  {
359  // d()/dxi
360  case 0:
361  return f*(FE<1,L2_HIERARCHIC>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
362  FE<1,L2_HIERARCHIC>::shape (EDGE3, totalorder, i1, eta));
363 
364  // d()/deta
365  case 1:
366  return f*(FE<1,L2_HIERARCHIC>::shape (EDGE3, totalorder, i0, xi)*
367  FE<1,L2_HIERARCHIC>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
368 
369  default:
370  libmesh_error_msg("Invalid derivative index j = " << j);
371  }
372  }
373 
374  default:
375  libmesh_error_msg("ERROR: Unsupported element type = " << type);
376  }
377 
378  return 0.;
379 }
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]

◆ shape_deriv() [67/109]

Real libMesh::FE< 1, HERMITE >::shape_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned  int,
const Point p 
)
inherited

Definition at line 250 of file fe_hermite_shape_1D.C.

255 {
256  libmesh_assert(elem);
257 
258  // Coefficient naming: d(1)d(2n) is the coefficient of the
259  // global shape function corresponding to value 1 in terms of the
260  // local shape function corresponding to normal derivative 2
261  Real d1xd1x, d2xd2x;
262 
263  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
264 
265  const ElemType type = elem->type();
266 
267 #ifndef NDEBUG
268  const unsigned int totalorder = order + elem->p_level();
269 #endif
270 
271  switch (type)
272  {
273  // C1 functions on the C1 cubic edge
274  case EDGE2:
275  case EDGE3:
276  {
277  libmesh_assert_less (i, totalorder+1);
278 
279  switch (i)
280  {
281  case 0:
283  case 1:
284  return d1xd1x * FEHermite<1>::hermite_raw_shape_deriv(2, p(0));
285  case 2:
287  case 3:
288  return d2xd2x * FEHermite<1>::hermite_raw_shape_deriv(3, p(0));
289  default:
291  }
292  }
293  default:
294  libmesh_error_msg("ERROR: Unsupported element type = " << type);
295  }
296 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_deriv() [68/109]

Real libMesh::FE< 2, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 251 of file fe_hermite_shape_2D.C.

256 {
257  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
258  return 0.;
259 }

◆ shape_deriv() [69/109]

Real libMesh::FE< 2, HERMITE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 264 of file fe_hermite_shape_2D.C.

269 {
270  libmesh_assert(elem);
271  libmesh_assert (j == 0 || j == 1);
272 
273  std::vector<std::vector<Real>> dxdxi(2, std::vector<Real>(2, 0));
274 
275 #ifdef DEBUG
276  std::vector<Real> dxdeta(2), dydxi(2);
277 #endif
278 
279  hermite_compute_coefs(elem,dxdxi
280 #ifdef DEBUG
281  ,dxdeta,dydxi
282 #endif
283  );
284 
285  const ElemType type = elem->type();
286 
287  const Order totalorder = static_cast<Order>(order + elem->p_level());
288 
289  switch (type)
290  {
291  case QUAD4:
292  case QUADSHELL4:
293  libmesh_assert_less (totalorder, 4);
294  libmesh_fallthrough();
295  case QUAD8:
296  case QUADSHELL8:
297  case QUAD9:
298  {
299  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
300 
301  std::vector<unsigned int> bases1D;
302 
303  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
304 
305  switch (j)
306  {
307  case 0:
308  return coef *
309  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
310  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
311  case 1:
312  return coef *
313  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
314  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1));
315  default:
316  libmesh_error_msg("Invalid derivative index j = " << j);
317  }
318  }
319  default:
320  libmesh_error_msg("ERROR: Unsupported element type = " << type);
321  }
322 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_deriv() [70/109]

Real libMesh::FE< 1, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 276 of file fe_clough_shape_1D.C.

281 {
282  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
283  return 0.;
284 }

◆ shape_deriv() [71/109]

Real libMesh::FE< 1, CLOUGH >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 289 of file fe_clough_shape_1D.C.

294 {
295  libmesh_assert(elem);
296 
297  clough_compute_coefs(elem);
298 
299  const ElemType type = elem->type();
300 
301  const Order totalorder = static_cast<Order>(order + elem->p_level());
302 
303  switch (totalorder)
304  {
305  // 3rd-order C1 cubic element
306  case THIRD:
307  {
308  switch (type)
309  {
310  // C1 functions on the C1 cubic edge
311  case EDGE2:
312  case EDGE3:
313  {
314  switch (i)
315  {
316  case 0:
317  return clough_raw_shape_deriv(0, j, p);
318  case 1:
319  return clough_raw_shape_deriv(1, j, p);
320  case 2:
321  return d1xd1x * clough_raw_shape_deriv(2, j, p);
322  case 3:
323  return d2xd2x * clough_raw_shape_deriv(3, j, p);
324  default:
325  libmesh_error_msg("Invalid shape function index i = " << i);
326  }
327  }
328  default:
329  libmesh_error_msg("ERROR: Unsupported element type = " << type);
330  }
331  }
332  // by default throw an error
333  default:
334  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
335  }
336 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape_deriv() [72/109]

Real libMesh::FE< 2, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 304 of file fe_monomial_shape_2D.C.

309 {
310  libmesh_assert(elem);
311 
312  // by default call the orientation-independent shape functions
313  return FE<2,MONOMIAL>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
314 }

◆ shape_deriv() [73/109]

Real libMesh::FE< 1, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 361 of file fe_bernstein_shape_1D.C.

366 {
367  libmesh_assert(elem);
368 
369  return FE<1,BERNSTEIN>::shape_deriv(elem->type(),
370  static_cast<Order>(order + elem->p_level()), i, j, p);
371 }

◆ shape_deriv() [74/109]

Real libMesh::FE< 3, L2_LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 371 of file fe_l2_lagrange_shape_3D.C.

376 {
377 #if LIBMESH_DIM == 3
378 
379  libmesh_assert_less (j, 3);
380 
381  switch (order)
382  {
383  // linear Lagrange shape functions
384  case FIRST:
385  {
386  switch (type)
387  {
388  // trilinear hexahedral shape functions
389  case HEX8:
390  case HEX20:
391  case HEX27:
392  {
393  libmesh_assert_less (i, 8);
394 
395  // Compute hex shape functions as a tensor-product
396  const Real xi = p(0);
397  const Real eta = p(1);
398  const Real zeta = p(2);
399 
400  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
401  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
402  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
403 
404  switch(j)
405  {
406  case 0:
407  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
408  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
409  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
410 
411  case 1:
412  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
413  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
414  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
415 
416  case 2:
417  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
418  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
419  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
420 
421  default:
422  libmesh_error_msg("Invalid j = " << j);
423  }
424  }
425 
426  // linear tetrahedral shape functions
427  case TET4:
428  case TET10:
429  {
430  libmesh_assert_less (i, 4);
431 
432  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
433  const Real dzeta0dxi = -1.;
434  const Real dzeta1dxi = 1.;
435  const Real dzeta2dxi = 0.;
436  const Real dzeta3dxi = 0.;
437 
438  const Real dzeta0deta = -1.;
439  const Real dzeta1deta = 0.;
440  const Real dzeta2deta = 1.;
441  const Real dzeta3deta = 0.;
442 
443  const Real dzeta0dzeta = -1.;
444  const Real dzeta1dzeta = 0.;
445  const Real dzeta2dzeta = 0.;
446  const Real dzeta3dzeta = 1.;
447 
448  switch (j)
449  {
450  // d()/dxi
451  case 0:
452  {
453  switch(i)
454  {
455  case 0:
456  return dzeta0dxi;
457 
458  case 1:
459  return dzeta1dxi;
460 
461  case 2:
462  return dzeta2dxi;
463 
464  case 3:
465  return dzeta3dxi;
466 
467  default:
468  libmesh_error_msg("Invalid i = " << i);
469  }
470  }
471 
472  // d()/deta
473  case 1:
474  {
475  switch(i)
476  {
477  case 0:
478  return dzeta0deta;
479 
480  case 1:
481  return dzeta1deta;
482 
483  case 2:
484  return dzeta2deta;
485 
486  case 3:
487  return dzeta3deta;
488 
489  default:
490  libmesh_error_msg("Invalid i = " << i);
491  }
492  }
493 
494  // d()/dzeta
495  case 2:
496  {
497  switch(i)
498  {
499  case 0:
500  return dzeta0dzeta;
501 
502  case 1:
503  return dzeta1dzeta;
504 
505  case 2:
506  return dzeta2dzeta;
507 
508  case 3:
509  return dzeta3dzeta;
510 
511  default:
512  libmesh_error_msg("Invalid i = " << i);
513  }
514  }
515 
516  default:
517  libmesh_error_msg("Invalid shape function derivative j = " << j);
518  }
519  }
520 
521  // linear prism shape functions
522  case PRISM6:
523  case PRISM15:
524  case PRISM18:
525  {
526  libmesh_assert_less (i, 6);
527 
528  // Compute prism shape functions as a tensor-product
529  // of a triangle and an edge
530 
531  Point p2d(p(0),p(1));
532  Point p1d(p(2));
533 
534  // 0 1 2 3 4 5
535  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
536  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
537 
538  switch (j)
539  {
540  // d()/dxi
541  case 0:
542  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
543  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
544 
545  // d()/deta
546  case 1:
547  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
548  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
549 
550  // d()/dzeta
551  case 2:
552  return (FE<2,L2_LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
553  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
554 
555  default:
556  libmesh_error_msg("Invalid shape function derivative j = " << j);
557  }
558  }
559 
560  // linear pyramid shape functions
561  case PYRAMID5:
562  {
563  libmesh_assert_less (i, 5);
564 
565  const Real xi = p(0);
566  const Real eta = p(1);
567  const Real zeta = p(2);
568  const Real eps = 1.e-35;
569 
570  switch (j)
571  {
572  // d/dxi
573  case 0:
574  switch(i)
575  {
576  case 0:
577  return .25*(zeta + eta - 1.)/((1. - zeta) + eps);
578 
579  case 1:
580  return -.25*(zeta + eta - 1.)/((1. - zeta) + eps);
581 
582  case 2:
583  return -.25*(zeta - eta - 1.)/((1. - zeta) + eps);
584 
585  case 3:
586  return .25*(zeta - eta - 1.)/((1. - zeta) + eps);
587 
588  case 4:
589  return 0;
590 
591  default:
592  libmesh_error_msg("Invalid i = " << i);
593  }
594 
595 
596  // d/deta
597  case 1:
598  switch(i)
599  {
600  case 0:
601  return .25*(zeta + xi - 1.)/((1. - zeta) + eps);
602 
603  case 1:
604  return .25*(zeta - xi - 1.)/((1. - zeta) + eps);
605 
606  case 2:
607  return -.25*(zeta - xi - 1.)/((1. - zeta) + eps);
608 
609  case 3:
610  return -.25*(zeta + xi - 1.)/((1. - zeta) + eps);
611 
612  case 4:
613  return 0;
614 
615  default:
616  libmesh_error_msg("Invalid i = " << i);
617  }
618 
619 
620  // d/dzeta
621  case 2:
622  switch(i)
623  {
624  case 0:
625  {
626  const Real a=1.;
627  const Real b=1.;
628 
629  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
630  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
631  ((1. - zeta)*(1. - zeta) + eps));
632  }
633 
634  case 1:
635  {
636  const Real a=-1.;
637  const Real b=1.;
638 
639  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
640  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
641  ((1. - zeta)*(1. - zeta) + eps));
642  }
643 
644  case 2:
645  {
646  const Real a=-1.;
647  const Real b=-1.;
648 
649  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
650  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
651  ((1. - zeta)*(1. - zeta) + eps));
652  }
653 
654  case 3:
655  {
656  const Real a=1.;
657  const Real b=-1.;
658 
659  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
660  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
661  ((1. - zeta)*(1. - zeta) + eps));
662  }
663 
664  case 4:
665  return 1.;
666 
667  default:
668  libmesh_error_msg("Invalid i = " << i);
669  }
670 
671 
672  default:
673  libmesh_error_msg("Invalid j = " << j);
674  }
675  }
676 
677 
678  default:
679  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
680  }
681  }
682 
683 
684  // quadratic Lagrange shape functions
685  case SECOND:
686  {
687  switch (type)
688  {
689 
690  // serendipity hexahedral quadratic shape functions
691  case HEX20:
692  {
693  libmesh_assert_less (i, 20);
694 
695  const Real xi = p(0);
696  const Real eta = p(1);
697  const Real zeta = p(2);
698 
699  // these functions are defined for (x,y,z) in [0,1]^3
700  // so transform the locations
701  const Real x = .5*(xi + 1.);
702  const Real y = .5*(eta + 1.);
703  const Real z = .5*(zeta + 1.);
704 
705  // and don't forget the chain rule!
706 
707  switch (j)
708  {
709 
710  // d/dx*dx/dxi
711  case 0:
712  switch (i)
713  {
714  case 0:
715  return .5*(1. - y)*(1. - z)*((1. - x)*(-2.) +
716  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
717 
718  case 1:
719  return .5*(1. - y)*(1. - z)*(x*(2.) +
720  (1.)*(2.*x - 2.*y - 2.*z - 1.));
721 
722  case 2:
723  return .5*y*(1. - z)*(x*(2.) +
724  (1.)*(2.*x + 2.*y - 2.*z - 3.));
725 
726  case 3:
727  return .5*y*(1. - z)*((1. - x)*(-2.) +
728  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
729 
730  case 4:
731  return .5*(1. - y)*z*((1. - x)*(-2.) +
732  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
733 
734  case 5:
735  return .5*(1. - y)*z*(x*(2.) +
736  (1.)*(2.*x - 2.*y + 2.*z - 3.));
737 
738  case 6:
739  return .5*y*z*(x*(2.) +
740  (1.)*(2.*x + 2.*y + 2.*z - 5.));
741 
742  case 7:
743  return .5*y*z*((1. - x)*(-2.) +
744  (-1.)*(2.*y - 2.*x + 2.*z - 3.));
745 
746  case 8:
747  return 2.*(1. - y)*(1. - z)*(1. - 2.*x);
748 
749  case 9:
750  return 2.*y*(1. - y)*(1. - z);
751 
752  case 10:
753  return 2.*y*(1. - z)*(1. - 2.*x);
754 
755  case 11:
756  return 2.*y*(1. - y)*(1. - z)*(-1.);
757 
758  case 12:
759  return 2.*(1. - y)*z*(1. - z)*(-1.);
760 
761  case 13:
762  return 2.*(1. - y)*z*(1. - z);
763 
764  case 14:
765  return 2.*y*z*(1. - z);
766 
767  case 15:
768  return 2.*y*z*(1. - z)*(-1.);
769 
770  case 16:
771  return 2.*(1. - y)*z*(1. - 2.*x);
772 
773  case 17:
774  return 2.*y*(1. - y)*z;
775 
776  case 18:
777  return 2.*y*z*(1. - 2.*x);
778 
779  case 19:
780  return 2.*y*(1. - y)*z*(-1.);
781 
782  default:
783  libmesh_error_msg("Invalid i = " << i);
784  }
785 
786 
787  // d/dy*dy/deta
788  case 1:
789  switch (i)
790  {
791  case 0:
792  return .5*(1. - x)*(1. - z)*((1. - y)*(-2.) +
793  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
794 
795  case 1:
796  return .5*x*(1. - z)*((1. - y)*(-2.) +
797  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
798 
799  case 2:
800  return .5*x*(1. - z)*(y*(2.) +
801  (1.)*(2.*x + 2.*y - 2.*z - 3.));
802 
803  case 3:
804  return .5*(1. - x)*(1. - z)*(y*(2.) +
805  (1.)*(2.*y - 2.*x - 2.*z - 1.));
806 
807  case 4:
808  return .5*(1. - x)*z*((1. - y)*(-2.) +
809  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
810 
811  case 5:
812  return .5*x*z*((1. - y)*(-2.) +
813  (-1.)*(2.*x - 2.*y + 2.*z - 3.));
814 
815  case 6:
816  return .5*x*z*(y*(2.) +
817  (1.)*(2.*x + 2.*y + 2.*z - 5.));
818 
819  case 7:
820  return .5*(1. - x)*z*(y*(2.) +
821  (1.)*(2.*y - 2.*x + 2.*z - 3.));
822 
823  case 8:
824  return 2.*x*(1. - x)*(1. - z)*(-1.);
825 
826  case 9:
827  return 2.*x*(1. - z)*(1. - 2.*y);
828 
829  case 10:
830  return 2.*x*(1. - x)*(1. - z);
831 
832  case 11:
833  return 2.*(1. - x)*(1. - z)*(1. - 2.*y);
834 
835  case 12:
836  return 2.*(1. - x)*z*(1. - z)*(-1.);
837 
838  case 13:
839  return 2.*x*z*(1. - z)*(-1.);
840 
841  case 14:
842  return 2.*x*z*(1. - z);
843 
844  case 15:
845  return 2.*(1. - x)*z*(1. - z);
846 
847  case 16:
848  return 2.*x*(1. - x)*z*(-1.);
849 
850  case 17:
851  return 2.*x*z*(1. - 2.*y);
852 
853  case 18:
854  return 2.*x*(1. - x)*z;
855 
856  case 19:
857  return 2.*(1. - x)*z*(1. - 2.*y);
858 
859  default:
860  libmesh_error_msg("Invalid i = " << i);
861  }
862 
863 
864  // d/dz*dz/dzeta
865  case 2:
866  switch (i)
867  {
868  case 0:
869  return .5*(1. - x)*(1. - y)*((1. - z)*(-2.) +
870  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
871 
872  case 1:
873  return .5*x*(1. - y)*((1. - z)*(-2.) +
874  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
875 
876  case 2:
877  return .5*x*y*((1. - z)*(-2.) +
878  (-1.)*(2.*x + 2.*y - 2.*z - 3.));
879 
880  case 3:
881  return .5*(1. - x)*y*((1. - z)*(-2.) +
882  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
883 
884  case 4:
885  return .5*(1. - x)*(1. - y)*(z*(2.) +
886  (1.)*(2.*z - 2.*x - 2.*y - 1.));
887 
888  case 5:
889  return .5*x*(1. - y)*(z*(2.) +
890  (1.)*(2.*x - 2.*y + 2.*z - 3.));
891 
892  case 6:
893  return .5*x*y*(z*(2.) +
894  (1.)*(2.*x + 2.*y + 2.*z - 5.));
895 
896  case 7:
897  return .5*(1. - x)*y*(z*(2.) +
898  (1.)*(2.*y - 2.*x + 2.*z - 3.));
899 
900  case 8:
901  return 2.*x*(1. - x)*(1. - y)*(-1.);
902 
903  case 9:
904  return 2.*x*y*(1. - y)*(-1.);
905 
906  case 10:
907  return 2.*x*(1. - x)*y*(-1.);
908 
909  case 11:
910  return 2.*(1. - x)*y*(1. - y)*(-1.);
911 
912  case 12:
913  return 2.*(1. - x)*(1. - y)*(1. - 2.*z);
914 
915  case 13:
916  return 2.*x*(1. - y)*(1. - 2.*z);
917 
918  case 14:
919  return 2.*x*y*(1. - 2.*z);
920 
921  case 15:
922  return 2.*(1. - x)*y*(1. - 2.*z);
923 
924  case 16:
925  return 2.*x*(1. - x)*(1. - y);
926 
927  case 17:
928  return 2.*x*y*(1. - y);
929 
930  case 18:
931  return 2.*x*(1. - x)*y;
932 
933  case 19:
934  return 2.*(1. - x)*y*(1. - y);
935 
936  default:
937  libmesh_error_msg("Invalid i = " << i);
938  }
939 
940  default:
941  libmesh_error_msg("Invalid shape function derivative j = " << j);
942  }
943  }
944 
945  // triquadratic hexahedral shape functions
946  case HEX27:
947  {
948  libmesh_assert_less (i, 27);
949 
950  // Compute hex shape functions as a tensor-product
951  const Real xi = p(0);
952  const Real eta = p(1);
953  const Real zeta = p(2);
954 
955  // The only way to make any sense of this
956  // is to look at the mgflo/mg2/mgf documentation
957  // and make the cut-out cube!
958  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
959  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
960  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
961  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
962 
963  switch(j)
964  {
965  case 0:
966  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
967  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
968  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
969 
970  case 1:
971  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
972  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
973  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
974 
975  case 2:
976  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
977  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
978  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
979 
980  default:
981  libmesh_error_msg("Invalid j = " << j);
982  }
983  }
984 
985  // quadratic tetrahedral shape functions
986  case TET10:
987  {
988  libmesh_assert_less (i, 10);
989 
990  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
991  const Real zeta1 = p(0);
992  const Real zeta2 = p(1);
993  const Real zeta3 = p(2);
994  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
995 
996  const Real dzeta0dxi = -1.;
997  const Real dzeta1dxi = 1.;
998  const Real dzeta2dxi = 0.;
999  const Real dzeta3dxi = 0.;
1000 
1001  const Real dzeta0deta = -1.;
1002  const Real dzeta1deta = 0.;
1003  const Real dzeta2deta = 1.;
1004  const Real dzeta3deta = 0.;
1005 
1006  const Real dzeta0dzeta = -1.;
1007  const Real dzeta1dzeta = 0.;
1008  const Real dzeta2dzeta = 0.;
1009  const Real dzeta3dzeta = 1.;
1010 
1011  switch (j)
1012  {
1013  // d()/dxi
1014  case 0:
1015  {
1016  switch(i)
1017  {
1018  case 0:
1019  return (4.*zeta0 - 1.)*dzeta0dxi;
1020 
1021  case 1:
1022  return (4.*zeta1 - 1.)*dzeta1dxi;
1023 
1024  case 2:
1025  return (4.*zeta2 - 1.)*dzeta2dxi;
1026 
1027  case 3:
1028  return (4.*zeta3 - 1.)*dzeta3dxi;
1029 
1030  case 4:
1031  return 4.*(zeta0*dzeta1dxi + dzeta0dxi*zeta1);
1032 
1033  case 5:
1034  return 4.*(zeta1*dzeta2dxi + dzeta1dxi*zeta2);
1035 
1036  case 6:
1037  return 4.*(zeta0*dzeta2dxi + dzeta0dxi*zeta2);
1038 
1039  case 7:
1040  return 4.*(zeta0*dzeta3dxi + dzeta0dxi*zeta3);
1041 
1042  case 8:
1043  return 4.*(zeta1*dzeta3dxi + dzeta1dxi*zeta3);
1044 
1045  case 9:
1046  return 4.*(zeta2*dzeta3dxi + dzeta2dxi*zeta3);
1047 
1048  default:
1049  libmesh_error_msg("Invalid i = " << i);
1050  }
1051  }
1052 
1053  // d()/deta
1054  case 1:
1055  {
1056  switch(i)
1057  {
1058  case 0:
1059  return (4.*zeta0 - 1.)*dzeta0deta;
1060 
1061  case 1:
1062  return (4.*zeta1 - 1.)*dzeta1deta;
1063 
1064  case 2:
1065  return (4.*zeta2 - 1.)*dzeta2deta;
1066 
1067  case 3:
1068  return (4.*zeta3 - 1.)*dzeta3deta;
1069 
1070  case 4:
1071  return 4.*(zeta0*dzeta1deta + dzeta0deta*zeta1);
1072 
1073  case 5:
1074  return 4.*(zeta1*dzeta2deta + dzeta1deta*zeta2);
1075 
1076  case 6:
1077  return 4.*(zeta0*dzeta2deta + dzeta0deta*zeta2);
1078 
1079  case 7:
1080  return 4.*(zeta0*dzeta3deta + dzeta0deta*zeta3);
1081 
1082  case 8:
1083  return 4.*(zeta1*dzeta3deta + dzeta1deta*zeta3);
1084 
1085  case 9:
1086  return 4.*(zeta2*dzeta3deta + dzeta2deta*zeta3);
1087 
1088  default:
1089  libmesh_error_msg("Invalid i = " << i);
1090  }
1091  }
1092 
1093  // d()/dzeta
1094  case 2:
1095  {
1096  switch(i)
1097  {
1098  case 0:
1099  return (4.*zeta0 - 1.)*dzeta0dzeta;
1100 
1101  case 1:
1102  return (4.*zeta1 - 1.)*dzeta1dzeta;
1103 
1104  case 2:
1105  return (4.*zeta2 - 1.)*dzeta2dzeta;
1106 
1107  case 3:
1108  return (4.*zeta3 - 1.)*dzeta3dzeta;
1109 
1110  case 4:
1111  return 4.*(zeta0*dzeta1dzeta + dzeta0dzeta*zeta1);
1112 
1113  case 5:
1114  return 4.*(zeta1*dzeta2dzeta + dzeta1dzeta*zeta2);
1115 
1116  case 6:
1117  return 4.*(zeta0*dzeta2dzeta + dzeta0dzeta*zeta2);
1118 
1119  case 7:
1120  return 4.*(zeta0*dzeta3dzeta + dzeta0dzeta*zeta3);
1121 
1122  case 8:
1123  return 4.*(zeta1*dzeta3dzeta + dzeta1dzeta*zeta3);
1124 
1125  case 9:
1126  return 4.*(zeta2*dzeta3dzeta + dzeta2dzeta*zeta3);
1127 
1128  default:
1129  libmesh_error_msg("Invalid i = " << i);
1130  }
1131  }
1132 
1133  default:
1134  libmesh_error_msg("Invalid j = " << j);
1135  }
1136  }
1137 
1138 
1139 
1140  // quadratic prism shape functions
1141  case PRISM18:
1142  {
1143  libmesh_assert_less (i, 18);
1144 
1145  // Compute prism shape functions as a tensor-product
1146  // of a triangle and an edge
1147 
1148  Point p2d(p(0),p(1));
1149  Point p1d(p(2));
1150 
1151  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1152  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1153  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1154 
1155  switch (j)
1156  {
1157  // d()/dxi
1158  case 0:
1159  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1160  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1161 
1162  // d()/deta
1163  case 1:
1164  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1165  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1166 
1167  // d()/dzeta
1168  case 2:
1169  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1170  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1171 
1172  default:
1173  libmesh_error_msg("Invalid shape function derivative j = " << j);
1174  }
1175  }
1176 
1177 
1178  default:
1179  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1180  }
1181  }
1182 
1183 
1184  // unsupported order
1185  default:
1186  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1187  }
1188 
1189 #endif
1190 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [75/109]

Real libMesh::FE< 2, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 386 of file fe_bernstein_shape_2D.C.

391 {
392  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge orientation is needed.");
393  return 0.;
394 }

◆ shape_deriv() [76/109]

Real libMesh::FE< 2, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 399 of file fe_bernstein_shape_2D.C.

404 {
405  libmesh_assert(elem);
406 
407  const ElemType type = elem->type();
408 
409  const Order totalorder = static_cast<Order>(order + elem->p_level());
410 
411  switch (type)
412  {
413  // Hierarchic shape functions on the quadrilateral.
414  case QUAD4:
415  case QUAD9:
416  {
417  // Compute quad shape functions as a tensor-product
418  const Real xi = p(0);
419  const Real eta = p(1);
420 
421  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
422 
423  unsigned int i0, i1;
424 
425  // Vertex DoFs
426  if (i == 0)
427  { i0 = 0; i1 = 0; }
428  else if (i == 1)
429  { i0 = 1; i1 = 0; }
430  else if (i == 2)
431  { i0 = 1; i1 = 1; }
432  else if (i == 3)
433  { i0 = 0; i1 = 1; }
434 
435 
436  // Edge DoFs
437  else if (i < totalorder + 3u)
438  { i0 = i - 2; i1 = 0; }
439  else if (i < 2u*totalorder + 2)
440  { i0 = 1; i1 = i - totalorder - 1; }
441  else if (i < 3u*totalorder + 1)
442  { i0 = i - 2u*totalorder; i1 = 1; }
443  else if (i < 4u*totalorder)
444  { i0 = 0; i1 = i - 3u*totalorder + 1; }
445  // Interior DoFs
446  else
447  {
448  unsigned int basisnum = i - 4*totalorder;
449  i0 = square_number_column[basisnum] + 2;
450  i1 = square_number_row[basisnum] + 2;
451  }
452 
453 
454  // Flip odd degree of freedom values if necessary
455  // to keep continuity on sides
456  if ((i>= 4 && i<= 4+ totalorder-2u) && elem->point(0) > elem->point(1)) i0=totalorder+2-i0;
457  else if ((i>= 4+ totalorder-1u && i<= 4+2*totalorder-3u) && elem->point(1) > elem->point(2)) i1=totalorder+2-i1;
458  else if ((i>= 4+2*totalorder-2u && i<= 4+3*totalorder-4u) && elem->point(3) > elem->point(2)) i0=totalorder+2-i0;
459  else if ((i>= 4+3*totalorder-3u && i<= 4+4*totalorder-5u) && elem->point(0) > elem->point(3)) i1=totalorder+2-i1;
460 
461  switch (j)
462  {
463  // d()/dxi
464  case 0:
465  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
466  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1, eta));
467 
468  // d()/deta
469  case 1:
470  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0, xi)*
471  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
472 
473  default:
474  libmesh_error_msg("Invalid shape function derivative j = " << j);
475  }
476  }
477 
478  // Bernstein shape functions on the 8-noded quadrilateral
479  // is handled separately.
480  case QUAD8:
481  case QUADSHELL8:
482  {
483  libmesh_assert_less (totalorder, 3);
484 
485  const Real xi = p(0);
486  const Real eta = p(1);
487 
488  libmesh_assert_less (i, 8);
489 
490  // 0 1 2 3 4 5 6 7 8
491  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
492  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
493  static const Real scal[] = {-0.25, -0.25, -0.25, -0.25, 0.5, 0.5, 0.5, 0.5};
494  switch (j)
495  {
496  // d()/dxi
497  case 0:
498  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
499  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)
500  +scal[i]*
501  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[8], 0, xi)*
502  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[8], eta));
503 
504  // d()/deta
505  case 1:
506  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
507  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)
508  +scal[i]*
509  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[8], xi)*
510  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[8], 0, eta));
511 
512  default:
513  libmesh_error_msg("Invalid shape function derivative j = " << j);
514  }
515  }
516 
517  case TRI3:
518  case TRISHELL3:
519  libmesh_assert_less (totalorder, 2);
520  libmesh_fallthrough();
521  case TRI6:
522  {
523  // I have been lazy here and am using finite differences
524  // to compute the derivatives!
525  const Real eps = 1.e-6;
526 
527  switch (j)
528  {
529  // d()/dxi
530  case 0:
531  {
532  const Point pp(p(0)+eps, p(1));
533  const Point pm(p(0)-eps, p(1));
534 
535  return (FE<2,BERNSTEIN>::shape(elem, totalorder, i, pp) -
536  FE<2,BERNSTEIN>::shape(elem, totalorder, i, pm))/2./eps;
537  }
538 
539  // d()/deta
540  case 1:
541  {
542  const Point pp(p(0), p(1)+eps);
543  const Point pm(p(0), p(1)-eps);
544 
545  return (FE<2,BERNSTEIN>::shape(elem, totalorder, i, pp) -
546  FE<2,BERNSTEIN>::shape(elem, totalorder, i, pm))/2./eps;
547  }
548 
549 
550  default:
551  libmesh_error_msg("Invalid shape function derivative j = " << j);
552  }
553  }
554 
555  default:
556  libmesh_error_msg("ERROR: Unsupported element type = " << type);
557  }
558 }
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]

◆ shape_deriv() [77/109]

Real libMesh::FE< 3, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 447 of file fe_hermite_shape_3D.C.

452 {
453  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
454  return 0.;
455 }

◆ shape_deriv() [78/109]

Real libMesh::FE< 3, HERMITE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 460 of file fe_hermite_shape_3D.C.

465 {
466  libmesh_assert(elem);
467  libmesh_assert (j == 0 || j == 1 || j == 2);
468 
469  std::vector<std::vector<Real>> dxdxi(3, std::vector<Real>(2, 0));
470 
471 #ifdef DEBUG
472  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
473  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
474 #endif //DEBUG
475 
476  hermite_compute_coefs(elem, dxdxi
477 #ifdef DEBUG
478  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
479 #endif
480  );
481 
482  const ElemType type = elem->type();
483 
484  const Order totalorder = static_cast<Order>(order + elem->p_level());
485 
486  switch (totalorder)
487  {
488  // 3rd-order tricubic Hermite functions
489  case THIRD:
490  {
491  switch (type)
492  {
493  case HEX8:
494  case HEX20:
495  case HEX27:
496  {
497  libmesh_assert_less (i, 64);
498 
499  std::vector<unsigned int> bases1D;
500 
501  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
502 
503  switch (j) // Derivative type
504  {
505  case 0:
506  return coef *
507  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
508  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
509  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
510  break;
511  case 1:
512  return coef *
513  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
514  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
515  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
516  break;
517  case 2:
518  return coef *
519  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
520  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
521  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
522  break;
523  default:
524  libmesh_error_msg("Invalid shape function derivative j = " << j);
525  }
526 
527  }
528  default:
529  libmesh_error_msg("ERROR: Unsupported element type " << type);
530  }
531  }
532  // by default throw an error
533  default:
534  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
535  }
536 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_deriv() [79/109]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 544 of file fe_lagrange_vec.C.

547 {
548  Real value = FE<0,LAGRANGE>::shape_deriv( type, order, i, j, p );
549  return libMesh::RealGradient( value );
550 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [80/109]

Real libMesh::FE< 2, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 550 of file fe_l2_lagrange_shape_2D.C.

555 {
556  libmesh_assert(elem);
557 
558 
559  // call the orientation-independent shape functions
560  return FE<2,L2_LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
561 }

◆ shape_deriv() [81/109]

Real libMesh::FE< 2, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 552 of file fe_lagrange_shape_2D.C.

557 {
558  libmesh_assert(elem);
559 
560 
561  // call the orientation-independent shape functions
562  return FE<2,LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
563 }

◆ shape_deriv() [82/109]

Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

◆ shape_deriv() [83/109]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 566 of file fe_lagrange_vec.C.

569 {
570  Real value = FE<1,LAGRANGE>::shape_deriv( type, order, i, j, p );
571  return libMesh::RealGradient( value );
572 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [84/109]

Real libMesh::FE< 3, LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 573 of file fe_lagrange_shape_3D.C.

578 {
579 #if LIBMESH_DIM == 3
580 
581  libmesh_assert_less (j, 3);
582 
583  switch (order)
584  {
585  // linear Lagrange shape functions
586  case FIRST:
587  {
588  switch (type)
589  {
590  // trilinear hexahedral shape functions
591  case HEX8:
592  case HEX20:
593  case HEX27:
594  {
595  libmesh_assert_less (i, 8);
596 
597  // Compute hex shape functions as a tensor-product
598  const Real xi = p(0);
599  const Real eta = p(1);
600  const Real zeta = p(2);
601 
602  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
603  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
604  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
605 
606  switch(j)
607  {
608  case 0:
609  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
610  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
611  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
612 
613  case 1:
614  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
615  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
616  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
617 
618  case 2:
619  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
620  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
621  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
622 
623  default:
624  libmesh_error_msg("Invalid j = " << j);
625  }
626  }
627 
628  // linear tetrahedral shape functions
629  case TET4:
630  case TET10:
631  {
632  libmesh_assert_less (i, 4);
633 
634  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
635  const Real dzeta0dxi = -1.;
636  const Real dzeta1dxi = 1.;
637  const Real dzeta2dxi = 0.;
638  const Real dzeta3dxi = 0.;
639 
640  const Real dzeta0deta = -1.;
641  const Real dzeta1deta = 0.;
642  const Real dzeta2deta = 1.;
643  const Real dzeta3deta = 0.;
644 
645  const Real dzeta0dzeta = -1.;
646  const Real dzeta1dzeta = 0.;
647  const Real dzeta2dzeta = 0.;
648  const Real dzeta3dzeta = 1.;
649 
650  switch (j)
651  {
652  // d()/dxi
653  case 0:
654  {
655  switch(i)
656  {
657  case 0:
658  return dzeta0dxi;
659 
660  case 1:
661  return dzeta1dxi;
662 
663  case 2:
664  return dzeta2dxi;
665 
666  case 3:
667  return dzeta3dxi;
668 
669  default:
670  libmesh_error_msg("Invalid i = " << i);
671  }
672  }
673 
674  // d()/deta
675  case 1:
676  {
677  switch(i)
678  {
679  case 0:
680  return dzeta0deta;
681 
682  case 1:
683  return dzeta1deta;
684 
685  case 2:
686  return dzeta2deta;
687 
688  case 3:
689  return dzeta3deta;
690 
691  default:
692  libmesh_error_msg("Invalid i = " << i);
693  }
694  }
695 
696  // d()/dzeta
697  case 2:
698  {
699  switch(i)
700  {
701  case 0:
702  return dzeta0dzeta;
703 
704  case 1:
705  return dzeta1dzeta;
706 
707  case 2:
708  return dzeta2dzeta;
709 
710  case 3:
711  return dzeta3dzeta;
712 
713  default:
714  libmesh_error_msg("Invalid i = " << i);
715  }
716  }
717 
718  default:
719  libmesh_error_msg("Invalid shape function derivative j = " << j);
720  }
721  }
722 
723  // linear prism shape functions
724  case PRISM6:
725  case PRISM15:
726  case PRISM18:
727  {
728  libmesh_assert_less (i, 6);
729 
730  // Compute prism shape functions as a tensor-product
731  // of a triangle and an edge
732 
733  Point p2d(p(0),p(1));
734  Point p1d(p(2));
735 
736  // 0 1 2 3 4 5
737  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
738  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
739 
740  switch (j)
741  {
742  // d()/dxi
743  case 0:
744  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
745  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
746 
747  // d()/deta
748  case 1:
749  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
750  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
751 
752  // d()/dzeta
753  case 2:
754  return (FE<2,LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
755  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
756 
757  default:
758  libmesh_error_msg("Invalid shape function derivative j = " << j);
759  }
760  }
761 
762  // linear pyramid shape functions
763  case PYRAMID5:
764  case PYRAMID13:
765  case PYRAMID14:
766  {
767  libmesh_assert_less (i, 5);
768 
769  const Real xi = p(0);
770  const Real eta = p(1);
771  const Real zeta = p(2);
772  const Real eps = 1.e-35;
773 
774  switch (j)
775  {
776  // d/dxi
777  case 0:
778  switch(i)
779  {
780  case 0:
781  return .25*(zeta + eta - 1.)/((1. - zeta) + eps);
782 
783  case 1:
784  return -.25*(zeta + eta - 1.)/((1. - zeta) + eps);
785 
786  case 2:
787  return -.25*(zeta - eta - 1.)/((1. - zeta) + eps);
788 
789  case 3:
790  return .25*(zeta - eta - 1.)/((1. - zeta) + eps);
791 
792  case 4:
793  return 0;
794 
795  default:
796  libmesh_error_msg("Invalid i = " << i);
797  }
798 
799 
800  // d/deta
801  case 1:
802  switch(i)
803  {
804  case 0:
805  return .25*(zeta + xi - 1.)/((1. - zeta) + eps);
806 
807  case 1:
808  return .25*(zeta - xi - 1.)/((1. - zeta) + eps);
809 
810  case 2:
811  return -.25*(zeta - xi - 1.)/((1. - zeta) + eps);
812 
813  case 3:
814  return -.25*(zeta + xi - 1.)/((1. - zeta) + eps);
815 
816  case 4:
817  return 0;
818 
819  default:
820  libmesh_error_msg("Invalid i = " << i);
821  }
822 
823 
824  // d/dzeta
825  case 2:
826  {
827  // We computed the derivatives with general eps and
828  // then let eps tend to zero in the numerators...
829  Real
830  num = zeta*(2. - zeta) - 1.,
831  den = (1. - zeta + eps)*(1. - zeta + eps);
832 
833  switch(i)
834  {
835  case 0:
836  case 2:
837  return .25*(num + xi*eta)/den;
838 
839  case 1:
840  case 3:
841  return .25*(num - xi*eta)/den;
842 
843  case 4:
844  return 1.;
845 
846  default:
847  libmesh_error_msg("Invalid i = " << i);
848  }
849  }
850 
851  default:
852  libmesh_error_msg("Invalid j = " << j);
853  }
854  }
855 
856 
857  default:
858  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
859  }
860  }
861 
862 
863  // quadratic Lagrange shape functions
864  case SECOND:
865  {
866  switch (type)
867  {
868 
869  // serendipity hexahedral quadratic shape functions
870  case HEX20:
871  {
872  libmesh_assert_less (i, 20);
873 
874  const Real xi = p(0);
875  const Real eta = p(1);
876  const Real zeta = p(2);
877 
878  // these functions are defined for (x,y,z) in [0,1]^3
879  // so transform the locations
880  const Real x = .5*(xi + 1.);
881  const Real y = .5*(eta + 1.);
882  const Real z = .5*(zeta + 1.);
883 
884  // and don't forget the chain rule!
885 
886  switch (j)
887  {
888 
889  // d/dx*dx/dxi
890  case 0:
891  switch (i)
892  {
893  case 0:
894  return .5*(1. - y)*(1. - z)*((1. - x)*(-2.) +
895  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
896 
897  case 1:
898  return .5*(1. - y)*(1. - z)*(x*(2.) +
899  (1.)*(2.*x - 2.*y - 2.*z - 1.));
900 
901  case 2:
902  return .5*y*(1. - z)*(x*(2.) +
903  (1.)*(2.*x + 2.*y - 2.*z - 3.));
904 
905  case 3:
906  return .5*y*(1. - z)*((1. - x)*(-2.) +
907  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
908 
909  case 4:
910  return .5*(1. - y)*z*((1. - x)*(-2.) +
911  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
912 
913  case 5:
914  return .5*(1. - y)*z*(x*(2.) +
915  (1.)*(2.*x - 2.*y + 2.*z - 3.));
916 
917  case 6:
918  return .5*y*z*(x*(2.) +
919  (1.)*(2.*x + 2.*y + 2.*z - 5.));
920 
921  case 7:
922  return .5*y*z*((1. - x)*(-2.) +
923  (-1.)*(2.*y - 2.*x + 2.*z - 3.));
924 
925  case 8:
926  return 2.*(1. - y)*(1. - z)*(1. - 2.*x);
927 
928  case 9:
929  return 2.*y*(1. - y)*(1. - z);
930 
931  case 10:
932  return 2.*y*(1. - z)*(1. - 2.*x);
933 
934  case 11:
935  return 2.*y*(1. - y)*(1. - z)*(-1.);
936 
937  case 12:
938  return 2.*(1. - y)*z*(1. - z)*(-1.);
939 
940  case 13:
941  return 2.*(1. - y)*z*(1. - z);
942 
943  case 14:
944  return 2.*y*z*(1. - z);
945 
946  case 15:
947  return 2.*y*z*(1. - z)*(-1.);
948 
949  case 16:
950  return 2.*(1. - y)*z*(1. - 2.*x);
951 
952  case 17:
953  return 2.*y*(1. - y)*z;
954 
955  case 18:
956  return 2.*y*z*(1. - 2.*x);
957 
958  case 19:
959  return 2.*y*(1. - y)*z*(-1.);
960 
961  default:
962  libmesh_error_msg("Invalid i = " << i);
963  }
964 
965 
966  // d/dy*dy/deta
967  case 1:
968  switch (i)
969  {
970  case 0:
971  return .5*(1. - x)*(1. - z)*((1. - y)*(-2.) +
972  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
973 
974  case 1:
975  return .5*x*(1. - z)*((1. - y)*(-2.) +
976  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
977 
978  case 2:
979  return .5*x*(1. - z)*(y*(2.) +
980  (1.)*(2.*x + 2.*y - 2.*z - 3.));
981 
982  case 3:
983  return .5*(1. - x)*(1. - z)*(y*(2.) +
984  (1.)*(2.*y - 2.*x - 2.*z - 1.));
985 
986  case 4:
987  return .5*(1. - x)*z*((1. - y)*(-2.) +
988  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
989 
990  case 5:
991  return .5*x*z*((1. - y)*(-2.) +
992  (-1.)*(2.*x - 2.*y + 2.*z - 3.));
993 
994  case 6:
995  return .5*x*z*(y*(2.) +
996  (1.)*(2.*x + 2.*y + 2.*z - 5.));
997 
998  case 7:
999  return .5*(1. - x)*z*(y*(2.) +
1000  (1.)*(2.*y - 2.*x + 2.*z - 3.));
1001 
1002  case 8:
1003  return 2.*x*(1. - x)*(1. - z)*(-1.);
1004 
1005  case 9:
1006  return 2.*x*(1. - z)*(1. - 2.*y);
1007 
1008  case 10:
1009  return 2.*x*(1. - x)*(1. - z);
1010 
1011  case 11:
1012  return 2.*(1. - x)*(1. - z)*(1. - 2.*y);
1013 
1014  case 12:
1015  return 2.*(1. - x)*z*(1. - z)*(-1.);
1016 
1017  case 13:
1018  return 2.*x*z*(1. - z)*(-1.);
1019 
1020  case 14:
1021  return 2.*x*z*(1. - z);
1022 
1023  case 15:
1024  return 2.*(1. - x)*z*(1. - z);
1025 
1026  case 16:
1027  return 2.*x*(1. - x)*z*(-1.);
1028 
1029  case 17:
1030  return 2.*x*z*(1. - 2.*y);
1031 
1032  case 18:
1033  return 2.*x*(1. - x)*z;
1034 
1035  case 19:
1036  return 2.*(1. - x)*z*(1. - 2.*y);
1037 
1038  default:
1039  libmesh_error_msg("Invalid i = " << i);
1040  }
1041 
1042 
1043  // d/dz*dz/dzeta
1044  case 2:
1045  switch (i)
1046  {
1047  case 0:
1048  return .5*(1. - x)*(1. - y)*((1. - z)*(-2.) +
1049  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
1050 
1051  case 1:
1052  return .5*x*(1. - y)*((1. - z)*(-2.) +
1053  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
1054 
1055  case 2:
1056  return .5*x*y*((1. - z)*(-2.) +
1057  (-1.)*(2.*x + 2.*y - 2.*z - 3.));
1058 
1059  case 3:
1060  return .5*(1. - x)*y*((1. - z)*(-2.) +
1061  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
1062 
1063  case 4:
1064  return .5*(1. - x)*(1. - y)*(z*(2.) +
1065  (1.)*(2.*z - 2.*x - 2.*y - 1.));
1066 
1067  case 5:
1068  return .5*x*(1. - y)*(z*(2.) +
1069  (1.)*(2.*x - 2.*y + 2.*z - 3.));
1070 
1071  case 6:
1072  return .5*x*y*(z*(2.) +
1073  (1.)*(2.*x + 2.*y + 2.*z - 5.));
1074 
1075  case 7:
1076  return .5*(1. - x)*y*(z*(2.) +
1077  (1.)*(2.*y - 2.*x + 2.*z - 3.));
1078 
1079  case 8:
1080  return 2.*x*(1. - x)*(1. - y)*(-1.);
1081 
1082  case 9:
1083  return 2.*x*y*(1. - y)*(-1.);
1084 
1085  case 10:
1086  return 2.*x*(1. - x)*y*(-1.);
1087 
1088  case 11:
1089  return 2.*(1. - x)*y*(1. - y)*(-1.);
1090 
1091  case 12:
1092  return 2.*(1. - x)*(1. - y)*(1. - 2.*z);
1093 
1094  case 13:
1095  return 2.*x*(1. - y)*(1. - 2.*z);
1096 
1097  case 14:
1098  return 2.*x*y*(1. - 2.*z);
1099 
1100  case 15:
1101  return 2.*(1. - x)*y*(1. - 2.*z);
1102 
1103  case 16:
1104  return 2.*x*(1. - x)*(1. - y);
1105 
1106  case 17:
1107  return 2.*x*y*(1. - y);
1108 
1109  case 18:
1110  return 2.*x*(1. - x)*y;
1111 
1112  case 19:
1113  return 2.*(1. - x)*y*(1. - y);
1114 
1115  default:
1116  libmesh_error_msg("Invalid i = " << i);
1117  }
1118 
1119  default:
1120  libmesh_error_msg("Invalid shape function derivative j = " << j);
1121  }
1122  }
1123 
1124  // triquadratic hexahedral shape functions
1125  case HEX27:
1126  {
1127  libmesh_assert_less (i, 27);
1128 
1129  // Compute hex shape functions as a tensor-product
1130  const Real xi = p(0);
1131  const Real eta = p(1);
1132  const Real zeta = p(2);
1133 
1134  // The only way to make any sense of this
1135  // is to look at the mgflo/mg2/mgf documentation
1136  // and make the cut-out cube!
1137  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1138  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1139  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1140  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1141 
1142  switch(j)
1143  {
1144  case 0:
1145  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1146  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1147  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1148 
1149  case 1:
1150  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1151  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1152  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1153 
1154  case 2:
1155  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1156  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1157  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1158 
1159  default:
1160  libmesh_error_msg("Invalid j = " << j);
1161  }
1162  }
1163 
1164  // quadratic tetrahedral shape functions
1165  case TET10:
1166  {
1167  libmesh_assert_less (i, 10);
1168 
1169  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
1170  const Real zeta1 = p(0);
1171  const Real zeta2 = p(1);
1172  const Real zeta3 = p(2);
1173  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
1174 
1175  const Real dzeta0dxi = -1.;
1176  const Real dzeta1dxi = 1.;
1177  const Real dzeta2dxi = 0.;
1178  const Real dzeta3dxi = 0.;
1179 
1180  const Real dzeta0deta = -1.;
1181  const Real dzeta1deta = 0.;
1182  const Real dzeta2deta = 1.;
1183  const Real dzeta3deta = 0.;
1184 
1185  const Real dzeta0dzeta = -1.;
1186  const Real dzeta1dzeta = 0.;
1187  const Real dzeta2dzeta = 0.;
1188  const Real dzeta3dzeta = 1.;
1189 
1190  switch (j)
1191  {
1192  // d()/dxi
1193  case 0:
1194  {
1195  switch(i)
1196  {
1197  case 0:
1198  return (4.*zeta0 - 1.)*dzeta0dxi;
1199 
1200  case 1:
1201  return (4.*zeta1 - 1.)*dzeta1dxi;
1202 
1203  case 2:
1204  return (4.*zeta2 - 1.)*dzeta2dxi;
1205 
1206  case 3:
1207  return (4.*zeta3 - 1.)*dzeta3dxi;
1208 
1209  case 4:
1210  return 4.*(zeta0*dzeta1dxi + dzeta0dxi*zeta1);
1211 
1212  case 5:
1213  return 4.*(zeta1*dzeta2dxi + dzeta1dxi*zeta2);
1214 
1215  case 6:
1216  return 4.*(zeta0*dzeta2dxi + dzeta0dxi*zeta2);
1217 
1218  case 7:
1219  return 4.*(zeta0*dzeta3dxi + dzeta0dxi*zeta3);
1220 
1221  case 8:
1222  return 4.*(zeta1*dzeta3dxi + dzeta1dxi*zeta3);
1223 
1224  case 9:
1225  return 4.*(zeta2*dzeta3dxi + dzeta2dxi*zeta3);
1226 
1227  default:
1228  libmesh_error_msg("Invalid i = " << i);
1229  }
1230  }
1231 
1232  // d()/deta
1233  case 1:
1234  {
1235  switch(i)
1236  {
1237  case 0:
1238  return (4.*zeta0 - 1.)*dzeta0deta;
1239 
1240  case 1:
1241  return (4.*zeta1 - 1.)*dzeta1deta;
1242 
1243  case 2:
1244  return (4.*zeta2 - 1.)*dzeta2deta;
1245 
1246  case 3:
1247  return (4.*zeta3 - 1.)*dzeta3deta;
1248 
1249  case 4:
1250  return 4.*(zeta0*dzeta1deta + dzeta0deta*zeta1);
1251 
1252  case 5:
1253  return 4.*(zeta1*dzeta2deta + dzeta1deta*zeta2);
1254 
1255  case 6:
1256  return 4.*(zeta0*dzeta2deta + dzeta0deta*zeta2);
1257 
1258  case 7:
1259  return 4.*(zeta0*dzeta3deta + dzeta0deta*zeta3);
1260 
1261  case 8:
1262  return 4.*(zeta1*dzeta3deta + dzeta1deta*zeta3);
1263 
1264  case 9:
1265  return 4.*(zeta2*dzeta3deta + dzeta2deta*zeta3);
1266 
1267  default:
1268  libmesh_error_msg("Invalid i = " << i);
1269  }
1270  }
1271 
1272  // d()/dzeta
1273  case 2:
1274  {
1275  switch(i)
1276  {
1277  case 0:
1278  return (4.*zeta0 - 1.)*dzeta0dzeta;
1279 
1280  case 1:
1281  return (4.*zeta1 - 1.)*dzeta1dzeta;
1282 
1283  case 2:
1284  return (4.*zeta2 - 1.)*dzeta2dzeta;
1285 
1286  case 3:
1287  return (4.*zeta3 - 1.)*dzeta3dzeta;
1288 
1289  case 4:
1290  return 4.*(zeta0*dzeta1dzeta + dzeta0dzeta*zeta1);
1291 
1292  case 5:
1293  return 4.*(zeta1*dzeta2dzeta + dzeta1dzeta*zeta2);
1294 
1295  case 6:
1296  return 4.*(zeta0*dzeta2dzeta + dzeta0dzeta*zeta2);
1297 
1298  case 7:
1299  return 4.*(zeta0*dzeta3dzeta + dzeta0dzeta*zeta3);
1300 
1301  case 8:
1302  return 4.*(zeta1*dzeta3dzeta + dzeta1dzeta*zeta3);
1303 
1304  case 9:
1305  return 4.*(zeta2*dzeta3dzeta + dzeta2dzeta*zeta3);
1306 
1307  default:
1308  libmesh_error_msg("Invalid i = " << i);
1309  }
1310  }
1311 
1312  default:
1313  libmesh_error_msg("Invalid j = " << j);
1314  }
1315  }
1316 
1317 
1318  // "serendipity" prism
1319  case PRISM15:
1320  {
1321  libmesh_assert_less (i, 15);
1322 
1323  const Real xi = p(0);
1324  const Real eta = p(1);
1325  const Real zeta = p(2);
1326 
1327  switch (j)
1328  {
1329  // d()/dxi
1330  case 0:
1331  {
1332  switch(i)
1333  {
1334  case 0:
1335  return (2.*xi + 2.*eta + 0.5*zeta - 1.)*(1. - zeta);
1336  case 1:
1337  return (2.*xi - 1. - 0.5*zeta)*(1. - zeta);
1338  case 2:
1339  return 0.;
1340  case 3:
1341  return (2.*xi + 2.*eta - 0.5*zeta - 1.)*(1. + zeta);
1342  case 4:
1343  return (2.*xi - 1. + 0.5*zeta)*(1. + zeta);
1344  case 5:
1345  return 0.;
1346  case 6:
1347  return (4.*xi + 2.*eta - 2.)*(zeta - 1.);
1348  case 7:
1349  return -2.*(zeta - 1.)*eta;
1350  case 8:
1351  return 2.*(zeta - 1.)*eta;
1352  case 9:
1353  return (zeta - 1.)*(1. + zeta);
1354  case 10:
1355  return (1. - zeta)*(1. + zeta);
1356  case 11:
1357  return 0.;
1358  case 12:
1359  return (-4.*xi - 2.*eta + 2.)*(1. + zeta);
1360  case 13:
1361  return 2.*(1. + zeta)*eta;
1362  case 14:
1363  return -2.*(1. + zeta)*eta;
1364  default:
1365  libmesh_error_msg("Invalid i = " << i);
1366  }
1367  }
1368 
1369  // d()/deta
1370  case 1:
1371  {
1372  switch(i)
1373  {
1374  case 0:
1375  return (2.*xi + 2.*eta + 0.5*zeta - 1.)*(1. - zeta);
1376  case 1:
1377  return 0.;
1378  case 2:
1379  return (2.*eta - 1. - 0.5*zeta)*(1. - zeta);
1380  case 3:
1381  return (2.*xi + 2.*eta - 0.5*zeta - 1.)*(1. + zeta);
1382  case 4:
1383  return 0.;
1384  case 5:
1385  return (2.*eta - 1. + 0.5*zeta)*(1. + zeta);
1386  case 6:
1387  return 2.*(zeta - 1.)*xi;
1388  case 7:
1389  return 2.*(1. - zeta)*xi;
1390  case 8:
1391  return (2.*xi + 4.*eta - 2.)*(zeta - 1.);
1392  case 9:
1393  return (zeta - 1.)*(1. + zeta);
1394  case 10:
1395  return 0.;
1396  case 11:
1397  return (1. - zeta)*(1. + zeta);
1398  case 12:
1399  return -2.*(1. + zeta)*xi;
1400  case 13:
1401  return 2.*(1. + zeta)*xi;
1402  case 14:
1403  return (-2.*xi - 4.*eta + 2.)*(1. + zeta);
1404 
1405  default:
1406  libmesh_error_msg("Invalid i = " << i);
1407  }
1408  }
1409 
1410  // d()/dzeta
1411  case 2:
1412  {
1413  switch(i)
1414  {
1415  case 0:
1416  return (-xi - eta - zeta + 0.5)*(xi + eta - 1.);
1417  case 1:
1418  return -0.5*xi*(2.*xi - 1. - 2.*zeta);
1419  case 2:
1420  return -0.5*eta*(2.*eta - 1. - 2.*zeta);
1421  case 3:
1422  return (xi + eta - zeta - 0.5)*(xi + eta - 1.);
1423  case 4:
1424  return 0.5*xi*(2.*xi - 1. + 2.*zeta);
1425  case 5:
1426  return 0.5*eta*(2.*eta - 1. + 2.*zeta);
1427  case 6:
1428  return 2.*xi*(xi + eta - 1.);
1429  case 7:
1430  return -2.*xi*eta;
1431  case 8:
1432  return 2.*eta*(xi + eta - 1.);
1433  case 9:
1434  return 2.*zeta*(xi + eta - 1.);
1435  case 10:
1436  return -2.*xi*zeta;
1437  case 11:
1438  return -2.*eta*zeta;
1439  case 12:
1440  return 2.*xi*(1. - xi - eta);
1441  case 13:
1442  return 2.*xi*eta;
1443  case 14:
1444  return 2.*eta*(1. - xi - eta);
1445 
1446  default:
1447  libmesh_error_msg("Invalid i = " << i);
1448  }
1449  }
1450 
1451  default:
1452  libmesh_error_msg("Invalid j = " << j);
1453  }
1454  }
1455 
1456 
1457 
1458  // quadratic prism shape functions
1459  case PRISM18:
1460  {
1461  libmesh_assert_less (i, 18);
1462 
1463  // Compute prism shape functions as a tensor-product
1464  // of a triangle and an edge
1465 
1466  Point p2d(p(0),p(1));
1467  Point p1d(p(2));
1468 
1469  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1470  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1471  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1472 
1473  switch (j)
1474  {
1475  // d()/dxi
1476  case 0:
1477  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1478  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1479 
1480  // d()/deta
1481  case 1:
1482  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1483  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1484 
1485  // d()/dzeta
1486  case 2:
1487  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1488  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1489 
1490  default:
1491  libmesh_error_msg("Invalid shape function derivative j = " << j);
1492  }
1493  }
1494 
1495  // G. Bedrosian, "Shape functions and integration formulas for
1496  // three-dimensional finite element analysis", Int. J. Numerical
1497  // Methods Engineering, vol 35, p. 95-108, 1992.
1498  case PYRAMID13:
1499  {
1500  libmesh_assert_less (i, 13);
1501 
1502  const Real xi = p(0);
1503  const Real eta = p(1);
1504  const Real zeta = p(2);
1505  const Real eps = 1.e-35;
1506 
1507  // Denominators are perturbed by epsilon to avoid
1508  // divide-by-zero issues.
1509  Real
1510  den = (-1. + zeta + eps),
1511  den2 = den*den,
1512  xi2 = xi*xi,
1513  eta2 = eta*eta,
1514  zeta2 = zeta*zeta,
1515  zeta3 = zeta2*zeta;
1516 
1517  switch (j)
1518  {
1519  // d/dxi
1520  case 0:
1521  switch(i)
1522  {
1523  case 0:
1524  return 0.25*(-zeta - eta + 2.*eta*zeta - 2.*xi + 2.*zeta*xi + 2.*eta*xi + zeta2 + eta2)/den;
1525 
1526  case 1:
1527  return -0.25*(-zeta - eta + 2.*eta*zeta + 2.*xi - 2.*zeta*xi - 2.*eta*xi + zeta2 + eta2)/den;
1528 
1529  case 2:
1530  return -0.25*(-zeta + eta - 2.*eta*zeta + 2.*xi - 2.*zeta*xi + 2.*eta*xi + zeta2 + eta2)/den;
1531 
1532  case 3:
1533  return 0.25*(-zeta + eta - 2.*eta*zeta - 2.*xi + 2.*zeta*xi - 2.*eta*xi + zeta2 + eta2)/den;
1534 
1535  case 4:
1536  return 0.;
1537 
1538  case 5:
1539  return -(-1. + eta + zeta)*xi/den;
1540 
1541  case 6:
1542  return 0.5*(-1. + eta + zeta)*(1. + eta - zeta)/den;
1543 
1544  case 7:
1545  return (1. + eta - zeta)*xi/den;
1546 
1547  case 8:
1548  return -0.5*(-1. + eta + zeta)*(1. + eta - zeta)/den;
1549 
1550  case 9:
1551  return -(-1. + eta + zeta)*zeta/den;
1552 
1553  case 10:
1554  return (-1. + eta + zeta)*zeta/den;
1555 
1556  case 11:
1557  return -(1. + eta - zeta)*zeta/den;
1558 
1559  case 12:
1560  return (1. + eta - zeta)*zeta/den;
1561 
1562  default:
1563  libmesh_error_msg("Invalid i = " << i);
1564  }
1565 
1566  // d/deta
1567  case 1:
1568  switch(i)
1569  {
1570  case 0:
1571  return 0.25*(-zeta - 2.*eta + 2.*eta*zeta - xi + 2.*zeta*xi + 2.*eta*xi + zeta2 + xi2)/den;
1572 
1573  case 1:
1574  return -0.25*(zeta + 2.*eta - 2.*eta*zeta - xi + 2.*zeta*xi + 2.*eta*xi - zeta2 - xi2)/den;
1575 
1576  case 2:
1577  return -0.25*(-zeta + 2.*eta - 2.*eta*zeta + xi - 2.*zeta*xi + 2.*eta*xi + zeta2 + xi2)/den;
1578 
1579  case 3:
1580  return 0.25*(zeta - 2.*eta + 2.*eta*zeta + xi - 2.*zeta*xi + 2.*eta*xi - zeta2 - xi2)/den;
1581 
1582  case 4:
1583  return 0.;
1584 
1585  case 5:
1586  return -0.5*(-1. + xi + zeta)*(1. + xi - zeta)/den;
1587 
1588  case 6:
1589  return (1. + xi - zeta)*eta/den;
1590 
1591  case 7:
1592  return 0.5*(-1. + xi + zeta)*(1. + xi - zeta)/den;
1593 
1594  case 8:
1595  return -(-1. + xi + zeta)*eta/den;
1596 
1597  case 9:
1598  return -(-1. + xi + zeta)*zeta/den;
1599 
1600  case 10:
1601  return (1. + xi - zeta)*zeta/den;
1602 
1603  case 11:
1604  return -(1. + xi - zeta)*zeta/den;
1605 
1606  case 12:
1607  return (-1. + xi + zeta)*zeta/den;
1608 
1609  default:
1610  libmesh_error_msg("Invalid i = " << i);
1611  }
1612 
1613  // d/dzeta
1614  case 2:
1615  {
1616  switch(i)
1617  {
1618  case 0:
1619  return -0.25*(xi + eta + 1.)*(-1. + 2.*zeta - zeta2 + eta*xi)/den2;
1620 
1621  case 1:
1622  return 0.25*(eta - xi + 1.)*(1. - 2.*zeta + zeta2 + eta*xi)/den2;
1623 
1624  case 2:
1625  return 0.25*(xi + eta - 1.)*(-1. + 2.*zeta - zeta2 + eta*xi)/den2;
1626 
1627  case 3:
1628  return -0.25*(eta - xi - 1.)*(1. - 2.*zeta + zeta2 + eta*xi)/den2;
1629 
1630  case 4:
1631  return 4.*zeta - 1.;
1632 
1633  case 5:
1634  return 0.5*(-2 + eta + 6.*zeta + eta*xi2 + eta*zeta2 - 6.*zeta2 + 2.*zeta3 - 2.*eta*zeta)/den2;
1635 
1636  case 6:
1637  return -0.5*(2 - 6.*zeta + xi + xi*zeta2 + eta2*xi + 6.*zeta2 - 2.*zeta3 - 2.*zeta*xi)/den2;
1638 
1639  case 7:
1640  return -0.5*(2 + eta - 6.*zeta + eta*xi2 + eta*zeta2 + 6.*zeta2 - 2.*zeta3 - 2.*eta*zeta)/den2;
1641 
1642  case 8:
1643  return 0.5*(-2 + 6.*zeta + xi + xi*zeta2 + eta2*xi - 6.*zeta2 + 2.*zeta3 - 2.*zeta*xi)/den2;
1644 
1645  case 9:
1646  return (1. - eta - 4.*zeta - xi - xi*zeta2 - eta*zeta2 + eta*xi + 5.*zeta2 - 2.*zeta3 + 2.*eta*zeta + 2.*zeta*xi)/den2;
1647 
1648  case 10:
1649  return -(-1. + eta + 4.*zeta - xi - xi*zeta2 + eta*zeta2 + eta*xi - 5.*zeta2 + 2.*zeta3 - 2.*eta*zeta + 2.*zeta*xi)/den2;
1650 
1651  case 11:
1652  return (1. + eta - 4.*zeta + xi + xi*zeta2 + eta*zeta2 + eta*xi + 5.*zeta2 - 2.*zeta3 - 2.*eta*zeta - 2.*zeta*xi)/den2;
1653 
1654  case 12:
1655  return -(-1. - eta + 4.*zeta + xi + xi*zeta2 - eta*zeta2 + eta*xi - 5.*zeta2 + 2.*zeta3 + 2.*eta*zeta - 2.*zeta*xi)/den2;
1656 
1657  default:
1658  libmesh_error_msg("Invalid i = " << i);
1659  }
1660  }
1661 
1662  default:
1663  libmesh_error_msg("Invalid j = " << j);
1664  }
1665  }
1666 
1667  // Quadratic shape functions, as defined in R. Graglia, "Higher order
1668  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
1669  // vol 47, no 5, May 1999.
1670  case PYRAMID14:
1671  {
1672  libmesh_assert_less (i, 14);
1673 
1674  const Real xi = p(0);
1675  const Real eta = p(1);
1676  const Real zeta = p(2);
1677  const Real eps = 1.e-35;
1678 
1679  // The "normalized coordinates" defined by Graglia. These are
1680  // the planes which define the faces of the pyramid.
1681  Real
1682  p1 = 0.5*(1. - eta - zeta), // back
1683  p2 = 0.5*(1. + xi - zeta), // left
1684  p3 = 0.5*(1. + eta - zeta), // front
1685  p4 = 0.5*(1. - xi - zeta); // right
1686 
1687  // Denominators are perturbed by epsilon to avoid
1688  // divide-by-zero issues.
1689  Real
1690  den = (-1. + zeta + eps),
1691  den2 = den*den,
1692  den3 = den2*den;
1693 
1694  switch (j)
1695  {
1696  // d/dxi
1697  case 0:
1698  switch(i)
1699  {
1700  case 0:
1701  return 0.5*p1*(-xi*eta + zeta - zeta*zeta + 2.*p4*eta)/den2;
1702 
1703  case 1:
1704  return -0.5*p1*(xi*eta + zeta - zeta*zeta + 2.*p2*eta)/den2;
1705 
1706  case 2:
1707  return 0.5*p3*(xi*eta - zeta + zeta*zeta + 2.*p2*eta)/den2;
1708 
1709  case 3:
1710  return -0.5*p3*(-xi*eta - zeta + zeta*zeta + 2.*p4*eta)/den2;
1711 
1712  case 4:
1713  return 0.;
1714 
1715  case 5:
1716  return 2.*p1*eta*xi/den2;
1717 
1718  case 6:
1719  return 2.*p1*p3*(xi + 2.*p2)/den2;
1720 
1721  case 7:
1722  return -2.*p3*eta*xi/den2;
1723 
1724  case 8:
1725  return -2.*p1*p3*(-xi + 2.*p4)/den2;
1726 
1727  case 9:
1728  return 2.*p1*zeta/den;
1729 
1730  case 10:
1731  return -2.*p1*zeta/den;
1732 
1733  case 11:
1734  return -2.*p3*zeta/den;
1735 
1736  case 12:
1737  return 2.*p3*zeta/den;
1738 
1739  case 13:
1740  return -8.*p1*p3*xi/den2;
1741 
1742  default:
1743  libmesh_error_msg("Invalid i = " << i);
1744  }
1745 
1746  // d/deta
1747  case 1:
1748  switch(i)
1749  {
1750  case 0:
1751  return -0.5*p4*(xi*eta - zeta + zeta*zeta - 2.*p1*xi)/den2;
1752 
1753  case 1:
1754  return 0.5*p2*(xi*eta + zeta - zeta*zeta - 2.*p1*xi)/den2;
1755 
1756  case 2:
1757  return 0.5*p2*(xi*eta - zeta + zeta*zeta + 2.*p3*xi)/den2;
1758 
1759  case 3:
1760  return -0.5*p4*(xi*eta + zeta - zeta*zeta + 2.*p3*xi)/den2;
1761 
1762  case 4:
1763  return 0.;
1764 
1765  case 5:
1766  return 2.*p2*p4*(eta - 2.*p1)/den2;
1767 
1768  case 6:
1769  return -2.*p2*xi*eta/den2;
1770 
1771  case 7:
1772  return 2.*p2*p4*(eta + 2.*p3)/den2;
1773 
1774  case 8:
1775  return 2.*p4*xi*eta/den2;
1776 
1777  case 9:
1778  return 2.*p4*zeta/den;
1779 
1780  case 10:
1781  return 2.*p2*zeta/den;
1782 
1783  case 11:
1784  return -2.*p2*zeta/den;
1785 
1786  case 12:
1787  return -2.*p4*zeta/den;
1788 
1789  case 13:
1790  return -8.*p2*p4*eta/den2;
1791 
1792  default:
1793  libmesh_error_msg("Invalid i = " << i);
1794  }
1795 
1796 
1797  // d/dzeta
1798  case 2:
1799  {
1800  switch(i)
1801  {
1802  case 0:
1803  return -0.5*p1*(xi*eta - zeta + zeta*zeta)/den2
1804  - 0.5*p4*(xi*eta - zeta + zeta*zeta)/den2
1805  + p4*p1*(2.*zeta - 1)/den2
1806  - 2.*p4*p1*(xi*eta - zeta + zeta*zeta)/den3;
1807 
1808  case 1:
1809  return 0.5*p2*(xi*eta + zeta - zeta*zeta)/den2
1810  + 0.5*p1*(xi*eta + zeta - zeta*zeta)/den2
1811  - p1*p2*(1 - 2.*zeta)/den2
1812  + 2.*p1*p2*(xi*eta + zeta - zeta*zeta)/den3;
1813 
1814  case 2:
1815  return -0.5*p3*(xi*eta - zeta + zeta*zeta)/den2
1816  - 0.5*p2*(xi*eta - zeta + zeta*zeta)/den2
1817  + p2*p3*(2.*zeta - 1)/den2
1818  - 2.*p2*p3*(xi*eta - zeta + zeta*zeta)/den3;
1819 
1820  case 3:
1821  return 0.5*p4*(xi*eta + zeta - zeta*zeta)/den2
1822  + 0.5*p3*(xi*eta + zeta - zeta*zeta)/den2
1823  - p3*p4*(1 - 2.*zeta)/den2
1824  + 2.*p3*p4*(xi*eta + zeta - zeta*zeta)/den3;
1825 
1826  case 4:
1827  return 4.*zeta - 1.;
1828 
1829  case 5:
1830  return 2.*p4*p1*eta/den2
1831  + 2.*p2*p4*eta/den2
1832  + 2.*p1*p2*eta/den2
1833  + 8.*p2*p1*p4*eta/den3;
1834 
1835  case 6:
1836  return -2.*p2*p3*xi/den2
1837  - 2.*p1*p3*xi/den2
1838  - 2.*p1*p2*xi/den2
1839  - 8.*p1*p2*p3*xi/den3;
1840 
1841  case 7:
1842  return -2.*p3*p4*eta/den2
1843  - 2.*p2*p4*eta/den2
1844  - 2.*p2*p3*eta/den2
1845  - 8.*p2*p3*p4*eta/den3;
1846 
1847  case 8:
1848  return 2.*p4*p1*xi/den2
1849  + 2.*p1*p3*xi/den2
1850  + 2.*p3*p4*xi/den2
1851  + 8.*p3*p4*p1*xi/den3;
1852 
1853  case 9:
1854  return 2.*p4*zeta/den
1855  + 2.*p1*zeta/den
1856  - 4.*p1*p4/den
1857  + 4.*p1*p4*zeta/den2;
1858 
1859  case 10:
1860  return 2.*p1*zeta/den
1861  + 2.*p2*zeta/den
1862  - 4.*p2*p1/den
1863  + 4.*p2*p1*zeta/den2;
1864 
1865  case 11:
1866  return 2.*p2*zeta/den
1867  + 2.*p3*zeta/den
1868  - 4.*p3*p2/den
1869  + 4.*p3*p2*zeta/den2;
1870 
1871  case 12:
1872  return 2.*p3*zeta/den
1873  + 2.*p4*zeta/den
1874  - 4.*p4*p3/den
1875  + 4.*p4*p3*zeta/den2;
1876 
1877  case 13:
1878  return -8.*p2*p3*p4/den2
1879  - 8.*p3*p4*p1/den2
1880  - 8.*p2*p1*p4/den2
1881  - 8.*p1*p2*p3/den2
1882  - 32.*p1*p2*p3*p4/den3;
1883 
1884  default:
1885  libmesh_error_msg("Invalid i = " << i);
1886  }
1887  }
1888 
1889  default:
1890  libmesh_error_msg("Invalid j = " << j);
1891  }
1892  }
1893 
1894 
1895  default:
1896  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1897  }
1898  }
1899 
1900 
1901  // unsupported order
1902  default:
1903  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1904  }
1905 
1906 #else
1907  return 0.;
1908 #endif
1909 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [85/109]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 599 of file fe_nedelec_one.C.

601 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_deriv() [86/109]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 602 of file fe_lagrange_vec.C.

605 {
606  Real value = FE<2,LAGRANGE>::shape_deriv( type, order, i/2, j, p );
607 
608  switch( i%2 )
609  {
610  case 0:
611  return libMesh::RealGradient( value );
612 
613  case 1:
614  return libMesh::RealGradient( Real(0), value );
615 
616  default:
617  libmesh_error_msg("i%2 must be either 0 or 1!");
618  }
619 
620  //dummy
621  return libMesh::RealGradient();
622 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [87/109]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 603 of file fe_nedelec_one.C.

605 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_deriv() [88/109]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 622 of file fe_nedelec_one.C.

624 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_deriv() [89/109]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 626 of file fe_nedelec_one.C.

628 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_deriv() [90/109]

Real libMesh::FE< 3, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 638 of file fe_monomial_shape_3D.C.

643 {
644  libmesh_assert(elem);
645 
646  // call the orientation-independent shape function derivatives
647  return FE<3,MONOMIAL>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
648 }

◆ shape_deriv() [91/109]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 670 of file fe_lagrange_vec.C.

673 {
674  Real value = FE<3,LAGRANGE>::shape_deriv( type, order, i/3, j, p );
675 
676  switch( i%3 )
677  {
678  case 0:
679  return libMesh::RealGradient( value );
680 
681  case 1:
682  return libMesh::RealGradient( Real(0), value );
683 
684  case 2:
685  return libMesh::RealGradient( Real(0), Real(0), value );
686 
687  default:
688  libmesh_error_msg("i%3 must be 0, 1, or 2!");
689  }
690 
691  //dummy
692  return libMesh::RealGradient();
693 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [92/109]

Real libMesh::FE< 3, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 704 of file fe_hierarchic_shape_3D.C.

709 {
710  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
711  return 0.;
712 }

◆ shape_deriv() [93/109]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 704 of file fe_l2_hierarchic_shape_3D.C.

709 {
710  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
711  return 0.;
712 }

◆ shape_deriv() [94/109]

Real libMesh::FE< 3, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 717 of file fe_hierarchic_shape_3D.C.

722 {
723 #if LIBMESH_DIM == 3
724  libmesh_assert(elem);
725 
726  libmesh_assert_less (j, 3);
727 
728  // cheat by using finite difference approximations:
729  const Real eps = 1.e-6;
730  Point pp, pm;
731 
732  switch (j)
733  {
734  // d()/dxi
735  case 0:
736  {
737  pp = Point(p(0)+eps, p(1), p(2));
738  pm = Point(p(0)-eps, p(1), p(2));
739  break;
740  }
741 
742  // d()/deta
743  case 1:
744  {
745  pp = Point(p(0), p(1)+eps, p(2));
746  pm = Point(p(0), p(1)-eps, p(2));
747  break;
748  }
749 
750  // d()/dzeta
751  case 2:
752  {
753  pp = Point(p(0), p(1), p(2)+eps);
754  pm = Point(p(0), p(1), p(2)-eps);
755  break;
756  }
757 
758  default:
759  libmesh_error_msg("Invalid derivative index j = " << j);
760  }
761 
762  return (FE<3,HIERARCHIC>::shape(elem, order, i, pp) -
763  FE<3,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
764 #endif
765 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [95/109]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 717 of file fe_l2_hierarchic_shape_3D.C.

722 {
723 #if LIBMESH_DIM == 3
724  libmesh_assert(elem);
725 
726  libmesh_assert_less (j, 3);
727 
728  // cheat by using finite difference approximations:
729  const Real eps = 1.e-6;
730  Point pp, pm;
731 
732  switch (j)
733  {
734  // d()/dxi
735  case 0:
736  {
737  pp = Point(p(0)+eps, p(1), p(2));
738  pm = Point(p(0)-eps, p(1), p(2));
739  break;
740  }
741 
742  // d()/deta
743  case 1:
744  {
745  pp = Point(p(0), p(1)+eps, p(2));
746  pm = Point(p(0), p(1)-eps, p(2));
747  break;
748  }
749 
750  // d()/dzeta
751  case 2:
752  {
753  pp = Point(p(0), p(1), p(2)+eps);
754  pm = Point(p(0), p(1), p(2)-eps);
755  break;
756  }
757 
758  default:
759  libmesh_error_msg("Invalid derivative index j = " << j);
760  }
761 
762  return (FE<3,L2_HIERARCHIC>::shape(elem, order, i, pp) -
763  FE<3,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
764 #endif
765 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [96/109]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 728 of file fe_lagrange_vec.C.

731 {
732  Real value = FE<0,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
733  return libMesh::RealGradient( value );
734 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [97/109]

Real libMesh::FE< 2, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 737 of file fe_szabab_shape_2D.C.

742 {
743  libmesh_error_msg("Szabo-Babuska polynomials require the element type \nbecause edge orientation is needed.");
744  return 0.;
745 }

◆ shape_deriv() [98/109]

Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 738 of file fe_subdivision_2D.C.

743 {
744  switch (order)
745  {
746  case FOURTH:
747  {
748  switch (type)
749  {
750  case TRI3SUBDIVISION:
751  libmesh_assert_less(i, 12);
752  return FESubdivision::regular_shape_deriv(i,j,p(0),p(1));
753  default:
754  libmesh_error_msg("ERROR: Unsupported element type!");
755  }
756  }
757  default:
758  libmesh_error_msg("ERROR: Unsupported polynomial order!");
759  }
760 }

◆ shape_deriv() [99/109]

Real libMesh::FE< 2, SZABAB >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 750 of file fe_szabab_shape_2D.C.

755 {
756  libmesh_assert(elem);
757 
758  const ElemType type = elem->type();
759 
760  const Order totalorder = static_cast<Order>(order + elem->p_level());
761 
762  switch (totalorder)
763  {
764 
765  // 1st & 2nd-order Szabo-Babuska.
766  case FIRST:
767  case SECOND:
768  {
769  switch (type)
770  {
771 
772  // Szabo-Babuska shape functions on the triangle.
773  case TRI3:
774  case TRI6:
775  {
776  // Here we use finite differences to compute the derivatives!
777  const Real eps = 1.e-6;
778 
779  libmesh_assert_less (i, 6);
780  libmesh_assert_less (j, 2);
781 
782  switch (j)
783  {
784  // d()/dxi
785  case 0:
786  {
787  const Point pp(p(0)+eps, p(1));
788  const Point pm(p(0)-eps, p(1));
789 
790  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
791  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
792  }
793 
794  // d()/deta
795  case 1:
796  {
797  const Point pp(p(0), p(1)+eps);
798  const Point pm(p(0), p(1)-eps);
799 
800  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
801  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
802  }
803 
804  default:
805  libmesh_error_msg("Invalid j = " << j);
806  }
807  }
808 
809 
810 
811  // Szabo-Babuska shape functions on the quadrilateral.
812  case QUAD4:
813  case QUAD8:
814  case QUAD9:
815  {
816  // Compute quad shape functions as a tensor-product
817  const Real xi = p(0);
818  const Real eta = p(1);
819 
820  libmesh_assert_less (i, 9);
821 
822  // 0 1 2 3 4 5 6 7 8
823  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
824  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
825 
826  switch (j)
827  {
828  // d()/dxi
829  case 0:
830  return (FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
831  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
832 
833  // d()/deta
834  case 1:
835  return (FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
836  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
837 
838  default:
839  libmesh_error_msg("Invalid j = " << j);
840  }
841  }
842 
843  default:
844  libmesh_error_msg("Invalid element type = " << type);
845  }
846  }
847 
848 
849 
850  // 3rd-order Szabo-Babuska.
851  case THIRD:
852  {
853  switch (type)
854  {
855  // Szabo-Babuska shape functions on the triangle.
856  case TRI6:
857  {
858  // Here we use finite differences to compute the derivatives!
859  const Real eps = 1.e-6;
860 
861  libmesh_assert_less (i, 10);
862  libmesh_assert_less (j, 2);
863 
864  switch (j)
865  {
866  // d()/dxi
867  case 0:
868  {
869  const Point pp(p(0)+eps, p(1));
870  const Point pm(p(0)-eps, p(1));
871 
872  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
873  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
874  }
875 
876  // d()/deta
877  case 1:
878  {
879  const Point pp(p(0), p(1)+eps);
880  const Point pm(p(0), p(1)-eps);
881 
882  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
883  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
884  }
885 
886 
887  default:
888  libmesh_error_msg("Invalid j = " << j);
889  }
890  }
891 
892 
893  // Szabo-Babuska shape functions on the quadrilateral.
894  case QUAD8:
895  case QUAD9:
896  {
897  // Compute quad shape functions as a tensor-product
898  const Real xi = p(0);
899  const Real eta = p(1);
900 
901  libmesh_assert_less (i, 16);
902 
903  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
904  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3};
905  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3};
906 
907  Real f=1.;
908 
909  switch(i)
910  {
911  case 5: // edge 0 points
912  if (elem->point(0) > elem->point(1))f = -1.;
913  break;
914  case 7: // edge 1 points
915  if (elem->point(1) > elem->point(2))f = -1.;
916  break;
917  case 9: // edge 2 points
918  if (elem->point(3) > elem->point(2))f = -1.;
919  break;
920  case 11: // edge 3 points
921  if (elem->point(0) > elem->point(3))f = -1.;
922  break;
923 
924  default:
925  // Everything else keeps f=1
926  break;
927  }
928 
929 
930  switch (j)
931  {
932  // d()/dxi
933  case 0:
934  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
935  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
936 
937  // d()/deta
938  case 1:
939  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
940  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
941 
942  default:
943  libmesh_error_msg("Invalid j = " << j);
944  }
945  }
946 
947  default:
948  libmesh_error_msg("Invalid element type = " << type);
949  }
950  }
951 
952 
953 
954 
955  // 4th-order Szabo-Babuska.
956  case FOURTH:
957  {
958  switch (type)
959  {
960 
961  // Szabo-Babuska shape functions on the triangle.
962  case TRI6:
963  {
964  // Here we use finite differences to compute the derivatives!
965  const Real eps = 1.e-6;
966 
967  libmesh_assert_less (i, 15);
968  libmesh_assert_less (j, 2);
969 
970  switch (j)
971  {
972  // d()/dxi
973  case 0:
974  {
975  const Point pp(p(0)+eps, p(1));
976  const Point pm(p(0)-eps, p(1));
977 
978  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
979  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
980  }
981 
982  // d()/deta
983  case 1:
984  {
985  const Point pp(p(0), p(1)+eps);
986  const Point pm(p(0), p(1)-eps);
987 
988  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
989  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
990  }
991 
992 
993  default:
994  libmesh_error_msg("Invalid j = " << j);
995  }
996  }
997 
998 
999 
1000  // Szabo-Babuska shape functions on the quadrilateral.
1001  case QUAD8:
1002  case QUAD9:
1003  {
1004  // Compute quad shape functions as a tensor-product
1005  const Real xi = p(0);
1006  const Real eta = p(1);
1007 
1008  libmesh_assert_less (i, 25);
1009 
1010  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
1011  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4};
1012  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
1013 
1014  Real f=1.;
1015 
1016  switch(i)
1017  {
1018  case 5: // edge 0 points
1019  if (elem->point(0) > elem->point(1))f = -1.;
1020  break;
1021  case 8: // edge 1 points
1022  if (elem->point(1) > elem->point(2))f = -1.;
1023  break;
1024  case 11: // edge 2 points
1025  if (elem->point(3) > elem->point(2))f = -1.;
1026  break;
1027  case 14: // edge 3 points
1028  if (elem->point(0) > elem->point(3))f = -1.;
1029  break;
1030 
1031  default:
1032  // Everything else keeps f=1
1033  break;
1034  }
1035 
1036 
1037  switch (j)
1038  {
1039  // d()/dxi
1040  case 0:
1041  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1042  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1043 
1044  // d()/deta
1045  case 1:
1046  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1047  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1048 
1049  default:
1050  libmesh_error_msg("Invalid j = " << j);
1051  }
1052  }
1053 
1054  default:
1055  libmesh_error_msg("Invalid element type = " << type);
1056  }
1057  }
1058 
1059 
1060 
1061 
1062  // 5th-order Szabo-Babuska.
1063  case FIFTH:
1064  {
1065  // Szabo-Babuska shape functions on the quadrilateral.
1066  switch (type)
1067  {
1068 
1069  // Szabo-Babuska shape functions on the triangle.
1070  case TRI6:
1071  {
1072  // Here we use finite differences to compute the derivatives!
1073  const Real eps = 1.e-6;
1074 
1075  libmesh_assert_less (i, 21);
1076  libmesh_assert_less (j, 2);
1077 
1078  switch (j)
1079  {
1080  // d()/dxi
1081  case 0:
1082  {
1083  const Point pp(p(0)+eps, p(1));
1084  const Point pm(p(0)-eps, p(1));
1085 
1086  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1087  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1088  }
1089 
1090  // d()/deta
1091  case 1:
1092  {
1093  const Point pp(p(0), p(1)+eps);
1094  const Point pm(p(0), p(1)-eps);
1095 
1096  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1097  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1098  }
1099 
1100  default:
1101  libmesh_error_msg("Invalid j = " << j);
1102  }
1103  }
1104 
1105 
1106 
1107  case QUAD8:
1108  case QUAD9:
1109  {
1110  // Compute quad shape functions as a tensor-product
1111  const Real xi = p(0);
1112  const Real eta = p(1);
1113 
1114  libmesh_assert_less (i, 36);
1115 
1116  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
1117  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
1118  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
1119 
1120  Real f=1.;
1121 
1122  switch(i)
1123  {
1124  case 5: // edge 0 points
1125  case 7:
1126  if (elem->point(0) > elem->point(1))f = -1.;
1127  break;
1128  case 9: // edge 1 points
1129  case 11:
1130  if (elem->point(1) > elem->point(2))f = -1.;
1131  break;
1132  case 13: // edge 2 points
1133  case 15:
1134  if (elem->point(3) > elem->point(2))f = -1.;
1135  break;
1136  case 14: // edge 3 points
1137  case 19:
1138  if (elem->point(0) > elem->point(3))f = -1.;
1139  break;
1140 
1141  default:
1142  // Everything else keeps f=1
1143  break;
1144  }
1145 
1146 
1147  switch (j)
1148  {
1149  // d()/dxi
1150  case 0:
1151  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1152  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1153 
1154  // d()/deta
1155  case 1:
1156  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1157  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1158 
1159  default:
1160  libmesh_error_msg("Invalid j = " << j);
1161  }
1162  }
1163 
1164  default:
1165  libmesh_error_msg("Invalid element type = " << type);
1166  }
1167  }
1168 
1169 
1170  // 6th-order Szabo-Babuska.
1171  case SIXTH:
1172  {
1173  // Szabo-Babuska shape functions on the quadrilateral.
1174  switch (type)
1175  {
1176 
1177  // Szabo-Babuska shape functions on the triangle.
1178  case TRI6:
1179  {
1180  // Here we use finite differences to compute the derivatives!
1181  const Real eps = 1.e-6;
1182 
1183  libmesh_assert_less (i, 28);
1184  libmesh_assert_less (j, 2);
1185 
1186  switch (j)
1187  {
1188  // d()/dxi
1189  case 0:
1190  {
1191  const Point pp(p(0)+eps, p(1));
1192  const Point pm(p(0)-eps, p(1));
1193 
1194  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1195  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1196  }
1197 
1198  // d()/deta
1199  case 1:
1200  {
1201  const Point pp(p(0), p(1)+eps);
1202  const Point pm(p(0), p(1)-eps);
1203 
1204  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1205  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1206  }
1207 
1208  default:
1209  libmesh_error_msg("Invalid j = " << j);
1210  }
1211  }
1212 
1213 
1214 
1215  case QUAD8:
1216  case QUAD9:
1217  {
1218  // Compute quad shape functions as a tensor-product
1219  const Real xi = p(0);
1220  const Real eta = p(1);
1221 
1222  libmesh_assert_less (i, 49);
1223 
1224  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
1225  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6};
1226  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6};
1227 
1228  Real f=1.;
1229 
1230  switch(i)
1231  {
1232  case 5: // edge 0 points
1233  case 7:
1234  if (elem->point(0) > elem->point(1))f = -1.;
1235  break;
1236  case 10: // edge 1 points
1237  case 12:
1238  if (elem->point(1) > elem->point(2))f = -1.;
1239  break;
1240  case 15: // edge 2 points
1241  case 17:
1242  if (elem->point(3) > elem->point(2))f = -1.;
1243  break;
1244  case 20: // edge 3 points
1245  case 22:
1246  if (elem->point(0) > elem->point(3))f = -1.;
1247  break;
1248 
1249  default:
1250  // Everything else keeps f=1
1251  break;
1252  }
1253 
1254 
1255  switch (j)
1256  {
1257  // d()/dxi
1258  case 0:
1259  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1260  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1261 
1262  // d()/deta
1263  case 1:
1264  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1265  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1266 
1267  default:
1268  libmesh_error_msg("Invalid j = " << j);
1269  }
1270  }
1271 
1272  default:
1273  libmesh_error_msg("Invalid element type = " << type);
1274  }
1275  }
1276 
1277 
1278  // 7th-order Szabo-Babuska.
1279  case SEVENTH:
1280  {
1281  // Szabo-Babuska shape functions on the quadrilateral.
1282  switch (type)
1283  {
1284 
1285  // Szabo-Babuska shape functions on the triangle.
1286  case TRI6:
1287  {
1288  // Here we use finite differences to compute the derivatives!
1289  const Real eps = 1.e-6;
1290 
1291  libmesh_assert_less (i, 36);
1292  libmesh_assert_less (j, 2);
1293 
1294  switch (j)
1295  {
1296  // d()/dxi
1297  case 0:
1298  {
1299  const Point pp(p(0)+eps, p(1));
1300  const Point pm(p(0)-eps, p(1));
1301 
1302  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1303  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1304  }
1305 
1306  // d()/deta
1307  case 1:
1308  {
1309  const Point pp(p(0), p(1)+eps);
1310  const Point pm(p(0), p(1)-eps);
1311 
1312  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1313  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1314  }
1315 
1316  default:
1317  libmesh_error_msg("Invalid j = " << j);
1318  }
1319  }
1320 
1321 
1322 
1323  case QUAD8:
1324  case QUAD9:
1325  {
1326  // Compute quad shape functions as a tensor-product
1327  const Real xi = p(0);
1328  const Real eta = p(1);
1329 
1330  libmesh_assert_less (i, 64);
1331 
1332  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
1333  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7};
1334  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7};
1335 
1336  Real f=1.;
1337 
1338  switch(i)
1339  {
1340  case 5: // edge 0 points
1341  case 7:
1342  case 9:
1343  if (elem->point(0) > elem->point(1))f = -1.;
1344  break;
1345  case 11: // edge 1 points
1346  case 13:
1347  case 15:
1348  if (elem->point(1) > elem->point(2))f = -1.;
1349  break;
1350  case 17: // edge 2 points
1351  case 19:
1352  case 21:
1353  if (elem->point(3) > elem->point(2))f = -1.;
1354  break;
1355  case 23: // edge 3 points
1356  case 25:
1357  case 27:
1358  if (elem->point(0) > elem->point(3))f = -1.;
1359  break;
1360 
1361  default:
1362  // Everything else keeps f=1
1363  break;
1364  }
1365 
1366 
1367  switch (j)
1368  {
1369  // d()/dxi
1370  case 0:
1371  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1372  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1373 
1374  // d()/deta
1375  case 1:
1376  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1377  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1378 
1379  default:
1380  libmesh_error_msg("Invalid j = " << j);
1381  }
1382  }
1383 
1384  default:
1385  libmesh_error_msg("Invalid element type = " << type);
1386  }
1387  }
1388 
1389 
1390 
1391  // by default throw an error;call the orientation-independent shape functions
1392  default:
1393  libmesh_error_msg("ERROR: Unsupported polynomial order!");
1394  }
1395 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [100/109]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 750 of file fe_lagrange_vec.C.

753 {
754  Real value = FE<1,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
755  return libMesh::RealGradient( value );
756 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [101/109]

Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 765 of file fe_subdivision_2D.C.

770 {
771  libmesh_assert(elem);
772  return FE<2,SUBDIVISION>::shape_deriv(elem->type(), order, i, j, p);
773 }
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)

◆ shape_deriv() [102/109]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 786 of file fe_lagrange_vec.C.

789 {
790  Real value = FE<2,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, j, p );
791 
792  switch( i%2 )
793  {
794  case 0:
795  return libMesh::RealGradient( value );
796 
797  case 1:
798  return libMesh::RealGradient( Real(0), value );
799 
800  default:
801  libmesh_error_msg("i%2 must be either 0 or 1!");
802  }
803 
804  //dummy
805  return libMesh::RealGradient();
806 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [103/109]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 853 of file fe_lagrange_vec.C.

856 {
857  Real value = FE<3,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, j, p );
858 
859  switch( i%3 )
860  {
861  case 0:
862  return libMesh::RealGradient( value );
863 
864  case 1:
865  return libMesh::RealGradient( Real(0), value );
866 
867  case 2:
868  return libMesh::RealGradient( Real(0), Real(0), value );
869 
870  default:
871  libmesh_error_msg("i%3 must be 0, 1, or 2!");
872  }
873 
874  //dummy
875  return libMesh::RealGradient();
876 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_deriv() [104/109]

Real libMesh::FE< 3, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1195 of file fe_l2_lagrange_shape_3D.C.

1200 {
1201  libmesh_assert(elem);
1202 
1203  // call the orientation-independent shape function derivatives
1204  return FE<3,L2_LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1205 }

◆ shape_deriv() [105/109]

Real libMesh::FE< 3, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 1382 of file fe_bernstein_shape_3D.C.

1387 {
1388  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
1389  return 0.;
1390 }

◆ shape_deriv() [106/109]

Real libMesh::FE< 3, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1395 of file fe_bernstein_shape_3D.C.

1400 {
1401 
1402 #if LIBMESH_DIM == 3
1403  libmesh_assert(elem);
1404  const ElemType type = elem->type();
1405 
1406  const Order totalorder = static_cast<Order>(order + elem->p_level());
1407 
1408  libmesh_assert_less (j, 3);
1409 
1410  switch (totalorder)
1411  {
1412  // 1st order Bernstein.
1413  case FIRST:
1414  {
1415  switch (type)
1416  {
1417  // Bernstein shape functions on the tetrahedron.
1418  case TET4:
1419  case TET10:
1420  {
1421  // I have been lazy here and am using finite differences
1422  // to compute the derivatives!
1423  const Real eps = 1.e-6;
1424 
1425  libmesh_assert_less (i, 4);
1426  libmesh_assert_less (j, 3);
1427 
1428 
1429  switch (j)
1430  {
1431  // d()/dxi
1432  case 0:
1433  {
1434  const Point pp(p(0)+eps, p(1), p(2));
1435  const Point pm(p(0)-eps, p(1), p(2));
1436 
1437  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1438  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1439  }
1440 
1441  // d()/deta
1442  case 1:
1443  {
1444  const Point pp(p(0), p(1)+eps, p(2));
1445  const Point pm(p(0), p(1)-eps, p(2));
1446 
1447  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1448  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1449  }
1450  // d()/dzeta
1451  case 2:
1452  {
1453  const Point pp(p(0), p(1), p(2)+eps);
1454  const Point pm(p(0), p(1), p(2)-eps);
1455 
1456  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1457  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1458  }
1459  default:
1460  libmesh_error_msg("Invalid derivative index j = " << j);
1461  }
1462  }
1463 
1464 
1465 
1466 
1467  // Bernstein shape functions on the hexahedral.
1468  case HEX8:
1469  case HEX20:
1470  case HEX27:
1471  {
1472  libmesh_assert_less (i, 8);
1473 
1474  // Compute hex shape functions as a tensor-product
1475  const Real xi = p(0);
1476  const Real eta = p(1);
1477  const Real zeta = p(2);
1478 
1479  // The only way to make any sense of this
1480  // is to look at the mgflo/mg2/mgf documentation
1481  // and make the cut-out cube!
1482  // 0 1 2 3 4 5 6 7
1483  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
1484  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
1485  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
1486 
1487  switch (j)
1488  {
1489  // d()/dxi
1490  case 0:
1491  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1492  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1493  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1494 
1495  // d()/deta
1496  case 1:
1497  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1498  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1499  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1500 
1501  // d()/dzeta
1502  case 2:
1503  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1504  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1505  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta));
1506 
1507  default:
1508  libmesh_error_msg("Invalid derivative index j = " << j);
1509  }
1510  }
1511 
1512  default:
1513  libmesh_error_msg("Invalid element type = " << type);
1514  }
1515  }
1516 
1517 
1518 
1519 
1520  case SECOND:
1521  {
1522  switch (type)
1523  {
1524  // Bernstein shape functions on the tetrahedron.
1525  case TET10:
1526  {
1527  // I have been lazy here and am using finite differences
1528  // to compute the derivatives!
1529  const Real eps = 1.e-6;
1530 
1531  libmesh_assert_less (i, 10);
1532  libmesh_assert_less (j, 3);
1533 
1534 
1535  switch (j)
1536  {
1537  // d()/dxi
1538  case 0:
1539  {
1540  const Point pp(p(0)+eps, p(1), p(2));
1541  const Point pm(p(0)-eps, p(1), p(2));
1542 
1543  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1544  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1545  }
1546 
1547  // d()/deta
1548  case 1:
1549  {
1550  const Point pp(p(0), p(1)+eps, p(2));
1551  const Point pm(p(0), p(1)-eps, p(2));
1552 
1553  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1554  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1555  }
1556  // d()/dzeta
1557  case 2:
1558  {
1559  const Point pp(p(0), p(1), p(2)+eps);
1560  const Point pm(p(0), p(1), p(2)-eps);
1561 
1562  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1563  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1564  }
1565  default:
1566  libmesh_error_msg("Invalid derivative index j = " << j);
1567  }
1568  }
1569 
1570  // Bernstein shape functions on the hexahedral.
1571  case HEX20:
1572  {
1573  libmesh_assert_less (i, 20);
1574 
1575  // Compute hex shape functions as a tensor-product
1576  const Real xi = p(0);
1577  const Real eta = p(1);
1578  const Real zeta = p(2);
1579 
1580  // The only way to make any sense of this
1581  // is to look at the mgflo/mg2/mgf documentation
1582  // and make the cut-out cube!
1583  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1584  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1585  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1586  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1587  static const Real scal20[] = {-0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0};
1588  static const Real scal21[] = {-0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0};
1589  static const Real scal22[] = {0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0};
1590  static const Real scal23[] = {0, 0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0};
1591  static const Real scal24[] = {-0.25, 0, 0, -0.25, -0.25, 0, 0, -0.25, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0, 0.5};
1592  static const Real scal25[] = {0, 0, 0, 0, -0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5};
1593  static const Real scal26[] = {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
1594 
1595  switch (j)
1596  {
1597  // d()/dxi
1598  case 0:
1599  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1600  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1601  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta)
1602  +scal20[i]*
1603  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[20], 0, xi)*
1604  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[20], eta)*
1605  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[20], zeta)
1606  +scal21[i]*
1607  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[21], 0, xi)*
1608  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[21], eta)*
1609  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[21], zeta)
1610  +scal22[i]*
1611  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[22], 0, xi)*
1612  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[22], eta)*
1613  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[22], zeta)
1614  +scal23[i]*
1615  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[23], 0, xi)*
1616  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[23], eta)*
1617  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[23], zeta)
1618  +scal24[i]*
1619  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[24], 0, xi)*
1620  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[24], eta)*
1621  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[24], zeta)
1622  +scal25[i]*
1623  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[25], 0, xi)*
1624  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[25], eta)*
1625  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[25], zeta)
1626  +scal26[i]*
1627  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[26], 0, xi)*
1628  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[26], eta)*
1629  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[26], zeta));
1630 
1631  // d()/deta
1632  case 1:
1633  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1634  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1635  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta)
1636  +scal20[i]*
1637  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[20], xi)*
1638  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[20], 0, eta)*
1639  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[20], zeta)
1640  +scal21[i]*
1641  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[21], xi)*
1642  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[21], 0, eta)*
1643  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[21], zeta)
1644  +scal22[i]*
1645  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[22], xi)*
1646  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[22], 0, eta)*
1647  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[22], zeta)
1648  +scal23[i]*
1649  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[23], xi)*
1650  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[23], 0, eta)*
1651  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[23], zeta)
1652  +scal24[i]*
1653  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[24], xi)*
1654  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[24], 0, eta)*
1655  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[24], zeta)
1656  +scal25[i]*
1657  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[25], xi)*
1658  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[25], 0, eta)*
1659  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[25], zeta)
1660  +scal26[i]*
1661  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[26], xi)*
1662  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[26], 0, eta)*
1663  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[26], zeta));
1664 
1665  // d()/dzeta
1666  case 2:
1667  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1668  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1669  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta)
1670  +scal20[i]*
1671  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[20], xi)*
1672  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[20], eta)*
1673  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[20], 0, zeta)
1674  +scal21[i]*
1675  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[21], xi)*
1676  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[21], eta)*
1677  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[21], 0, zeta)
1678  +scal22[i]*
1679  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[22], xi)*
1680  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[22], eta)*
1681  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[22], 0, zeta)
1682  +scal23[i]*
1683  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[23], xi)*
1684  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[23], eta)*
1685  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[23], 0, zeta)
1686  +scal24[i]*
1687  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[24], xi)*
1688  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[24], eta)*
1689  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[24], 0, zeta)
1690  +scal25[i]*
1691  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[25], xi)*
1692  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[25], eta)*
1693  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[25], 0, zeta)
1694  +scal26[i]*
1695  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[26], xi)*
1696  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[26], eta)*
1697  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[26], 0, zeta));
1698 
1699  default:
1700  libmesh_error_msg("Invalid derivative index j = " << j);
1701  }
1702  }
1703 
1704  // Bernstein shape functions on the hexahedral.
1705  case HEX27:
1706  {
1707  libmesh_assert_less (i, 27);
1708 
1709  // Compute hex shape functions as a tensor-product
1710  const Real xi = p(0);
1711  const Real eta = p(1);
1712  const Real zeta = p(2);
1713 
1714  // The only way to make any sense of this
1715  // is to look at the mgflo/mg2/mgf documentation
1716  // and make the cut-out cube!
1717  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1718  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1719  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1720  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1721 
1722  switch (j)
1723  {
1724  // d()/dxi
1725  case 0:
1726  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1727  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1728  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1729 
1730  // d()/deta
1731  case 1:
1732  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1733  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1734  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1735 
1736  // d()/dzeta
1737  case 2:
1738  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1739  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1740  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta));
1741 
1742  default:
1743  libmesh_error_msg("Invalid derivative index j = " << j);
1744  }
1745  }
1746 
1747 
1748  default:
1749  libmesh_error_msg("Invalid element type = " << type);
1750  }
1751  }
1752 
1753 
1754 
1755  // 3rd-order Bernstein.
1756  case THIRD:
1757  {
1758  switch (type)
1759  {
1760 
1761  // // Bernstein shape functions derivatives.
1762  // case TET10:
1763  // {
1764  // // I have been lazy here and am using finite differences
1765  // // to compute the derivatives!
1766  // const Real eps = 1.e-6;
1767 
1768  // libmesh_assert_less (i, 20);
1769  // libmesh_assert_less (j, 3);
1770 
1771  // switch (j)
1772  // {
1773  // // d()/dxi
1774  // case 0:
1775  // {
1776  // const Point pp(p(0)+eps, p(1), p(2));
1777  // const Point pm(p(0)-eps, p(1), p(2));
1778 
1779  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1780  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1781  // }
1782 
1783  // // d()/deta
1784  // case 1:
1785  // {
1786  // const Point pp(p(0), p(1)+eps, p(2));
1787  // const Point pm(p(0), p(1)-eps, p(2));
1788 
1789  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1790  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1791  // }
1792  // // d()/dzeta
1793  // case 2:
1794  // {
1795  // const Point pp(p(0), p(1), p(2)+eps);
1796  // const Point pm(p(0), p(1), p(2)-eps);
1797 
1798  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1799  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1800  // }
1801  // default:
1802  // libmesh_error_msg("Invalid derivative index j = " << j);
1803  // }
1804 
1805 
1806  // }
1807 
1808 
1809  // Bernstein shape functions on the hexahedral.
1810  case HEX27:
1811  {
1812  // I have been lazy here and am using finite differences
1813  // to compute the derivatives!
1814  const Real eps = 1.e-6;
1815 
1816  libmesh_assert_less (i, 64);
1817  libmesh_assert_less (j, 3);
1818 
1819  switch (j)
1820  {
1821  // d()/dxi
1822  case 0:
1823  {
1824  const Point pp(p(0)+eps, p(1), p(2));
1825  const Point pm(p(0)-eps, p(1), p(2));
1826 
1827  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1828  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1829  }
1830 
1831  // d()/deta
1832  case 1:
1833  {
1834  const Point pp(p(0), p(1)+eps, p(2));
1835  const Point pm(p(0), p(1)-eps, p(2));
1836 
1837  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1838  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1839  }
1840  // d()/dzeta
1841  case 2:
1842  {
1843  const Point pp(p(0), p(1), p(2)+eps);
1844  const Point pm(p(0), p(1), p(2)-eps);
1845 
1846  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1847  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1848  }
1849  default:
1850  libmesh_error_msg("Invalid derivative index j = " << j);
1851  }
1852 
1853  }
1854 
1855  // // Compute hex shape functions as a tensor-product
1856  // const Real xi = p(0);
1857  // const Real eta = p(1);
1858  // const Real zeta = p(2);
1859  // Real xi_mapped = p(0);
1860  // Real eta_mapped = p(1);
1861  // Real zeta_mapped = p(2);
1862 
1863  // // The only way to make any sense of this
1864  // // is to look at the mgflo/mg2/mgf documentation
1865  // // and make the cut-out cube!
1866  // // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
1867  // // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63
1868  // static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3};
1869  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3};
1870  // static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
1871 
1872 
1873 
1874  // // handle the edge orientation
1875  // {
1876  // // Edge 0
1877  // if ((i1[i] == 0) && (i2[i] == 0))
1878  // {
1879  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(1)))
1880  // xi_mapped = -xi;
1881  // }
1882  // // Edge 1
1883  // else if ((i0[i] == 1) && (i2[i] == 0))
1884  // {
1885  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(2)))
1886  // eta_mapped = -eta;
1887  // }
1888  // // Edge 2
1889  // else if ((i1[i] == 1) && (i2[i] == 0))
1890  // {
1891  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(2)))
1892  // xi_mapped = -xi;
1893  // }
1894  // // Edge 3
1895  // else if ((i0[i] == 0) && (i2[i] == 0))
1896  // {
1897  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(3)))
1898  // eta_mapped = -eta;
1899  // }
1900  // // Edge 4
1901  // else if ((i0[i] == 0) && (i1[i] == 0))
1902  // {
1903  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(4)))
1904  // zeta_mapped = -zeta;
1905  // }
1906  // // Edge 5
1907  // else if ((i0[i] == 1) && (i1[i] == 0))
1908  // {
1909  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(5)))
1910  // zeta_mapped = -zeta;
1911  // }
1912  // // Edge 6
1913  // else if ((i0[i] == 1) && (i1[i] == 1))
1914  // {
1915  // if (elem->node_id(2) != std::min(elem->node_id(2), elem->node_id(6)))
1916  // zeta_mapped = -zeta;
1917  // }
1918  // // Edge 7
1919  // else if ((i0[i] == 0) && (i1[i] == 1))
1920  // {
1921  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(7)))
1922  // zeta_mapped = -zeta;
1923  // }
1924  // // Edge 8
1925  // else if ((i1[i] == 0) && (i2[i] == 1))
1926  // {
1927  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(5)))
1928  // xi_mapped = -xi;
1929  // }
1930  // // Edge 9
1931  // else if ((i0[i] == 1) && (i2[i] == 1))
1932  // {
1933  // if (elem->node_id(5) != std::min(elem->node_id(5), elem->node_id(6)))
1934  // eta_mapped = -eta;
1935  // }
1936  // // Edge 10
1937  // else if ((i1[i] == 1) && (i2[i] == 1))
1938  // {
1939  // if (elem->node_id(7) != std::min(elem->node_id(7), elem->node_id(6)))
1940  // xi_mapped = -xi;
1941  // }
1942  // // Edge 11
1943  // else if ((i0[i] == 0) && (i2[i] == 1))
1944  // {
1945  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(7)))
1946  // eta_mapped = -eta;
1947  // }
1948  // }
1949 
1950 
1951  // // handle the face orientation
1952  // {
1953  // // Face 0
1954  // if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
1955  // {
1956  // const unsigned int min_node = std::min(elem->node_id(1),
1957  // std::min(elem->node_id(2),
1958  // std::min(elem->node_id(0),
1959  // elem->node_id(3))));
1960  // if (elem->node_id(0) == min_node)
1961  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(3)))
1962  // {
1963  // // Case 1
1964  // xi_mapped = xi;
1965  // eta_mapped = eta;
1966  // }
1967  // else
1968  // {
1969  // // Case 2
1970  // xi_mapped = eta;
1971  // eta_mapped = xi;
1972  // }
1973 
1974  // else if (elem->node_id(3) == min_node)
1975  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(2)))
1976  // {
1977  // // Case 3
1978  // xi_mapped = -eta;
1979  // eta_mapped = xi;
1980  // }
1981  // else
1982  // {
1983  // // Case 4
1984  // xi_mapped = xi;
1985  // eta_mapped = -eta;
1986  // }
1987 
1988  // else if (elem->node_id(2) == min_node)
1989  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(1)))
1990  // {
1991  // // Case 5
1992  // xi_mapped = -xi;
1993  // eta_mapped = -eta;
1994  // }
1995  // else
1996  // {
1997  // // Case 6
1998  // xi_mapped = -eta;
1999  // eta_mapped = -xi;
2000  // }
2001 
2002  // else if (elem->node_id(1) == min_node)
2003  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(0)))
2004  // {
2005  // // Case 7
2006  // xi_mapped = eta;
2007  // eta_mapped = -xi;
2008  // }
2009  // else
2010  // {
2011  // // Case 8
2012  // xi_mapped = -xi;
2013  // eta_mapped = eta;
2014  // }
2015  // }
2016 
2017 
2018  // // Face 1
2019  // else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
2020  // {
2021  // const unsigned int min_node = std::min(elem->node_id(0),
2022  // std::min(elem->node_id(1),
2023  // std::min(elem->node_id(5),
2024  // elem->node_id(4))));
2025  // if (elem->node_id(0) == min_node)
2026  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(4)))
2027  // {
2028  // // Case 1
2029  // xi_mapped = xi;
2030  // zeta_mapped = zeta;
2031  // }
2032  // else
2033  // {
2034  // // Case 2
2035  // xi_mapped = zeta;
2036  // zeta_mapped = xi;
2037  // }
2038 
2039  // else if (elem->node_id(1) == min_node)
2040  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(0)))
2041  // {
2042  // // Case 3
2043  // xi_mapped = zeta;
2044  // zeta_mapped = -xi;
2045  // }
2046  // else
2047  // {
2048  // // Case 4
2049  // xi_mapped = -xi;
2050  // zeta_mapped = zeta;
2051  // }
2052 
2053  // else if (elem->node_id(5) == min_node)
2054  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(1)))
2055  // {
2056  // // Case 5
2057  // xi_mapped = -xi;
2058  // zeta_mapped = -zeta;
2059  // }
2060  // else
2061  // {
2062  // // Case 6
2063  // xi_mapped = -zeta;
2064  // zeta_mapped = -xi;
2065  // }
2066 
2067  // else if (elem->node_id(4) == min_node)
2068  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(5)))
2069  // {
2070  // // Case 7
2071  // xi_mapped = -xi;
2072  // zeta_mapped = zeta;
2073  // }
2074  // else
2075  // {
2076  // // Case 8
2077  // xi_mapped = xi;
2078  // zeta_mapped = -zeta;
2079  // }
2080  // }
2081 
2082 
2083  // // Face 2
2084  // else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
2085  // {
2086  // const unsigned int min_node = std::min(elem->node_id(1),
2087  // std::min(elem->node_id(2),
2088  // std::min(elem->node_id(6),
2089  // elem->node_id(5))));
2090  // if (elem->node_id(1) == min_node)
2091  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(5)))
2092  // {
2093  // // Case 1
2094  // eta_mapped = eta;
2095  // zeta_mapped = zeta;
2096  // }
2097  // else
2098  // {
2099  // // Case 2
2100  // eta_mapped = zeta;
2101  // zeta_mapped = eta;
2102  // }
2103 
2104  // else if (elem->node_id(2) == min_node)
2105  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(1)))
2106  // {
2107  // // Case 3
2108  // eta_mapped = zeta;
2109  // zeta_mapped = -eta;
2110  // }
2111  // else
2112  // {
2113  // // Case 4
2114  // eta_mapped = -eta;
2115  // zeta_mapped = zeta;
2116  // }
2117 
2118  // else if (elem->node_id(6) == min_node)
2119  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(2)))
2120  // {
2121  // // Case 5
2122  // eta_mapped = -eta;
2123  // zeta_mapped = -zeta;
2124  // }
2125  // else
2126  // {
2127  // // Case 6
2128  // eta_mapped = -zeta;
2129  // zeta_mapped = -eta;
2130  // }
2131 
2132  // else if (elem->node_id(5) == min_node)
2133  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(6)))
2134  // {
2135  // // Case 7
2136  // eta_mapped = -zeta;
2137  // zeta_mapped = eta;
2138  // }
2139  // else
2140  // {
2141  // // Case 8
2142  // eta_mapped = eta;
2143  // zeta_mapped = -zeta;
2144  // }
2145  // }
2146 
2147 
2148  // // Face 3
2149  // else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
2150  // {
2151  // const unsigned int min_node = std::min(elem->node_id(2),
2152  // std::min(elem->node_id(3),
2153  // std::min(elem->node_id(7),
2154  // elem->node_id(6))));
2155  // if (elem->node_id(3) == min_node)
2156  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(7)))
2157  // {
2158  // // Case 1
2159  // xi_mapped = xi;
2160  // zeta_mapped = zeta;
2161  // }
2162  // else
2163  // {
2164  // // Case 2
2165  // xi_mapped = zeta;
2166  // zeta_mapped = xi;
2167  // }
2168 
2169  // else if (elem->node_id(7) == min_node)
2170  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(6)))
2171  // {
2172  // // Case 3
2173  // xi_mapped = -zeta;
2174  // zeta_mapped = xi;
2175  // }
2176  // else
2177  // {
2178  // // Case 4
2179  // xi_mapped = xi;
2180  // zeta_mapped = -zeta;
2181  // }
2182 
2183  // else if (elem->node_id(6) == min_node)
2184  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(2)))
2185  // {
2186  // // Case 5
2187  // xi_mapped = -xi;
2188  // zeta_mapped = -zeta;
2189  // }
2190  // else
2191  // {
2192  // // Case 6
2193  // xi_mapped = -zeta;
2194  // zeta_mapped = -xi;
2195  // }
2196 
2197  // else if (elem->node_id(2) == min_node)
2198  // if (elem->node_id(6) == std::min(elem->node_id(3), elem->node_id(6)))
2199  // {
2200  // // Case 7
2201  // xi_mapped = zeta;
2202  // zeta_mapped = -xi;
2203  // }
2204  // else
2205  // {
2206  // // Case 8
2207  // xi_mapped = -xi;
2208  // zeta_mapped = zeta;
2209  // }
2210  // }
2211 
2212 
2213  // // Face 4
2214  // else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
2215  // {
2216  // const unsigned int min_node = std::min(elem->node_id(3),
2217  // std::min(elem->node_id(0),
2218  // std::min(elem->node_id(4),
2219  // elem->node_id(7))));
2220  // if (elem->node_id(0) == min_node)
2221  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(4)))
2222  // {
2223  // // Case 1
2224  // eta_mapped = eta;
2225  // zeta_mapped = zeta;
2226  // }
2227  // else
2228  // {
2229  // // Case 2
2230  // eta_mapped = zeta;
2231  // zeta_mapped = eta;
2232  // }
2233 
2234  // else if (elem->node_id(4) == min_node)
2235  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(7)))
2236  // {
2237  // // Case 3
2238  // eta_mapped = -zeta;
2239  // zeta_mapped = eta;
2240  // }
2241  // else
2242  // {
2243  // // Case 4
2244  // eta_mapped = eta;
2245  // zeta_mapped = -zeta;
2246  // }
2247 
2248  // else if (elem->node_id(7) == min_node)
2249  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(3)))
2250  // {
2251  // // Case 5
2252  // eta_mapped = -eta;
2253  // zeta_mapped = -zeta;
2254  // }
2255  // else
2256  // {
2257  // // Case 6
2258  // eta_mapped = -zeta;
2259  // zeta_mapped = -eta;
2260  // }
2261 
2262  // else if (elem->node_id(3) == min_node)
2263  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(0)))
2264  // {
2265  // // Case 7
2266  // eta_mapped = zeta;
2267  // zeta_mapped = -eta;
2268  // }
2269  // else
2270  // {
2271  // // Case 8
2272  // eta_mapped = -eta;
2273  // zeta_mapped = zeta;
2274  // }
2275  // }
2276 
2277 
2278  // // Face 5
2279  // else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
2280  // {
2281  // const unsigned int min_node = std::min(elem->node_id(4),
2282  // std::min(elem->node_id(5),
2283  // std::min(elem->node_id(6),
2284  // elem->node_id(7))));
2285  // if (elem->node_id(4) == min_node)
2286  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(7)))
2287  // {
2288  // // Case 1
2289  // xi_mapped = xi;
2290  // eta_mapped = eta;
2291  // }
2292  // else
2293  // {
2294  // // Case 2
2295  // xi_mapped = eta;
2296  // eta_mapped = xi;
2297  // }
2298 
2299  // else if (elem->node_id(5) == min_node)
2300  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(4)))
2301  // {
2302  // // Case 3
2303  // xi_mapped = eta;
2304  // eta_mapped = -xi;
2305  // }
2306  // else
2307  // {
2308  // // Case 4
2309  // xi_mapped = -xi;
2310  // eta_mapped = eta;
2311  // }
2312 
2313  // else if (elem->node_id(6) == min_node)
2314  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(5)))
2315  // {
2316  // // Case 5
2317  // xi_mapped = -xi;
2318  // eta_mapped = -eta;
2319  // }
2320  // else
2321  // {
2322  // // Case 6
2323  // xi_mapped = -eta;
2324  // eta_mapped = -xi;
2325  // }
2326 
2327  // else if (elem->node_id(7) == min_node)
2328  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(6)))
2329  // {
2330  // // Case 7
2331  // xi_mapped = -eta;
2332  // eta_mapped = xi;
2333  // }
2334  // else
2335  // {
2336  // // Case 8
2337  // xi_mapped = xi;
2338  // eta_mapped = eta;
2339  // }
2340  // }
2341 
2342 
2343  // }
2344 
2345 
2346 
2347  // libmesh_assert_less (j, 3);
2348 
2349  // switch (j)
2350  // {
2351  // // d()/dxi
2352  // case 0:
2353  // return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi_mapped)*
2354  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2355  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2356 
2357  // // d()/deta
2358  // case 1:
2359  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2360  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta_mapped)*
2361  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2362 
2363  // // d()/dzeta
2364  // case 2:
2365  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2366  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2367  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta_mapped));
2368 
2369  // default:
2370  // libmesh_error_msg("Invalid derivative index j = " << j);
2371  // }
2372  // }
2373 
2374 
2375  default:
2376  libmesh_error_msg("Invalid element type = " << type);
2377  }
2378  }
2379 
2380  // 4th-order Bernstein.
2381  case FOURTH:
2382  {
2383  switch (type)
2384  {
2385 
2386  // Bernstein shape functions derivatives on the hexahedral.
2387  case HEX27:
2388  {
2389  const Real eps = 1.e-6;
2390 
2391  libmesh_assert_less (i, 125);
2392  libmesh_assert_less (j, 3);
2393 
2394  switch (j)
2395  {
2396  // d()/dxi
2397  case 0:
2398  {
2399  const Point pp(p(0)+eps, p(1), p(2));
2400  const Point pm(p(0)-eps, p(1), p(2));
2401 
2402  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2403  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2404  }
2405 
2406  // d()/deta
2407  case 1:
2408  {
2409  const Point pp(p(0), p(1)+eps, p(2));
2410  const Point pm(p(0), p(1)-eps, p(2));
2411 
2412  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2413  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2414  }
2415  // d()/dzeta
2416  case 2:
2417  {
2418  const Point pp(p(0), p(1), p(2)+eps);
2419  const Point pm(p(0), p(1), p(2)-eps);
2420 
2421  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2422  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2423  }
2424  default:
2425  libmesh_error_msg("Invalid derivative index j = " << j);
2426  }
2427  }
2428 
2429  // // Compute hex shape functions as a tensor-product
2430  // const Real xi = p(0);
2431  // const Real eta = p(1);
2432  // const Real zeta = p(2);
2433  // Real xi_mapped = p(0);
2434  // Real eta_mapped = p(1);
2435  // Real zeta_mapped = p(2);
2436 
2437  // // The only way to make any sense of this
2438  // // is to look at the mgflo/mg2/mgf documentation
2439  // // and make the cut-out cube!
2440  // // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
2441  // // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
2442  // static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4};
2443  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
2444  // static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4};
2445 
2446 
2447 
2448  // // handle the edge orientation
2449  // {
2450  // // Edge 0
2451  // if ((i1[i] == 0) && (i2[i] == 0))
2452  // {
2453  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(1)))
2454  // xi_mapped = -xi;
2455  // }
2456  // // Edge 1
2457  // else if ((i0[i] == 1) && (i2[i] == 0))
2458  // {
2459  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(2)))
2460  // eta_mapped = -eta;
2461  // }
2462  // // Edge 2
2463  // else if ((i1[i] == 1) && (i2[i] == 0))
2464  // {
2465  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(2)))
2466  // xi_mapped = -xi;
2467  // }
2468  // // Edge 3
2469  // else if ((i0[i] == 0) && (i2[i] == 0))
2470  // {
2471  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(3)))
2472  // eta_mapped = -eta;
2473  // }
2474  // // Edge 4
2475  // else if ((i0[i] == 0) && (i1[i] == 0))
2476  // {
2477  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(4)))
2478  // zeta_mapped = -zeta;
2479  // }
2480  // // Edge 5
2481  // else if ((i0[i] == 1) && (i1[i] == 0))
2482  // {
2483  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(5)))
2484  // zeta_mapped = -zeta;
2485  // }
2486  // // Edge 6
2487  // else if ((i0[i] == 1) && (i1[i] == 1))
2488  // {
2489  // if (elem->node_id(2) != std::min(elem->node_id(2), elem->node_id(6)))
2490  // zeta_mapped = -zeta;
2491  // }
2492  // // Edge 7
2493  // else if ((i0[i] == 0) && (i1[i] == 1))
2494  // {
2495  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(7)))
2496  // zeta_mapped = -zeta;
2497  // }
2498  // // Edge 8
2499  // else if ((i1[i] == 0) && (i2[i] == 1))
2500  // {
2501  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(5)))
2502  // xi_mapped = -xi;
2503  // }
2504  // // Edge 9
2505  // else if ((i0[i] == 1) && (i2[i] == 1))
2506  // {
2507  // if (elem->node_id(5) != std::min(elem->node_id(5), elem->node_id(6)))
2508  // eta_mapped = -eta;
2509  // }
2510  // // Edge 10
2511  // else if ((i1[i] == 1) && (i2[i] == 1))
2512  // {
2513  // if (elem->node_id(7) != std::min(elem->node_id(7), elem->node_id(6)))
2514  // xi_mapped = -xi;
2515  // }
2516  // // Edge 11
2517  // else if ((i0[i] == 0) && (i2[i] == 1))
2518  // {
2519  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(7)))
2520  // eta_mapped = -eta;
2521  // }
2522  // }
2523 
2524 
2525  // // handle the face orientation
2526  // {
2527  // // Face 0
2528  // if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
2529  // {
2530  // const unsigned int min_node = std::min(elem->node_id(1),
2531  // std::min(elem->node_id(2),
2532  // std::min(elem->node_id(0),
2533  // elem->node_id(3))));
2534  // if (elem->node_id(0) == min_node)
2535  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(3)))
2536  // {
2537  // // Case 1
2538  // xi_mapped = xi;
2539  // eta_mapped = eta;
2540  // }
2541  // else
2542  // {
2543  // // Case 2
2544  // xi_mapped = eta;
2545  // eta_mapped = xi;
2546  // }
2547 
2548  // else if (elem->node_id(3) == min_node)
2549  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(2)))
2550  // {
2551  // // Case 3
2552  // xi_mapped = -eta;
2553  // eta_mapped = xi;
2554  // }
2555  // else
2556  // {
2557  // // Case 4
2558  // xi_mapped = xi;
2559  // eta_mapped = -eta;
2560  // }
2561 
2562  // else if (elem->node_id(2) == min_node)
2563  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(1)))
2564  // {
2565  // // Case 5
2566  // xi_mapped = -xi;
2567  // eta_mapped = -eta;
2568  // }
2569  // else
2570  // {
2571  // // Case 6
2572  // xi_mapped = -eta;
2573  // eta_mapped = -xi;
2574  // }
2575 
2576  // else if (elem->node_id(1) == min_node)
2577  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(0)))
2578  // {
2579  // // Case 7
2580  // xi_mapped = eta;
2581  // eta_mapped = -xi;
2582  // }
2583  // else
2584  // {
2585  // // Case 8
2586  // xi_mapped = -xi;
2587  // eta_mapped = eta;
2588  // }
2589  // }
2590 
2591 
2592  // // Face 1
2593  // else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
2594  // {
2595  // const unsigned int min_node = std::min(elem->node_id(0),
2596  // std::min(elem->node_id(1),
2597  // std::min(elem->node_id(5),
2598  // elem->node_id(4))));
2599  // if (elem->node_id(0) == min_node)
2600  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(4)))
2601  // {
2602  // // Case 1
2603  // xi_mapped = xi;
2604  // zeta_mapped = zeta;
2605  // }
2606  // else
2607  // {
2608  // // Case 2
2609  // xi_mapped = zeta;
2610  // zeta_mapped = xi;
2611  // }
2612 
2613  // else if (elem->node_id(1) == min_node)
2614  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(0)))
2615  // {
2616  // // Case 3
2617  // xi_mapped = zeta;
2618  // zeta_mapped = -xi;
2619  // }
2620  // else
2621  // {
2622  // // Case 4
2623  // xi_mapped = -xi;
2624  // zeta_mapped = zeta;
2625  // }
2626 
2627  // else if (elem->node_id(5) == min_node)
2628  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(1)))
2629  // {
2630  // // Case 5
2631  // xi_mapped = -xi;
2632  // zeta_mapped = -zeta;
2633  // }
2634  // else
2635  // {
2636  // // Case 6
2637  // xi_mapped = -zeta;
2638  // zeta_mapped = -xi;
2639  // }
2640 
2641  // else if (elem->node_id(4) == min_node)
2642  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(5)))
2643  // {
2644  // // Case 7
2645  // xi_mapped = -xi;
2646  // zeta_mapped = zeta;
2647  // }
2648  // else
2649  // {
2650  // // Case 8
2651  // xi_mapped = xi;
2652  // zeta_mapped = -zeta;
2653  // }
2654  // }
2655 
2656 
2657  // // Face 2
2658  // else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
2659  // {
2660  // const unsigned int min_node = std::min(elem->node_id(1),
2661  // std::min(elem->node_id(2),
2662  // std::min(elem->node_id(6),
2663  // elem->node_id(5))));
2664  // if (elem->node_id(1) == min_node)
2665  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(5)))
2666  // {
2667  // // Case 1
2668  // eta_mapped = eta;
2669  // zeta_mapped = zeta;
2670  // }
2671  // else
2672  // {
2673  // // Case 2
2674  // eta_mapped = zeta;
2675  // zeta_mapped = eta;
2676  // }
2677 
2678  // else if (elem->node_id(2) == min_node)
2679  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(1)))
2680  // {
2681  // // Case 3
2682  // eta_mapped = zeta;
2683  // zeta_mapped = -eta;
2684  // }
2685  // else
2686  // {
2687  // // Case 4
2688  // eta_mapped = -eta;
2689  // zeta_mapped = zeta;
2690  // }
2691 
2692  // else if (elem->node_id(6) == min_node)
2693  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(2)))
2694  // {
2695  // // Case 5
2696  // eta_mapped = -eta;
2697  // zeta_mapped = -zeta;
2698  // }
2699  // else
2700  // {
2701  // // Case 6
2702  // eta_mapped = -zeta;
2703  // zeta_mapped = -eta;
2704  // }
2705 
2706  // else if (elem->node_id(5) == min_node)
2707  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(6)))
2708  // {
2709  // // Case 7
2710  // eta_mapped = -zeta;
2711  // zeta_mapped = eta;
2712  // }
2713  // else
2714  // {
2715  // // Case 8
2716  // eta_mapped = eta;
2717  // zeta_mapped = -zeta;
2718  // }
2719  // }
2720 
2721 
2722  // // Face 3
2723  // else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
2724  // {
2725  // const unsigned int min_node = std::min(elem->node_id(2),
2726  // std::min(elem->node_id(3),
2727  // std::min(elem->node_id(7),
2728  // elem->node_id(6))));
2729  // if (elem->node_id(3) == min_node)
2730  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(7)))
2731  // {
2732  // // Case 1
2733  // xi_mapped = xi;
2734  // zeta_mapped = zeta;
2735  // }
2736  // else
2737  // {
2738  // // Case 2
2739  // xi_mapped = zeta;
2740  // zeta_mapped = xi;
2741  // }
2742 
2743  // else if (elem->node_id(7) == min_node)
2744  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(6)))
2745  // {
2746  // // Case 3
2747  // xi_mapped = -zeta;
2748  // zeta_mapped = xi;
2749  // }
2750  // else
2751  // {
2752  // // Case 4
2753  // xi_mapped = xi;
2754  // zeta_mapped = -zeta;
2755  // }
2756 
2757  // else if (elem->node_id(6) == min_node)
2758  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(2)))
2759  // {
2760  // // Case 5
2761  // xi_mapped = -xi;
2762  // zeta_mapped = -zeta;
2763  // }
2764  // else
2765  // {
2766  // // Case 6
2767  // xi_mapped = -zeta;
2768  // zeta_mapped = -xi;
2769  // }
2770 
2771  // else if (elem->node_id(2) == min_node)
2772  // if (elem->node_id(6) == std::min(elem->node_id(3), elem->node_id(6)))
2773  // {
2774  // // Case 7
2775  // xi_mapped = zeta;
2776  // zeta_mapped = -xi;
2777  // }
2778  // else
2779  // {
2780  // // Case 8
2781  // xi_mapped = -xi;
2782  // zeta_mapped = zeta;
2783  // }
2784  // }
2785 
2786 
2787  // // Face 4
2788  // else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
2789  // {
2790  // const unsigned int min_node = std::min(elem->node_id(3),
2791  // std::min(elem->node_id(0),
2792  // std::min(elem->node_id(4),
2793  // elem->node_id(7))));
2794  // if (elem->node_id(0) == min_node)
2795  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(4)))
2796  // {
2797  // // Case 1
2798  // eta_mapped = eta;
2799  // zeta_mapped = zeta;
2800  // }
2801  // else
2802  // {
2803  // // Case 2
2804  // eta_mapped = zeta;
2805  // zeta_mapped = eta;
2806  // }
2807 
2808  // else if (elem->node_id(4) == min_node)
2809  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(7)))
2810  // {
2811  // // Case 3
2812  // eta_mapped = -zeta;
2813  // zeta_mapped = eta;
2814  // }
2815  // else
2816  // {
2817  // // Case 4
2818  // eta_mapped = eta;
2819  // zeta_mapped = -zeta;
2820  // }
2821 
2822  // else if (elem->node_id(7) == min_node)
2823  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(3)))
2824  // {
2825  // // Case 5
2826  // eta_mapped = -eta;
2827  // zeta_mapped = -zeta;
2828  // }
2829  // else
2830  // {
2831  // // Case 6
2832  // eta_mapped = -zeta;
2833  // zeta_mapped = -eta;
2834  // }
2835 
2836  // else if (elem->node_id(3) == min_node)
2837  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(0)))
2838  // {
2839  // // Case 7
2840  // eta_mapped = zeta;
2841  // zeta_mapped = -eta;
2842  // }
2843  // else
2844  // {
2845  // // Case 8
2846  // eta_mapped = -eta;
2847  // zeta_mapped = zeta;
2848  // }
2849  // }
2850 
2851 
2852  // // Face 5
2853  // else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
2854  // {
2855  // const unsigned int min_node = std::min(elem->node_id(4),
2856  // std::min(elem->node_id(5),
2857  // std::min(elem->node_id(6),
2858  // elem->node_id(7))));
2859  // if (elem->node_id(4) == min_node)
2860  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(7)))
2861  // {
2862  // // Case 1
2863  // xi_mapped = xi;
2864  // eta_mapped = eta;
2865  // }
2866  // else
2867  // {
2868  // // Case 2
2869  // xi_mapped = eta;
2870  // eta_mapped = xi;
2871  // }
2872 
2873  // else if (elem->node_id(5) == min_node)
2874  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(4)))
2875  // {
2876  // // Case 3
2877  // xi_mapped = eta;
2878  // eta_mapped = -xi;
2879  // }
2880  // else
2881  // {
2882  // // Case 4
2883  // xi_mapped = -xi;
2884  // eta_mapped = eta;
2885  // }
2886 
2887  // else if (elem->node_id(6) == min_node)
2888  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(5)))
2889  // {
2890  // // Case 5
2891  // xi_mapped = -xi;
2892  // eta_mapped = -eta;
2893  // }
2894  // else
2895  // {
2896  // // Case 6
2897  // xi_mapped = -eta;
2898  // eta_mapped = -xi;
2899  // }
2900 
2901  // else if (elem->node_id(7) == min_node)
2902  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(6)))
2903  // {
2904  // // Case 7
2905  // xi_mapped = -eta;
2906  // eta_mapped = xi;
2907  // }
2908  // else
2909  // {
2910  // // Case 8
2911  // xi_mapped = xi;
2912  // eta_mapped = eta;
2913  // }
2914  // }
2915 
2916 
2917  // }
2918 
2919 
2920 
2921  // libmesh_assert_less (j, 3);
2922 
2923  // switch (j)
2924  // {
2925  // // d()/dxi
2926  // case 0:
2927  // return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi_mapped)*
2928  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2929  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2930 
2931  // // d()/deta
2932  // case 1:
2933  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2934  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta_mapped)*
2935  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2936 
2937  // // d()/dzeta
2938  // case 2:
2939  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2940  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2941  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta_mapped));
2942 
2943  // default:
2944  // libmesh_error_msg("Invalid derivative index j = " << j);
2945  // }
2946  // }
2947 
2948 
2949  default:
2950  libmesh_error_msg("Invalid element type = " << type);
2951  }
2952  }
2953 
2954 
2955  default:
2956  libmesh_error_msg("Invalid totalorder = " << totalorder);
2957  }
2958 
2959 #endif
2960 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_deriv() [107/109]

Real libMesh::FE< 3, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1914 of file fe_lagrange_shape_3D.C.

1919 {
1920  libmesh_assert(elem);
1921 
1922  // call the orientation-independent shape function derivatives
1923  return FE<3,LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1924 }

◆ shape_deriv() [108/109]

Real libMesh::FE< 2, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 1994 of file fe_clough_shape_2D.C.

1999 {
2000  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
2001  return 0.;
2002 }

◆ shape_deriv() [109/109]

Real libMesh::FE< 2, CLOUGH >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 2007 of file fe_clough_shape_2D.C.

2012 {
2013  libmesh_assert(elem);
2014 
2015  clough_compute_coefs(elem);
2016 
2017  const ElemType type = elem->type();
2018 
2019  const Order totalorder = static_cast<Order>(order + elem->p_level());
2020 
2021  switch (totalorder)
2022  {
2023  // 2nd-order restricted Clough-Tocher element
2024  case SECOND:
2025  {
2026  // There may be a bug in the 2nd order case; the 3rd order
2027  // Clough-Tocher elements are pretty uniformly better anyways
2028  // so use those instead.
2029  libmesh_experimental();
2030  switch (type)
2031  {
2032  // C1 functions on the Clough-Tocher triangle.
2033  case TRI6:
2034  {
2035  libmesh_assert_less (i, 9);
2036  // FIXME: it would be nice to calculate (and cache)
2037  // clough_raw_shape(j,p) only once per triangle, not 1-7
2038  // times
2039  switch (i)
2040  {
2041  // Note: these DoF numbers are "scrambled" because my
2042  // initial numbering conventions didn't match libMesh
2043  case 0:
2044  return clough_raw_shape_deriv(0, j, p)
2045  + d1d2n * clough_raw_shape_deriv(10, j, p)
2046  + d1d3n * clough_raw_shape_deriv(11, j, p);
2047  case 3:
2048  return clough_raw_shape_deriv(1, j, p)
2049  + d2d3n * clough_raw_shape_deriv(11, j, p)
2050  + d2d1n * clough_raw_shape_deriv(9, j, p);
2051  case 6:
2052  return clough_raw_shape_deriv(2, j, p)
2053  + d3d1n * clough_raw_shape_deriv(9, j, p)
2054  + d3d2n * clough_raw_shape_deriv(10, j, p);
2055  case 1:
2056  return d1xd1x * clough_raw_shape_deriv(3, j, p)
2057  + d1xd1y * clough_raw_shape_deriv(4, j, p)
2058  + d1xd2n * clough_raw_shape_deriv(10, j, p)
2059  + d1xd3n * clough_raw_shape_deriv(11, j, p)
2060  + 0.5 * N01x * d3nd3n * clough_raw_shape_deriv(11, j, p)
2061  + 0.5 * N02x * d2nd2n * clough_raw_shape_deriv(10, j, p);
2062  case 2:
2063  return d1yd1y * clough_raw_shape_deriv(4, j, p)
2064  + d1yd1x * clough_raw_shape_deriv(3, j, p)
2065  + d1yd2n * clough_raw_shape_deriv(10, j, p)
2066  + d1yd3n * clough_raw_shape_deriv(11, j, p)
2067  + 0.5 * N01y * d3nd3n * clough_raw_shape_deriv(11, j, p)
2068  + 0.5 * N02y * d2nd2n * clough_raw_shape_deriv(10, j, p);
2069  case 4:
2070  return d2xd2x * clough_raw_shape_deriv(5, j, p)
2071  + d2xd2y * clough_raw_shape_deriv(6, j, p)
2072  + d2xd3n * clough_raw_shape_deriv(11, j, p)
2073  + d2xd1n * clough_raw_shape_deriv(9, j, p)
2074  + 0.5 * N10x * d3nd3n * clough_raw_shape_deriv(11, j, p)
2075  + 0.5 * N12x * d1nd1n * clough_raw_shape_deriv(9, j, p);
2076  case 5:
2077  return d2yd2y * clough_raw_shape_deriv(6, j, p)
2078  + d2yd2x * clough_raw_shape_deriv(5, j, p)
2079  + d2yd3n * clough_raw_shape_deriv(11, j, p)
2080  + d2yd1n * clough_raw_shape_deriv(9, j, p)
2081  + 0.5 * N10y * d3nd3n * clough_raw_shape_deriv(11, j, p)
2082  + 0.5 * N12y * d1nd1n * clough_raw_shape_deriv(9, j, p);
2083  case 7:
2084  return d3xd3x * clough_raw_shape_deriv(7, j, p)
2085  + d3xd3y * clough_raw_shape_deriv(8, j, p)
2086  + d3xd1n * clough_raw_shape_deriv(9, j, p)
2087  + d3xd2n * clough_raw_shape_deriv(10, j, p)
2088  + 0.5 * N20x * d2nd2n * clough_raw_shape_deriv(10, j, p)
2089  + 0.5 * N21x * d1nd1n * clough_raw_shape_deriv(9, j, p);
2090  case 8:
2091  return d3yd3y * clough_raw_shape_deriv(8, j, p)
2092  + d3yd3x * clough_raw_shape_deriv(7, j, p)
2093  + d3yd1n * clough_raw_shape_deriv(9, j, p)
2094  + d3yd2n * clough_raw_shape_deriv(10, j, p)
2095  + 0.5 * N20y * d2nd2n * clough_raw_shape_deriv(10, j, p)
2096  + 0.5 * N21y * d1nd1n * clough_raw_shape_deriv(9, j, p);
2097  default:
2098  libmesh_error_msg("Invalid shape function index i = " << i);
2099  }
2100  }
2101  default:
2102  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2103  }
2104  }
2105  // 3rd-order Clough-Tocher element
2106  case THIRD:
2107  {
2108  switch (type)
2109  {
2110  // C1 functions on the Clough-Tocher triangle.
2111  case TRI6:
2112  {
2113  libmesh_assert_less (i, 12);
2114 
2115  // FIXME: it would be nice to calculate (and cache)
2116  // clough_raw_shape(j,p) only once per triangle, not 1-7
2117  // times
2118  switch (i)
2119  {
2120  // Note: these DoF numbers are "scrambled" because my
2121  // initial numbering conventions didn't match libMesh
2122  case 0:
2123  return clough_raw_shape_deriv(0, j, p)
2124  + d1d2n * clough_raw_shape_deriv(10, j, p)
2125  + d1d3n * clough_raw_shape_deriv(11, j, p);
2126  case 3:
2127  return clough_raw_shape_deriv(1, j, p)
2128  + d2d3n * clough_raw_shape_deriv(11, j, p)
2129  + d2d1n * clough_raw_shape_deriv(9, j, p);
2130  case 6:
2131  return clough_raw_shape_deriv(2, j, p)
2132  + d3d1n * clough_raw_shape_deriv(9, j, p)
2133  + d3d2n * clough_raw_shape_deriv(10, j, p);
2134  case 1:
2135  return d1xd1x * clough_raw_shape_deriv(3, j, p)
2136  + d1xd1y * clough_raw_shape_deriv(4, j, p)
2137  + d1xd2n * clough_raw_shape_deriv(10, j, p)
2138  + d1xd3n * clough_raw_shape_deriv(11, j, p);
2139  case 2:
2140  return d1yd1y * clough_raw_shape_deriv(4, j, p)
2141  + d1yd1x * clough_raw_shape_deriv(3, j, p)
2142  + d1yd2n * clough_raw_shape_deriv(10, j, p)
2143  + d1yd3n * clough_raw_shape_deriv(11, j, p);
2144  case 4:
2145  return d2xd2x * clough_raw_shape_deriv(5, j, p)
2146  + d2xd2y * clough_raw_shape_deriv(6, j, p)
2147  + d2xd3n * clough_raw_shape_deriv(11, j, p)
2148  + d2xd1n * clough_raw_shape_deriv(9, j, p);
2149  case 5:
2150  return d2yd2y * clough_raw_shape_deriv(6, j, p)
2151  + d2yd2x * clough_raw_shape_deriv(5, j, p)
2152  + d2yd3n * clough_raw_shape_deriv(11, j, p)
2153  + d2yd1n * clough_raw_shape_deriv(9, j, p);
2154  case 7:
2155  return d3xd3x * clough_raw_shape_deriv(7, j, p)
2156  + d3xd3y * clough_raw_shape_deriv(8, j, p)
2157  + d3xd1n * clough_raw_shape_deriv(9, j, p)
2158  + d3xd2n * clough_raw_shape_deriv(10, j, p);
2159  case 8:
2160  return d3yd3y * clough_raw_shape_deriv(8, j, p)
2161  + d3yd3x * clough_raw_shape_deriv(7, j, p)
2162  + d3yd1n * clough_raw_shape_deriv(9, j, p)
2163  + d3yd2n * clough_raw_shape_deriv(10, j, p);
2164  case 10:
2165  return d1nd1n * clough_raw_shape_deriv(9, j, p);
2166  case 11:
2167  return d2nd2n * clough_raw_shape_deriv(10, j, p);
2168  case 9:
2169  return d3nd3n * clough_raw_shape_deriv(11, j, p);
2170 
2171  default:
2172  libmesh_error_msg("Invalid shape function index i = " << i);
2173  }
2174  }
2175  default:
2176  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2177  }
2178  }
2179  // by default throw an error
2180  default:
2181  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
2182  }
2183 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape_second_deriv() [1/103]

Real libMesh::FE< 3, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 67 of file fe_scalar_shape_3D.C.

72 {
73  return 0.;
74 }

◆ shape_second_deriv() [2/103]

Real libMesh::FE< 1, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 67 of file fe_scalar_shape_1D.C.

72 {
73  return 0.;
74 }

◆ shape_second_deriv() [3/103]

Real libMesh::FE< 0, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 67 of file fe_scalar_shape_0D.C.

72 {
73  return 0.;
74 }

◆ shape_second_deriv() [4/103]

Real libMesh::FE< 2, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 69 of file fe_scalar_shape_2D.C.

74 {
75  return 0.;
76 }

◆ shape_second_deriv() [5/103]

Real libMesh::FE< 1, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 77 of file fe_scalar_shape_1D.C.

82 {
83  return 0.;
84 }

◆ shape_second_deriv() [6/103]

Real libMesh::FE< 0, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 77 of file fe_scalar_shape_0D.C.

82 {
83  return 0.;
84 }

◆ shape_second_deriv() [7/103]

Real libMesh::FE< 3, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 77 of file fe_scalar_shape_3D.C.

82 {
83  return 0.;
84 }

◆ shape_second_deriv() [8/103]

Real libMesh::FE< 2, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 79 of file fe_scalar_shape_2D.C.

84 {
85  return 0.;
86 }

◆ shape_second_deriv() [9/103]

Real libMesh::FE< 3, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 81 of file fe_szabab_shape_3D.C.

86 {
87  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
88  return 0.;
89 }

◆ shape_second_deriv() [10/103]

Real libMesh::FE< 0, CLOUGH >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_clough_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [11/103]

Real libMesh::FE< 0, LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_lagrange_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [12/103]

Real libMesh::FE< 0, HERMITE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_hermite_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [13/103]

Real libMesh::FE< 0, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_szabab_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [14/103]

Real libMesh::FE< 0, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_xyz_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [15/103]

Real libMesh::FE< 0, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_hierarchic_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [16/103]

Real libMesh::FE< 0, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_monomial_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [17/103]

Real libMesh::FE< 0, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_bernstein_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [18/103]

Real libMesh::FE< 0, L2_LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_l2_lagrange_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [19/103]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 83 of file fe_l2_hierarchic_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }

◆ shape_second_deriv() [20/103]

Real libMesh::FE< 3, CLOUGH >::shape_second_deriv ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 86 of file fe_clough_shape_3D.C.

91 {
92  libmesh_assert(elem);
93  libmesh_not_implemented();
94  return 0.;
95 }

◆ shape_second_deriv() [21/103]

Real libMesh::FE< 3, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 94 of file fe_szabab_shape_3D.C.

99 {
100  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
101  return 0.;
102 }

◆ shape_second_deriv() [22/103]

Real libMesh::FE< 0, HIERARCHIC >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_hierarchic_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [23/103]

Real libMesh::FE< 0, CLOUGH >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_clough_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [24/103]

Real libMesh::FE< 0, XYZ >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_xyz_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [25/103]

Real libMesh::FE< 0, LAGRANGE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_lagrange_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [26/103]

Real libMesh::FE< 0, MONOMIAL >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_monomial_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [27/103]

Real libMesh::FE< 0, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_szabab_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [28/103]

Real libMesh::FE< 0, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_bernstein_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [29/103]

Real libMesh::FE< 0, HERMITE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_hermite_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [30/103]

Real libMesh::FE< 0, L2_LAGRANGE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_l2_lagrange_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [31/103]

Real libMesh::FE< 0, L2_HIERARCHIC >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 96 of file fe_l2_hierarchic_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }

◆ shape_second_deriv() [32/103]

Real libMesh::FE< 1, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 141 of file fe_monomial_shape_1D.C.

146 {
147  // only d()/dxi in 1D!
148 
149  libmesh_assert_equal_to (j, 0);
150 
151  const Real xi = p(0);
152 
153  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
154 
155  switch (i)
156  {
157  case 0:
158  case 1:
159  return 0.;
160 
161  case 2:
162  return 2.;
163 
164  case 3:
165  return 6.*xi;
166 
167  case 4:
168  return 12.*xi*xi;
169 
170  default:
171  Real val = 2.;
172  for (unsigned int index = 2; index != i; ++index)
173  val *= (index+1) * xi;
174  return val;
175  }
176 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [33/103]

Real libMesh::FE< 1, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 153 of file fe_szabab_shape_1D.C.

158 {
159  static bool warning_given = false;
160 
161  if (!warning_given)
162  libMesh::err << "Second derivatives for Szabab elements "
163  << " are not yet implemented!"
164  << std::endl;
165 
166  warning_given = true;
167  return 0.;
168 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [34/103]

Real libMesh::FE< 1, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 160 of file fe_xyz_shape_1D.C.

165 {
166  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
167  return 0.;
168 }

◆ shape_second_deriv() [35/103]

Real libMesh::FE< 1, XYZ >::shape_second_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point point_in 
)
inherited

Definition at line 173 of file fe_xyz_shape_1D.C.

178 {
179  libmesh_assert(elem);
180  libmesh_assert_less_equal (i, order + elem->p_level());
181 
182  // only d2()/dxi2 in 1D!
183 
184  libmesh_assert_equal_to (j, 0);
185 
186  Point centroid = elem->centroid();
187  Real max_distance = 0.;
188  for (unsigned int p = 0; p < elem->n_nodes(); p++)
189  {
190  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
191  max_distance = std::max(distance, max_distance);
192  }
193 
194  const Real x = point_in(0);
195  const Real xc = centroid(0);
196  const Real dx = (x - xc)/max_distance;
197  const Real dist2 = pow(max_distance,2.);
198 
199  // monomials. since they are hierarchic we only need one case block.
200  switch (i)
201  {
202  case 0:
203  case 1:
204  return 0.;
205 
206  case 2:
207  return 2./dist2;
208 
209  case 3:
210  return 6.*dx/dist2;
211 
212  case 4:
213  return 12.*dx*dx/dist2;
214 
215  default:
216  Real val = 2.;
217  for (unsigned int index = 2; index != i; ++index)
218  val *= (index+1) * dx;
219  return val/dist2;
220  }
221 }
double abs(double a)
long double max(long double a, double b)
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [36/103]

Real libMesh::FE< 1, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 173 of file fe_szabab_shape_1D.C.

178 {
179  static bool warning_given = false;
180 
181  if (!warning_given)
182  libMesh::err << "Second derivatives for Szabab elements "
183  << " are not yet implemented!"
184  << std::endl;
185 
186  warning_given = true;
187  return 0.;
188 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [37/103]

static OutputShape libMesh::FE< Dim, T >::shape_second_deriv ( const ElemType  t,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
staticinherited
Returns
The second $ j^{th} $ derivative of the $ i^{th} $ shape function at the point p.
Note
Cross-derivatives are indexed according to: j = 0 ==> d^2 phi / dxi^2 j = 1 ==> d^2 phi / dxi deta j = 2 ==> d^2 phi / deta^2 j = 3 ==> d^2 phi / dxi dzeta j = 4 ==> d^2 phi / deta dzeta j = 5 ==> d^2 phi / dzeta^2
Computing second derivatives is not currently supported for all element types: $ C^1 $ (Clough, Hermite and Subdivision), Lagrange, Hierarchic, L2_Hierarchic, and Monomial are supported. All other element types return an error when asked for second derivatives.

On a p-refined element, o should be the total order of the element.

◆ shape_second_deriv() [38/103]

Real libMesh::FE< 1, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 181 of file fe_monomial_shape_1D.C.

186 {
187  libmesh_assert(elem);
188 
189  return FE<1,MONOMIAL>::shape_second_deriv(elem->type(),
190  static_cast<Order>(order + elem->p_level()), i, j, p);
191 }

◆ shape_second_deriv() [39/103]

static OutputShape libMesh::FE< Dim, T >::shape_second_deriv ( const Elem elem,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
staticinherited
Returns
The second $ j^{th} $ derivative of the $ i^{th} $ shape function at the point p.
Note
Cross-derivatives are indexed according to: j = 0 ==> d^2 phi / dxi^2 j = 1 ==> d^2 phi / dxi deta j = 2 ==> d^2 phi / deta^2 j = 3 ==> d^2 phi / dxi dzeta j = 4 ==> d^2 phi / deta dzeta j = 5 ==> d^2 phi / dzeta^2
Computing second derivatives is not currently supported for all element types: $ C^1 $ (Clough, Hermite and Subdivision), Lagrange, Hierarchic, L2_Hierarchic, and Monomial are supported. All other element types return an error when asked for second derivatives.

On a p-refined element, o should be the base order of the element.

◆ shape_second_deriv() [40/103]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 200 of file fe_l2_hierarchic_shape_1D.C.

205 {
206  // only d2()/d2xi in 1D!
207 
208  libmesh_assert_equal_to (j, 0);
209  libmesh_assert_less (i, order+1u);
210 
211  // Declare that we are using our own special power function
212  // from the Utility namespace. This saves typing later.
213  using Utility::pow;
214 
215  const Real xi = p(0);
216 
217  Real returnval = 1.;
218 
219  switch (i)
220  {
221  case 0:
222  case 1:
223  returnval = 0;
224  break;
225  // All terms have the same form.
226  // xi^(p-2)/(p-2)!
227  case 2:
228  returnval = 1;
229  break;
230  case 3:
231  returnval = xi;
232  break;
233  case 4:
234  returnval = pow<2>(xi)/2.;
235  break;
236  case 5:
237  returnval = pow<3>(xi)/6.;
238  break;
239  case 6:
240  returnval = pow<4>(xi)/24.;
241  break;
242  case 7:
243  returnval = pow<5>(xi)/120.;
244  break;
245 
246  default:
247  Real denominator = 1.;
248  for (unsigned int n=1; n != i; ++n)
249  {
250  returnval *= xi;
251  denominator *= n;
252  }
253  // Odd:
254  if (i % 2)
255  returnval = (i * returnval - 1.)/denominator/i;
256  // Even:
257  else
258  returnval = returnval/denominator;
259  break;
260  }
261 
262  return returnval;
263 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [41/103]

Real libMesh::FE< 1, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 200 of file fe_hierarchic_shape_1D.C.

205 {
206  // only d2()/d2xi in 1D!
207 
208  libmesh_assert_equal_to (j, 0);
209  libmesh_assert_less (i, order+1u);
210 
211  // Declare that we are using our own special power function
212  // from the Utility namespace. This saves typing later.
213  using Utility::pow;
214 
215  const Real xi = p(0);
216 
217  Real returnval = 1.;
218 
219  switch (i)
220  {
221  case 0:
222  case 1:
223  returnval = 0;
224  break;
225  // All terms have the same form.
226  // xi^(p-2)/(p-2)!
227  case 2:
228  returnval = 1;
229  break;
230  case 3:
231  returnval = xi;
232  break;
233  case 4:
234  returnval = pow<2>(xi)/2.;
235  break;
236  case 5:
237  returnval = pow<3>(xi)/6.;
238  break;
239  case 6:
240  returnval = pow<4>(xi)/24.;
241  break;
242  case 7:
243  returnval = pow<5>(xi)/120.;
244  break;
245 
246  default:
247  Real denominator = 1.;
248  for (unsigned int n=1; n != i; ++n)
249  {
250  returnval *= xi;
251  denominator *= n;
252  }
253  // Odd:
254  if (i % 2)
255  returnval = (i * returnval - 1.)/denominator/i;
256  // Even:
257  else
258  returnval = returnval/denominator;
259  break;
260  }
261 
262  return returnval;
263 }
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [42/103]

Real libMesh::FE< 1, LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 235 of file fe_lagrange_shape_1D.C.

240 {
241  // Don't need to switch on j. 1D shape functions
242  // depend on xi only!
243 
244  const Real xi = p(0);
245  libmesh_assert_equal_to (j, 0);
246 
247  switch (order)
248  {
249  // linear Lagrange shape functions
250  case FIRST:
251  {
252  // All second derivatives of linears are zero....
253  return 0.;
254  }
255 
256  // quadratic Lagrange shape functions
257  case SECOND:
258  {
259  switch (i)
260  {
261  case 0:
262  return 1.;
263 
264  case 1:
265  return 1.;
266 
267  case 2:
268  return -2.;
269 
270  default:
271  libmesh_error_msg("Invalid shape function index i = " << i);
272  }
273  } // end case SECOND
274 
275  case THIRD:
276  {
277  switch (i)
278  {
279  case 0:
280  return -9./16.*(6.*xi-2);
281 
282  case 1:
283  return -9./16.*(-6*xi-2.);
284 
285  case 2:
286  return 27./16.*(6*xi-2./3.);
287 
288  case 3:
289  return 27./16.*(-6*xi-2./3.);
290 
291  default:
292  libmesh_error_msg("Invalid shape function index i = " << i);
293  }
294  } // end case THIRD
295 
296 
297  default:
298  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
299  } // end switch (order)
300 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [43/103]

Real libMesh::FE< 1, L2_LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int  libmesh_dbg_varj,
const Point p 
)
inherited

Definition at line 235 of file fe_l2_lagrange_shape_1D.C.

240 {
241  // Don't need to switch on j. 1D shape functions
242  // depend on xi only!
243 
244  const Real xi = p(0);
245  libmesh_assert_equal_to (j, 0);
246 
247  switch (order)
248  {
249  // linear Lagrange shape functions
250  case FIRST:
251  {
252  // All second derivatives of linears are zero....
253  return 0.;
254  }
255 
256  // quadratic Lagrange shape functions
257  case SECOND:
258  {
259  switch (i)
260  {
261  case 0:
262  return 1.;
263 
264  case 1:
265  return 1.;
266 
267  case 2:
268  return -2.;
269 
270  default:
271  libmesh_error_msg("Invalid shape function index i = " << i);
272  }
273  } // end case SECOND
274 
275  case THIRD:
276  {
277  switch (i)
278  {
279  case 0:
280  return -9./16.*(6.*xi-2);
281 
282  case 1:
283  return -9./16.*(-6*xi-2.);
284 
285  case 2:
286  return 27./16.*(6*xi-2./3.);
287 
288  case 3:
289  return 27./16.*(-6*xi-2./3.);
290 
291  default:
292  libmesh_error_msg("Invalid shape function index i = " << i);
293  }
294  } // end case THIRD
295 
296 
297  default:
298  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
299  } // end switch (order)
300 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [44/103]

Real libMesh::FE< 1, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 268 of file fe_l2_hierarchic_shape_1D.C.

273 {
274  libmesh_assert(elem);
275 
276  return FE<1,L2_HIERARCHIC>::shape_second_deriv(elem->type(),
277  static_cast<Order>(order + elem->p_level()), i, j, p);
278 }

◆ shape_second_deriv() [45/103]

Real libMesh::FE< 1, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 268 of file fe_hierarchic_shape_1D.C.

273 {
274  libmesh_assert(elem);
275 
276  return FE<1,HIERARCHIC>::shape_second_deriv(elem->type(),
277  static_cast<Order>(order + elem->p_level()), i, j, p);
278 }

◆ shape_second_deriv() [46/103]

Real libMesh::FE< 1, HERMITE >::shape_second_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned  int,
const Point p 
)
inherited

Definition at line 301 of file fe_hermite_shape_1D.C.

306 {
307  libmesh_assert(elem);
308 
309  // Coefficient naming: d(1)d(2n) is the coefficient of the
310  // global shape function corresponding to value 1 in terms of the
311  // local shape function corresponding to normal derivative 2
312  Real d1xd1x, d2xd2x;
313 
314  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
315 
316  const ElemType type = elem->type();
317 
318 #ifndef NDEBUG
319  const unsigned int totalorder = order + elem->p_level();
320 #endif
321 
322  switch (type)
323  {
324  // C1 functions on the C1 cubic edge
325  case EDGE2:
326  case EDGE3:
327  {
328  libmesh_assert_less (i, totalorder+1);
329 
330  switch (i)
331  {
332  case 0:
334  case 1:
335  return d1xd1x * FEHermite<1>::hermite_raw_shape_second_deriv(2, p(0));
336  case 2:
338  case 3:
339  return d2xd2x * FEHermite<1>::hermite_raw_shape_second_deriv(3, p(0));
340  default:
342  }
343  }
344  default:
345  libmesh_error_msg("ERROR: Unsupported element type = " << type);
346  }
347 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_second_deriv() [47/103]

Real libMesh::FE< 1, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 305 of file fe_l2_lagrange_shape_1D.C.

310 {
311  libmesh_assert(elem);
312 
313  return FE<1,L2_LAGRANGE>::shape_second_deriv(elem->type(),
314  static_cast<Order>(order + elem->p_level()), i, j, p);
315 }

◆ shape_second_deriv() [48/103]

Real libMesh::FE< 1, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 305 of file fe_lagrange_shape_1D.C.

310 {
311  libmesh_assert(elem);
312 
313  return FE<1,LAGRANGE>::shape_second_deriv(elem->type(),
314  static_cast<Order>(order + elem->p_level()), i, j, p);
315 }

◆ shape_second_deriv() [49/103]

Real libMesh::FE< 2, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 319 of file fe_monomial_shape_2D.C.

324 {
325 #if LIBMESH_DIM > 1
326 
327 
328  libmesh_assert_less_equal (j, 2);
329 
330  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
331  (static_cast<unsigned int>(order)+2)/2);
332 
333  const Real xi = p(0);
334  const Real eta = p(1);
335 
336  // monomials. since they are hierarchic we only need one case block.
337 
338  switch (j)
339  {
340  // d^2()/dxi^2
341  case 0:
342  {
343  switch (i)
344  {
345  // constants
346  case 0:
347  // linears
348  case 1:
349  case 2:
350  return 0.;
351 
352  // quadratics
353  case 3:
354  return 2.;
355 
356  case 4:
357  case 5:
358  return 0.;
359 
360  // cubics
361  case 6:
362  return 6.*xi;
363 
364  case 7:
365  return 2.*eta;
366 
367  case 8:
368  case 9:
369  return 0.;
370 
371  // quartics
372  case 10:
373  return 12.*xi*xi;
374 
375  case 11:
376  return 6.*xi*eta;
377 
378  case 12:
379  return 2.*eta*eta;
380 
381  case 13:
382  case 14:
383  return 0.;
384 
385  default:
386  unsigned int o = 0;
387  for (; i >= (o+1)*(o+2)/2; o++) { }
388  unsigned int ny = i - (o*(o+1)/2);
389  unsigned int nx = o - ny;
390  Real val = nx * (nx - 1);
391  for (unsigned int index=2; index < nx; index++)
392  val *= xi;
393  for (unsigned int index=0; index != ny; index++)
394  val *= eta;
395  return val;
396  }
397  }
398 
399  // d^2()/dxideta
400  case 1:
401  {
402  switch (i)
403  {
404  // constants
405  case 0:
406 
407  // linears
408  case 1:
409  case 2:
410  return 0.;
411 
412  // quadratics
413  case 3:
414  return 0.;
415 
416  case 4:
417  return 1.;
418 
419  case 5:
420  return 0.;
421 
422  // cubics
423  case 6:
424  return 0.;
425  case 7:
426  return 2.*xi;
427 
428  case 8:
429  return 2.*eta;
430 
431  case 9:
432  return 0.;
433 
434  // quartics
435  case 10:
436  return 0.;
437 
438  case 11:
439  return 3.*xi*xi;
440 
441  case 12:
442  return 4.*xi*eta;
443 
444  case 13:
445  return 3.*eta*eta;
446 
447  case 14:
448  return 0.;
449 
450  default:
451  unsigned int o = 0;
452  for (; i >= (o+1)*(o+2)/2; o++) { }
453  unsigned int ny = i - (o*(o+1)/2);
454  unsigned int nx = o - ny;
455  Real val = nx * ny;
456  for (unsigned int index=1; index < nx; index++)
457  val *= xi;
458  for (unsigned int index=1; index < ny; index++)
459  val *= eta;
460  return val;
461  }
462  }
463 
464  // d^2()/deta^2
465  case 2:
466  {
467  switch (i)
468  {
469  // constants
470  case 0:
471 
472  // linears
473  case 1:
474  case 2:
475  return 0.;
476 
477  // quadratics
478  case 3:
479  case 4:
480  return 0.;
481 
482  case 5:
483  return 2.;
484 
485  // cubics
486  case 6:
487  return 0.;
488 
489  case 7:
490  return 0.;
491 
492  case 8:
493  return 2.*xi;
494 
495  case 9:
496  return 6.*eta;
497 
498  // quartics
499  case 10:
500  case 11:
501  return 0.;
502 
503  case 12:
504  return 2.*xi*xi;
505 
506  case 13:
507  return 6.*xi*eta;
508 
509  case 14:
510  return 12.*eta*eta;
511 
512  default:
513  unsigned int o = 0;
514  for (; i >= (o+1)*(o+2)/2; o++) { }
515  unsigned int ny = i - (o*(o+1)/2);
516  unsigned int nx = o - ny;
517  Real val = ny * (ny - 1);
518  for (unsigned int index=0; index != nx; index++)
519  val *= xi;
520  for (unsigned int index=2; index < ny; index++)
521  val *= eta;
522  return val;
523  }
524  }
525 
526  default:
527  libmesh_error_msg("Invalid shape function derivative j = " << j);
528  }
529 
530 #else
531  return 0.;
532 #endif
533 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [50/103]

Real libMesh::FE< 2, HERMITE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 327 of file fe_hermite_shape_2D.C.

332 {
333  libmesh_assert(elem);
334  libmesh_assert (j == 0 || j == 1 || j == 2);
335 
336  std::vector<std::vector<Real>> dxdxi(2, std::vector<Real>(2, 0));
337 
338 #ifdef DEBUG
339  std::vector<Real> dxdeta(2), dydxi(2);
340 #endif
341 
342  hermite_compute_coefs(elem,dxdxi
343 #ifdef DEBUG
344  ,dxdeta,dydxi
345 #endif
346  );
347 
348  const ElemType type = elem->type();
349 
350  const Order totalorder = static_cast<Order>(order + elem->p_level());
351 
352  switch (type)
353  {
354  case QUAD4:
355  case QUADSHELL4:
356  libmesh_assert_less (totalorder, 4);
357  libmesh_fallthrough();
358  case QUAD8:
359  case QUADSHELL8:
360  case QUAD9:
361  {
362  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
363 
364  std::vector<unsigned int> bases1D;
365 
366  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
367 
368  switch (j)
369  {
370  case 0:
371  return coef *
373  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
374  case 1:
375  return coef *
376  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
377  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1));
378  case 2:
379  return coef *
380  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
382  default:
383  libmesh_error_msg("Invalid derivative index j = " << j);
384  }
385  }
386  default:
387  libmesh_error_msg("ERROR: Unsupported element type = " << type);
388  }
389 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_second_deriv() [51/103]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 330 of file fe_nedelec_one_shape_2D.C.

335 {
336  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
337  return RealGradient();
338 }
RealVectorValue RealGradient

◆ shape_second_deriv() [52/103]

Real libMesh::FE< 1, CLOUGH >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 341 of file fe_clough_shape_1D.C.

346 {
347  libmesh_assert(elem);
348 
349  clough_compute_coefs(elem);
350 
351  const ElemType type = elem->type();
352 
353  const Order totalorder = static_cast<Order>(order + elem->p_level());
354 
355  switch (totalorder)
356  {
357  // 3rd-order C1 cubic element
358  case THIRD:
359  {
360  switch (type)
361  {
362  // C1 functions on the C1 cubic edge
363  case EDGE2:
364  case EDGE3:
365  {
366  switch (i)
367  {
368  case 0:
369  return clough_raw_shape_second_deriv(0, j, p);
370  case 1:
371  return clough_raw_shape_second_deriv(1, j, p);
372  case 2:
373  return d1xd1x * clough_raw_shape_second_deriv(2, j, p);
374  case 3:
375  return d2xd2x * clough_raw_shape_second_deriv(3, j, p);
376  default:
377  libmesh_error_msg("Invalid shape function index i = " << i);
378  }
379  }
380  default:
381  libmesh_error_msg("ERROR: Unsupported element type = " << type);
382  }
383  }
384  // by default throw an error
385  default:
386  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
387  }
388 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape_second_deriv() [53/103]

RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  libmesh_dbg_vari,
const unsigned int  libmesh_dbg_varj,
const Point  
)
inherited

Definition at line 343 of file fe_nedelec_one_shape_2D.C.

348 {
349 #if LIBMESH_DIM > 1
350  libmesh_assert(elem);
351 
352  // j = 0 ==> d^2 phi / dxi^2
353  // j = 1 ==> d^2 phi / dxi deta
354  // j = 2 ==> d^2 phi / deta^2
355  libmesh_assert_less (j, 3);
356 
357  const Order total_order = static_cast<Order>(order + elem->p_level());
358 
359  switch (total_order)
360  {
361  // linear Lagrange shape functions
362  case FIRST:
363  {
364  switch (elem->type())
365  {
366  case QUAD8:
367  case QUAD9:
368  {
369  libmesh_assert_less (i, 4);
370  // All second derivatives for linear quads are zero.
371  return RealGradient();
372  }
373 
374  case TRI6:
375  {
376  libmesh_assert_less (i, 3);
377  // All second derivatives for linear triangles are zero.
378  return RealGradient();
379  }
380 
381  default:
382  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
383 
384  } // end switch (type)
385  } // end case FIRST
386 
387  // unsupported order
388  default:
389  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
390 
391  } // end switch (order)
392 
393 #else // LIBMESH_DIM > 1
394  return RealGradient();
395 #endif
396 }
RealVectorValue RealGradient

◆ shape_second_deriv() [54/103]

Real libMesh::FE< 2, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 356 of file fe_xyz_shape_2D.C.

361 {
362  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
363  return 0.;
364 }

◆ shape_second_deriv() [55/103]

Real libMesh::FE< 2, XYZ >::shape_second_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)
inherited

Definition at line 369 of file fe_xyz_shape_2D.C.

374 {
375 #if LIBMESH_DIM > 1
376 
377  libmesh_assert_less_equal (j, 2);
378  libmesh_assert(elem);
379 
380  Point centroid = elem->centroid();
381  Point max_distance = Point(0.,0.,0.);
382  for (unsigned int p = 0; p < elem->n_nodes(); p++)
383  for (unsigned int d = 0; d < 2; d++)
384  {
385  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
386  max_distance(d) = std::max(distance, max_distance(d));
387  }
388 
389  const Real x = point_in(0);
390  const Real y = point_in(1);
391  const Real xc = centroid(0);
392  const Real yc = centroid(1);
393  const Real distx = max_distance(0);
394  const Real disty = max_distance(1);
395  const Real dx = (x - xc)/distx;
396  const Real dy = (y - yc)/disty;
397  const Real dist2x = pow(distx,2.);
398  const Real dist2y = pow(disty,2.);
399  const Real distxy = distx * disty;
400 
401 #ifndef NDEBUG
402  // totalorder is only used in the assertion below, so
403  // we avoid declaring it when asserts are not active.
404  const unsigned int totalorder = order + elem->p_level();
405 #endif
406  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
407 
408  // monomials. since they are hierarchic we only need one case block.
409 
410  switch (j)
411  {
412  // d^2()/dx^2
413  case 0:
414  {
415  switch (i)
416  {
417  // constants
418  case 0:
419  // linears
420  case 1:
421  case 2:
422  return 0.;
423 
424  // quadratics
425  case 3:
426  return 2./dist2x;
427 
428  case 4:
429  case 5:
430  return 0.;
431 
432  // cubics
433  case 6:
434  return 6.*dx/dist2x;
435 
436  case 7:
437  return 2.*dy/dist2x;
438 
439  case 8:
440  case 9:
441  return 0.;
442 
443  // quartics
444  case 10:
445  return 12.*dx*dx/dist2x;
446 
447  case 11:
448  return 6.*dx*dy/dist2x;
449 
450  case 12:
451  return 2.*dy*dy/dist2x;
452 
453  case 13:
454  case 14:
455  return 0.;
456 
457  default:
458  unsigned int o = 0;
459  for (; i >= (o+1)*(o+2)/2; o++) { }
460  unsigned int i2 = i - (o*(o+1)/2);
461  Real val = (o - i2) * (o - i2 - 1);
462  for (unsigned int index=i2+2; index < o; index++)
463  val *= dx;
464  for (unsigned int index=0; index != i2; index++)
465  val *= dy;
466  return val/dist2x;
467  }
468  }
469 
470  // d^2()/dxdy
471  case 1:
472  {
473  switch (i)
474  {
475  // constants
476  case 0:
477 
478  // linears
479  case 1:
480  case 2:
481  return 0.;
482 
483  // quadratics
484  case 3:
485  return 0.;
486 
487  case 4:
488  return 1./distxy;
489 
490  case 5:
491  return 0.;
492 
493  // cubics
494  case 6:
495  return 0.;
496  case 7:
497  return 2.*dx/distxy;
498 
499  case 8:
500  return 2.*dy/distxy;
501 
502  case 9:
503  return 0.;
504 
505  // quartics
506  case 10:
507  return 0.;
508 
509  case 11:
510  return 3.*dx*dx/distxy;
511 
512  case 12:
513  return 4.*dx*dy/distxy;
514 
515  case 13:
516  return 3.*dy*dy/distxy;
517 
518  case 14:
519  return 0.;
520 
521  default:
522  unsigned int o = 0;
523  for (; i >= (o+1)*(o+2)/2; o++) { }
524  unsigned int i2 = i - (o*(o+1)/2);
525  Real val = (o - i2) * i2;
526  for (unsigned int index=i2+1; index < o; index++)
527  val *= dx;
528  for (unsigned int index=1; index < i2; index++)
529  val *= dy;
530  return val/distxy;
531  }
532  }
533 
534  // d^2()/dy^2
535  case 2:
536  {
537  switch (i)
538  {
539  // constants
540  case 0:
541 
542  // linears
543  case 1:
544  case 2:
545  return 0.;
546 
547  // quadratics
548  case 3:
549  case 4:
550  return 0.;
551 
552  case 5:
553  return 2./dist2y;
554 
555  // cubics
556  case 6:
557  return 0.;
558 
559  case 7:
560  return 0.;
561 
562  case 8:
563  return 2.*dx/dist2y;
564 
565  case 9:
566  return 6.*dy/dist2y;
567 
568  // quartics
569  case 10:
570  case 11:
571  return 0.;
572 
573  case 12:
574  return 2.*dx*dx/dist2y;
575 
576  case 13:
577  return 6.*dx*dy/dist2y;
578 
579  case 14:
580  return 12.*dy*dy/dist2y;
581 
582  default:
583  unsigned int o = 0;
584  for (; i >= (o+1)*(o+2)/2; o++) { }
585  unsigned int i2 = i - (o*(o+1)/2);
586  Real val = i2 * (i2 - 1);
587  for (unsigned int index=i2; index != o; index++)
588  val *= dx;
589  for (unsigned int index=2; index < i2; index++)
590  val *= dy;
591  return val/dist2y;
592  }
593  }
594 
595  default:
596  libmesh_error_msg("Invalid shape function derivative j = " << j);
597  }
598 
599 #else
600  return 0.;
601 #endif
602 }
double abs(double a)
long double max(long double a, double b)
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [56/103]

Real libMesh::FE< 1, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 376 of file fe_bernstein_shape_1D.C.

381 {
382  static bool warning_given = false;
383 
384  if (!warning_given)
385  libMesh::err << "Second derivatives for Bernstein elements "
386  << "are not yet implemented!"
387  << std::endl;
388 
389  warning_given = true;
390  return 0.;
391 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [57/103]

Real libMesh::FE< 2, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 383 of file fe_hierarchic_shape_2D.C.

388 {
389  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
390  return 0.;
391 }

◆ shape_second_deriv() [58/103]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 384 of file fe_l2_hierarchic_shape_2D.C.

389 {
390  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
391  return 0.;
392 }

◆ shape_second_deriv() [59/103]

Real libMesh::FE< 2, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 396 of file fe_hierarchic_shape_2D.C.

401 {
402  libmesh_assert(elem);
403 
404  // I have been lazy here and am using finite differences
405  // to compute the derivatives!
406  const Real eps = 1.e-6;
407  Point pp, pm;
408  unsigned int prevj = libMesh::invalid_uint;
409 
410  switch (j)
411  {
412  // d^2()/dxi^2
413  case 0:
414  {
415  pp = Point(p(0)+eps, p(1));
416  pm = Point(p(0)-eps, p(1));
417  prevj = 0;
418  break;
419  }
420 
421  // d^2()/dxideta
422  case 1:
423  {
424  pp = Point(p(0), p(1)+eps);
425  pm = Point(p(0), p(1)-eps);
426  prevj = 0;
427  break;
428  }
429 
430  // d^2()/deta^2
431  case 2:
432  {
433  pp = Point(p(0), p(1)+eps);
434  pm = Point(p(0), p(1)-eps);
435  prevj = 1;
436  break;
437  }
438  default:
439  libmesh_error_msg("Invalid derivative index j = " << j);
440  }
441 
442  return (FE<2,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
443  FE<2,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm)
444  )/2./eps;
445 }
const unsigned int invalid_uint
Definition: libmesh.h:245
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [60/103]

Real libMesh::FE< 2, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 397 of file fe_l2_hierarchic_shape_2D.C.

402 {
403  libmesh_assert(elem);
404 
405  // I have been lazy here and am using finite differences
406  // to compute the derivatives!
407  const Real eps = 1.e-6;
408  Point pp, pm;
409  unsigned int prevj = libMesh::invalid_uint;
410 
411  switch (j)
412  {
413  // d^2()/dxi^2
414  case 0:
415  {
416  pp = Point(p(0)+eps, p(1));
417  pm = Point(p(0)-eps, p(1));
418  prevj = 0;
419  break;
420  }
421 
422  // d^2()/dxideta
423  case 1:
424  {
425  pp = Point(p(0), p(1)+eps);
426  pm = Point(p(0), p(1)-eps);
427  prevj = 0;
428  break;
429  }
430 
431  // d^2()/deta^2
432  case 2:
433  {
434  pp = Point(p(0), p(1)+eps);
435  pm = Point(p(0), p(1)-eps);
436  prevj = 1;
437  break;
438  }
439  default:
440  libmesh_error_msg("Invalid derivative index j = " << j);
441  }
442  return (FE<2,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
443  FE<2,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm)
444  )/2./eps;
445 }
const unsigned int invalid_uint
Definition: libmesh.h:245
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [61/103]

Real libMesh::FE< 1, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 397 of file fe_bernstein_shape_1D.C.

402 {
403  static bool warning_given = false;
404 
405  if (!warning_given)
406  libMesh::err << "Second derivatives for Bernstein elements "
407  << "are not yet implemented!"
408  << std::endl;
409 
410  warning_given = true;
411  return 0.;
412 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [62/103]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 491 of file fe_nedelec_one_shape_3D.C.

496 {
497  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
498  return RealGradient();
499 }
RealVectorValue RealGradient

◆ shape_second_deriv() [63/103]

RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point libmesh_dbg_var
)
inherited

Definition at line 504 of file fe_nedelec_one_shape_3D.C.

509 {
510 #if LIBMESH_DIM == 3
511 
512  libmesh_assert(elem);
513 
514  // j = 0 ==> d^2 phi / dxi^2
515  // j = 1 ==> d^2 phi / dxi deta
516  // j = 2 ==> d^2 phi / deta^2
517  // j = 3 ==> d^2 phi / dxi dzeta
518  // j = 4 ==> d^2 phi / deta dzeta
519  // j = 5 ==> d^2 phi / dzeta^2
520  libmesh_assert_less (j, 6);
521 
522  const Order totalorder = static_cast<Order>(order + elem->p_level());
523 
524  switch (totalorder)
525  {
526  // linear Lagrange shape functions
527  case FIRST:
528  {
529  switch (elem->type())
530  {
531  case HEX20:
532  case HEX27:
533  {
534  libmesh_assert_less (i, 12);
535 
536 #ifndef NDEBUG
537  const Real xi = p(0);
538  const Real eta = p(1);
539  const Real zeta = p(2);
540 #endif
541 
542  libmesh_assert_less_equal ( std::fabs(xi), 1.0+TOLERANCE );
543  libmesh_assert_less_equal ( std::fabs(eta), 1.0+TOLERANCE );
544  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+TOLERANCE );
545 
546  switch (j)
547  {
548  // d^2()/dxi^2
549  case 0:
550  {
551  // All d^2()/dxi^2 derivatives for linear hexes are zero.
552  return RealGradient();
553  } // j=0
554 
555  // d^2()/dxideta
556  case 1:
557  {
558  switch(i)
559  {
560  case 0:
561  case 1:
562  case 2:
563  case 3:
564  case 8:
565  case 9:
566  case 10:
567  case 11:
568  return RealGradient();
569  case 4:
570  {
571  if (elem->point(0) > elem->point(4))
572  return RealGradient( 0.0, 0.0, -0.125 );
573  else
574  return RealGradient( 0.0, 0.0, 0.125 );
575  }
576  case 5:
577  {
578  if (elem->point(1) > elem->point(5))
579  return RealGradient( 0.0, 0.0, 0.125 );
580  else
581  return RealGradient( 0.0, 0.0, -0.125 );
582  }
583  case 6:
584  {
585  if (elem->point(2) > elem->point(6))
586  return RealGradient( 0.0, 0.0, -0.125 );
587  else
588  return RealGradient( 0.0, 0.0, 0.125 );
589  }
590  case 7:
591  {
592  if (elem->point(3) > elem->point(7))
593  return RealGradient( 0.0, 0.0, 0.125 );
594  else
595  return RealGradient( 0.0, 0.0, -0.125 );
596  }
597  default:
598  libmesh_error_msg("Invalid i = " << i);
599  } // switch(i)
600 
601  } // j=1
602 
603  // d^2()/deta^2
604  case 2:
605  {
606  // All d^2()/deta^2 derivatives for linear hexes are zero.
607  return RealGradient();
608  } // j = 2
609 
610  // d^2()/dxidzeta
611  case 3:
612  {
613  switch(i)
614  {
615  case 0:
616  case 2:
617  case 4:
618  case 5:
619  case 6:
620  case 7:
621  case 8:
622  case 10:
623  return RealGradient();
624 
625  case 1:
626  {
627  if (elem->point(1) > elem->point(2))
628  return RealGradient( 0.0, 0.125 );
629  else
630  return RealGradient( 0.0, -0.125 );
631  }
632  case 3:
633  {
634  if (elem->point(3) > elem->point(0))
635  return RealGradient( 0.0, -0.125 );
636  else
637  return RealGradient( 0.0, 0.125 );
638  }
639  case 9:
640  {
641  if (elem->point(5) > elem->point(6))
642  return RealGradient( 0.0, -0.125, 0.0 );
643  else
644  return RealGradient( 0.0, 0.125, 0.0 );
645  }
646  case 11:
647  {
648  if (elem->point(4) > elem->point(7))
649  return RealGradient( 0.0, 0.125, 0.0 );
650  else
651  return RealGradient( 0.0, -0.125, 0.0 );
652  }
653  default:
654  libmesh_error_msg("Invalid i = " << i);
655  } // switch(i)
656 
657  } // j = 3
658 
659  // d^2()/detadzeta
660  case 4:
661  {
662  switch(i)
663  {
664  case 1:
665  case 3:
666  case 4:
667  case 5:
668  case 6:
669  case 7:
670  case 9:
671  case 11:
672  return RealGradient();
673 
674  case 0:
675  {
676  if (elem->point(0) > elem->point(1))
677  return RealGradient( -0.125, 0.0, 0.0 );
678  else
679  return RealGradient( 0.125, 0.0, 0.0 );
680  }
681  case 2:
682  {
683  if (elem->point(2) > elem->point(3))
684  return RealGradient( 0.125, 0.0, 0.0 );
685  else
686  return RealGradient( -0.125, 0.0, 0.0 );
687  }
688  case 8:
689  {
690  if (elem->point(4) > elem->point(5))
691  return RealGradient( 0.125, 0.0, 0.0 );
692  else
693  return RealGradient( -0.125, 0.0, 0.0 );
694  }
695  case 10:
696  {
697  if (elem->point(7) > elem->point(6))
698  return RealGradient( -0.125, 0.0, 0.0 );
699  else
700  return RealGradient( 0.125, 0.0, 0.0 );
701  }
702  default:
703  libmesh_error_msg("Invalid i = " << i);
704  } // switch(i)
705 
706  } // j = 4
707 
708  // d^2()/dzeta^2
709  case 5:
710  {
711  // All d^2()/dzeta^2 derivatives for linear hexes are zero.
712  return RealGradient();
713  } // j = 5
714 
715  default:
716  libmesh_error_msg("Invalid j = " << j);
717  }
718 
719  return RealGradient();
720  }
721 
722  case TET10:
723  {
724  libmesh_assert_less (i, 6);
725 
726  libmesh_not_implemented();
727  return RealGradient();
728  }
729 
730  default:
731  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
732 
733  } //switch(type)
734 
735  } // case FIRST:
736  // unsupported order
737  default:
738  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
739  }
740 
741 #else
742  return RealGradient();
743 #endif
744 }
RealVectorValue RealGradient
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [64/103]

Real libMesh::FE< 2, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 538 of file fe_monomial_shape_2D.C.

543 {
544  libmesh_assert(elem);
545 
546  // by default call the orientation-independent shape functions
547  return FE<2,MONOMIAL>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
548 }

◆ shape_second_deriv() [65/103]

Real libMesh::FE< 3, HERMITE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 541 of file fe_hermite_shape_3D.C.

546 {
547  libmesh_assert(elem);
548 
549  std::vector<std::vector<Real>> dxdxi(3, std::vector<Real>(2, 0));
550 
551 #ifdef DEBUG
552  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
553  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
554 #endif //DEBUG
555 
556  hermite_compute_coefs(elem, dxdxi
557 #ifdef DEBUG
558  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
559 #endif
560  );
561 
562  const ElemType type = elem->type();
563 
564  const Order totalorder = static_cast<Order>(order + elem->p_level());
565 
566  switch (totalorder)
567  {
568  // 3rd-order tricubic Hermite functions
569  case THIRD:
570  {
571  switch (type)
572  {
573  case HEX8:
574  case HEX20:
575  case HEX27:
576  {
577  libmesh_assert_less (i, 64);
578 
579  std::vector<unsigned int> bases1D;
580 
581  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
582 
583  switch (j) // Derivative type
584  {
585  case 0:
586  return coef *
588  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
589  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
590  break;
591  case 1:
592  return coef *
593  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
594  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
595  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
596  break;
597  case 2:
598  return coef *
599  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
601  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
602  break;
603  case 3:
604  return coef *
605  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
606  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
607  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
608  break;
609  case 4:
610  return coef *
611  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
612  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
613  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
614  break;
615  case 5:
616  return coef *
617  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
618  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
620  break;
621  default:
622  libmesh_error_msg("Invalid shape function derivative j = " << j);
623  }
624 
625  }
626  default:
627  libmesh_error_msg("ERROR: Unsupported element type " << type);
628  }
629  }
630  // by default throw an error
631  default:
632  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
633  }
634 }
unsigned int p_level() const
Definition: elem.h:2555
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0

◆ shape_second_deriv() [66/103]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 551 of file fe_lagrange_vec.C.

554 {
555  Real value = FE<0,LAGRANGE>::shape_second_deriv( type, order, i, j, p );
556  return libMesh::RealGradient( value );
557 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [67/103]

Real libMesh::FE< 2, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 563 of file fe_bernstein_shape_2D.C.

568 {
569  static bool warning_given = false;
570 
571  if (!warning_given)
572  libMesh::err << "Second derivatives for Bernstein elements "
573  << "are not yet implemented!"
574  << std::endl;
575 
576  warning_given = true;
577  return 0.;
578 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [68/103]

Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

◆ shape_second_deriv() [69/103]

Real libMesh::FE< 2, L2_LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 567 of file fe_l2_lagrange_shape_2D.C.

572 {
573 #if LIBMESH_DIM > 1
574 
575  // j = 0 ==> d^2 phi / dxi^2
576  // j = 1 ==> d^2 phi / dxi deta
577  // j = 2 ==> d^2 phi / deta^2
578  libmesh_assert_less (j, 3);
579 
580  switch (order)
581  {
582  // linear Lagrange shape functions
583  case FIRST:
584  {
585  switch (type)
586  {
587  case QUAD4:
588  case QUADSHELL4:
589  case QUAD8:
590  case QUADSHELL8:
591  case QUAD9:
592  {
593  // Compute quad shape functions as a tensor-product
594  const Real xi = p(0);
595  const Real eta = p(1);
596 
597  libmesh_assert_less (i, 4);
598 
599  // 0 1 2 3
600  static const unsigned int i0[] = {0, 1, 1, 0};
601  static const unsigned int i1[] = {0, 0, 1, 1};
602 
603  switch (j)
604  {
605  // d^2() / dxi^2
606  case 0:
607  return 0.;
608 
609  // d^2() / dxi deta
610  case 1:
611  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
612  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
613 
614  // d^2() / deta^2
615  case 2:
616  return 0.;
617 
618  default:
619  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
620  }
621  }
622 
623  case TRI3:
624  case TRISHELL3:
625  case TRI6:
626  {
627  // All second derivatives for linear triangles are zero.
628  return 0.;
629  }
630 
631  default:
632  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
633 
634  } // end switch (type)
635  } // end case FIRST
636 
637 
638  // quadratic Lagrange shape functions
639  case SECOND:
640  {
641  switch (type)
642  {
643  case QUAD8:
644  {
645  const Real xi = p(0);
646  const Real eta = p(1);
647 
648  libmesh_assert_less (j, 3);
649 
650  switch (j)
651  {
652  // d^2() / dxi^2
653  case 0:
654  {
655  switch (i)
656  {
657  case 0:
658  case 1:
659  return 0.5*(1.-eta);
660 
661  case 2:
662  case 3:
663  return 0.5*(1.+eta);
664 
665  case 4:
666  return eta - 1.;
667 
668  case 5:
669  case 7:
670  return 0.0;
671 
672  case 6:
673  return -1. - eta;
674 
675  default:
676  libmesh_error_msg("Invalid shape function index i = " << i);
677  }
678  }
679 
680  // d^2() / dxi deta
681  case 1:
682  {
683  switch (i)
684  {
685  case 0:
686  return 0.25*( 1. - 2.*xi - 2.*eta);
687 
688  case 1:
689  return 0.25*(-1. - 2.*xi + 2.*eta);
690 
691  case 2:
692  return 0.25*( 1. + 2.*xi + 2.*eta);
693 
694  case 3:
695  return 0.25*(-1. + 2.*xi - 2.*eta);
696 
697  case 4:
698  return xi;
699 
700  case 5:
701  return -eta;
702 
703  case 6:
704  return -xi;
705 
706  case 7:
707  return eta;
708 
709  default:
710  libmesh_error_msg("Invalid shape function index i = " << i);
711  }
712  }
713 
714  // d^2() / deta^2
715  case 2:
716  {
717  switch (i)
718  {
719  case 0:
720  case 3:
721  return 0.5*(1.-xi);
722 
723  case 1:
724  case 2:
725  return 0.5*(1.+xi);
726 
727  case 4:
728  case 6:
729  return 0.0;
730 
731  case 5:
732  return -1.0 - xi;
733 
734  case 7:
735  return xi - 1.0;
736 
737  default:
738  libmesh_error_msg("Invalid shape function index i = " << i);
739  }
740  }
741 
742 
743  default:
744  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
745  } // end switch (j)
746  } // end case QUAD8
747 
748  case QUAD9:
749  {
750  // Compute QUAD9 second derivatives as tensor product
751  const Real xi = p(0);
752  const Real eta = p(1);
753 
754  libmesh_assert_less (i, 9);
755 
756  // 0 1 2 3 4 5 6 7 8
757  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
758  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
759 
760  switch (j)
761  {
762  // d^2() / dxi^2
763  case 0:
764  return (FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
765  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
766 
767  // d^2() / dxi deta
768  case 1:
769  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
770  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
771 
772  // d^2() / deta^2
773  case 2:
774  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
775  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta));
776 
777  default:
778  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
779  } // end switch (j)
780  } // end case QUAD9
781 
782  case TRI6:
783  {
784  const Real dzeta0dxi = -1.;
785  const Real dzeta1dxi = 1.;
786  const Real dzeta2dxi = 0.;
787 
788  const Real dzeta0deta = -1.;
789  const Real dzeta1deta = 0.;
790  const Real dzeta2deta = 1.;
791 
792  libmesh_assert_less (j, 3);
793 
794  switch (j)
795  {
796  // d^2() / dxi^2
797  case 0:
798  {
799  switch (i)
800  {
801  case 0:
802  return 4.*dzeta0dxi*dzeta0dxi;
803 
804  case 1:
805  return 4.*dzeta1dxi*dzeta1dxi;
806 
807  case 2:
808  return 4.*dzeta2dxi*dzeta2dxi;
809 
810  case 3:
811  return 8.*dzeta0dxi*dzeta1dxi;
812 
813  case 4:
814  return 8.*dzeta1dxi*dzeta2dxi;
815 
816  case 5:
817  return 8.*dzeta0dxi*dzeta2dxi;
818 
819  default:
820  libmesh_error_msg("Invalid shape function index i = " << i);
821  }
822  }
823 
824  // d^2() / dxi deta
825  case 1:
826  {
827  switch (i)
828  {
829  case 0:
830  return 4.*dzeta0dxi*dzeta0deta;
831 
832  case 1:
833  return 4.*dzeta1dxi*dzeta1deta;
834 
835  case 2:
836  return 4.*dzeta2dxi*dzeta2deta;
837 
838  case 3:
839  return 4.*dzeta1deta*dzeta0dxi + 4.*dzeta0deta*dzeta1dxi;
840 
841  case 4:
842  return 4.*dzeta2deta*dzeta1dxi + 4.*dzeta1deta*dzeta2dxi;
843 
844  case 5:
845  return 4.*dzeta2deta*dzeta0dxi + 4.*dzeta0deta*dzeta2dxi;
846 
847  default:
848  libmesh_error_msg("Invalid shape function index i = " << i);
849  }
850  }
851 
852  // d^2() / deta^2
853  case 2:
854  {
855  switch (i)
856  {
857  case 0:
858  return 4.*dzeta0deta*dzeta0deta;
859 
860  case 1:
861  return 4.*dzeta1deta*dzeta1deta;
862 
863  case 2:
864  return 4.*dzeta2deta*dzeta2deta;
865 
866  case 3:
867  return 8.*dzeta0deta*dzeta1deta;
868 
869  case 4:
870  return 8.*dzeta1deta*dzeta2deta;
871 
872  case 5:
873  return 8.*dzeta0deta*dzeta2deta;
874 
875  default:
876  libmesh_error_msg("Invalid shape function index i = " << i);
877  }
878  }
879 
880  default:
881  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
882  } // end switch (j)
883  } // end case TRI6
884 
885  default:
886  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
887  }
888  } // end case SECOND
889 
890 
891 
892  // unsupported order
893  default:
894  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
895 
896  } // end switch (order)
897 
898 #endif // LIBMESH_DIM > 1
899 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [70/103]

Real libMesh::FE< 2, LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 569 of file fe_lagrange_shape_2D.C.

574 {
575 #if LIBMESH_DIM > 1
576 
577  // j = 0 ==> d^2 phi / dxi^2
578  // j = 1 ==> d^2 phi / dxi deta
579  // j = 2 ==> d^2 phi / deta^2
580  libmesh_assert_less (j, 3);
581 
582  switch (order)
583  {
584  // linear Lagrange shape functions
585  case FIRST:
586  {
587  switch (type)
588  {
589  case QUAD4:
590  case QUADSHELL4:
591  case QUAD8:
592  case QUADSHELL8:
593  case QUAD9:
594  {
595  // Compute quad shape functions as a tensor-product
596  const Real xi = p(0);
597  const Real eta = p(1);
598 
599  libmesh_assert_less (i, 4);
600 
601  // 0 1 2 3
602  static const unsigned int i0[] = {0, 1, 1, 0};
603  static const unsigned int i1[] = {0, 0, 1, 1};
604 
605  switch (j)
606  {
607  // d^2() / dxi^2
608  case 0:
609  return 0.;
610 
611  // d^2() / dxi deta
612  case 1:
613  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
614  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
615 
616  // d^2() / deta^2
617  case 2:
618  return 0.;
619 
620  default:
621  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
622  }
623  }
624 
625  case TRI3:
626  case TRISHELL3:
627  case TRI6:
628  {
629  // All second derivatives for linear triangles are zero.
630  return 0.;
631  }
632 
633  default:
634  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
635 
636  } // end switch (type)
637  } // end case FIRST
638 
639 
640  // quadratic Lagrange shape functions
641  case SECOND:
642  {
643  switch (type)
644  {
645  case QUAD8:
646  case QUADSHELL8:
647  {
648  const Real xi = p(0);
649  const Real eta = p(1);
650 
651  libmesh_assert_less (j, 3);
652 
653  switch (j)
654  {
655  // d^2() / dxi^2
656  case 0:
657  {
658  switch (i)
659  {
660  case 0:
661  case 1:
662  return 0.5*(1.-eta);
663 
664  case 2:
665  case 3:
666  return 0.5*(1.+eta);
667 
668  case 4:
669  return eta - 1.;
670 
671  case 5:
672  case 7:
673  return 0.0;
674 
675  case 6:
676  return -1. - eta;
677 
678  default:
679  libmesh_error_msg("Invalid shape function index i = " << i);
680  }
681  }
682 
683  // d^2() / dxi deta
684  case 1:
685  {
686  switch (i)
687  {
688  case 0:
689  return 0.25*( 1. - 2.*xi - 2.*eta);
690 
691  case 1:
692  return 0.25*(-1. - 2.*xi + 2.*eta);
693 
694  case 2:
695  return 0.25*( 1. + 2.*xi + 2.*eta);
696 
697  case 3:
698  return 0.25*(-1. + 2.*xi - 2.*eta);
699 
700  case 4:
701  return xi;
702 
703  case 5:
704  return -eta;
705 
706  case 6:
707  return -xi;
708 
709  case 7:
710  return eta;
711 
712  default:
713  libmesh_error_msg("Invalid shape function index i = " << i);
714  }
715  }
716 
717  // d^2() / deta^2
718  case 2:
719  {
720  switch (i)
721  {
722  case 0:
723  case 3:
724  return 0.5*(1.-xi);
725 
726  case 1:
727  case 2:
728  return 0.5*(1.+xi);
729 
730  case 4:
731  case 6:
732  return 0.0;
733 
734  case 5:
735  return -1.0 - xi;
736 
737  case 7:
738  return xi - 1.0;
739 
740  default:
741  libmesh_error_msg("Invalid shape function index i = " << i);
742  }
743  }
744 
745  default:
746  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
747  } // end switch (j)
748  } // end case QUAD8
749 
750  case QUAD9:
751  {
752  // Compute QUAD9 second derivatives as tensor product
753  const Real xi = p(0);
754  const Real eta = p(1);
755 
756  libmesh_assert_less (i, 9);
757 
758  // 0 1 2 3 4 5 6 7 8
759  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
760  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
761 
762  switch (j)
763  {
764  // d^2() / dxi^2
765  case 0:
766  return (FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
767  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
768 
769  // d^2() / dxi deta
770  case 1:
771  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
772  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
773 
774  // d^2() / deta^2
775  case 2:
776  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
777  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta));
778 
779  default:
780  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
781  } // end switch (j)
782  } // end case QUAD9
783 
784  case TRI6:
785  {
786  const Real dzeta0dxi = -1.;
787  const Real dzeta1dxi = 1.;
788  const Real dzeta2dxi = 0.;
789 
790  const Real dzeta0deta = -1.;
791  const Real dzeta1deta = 0.;
792  const Real dzeta2deta = 1.;
793 
794  libmesh_assert_less (j, 3);
795 
796  switch (j)
797  {
798  // d^2() / dxi^2
799  case 0:
800  {
801  switch (i)
802  {
803  case 0:
804  return 4.*dzeta0dxi*dzeta0dxi;
805 
806  case 1:
807  return 4.*dzeta1dxi*dzeta1dxi;
808 
809  case 2:
810  return 4.*dzeta2dxi*dzeta2dxi;
811 
812  case 3:
813  return 8.*dzeta0dxi*dzeta1dxi;
814 
815  case 4:
816  return 8.*dzeta1dxi*dzeta2dxi;
817 
818  case 5:
819  return 8.*dzeta0dxi*dzeta2dxi;
820 
821  default:
822  libmesh_error_msg("Invalid shape function index i = " << i);
823  }
824  }
825 
826  // d^2() / dxi deta
827  case 1:
828  {
829  switch (i)
830  {
831  case 0:
832  return 4.*dzeta0dxi*dzeta0deta;
833 
834  case 1:
835  return 4.*dzeta1dxi*dzeta1deta;
836 
837  case 2:
838  return 4.*dzeta2dxi*dzeta2deta;
839 
840  case 3:
841  return 4.*dzeta1deta*dzeta0dxi + 4.*dzeta0deta*dzeta1dxi;
842 
843  case 4:
844  return 4.*dzeta2deta*dzeta1dxi + 4.*dzeta1deta*dzeta2dxi;
845 
846  case 5:
847  return 4.*dzeta2deta*dzeta0dxi + 4.*dzeta0deta*dzeta2dxi;
848 
849  default:
850  libmesh_error_msg("Invalid shape function index i = " << i);
851  }
852  }
853 
854  // d^2() / deta^2
855  case 2:
856  {
857  switch (i)
858  {
859  case 0:
860  return 4.*dzeta0deta*dzeta0deta;
861 
862  case 1:
863  return 4.*dzeta1deta*dzeta1deta;
864 
865  case 2:
866  return 4.*dzeta2deta*dzeta2deta;
867 
868  case 3:
869  return 8.*dzeta0deta*dzeta1deta;
870 
871  case 4:
872  return 8.*dzeta1deta*dzeta2deta;
873 
874  case 5:
875  return 8.*dzeta0deta*dzeta2deta;
876 
877  default:
878  libmesh_error_msg("Invalid shape function index i = " << i);
879  }
880  }
881 
882  default:
883  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
884  } // end switch (j)
885  } // end case TRI6
886 
887  default:
888  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
889  }
890  } // end case SECOND
891 
892 
893 
894  // unsupported order
895  default:
896  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
897 
898  } // end switch (order)
899 
900 #else // LIBMESH_DIM > 1
901  return 0.;
902 #endif
903 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [71/103]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 573 of file fe_lagrange_vec.C.

576 {
577  Real value = FE<1,LAGRANGE>::shape_second_deriv( type, order, i, j, p );
578  return libMesh::RealGradient( value );
579 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [72/103]

Real libMesh::FE< 2, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 583 of file fe_bernstein_shape_2D.C.

588 {
589  static bool warning_given = false;
590 
591  if (!warning_given)
592  libMesh::err << "Second derivatives for Bernstein elements "
593  << "are not yet implemented!"
594  << std::endl;
595 
596  warning_given = true;
597  return 0.;
598 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [73/103]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 607 of file fe_nedelec_one.C.

609 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_second_deriv() [74/103]

RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 611 of file fe_nedelec_one.C.

613 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_second_deriv() [75/103]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 623 of file fe_lagrange_vec.C.

626 {
627  Real value = FE<2,LAGRANGE>::shape_second_deriv( type, order, i/2, j, p );
628 
629  switch( i%2 )
630  {
631  case 0:
632  return libMesh::RealGradient( value );
633 
634  case 1:
635  return libMesh::RealGradient( Real(0), value );
636 
637  default:
638  libmesh_error_msg("i%2 must be either 0 or 1!");
639  }
640 
641  //dummy
642  return libMesh::RealGradient();
643 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [76/103]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 630 of file fe_nedelec_one.C.

632 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_second_deriv() [77/103]

RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 634 of file fe_nedelec_one.C.

636 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shape_second_deriv() [78/103]

Real libMesh::FE< 3, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 653 of file fe_monomial_shape_3D.C.

658 {
659 #if LIBMESH_DIM == 3
660 
661  libmesh_assert_less (j, 6);
662 
663  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
664  (static_cast<unsigned int>(order)+2)*
665  (static_cast<unsigned int>(order)+3)/6);
666 
667  const Real xi = p(0);
668  const Real eta = p(1);
669  const Real zeta = p(2);
670 
671  // monomials. since they are hierarchic we only need one case block.
672  switch (j)
673  {
674  // d^2()/dxi^2
675  case 0:
676  {
677  switch (i)
678  {
679  // constant
680  case 0:
681 
682  // linear
683  case 1:
684  case 2:
685  case 3:
686  return 0.;
687 
688  // quadratic
689  case 4:
690  return 2.;
691 
692  case 5:
693  case 6:
694  case 7:
695  case 8:
696  case 9:
697  return 0.;
698 
699  // cubic
700  case 10:
701  return 6.*xi;
702 
703  case 11:
704  return 2.*eta;
705 
706  case 12:
707  case 13:
708  return 0.;
709 
710  case 14:
711  return 2.*zeta;
712 
713  case 15:
714  case 16:
715  case 17:
716  case 18:
717  case 19:
718  return 0.;
719 
720  // quartics
721  case 20:
722  return 12.*xi*xi;
723 
724  case 21:
725  return 6.*xi*eta;
726 
727  case 22:
728  return 2.*eta*eta;
729 
730  case 23:
731  case 24:
732  return 0.;
733 
734  case 25:
735  return 6.*xi*zeta;
736 
737  case 26:
738  return 2.*eta*zeta;
739 
740  case 27:
741  case 28:
742  return 0.;
743 
744  case 29:
745  return 2.*zeta*zeta;
746 
747  case 30:
748  case 31:
749  case 32:
750  case 33:
751  case 34:
752  return 0.;
753 
754  default:
755  unsigned int o = 0;
756  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
757  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
758  unsigned int block=o, nz = 0;
759  for (; block < i2; block += (o-nz+1)) { nz++; }
760  const unsigned int nx = block - i2;
761  const unsigned int ny = o - nx - nz;
762  Real val = nx * (nx - 1);
763  for (unsigned int index=2; index < nx; index++)
764  val *= xi;
765  for (unsigned int index=0; index != ny; index++)
766  val *= eta;
767  for (unsigned int index=0; index != nz; index++)
768  val *= zeta;
769  return val;
770  }
771  }
772 
773 
774  // d^2()/dxideta
775  case 1:
776  {
777  switch (i)
778  {
779  // constant
780  case 0:
781 
782  // linear
783  case 1:
784  case 2:
785  case 3:
786  return 0.;
787 
788  // quadratic
789  case 4:
790  return 0.;
791 
792  case 5:
793  return 1.;
794 
795  case 6:
796  case 7:
797  case 8:
798  case 9:
799  return 0.;
800 
801  // cubic
802  case 10:
803  return 0.;
804 
805  case 11:
806  return 2.*xi;
807 
808  case 12:
809  return 2.*eta;
810 
811  case 13:
812  case 14:
813  return 0.;
814 
815  case 15:
816  return zeta;
817 
818  case 16:
819  case 17:
820  case 18:
821  case 19:
822  return 0.;
823 
824  // quartics
825  case 20:
826  return 0.;
827 
828  case 21:
829  return 3.*xi*xi;
830 
831  case 22:
832  return 4.*xi*eta;
833 
834  case 23:
835  return 3.*eta*eta;
836 
837  case 24:
838  case 25:
839  return 0.;
840 
841  case 26:
842  return 2.*xi*zeta;
843 
844  case 27:
845  return 2.*eta*zeta;
846 
847  case 28:
848  case 29:
849  return 0.;
850 
851  case 30:
852  return zeta*zeta;
853 
854  case 31:
855  case 32:
856  case 33:
857  case 34:
858  return 0.;
859 
860  default:
861  unsigned int o = 0;
862  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
863  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
864  unsigned int block=o, nz = 0;
865  for (; block < i2; block += (o-nz+1)) { nz++; }
866  const unsigned int nx = block - i2;
867  const unsigned int ny = o - nx - nz;
868  Real val = nx * ny;
869  for (unsigned int index=1; index < nx; index++)
870  val *= xi;
871  for (unsigned int index=1; index < ny; index++)
872  val *= eta;
873  for (unsigned int index=0; index != nz; index++)
874  val *= zeta;
875  return val;
876  }
877  }
878 
879 
880  // d^2()/deta^2
881  case 2:
882  {
883  switch (i)
884  {
885  // constant
886  case 0:
887 
888  // linear
889  case 1:
890  case 2:
891  case 3:
892  return 0.;
893 
894  // quadratic
895  case 4:
896  case 5:
897  return 0.;
898 
899  case 6:
900  return 2.;
901 
902  case 7:
903  case 8:
904  case 9:
905  return 0.;
906 
907  // cubic
908  case 10:
909  case 11:
910  return 0.;
911 
912  case 12:
913  return 2.*xi;
914  case 13:
915  return 6.*eta;
916 
917  case 14:
918  case 15:
919  return 0.;
920 
921  case 16:
922  return 2.*zeta;
923 
924  case 17:
925  case 18:
926  case 19:
927  return 0.;
928 
929  // quartics
930  case 20:
931  case 21:
932  return 0.;
933 
934  case 22:
935  return 2.*xi*xi;
936 
937  case 23:
938  return 6.*xi*eta;
939 
940  case 24:
941  return 12.*eta*eta;
942 
943  case 25:
944  case 26:
945  return 0.;
946 
947  case 27:
948  return 2.*xi*zeta;
949 
950  case 28:
951  return 6.*eta*zeta;
952 
953  case 29:
954  case 30:
955  return 0.;
956 
957  case 31:
958  return 2.*zeta*zeta;
959 
960  case 32:
961  case 33:
962  case 34:
963  return 0.;
964 
965  default:
966  unsigned int o = 0;
967  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
968  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
969  unsigned int block=o, nz = 0;
970  for (; block < i2; block += (o-nz+1)) { nz++; }
971  const unsigned int nx = block - i2;
972  const unsigned int ny = o - nx - nz;
973  Real val = ny * (ny - 1);
974  for (unsigned int index=0; index != nx; index++)
975  val *= xi;
976  for (unsigned int index=2; index < ny; index++)
977  val *= eta;
978  for (unsigned int index=0; index != nz; index++)
979  val *= zeta;
980  return val;
981  }
982  }
983 
984 
985  // d^2()/dxidzeta
986  case 3:
987  {
988  switch (i)
989  {
990  // constant
991  case 0:
992 
993  // linear
994  case 1:
995  case 2:
996  case 3:
997  return 0.;
998 
999  // quadratic
1000  case 4:
1001  case 5:
1002  case 6:
1003  return 0.;
1004 
1005  case 7:
1006  return 1.;
1007 
1008  case 8:
1009  case 9:
1010  return 0.;
1011 
1012  // cubic
1013  case 10:
1014  case 11:
1015  case 12:
1016  case 13:
1017  return 0.;
1018 
1019  case 14:
1020  return 2.*xi;
1021 
1022  case 15:
1023  return eta;
1024 
1025  case 16:
1026  return 0.;
1027 
1028  case 17:
1029  return 2.*zeta;
1030 
1031  case 18:
1032  case 19:
1033  return 0.;
1034 
1035  // quartics
1036  case 20:
1037  case 21:
1038  case 22:
1039  case 23:
1040  case 24:
1041  return 0.;
1042 
1043  case 25:
1044  return 3.*xi*xi;
1045 
1046  case 26:
1047  return 2.*xi*eta;
1048 
1049  case 27:
1050  return eta*eta;
1051 
1052  case 28:
1053  return 0.;
1054 
1055  case 29:
1056  return 4.*xi*zeta;
1057 
1058  case 30:
1059  return 2.*eta*zeta;
1060 
1061  case 31:
1062  return 0.;
1063 
1064  case 32:
1065  return 3.*zeta*zeta;
1066 
1067  case 33:
1068  case 34:
1069  return 0.;
1070 
1071  default:
1072  unsigned int o = 0;
1073  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1074  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1075  unsigned int block=o, nz = 0;
1076  for (; block < i2; block += (o-nz+1)) { nz++; }
1077  const unsigned int nx = block - i2;
1078  const unsigned int ny = o - nx - nz;
1079  Real val = nx * nz;
1080  for (unsigned int index=1; index < nx; index++)
1081  val *= xi;
1082  for (unsigned int index=0; index != ny; index++)
1083  val *= eta;
1084  for (unsigned int index=1; index < nz; index++)
1085  val *= zeta;
1086  return val;
1087  }
1088  }
1089 
1090  // d^2()/detadzeta
1091  case 4:
1092  {
1093  switch (i)
1094  {
1095  // constant
1096  case 0:
1097 
1098  // linear
1099  case 1:
1100  case 2:
1101  case 3:
1102  return 0.;
1103 
1104  // quadratic
1105  case 4:
1106  case 5:
1107  case 6:
1108  case 7:
1109  return 0.;
1110 
1111  case 8:
1112  return 1.;
1113 
1114  case 9:
1115  return 0.;
1116 
1117  // cubic
1118  case 10:
1119  case 11:
1120  case 12:
1121  case 13:
1122  case 14:
1123  return 0.;
1124 
1125  case 15:
1126  return xi;
1127 
1128  case 16:
1129  return 2.*eta;
1130 
1131  case 17:
1132  return 0.;
1133 
1134  case 18:
1135  return 2.*zeta;
1136 
1137  case 19:
1138  return 0.;
1139 
1140  // quartics
1141  case 20:
1142  case 21:
1143  case 22:
1144  case 23:
1145  case 24:
1146  case 25:
1147  return 0.;
1148 
1149  case 26:
1150  return xi*xi;
1151 
1152  case 27:
1153  return 2.*xi*eta;
1154 
1155  case 28:
1156  return 3.*eta*eta;
1157 
1158  case 29:
1159  return 0.;
1160 
1161  case 30:
1162  return 2.*xi*zeta;
1163 
1164  case 31:
1165  return 4.*eta*zeta;
1166 
1167  case 32:
1168  return 0.;
1169 
1170  case 33:
1171  return 3.*zeta*zeta;
1172 
1173  case 34:
1174  return 0.;
1175 
1176  default:
1177  unsigned int o = 0;
1178  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1179  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1180  unsigned int block=o, nz = 0;
1181  for (; block < i2; block += (o-nz+1)) { nz++; }
1182  const unsigned int nx = block - i2;
1183  const unsigned int ny = o - nx - nz;
1184  Real val = ny * nz;
1185  for (unsigned int index=0; index != nx; index++)
1186  val *= xi;
1187  for (unsigned int index=1; index < ny; index++)
1188  val *= eta;
1189  for (unsigned int index=1; index < nz; index++)
1190  val *= zeta;
1191  return val;
1192  }
1193  }
1194 
1195 
1196  // d^2()/dzeta^2
1197  case 5:
1198  {
1199  switch (i)
1200  {
1201  // constant
1202  case 0:
1203 
1204  // linear
1205  case 1:
1206  case 2:
1207  case 3:
1208  return 0.;
1209 
1210  // quadratic
1211  case 4:
1212  case 5:
1213  case 6:
1214  case 7:
1215  case 8:
1216  return 0.;
1217 
1218  case 9:
1219  return 2.;
1220 
1221  // cubic
1222  case 10:
1223  case 11:
1224  case 12:
1225  case 13:
1226  case 14:
1227  case 15:
1228  case 16:
1229  return 0.;
1230 
1231  case 17:
1232  return 2.*xi;
1233 
1234  case 18:
1235  return 2.*eta;
1236 
1237  case 19:
1238  return 6.*zeta;
1239 
1240  // quartics
1241  case 20:
1242  case 21:
1243  case 22:
1244  case 23:
1245  case 24:
1246  case 25:
1247  case 26:
1248  case 27:
1249  case 28:
1250  return 0.;
1251 
1252  case 29:
1253  return 2.*xi*xi;
1254 
1255  case 30:
1256  return 2.*xi*eta;
1257 
1258  case 31:
1259  return 2.*eta*eta;
1260 
1261  case 32:
1262  return 6.*xi*zeta;
1263 
1264  case 33:
1265  return 6.*eta*zeta;
1266 
1267  case 34:
1268  return 12.*zeta*zeta;
1269 
1270  default:
1271  unsigned int o = 0;
1272  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1273  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1274  unsigned int block=o, nz = 0;
1275  for (; block < i2; block += (o-nz+1)) { nz++; }
1276  const unsigned int nx = block - i2;
1277  const unsigned int ny = o - nx - nz;
1278  Real val = nz * (nz - 1);
1279  for (unsigned int index=0; index != nx; index++)
1280  val *= xi;
1281  for (unsigned int index=0; index != ny; index++)
1282  val *= eta;
1283  for (unsigned int index=2; index < nz; index++)
1284  val *= zeta;
1285  return val;
1286  }
1287  }
1288 
1289  default:
1290  libmesh_error_msg("Invalid j = " << j);
1291  }
1292 
1293 #else
1294  return 0.;
1295 #endif
1296 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [79/103]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 694 of file fe_lagrange_vec.C.

697 {
698  Real value = FE<3,LAGRANGE>::shape_second_deriv( type, order, i/3, j, p );
699 
700  switch( i%3 )
701  {
702  case 0:
703  return libMesh::RealGradient( value );
704 
705  case 1:
706  return libMesh::RealGradient( Real(0), value );
707 
708  case 2:
709  return libMesh::RealGradient( Real(0), Real(0), value );
710 
711  default:
712  libmesh_error_msg("i%3 must be 0, 1, or 2!");
713  }
714 
715  //dummy
716  return libMesh::RealGradient();
717 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [80/103]

Real libMesh::FE< 3, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 696 of file fe_xyz_shape_3D.C.

701 {
702  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
703  return 0.;
704 }

◆ shape_second_deriv() [81/103]

Real libMesh::FE< 3, XYZ >::shape_second_deriv ( const Elem elem,
const Order  libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)
inherited

Definition at line 709 of file fe_xyz_shape_3D.C.

714 {
715 #if LIBMESH_DIM == 3
716 
717  libmesh_assert(elem);
718  libmesh_assert_less (j, 6);
719 
720  Point centroid = elem->centroid();
721  Point max_distance = Point(0.,0.,0.);
722  for (unsigned int p = 0; p < elem->n_nodes(); p++)
723  for (unsigned int d = 0; d < 3; d++)
724  {
725  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
726  max_distance(d) = std::max(distance, max_distance(d));
727  }
728 
729  const Real x = point_in(0);
730  const Real y = point_in(1);
731  const Real z = point_in(2);
732  const Real xc = centroid(0);
733  const Real yc = centroid(1);
734  const Real zc = centroid(2);
735  const Real distx = max_distance(0);
736  const Real disty = max_distance(1);
737  const Real distz = max_distance(2);
738  const Real dx = (x - xc)/distx;
739  const Real dy = (y - yc)/disty;
740  const Real dz = (z - zc)/distz;
741  const Real dist2x = pow(distx,2.);
742  const Real dist2y = pow(disty,2.);
743  const Real dist2z = pow(distz,2.);
744  const Real distxy = distx * disty;
745  const Real distxz = distx * distz;
746  const Real distyz = disty * distz;
747 
748 #ifndef NDEBUG
749  // totalorder is only used in the assertion below, so
750  // we avoid declaring it when asserts are not active.
751  const unsigned int totalorder = static_cast<Order>(order + elem->p_level());
752 #endif
753  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
754  (static_cast<unsigned int>(totalorder)+2)*
755  (static_cast<unsigned int>(totalorder)+3)/6);
756 
757  // monomials. since they are hierarchic we only need one case block.
758  switch (j)
759  {
760  // d^2()/dx^2
761  case 0:
762  {
763  switch (i)
764  {
765  // constant
766  case 0:
767 
768  // linear
769  case 1:
770  case 2:
771  case 3:
772  return 0.;
773 
774  // quadratic
775  case 4:
776  return 2./dist2x;
777 
778  case 5:
779  case 6:
780  case 7:
781  case 8:
782  case 9:
783  return 0.;
784 
785  // cubic
786  case 10:
787  return 6.*dx/dist2x;
788 
789  case 11:
790  return 2.*dy/dist2x;
791 
792  case 12:
793  case 13:
794  return 0.;
795 
796  case 14:
797  return 2.*dz/dist2x;
798 
799  case 15:
800  case 16:
801  case 17:
802  case 18:
803  case 19:
804  return 0.;
805 
806  // quartics
807  case 20:
808  return 12.*dx*dx/dist2x;
809 
810  case 21:
811  return 6.*dx*dy/dist2x;
812 
813  case 22:
814  return 2.*dy*dy/dist2x;
815 
816  case 23:
817  case 24:
818  return 0.;
819 
820  case 25:
821  return 6.*dx*dz/dist2x;
822 
823  case 26:
824  return 2.*dy*dz/dist2x;
825 
826  case 27:
827  case 28:
828  return 0.;
829 
830  case 29:
831  return 2.*dz*dz/dist2x;
832 
833  case 30:
834  case 31:
835  case 32:
836  case 33:
837  case 34:
838  return 0.;
839 
840  default:
841  unsigned int o = 0;
842  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
843  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
844  unsigned int block=o, nz = 0;
845  for (; block < i2; block += (o-nz+1)) { nz++; }
846  const unsigned int nx = block - i2;
847  const unsigned int ny = o - nx - nz;
848  Real val = nx * (nx - 1);
849  for (unsigned int index=2; index < nx; index++)
850  val *= dx;
851  for (unsigned int index=0; index != ny; index++)
852  val *= dy;
853  for (unsigned int index=0; index != nz; index++)
854  val *= dz;
855  return val/dist2x;
856  }
857  }
858 
859 
860  // d^2()/dxdy
861  case 1:
862  {
863  switch (i)
864  {
865  // constant
866  case 0:
867 
868  // linear
869  case 1:
870  case 2:
871  case 3:
872  return 0.;
873 
874  // quadratic
875  case 4:
876  return 0.;
877 
878  case 5:
879  return 1./distxy;
880 
881  case 6:
882  case 7:
883  case 8:
884  case 9:
885  return 0.;
886 
887  // cubic
888  case 10:
889  return 0.;
890 
891  case 11:
892  return 2.*dx/distxy;
893 
894  case 12:
895  return 2.*dy/distxy;
896 
897  case 13:
898  case 14:
899  return 0.;
900 
901  case 15:
902  return dz/distxy;
903 
904  case 16:
905  case 17:
906  case 18:
907  case 19:
908  return 0.;
909 
910  // quartics
911  case 20:
912  return 0.;
913 
914  case 21:
915  return 3.*dx*dx/distxy;
916 
917  case 22:
918  return 4.*dx*dy/distxy;
919 
920  case 23:
921  return 3.*dy*dy/distxy;
922 
923  case 24:
924  case 25:
925  return 0.;
926 
927  case 26:
928  return 2.*dx*dz/distxy;
929 
930  case 27:
931  return 2.*dy*dz/distxy;
932 
933  case 28:
934  case 29:
935  return 0.;
936 
937  case 30:
938  return dz*dz/distxy;
939 
940  case 31:
941  case 32:
942  case 33:
943  case 34:
944  return 0.;
945 
946  default:
947  unsigned int o = 0;
948  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
949  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
950  unsigned int block=o, nz = 0;
951  for (; block < i2; block += (o-nz+1)) { nz++; }
952  const unsigned int nx = block - i2;
953  const unsigned int ny = o - nx - nz;
954  Real val = nx * ny;
955  for (unsigned int index=1; index < nx; index++)
956  val *= dx;
957  for (unsigned int index=1; index < ny; index++)
958  val *= dy;
959  for (unsigned int index=0; index != nz; index++)
960  val *= dz;
961  return val/distxy;
962  }
963  }
964 
965 
966  // d^2()/dy^2
967  case 2:
968  {
969  switch (i)
970  {
971  // constant
972  case 0:
973 
974  // linear
975  case 1:
976  case 2:
977  case 3:
978  return 0.;
979 
980  // quadratic
981  case 4:
982  case 5:
983  return 0.;
984 
985  case 6:
986  return 2./dist2y;
987 
988  case 7:
989  case 8:
990  case 9:
991  return 0.;
992 
993  // cubic
994  case 10:
995  case 11:
996  return 0.;
997 
998  case 12:
999  return 2.*dx/dist2y;
1000  case 13:
1001  return 6.*dy/dist2y;
1002 
1003  case 14:
1004  case 15:
1005  return 0.;
1006 
1007  case 16:
1008  return 2.*dz/dist2y;
1009 
1010  case 17:
1011  case 18:
1012  case 19:
1013  return 0.;
1014 
1015  // quartics
1016  case 20:
1017  case 21:
1018  return 0.;
1019 
1020  case 22:
1021  return 2.*dx*dx/dist2y;
1022 
1023  case 23:
1024  return 6.*dx*dy/dist2y;
1025 
1026  case 24:
1027  return 12.*dy*dy/dist2y;
1028 
1029  case 25:
1030  case 26:
1031  return 0.;
1032 
1033  case 27:
1034  return 2.*dx*dz/dist2y;
1035 
1036  case 28:
1037  return 6.*dy*dz/dist2y;
1038 
1039  case 29:
1040  case 30:
1041  return 0.;
1042 
1043  case 31:
1044  return 2.*dz*dz/dist2y;
1045 
1046  case 32:
1047  case 33:
1048  case 34:
1049  return 0.;
1050 
1051  default:
1052  unsigned int o = 0;
1053  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1054  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1055  unsigned int block=o, nz = 0;
1056  for (; block < i2; block += (o-nz+1)) { nz++; }
1057  const unsigned int nx = block - i2;
1058  const unsigned int ny = o - nx - nz;
1059  Real val = ny * (ny - 1);
1060  for (unsigned int index=0; index != nx; index++)
1061  val *= dx;
1062  for (unsigned int index=2; index < ny; index++)
1063  val *= dy;
1064  for (unsigned int index=0; index != nz; index++)
1065  val *= dz;
1066  return val/dist2y;
1067  }
1068  }
1069 
1070 
1071  // d^2()/dxdz
1072  case 3:
1073  {
1074  switch (i)
1075  {
1076  // constant
1077  case 0:
1078 
1079  // linear
1080  case 1:
1081  case 2:
1082  case 3:
1083  return 0.;
1084 
1085  // quadratic
1086  case 4:
1087  case 5:
1088  case 6:
1089  return 0.;
1090 
1091  case 7:
1092  return 1./distxz;
1093 
1094  case 8:
1095  case 9:
1096  return 0.;
1097 
1098  // cubic
1099  case 10:
1100  case 11:
1101  case 12:
1102  case 13:
1103  return 0.;
1104 
1105  case 14:
1106  return 2.*dx/distxz;
1107 
1108  case 15:
1109  return dy/distxz;
1110 
1111  case 16:
1112  return 0.;
1113 
1114  case 17:
1115  return 2.*dz/distxz;
1116 
1117  case 18:
1118  case 19:
1119  return 0.;
1120 
1121  // quartics
1122  case 20:
1123  case 21:
1124  case 22:
1125  case 23:
1126  case 24:
1127  return 0.;
1128 
1129  case 25:
1130  return 3.*dx*dx/distxz;
1131 
1132  case 26:
1133  return 2.*dx*dy/distxz;
1134 
1135  case 27:
1136  return dy*dy/distxz;
1137 
1138  case 28:
1139  return 0.;
1140 
1141  case 29:
1142  return 4.*dx*dz/distxz;
1143 
1144  case 30:
1145  return 2.*dy*dz/distxz;
1146 
1147  case 31:
1148  return 0.;
1149 
1150  case 32:
1151  return 3.*dz*dz/distxz;
1152 
1153  case 33:
1154  case 34:
1155  return 0.;
1156 
1157  default:
1158  unsigned int o = 0;
1159  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1160  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1161  unsigned int block=o, nz = 0;
1162  for (; block < i2; block += (o-nz+1)) { nz++; }
1163  const unsigned int nx = block - i2;
1164  const unsigned int ny = o - nx - nz;
1165  Real val = nx * nz;
1166  for (unsigned int index=1; index < nx; index++)
1167  val *= dx;
1168  for (unsigned int index=0; index != ny; index++)
1169  val *= dy;
1170  for (unsigned int index=1; index < nz; index++)
1171  val *= dz;
1172  return val/distxz;
1173  }
1174  }
1175 
1176  // d^2()/dydz
1177  case 4:
1178  {
1179  switch (i)
1180  {
1181  // constant
1182  case 0:
1183 
1184  // linear
1185  case 1:
1186  case 2:
1187  case 3:
1188  return 0.;
1189 
1190  // quadratic
1191  case 4:
1192  case 5:
1193  case 6:
1194  case 7:
1195  return 0.;
1196 
1197  case 8:
1198  return 1./distyz;
1199 
1200  case 9:
1201  return 0.;
1202 
1203  // cubic
1204  case 10:
1205  case 11:
1206  case 12:
1207  case 13:
1208  case 14:
1209  return 0.;
1210 
1211  case 15:
1212  return dx/distyz;
1213 
1214  case 16:
1215  return 2.*dy/distyz;
1216 
1217  case 17:
1218  return 0.;
1219 
1220  case 18:
1221  return 2.*dz/distyz;
1222 
1223  case 19:
1224  return 0.;
1225 
1226  // quartics
1227  case 20:
1228  case 21:
1229  case 22:
1230  case 23:
1231  case 24:
1232  case 25:
1233  return 0.;
1234 
1235  case 26:
1236  return dx*dx/distyz;
1237 
1238  case 27:
1239  return 2.*dx*dy/distyz;
1240 
1241  case 28:
1242  return 3.*dy*dy/distyz;
1243 
1244  case 29:
1245  return 0.;
1246 
1247  case 30:
1248  return 2.*dx*dz/distyz;
1249 
1250  case 31:
1251  return 4.*dy*dz/distyz;
1252 
1253  case 32:
1254  return 0.;
1255 
1256  case 33:
1257  return 3.*dz*dz/distyz;
1258 
1259  case 34:
1260  return 0.;
1261 
1262  default:
1263  unsigned int o = 0;
1264  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1265  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1266  unsigned int block=o, nz = 0;
1267  for (; block < i2; block += (o-nz+1)) { nz++; }
1268  const unsigned int nx = block - i2;
1269  const unsigned int ny = o - nx - nz;
1270  Real val = ny * nz;
1271  for (unsigned int index=0; index != nx; index++)
1272  val *= dx;
1273  for (unsigned int index=1; index < ny; index++)
1274  val *= dy;
1275  for (unsigned int index=1; index < nz; index++)
1276  val *= dz;
1277  return val/distyz;
1278  }
1279  }
1280 
1281 
1282  // d^2()/dz^2
1283  case 5:
1284  {
1285  switch (i)
1286  {
1287  // constant
1288  case 0:
1289 
1290  // linear
1291  case 1:
1292  case 2:
1293  case 3:
1294  return 0.;
1295 
1296  // quadratic
1297  case 4:
1298  case 5:
1299  case 6:
1300  case 7:
1301  case 8:
1302  return 0.;
1303 
1304  case 9:
1305  return 2./dist2z;
1306 
1307  // cubic
1308  case 10:
1309  case 11:
1310  case 12:
1311  case 13:
1312  case 14:
1313  case 15:
1314  case 16:
1315  return 0.;
1316 
1317  case 17:
1318  return 2.*dx/dist2z;
1319 
1320  case 18:
1321  return 2.*dy/dist2z;
1322 
1323  case 19:
1324  return 6.*dz/dist2z;
1325 
1326  // quartics
1327  case 20:
1328  case 21:
1329  case 22:
1330  case 23:
1331  case 24:
1332  case 25:
1333  case 26:
1334  case 27:
1335  case 28:
1336  return 0.;
1337 
1338  case 29:
1339  return 2.*dx*dx/dist2z;
1340 
1341  case 30:
1342  return 2.*dx*dy/dist2z;
1343 
1344  case 31:
1345  return 2.*dy*dy/dist2z;
1346 
1347  case 32:
1348  return 6.*dx*dz/dist2z;
1349 
1350  case 33:
1351  return 6.*dy*dz/dist2z;
1352 
1353  case 34:
1354  return 12.*dz*dz/dist2z;
1355 
1356  default:
1357  unsigned int o = 0;
1358  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1359  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1360  unsigned int block=o, nz = 0;
1361  for (; block < i2; block += (o-nz+1)) { nz++; }
1362  const unsigned int nx = block - i2;
1363  const unsigned int ny = o - nx - nz;
1364  Real val = nz * (nz - 1);
1365  for (unsigned int index=0; index != nx; index++)
1366  val *= dx;
1367  for (unsigned int index=0; index != ny; index++)
1368  val *= dy;
1369  for (unsigned int index=2; index < nz; index++)
1370  val *= dz;
1371  return val/dist2z;
1372  }
1373  }
1374 
1375 
1376  default:
1377  libmesh_error_msg("Invalid j = " << j);
1378  }
1379 
1380 #else
1381  return 0.;
1382 #endif
1383 }
double abs(double a)
long double max(long double a, double b)
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [82/103]

RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 735 of file fe_lagrange_vec.C.

738 {
739  Real value = FE<0,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
740  return libMesh::RealGradient( value );
741 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [83/103]

RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 757 of file fe_lagrange_vec.C.

760 {
761  Real value = FE<1,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
762  return libMesh::RealGradient( value );
763 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [84/103]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 770 of file fe_l2_hierarchic_shape_3D.C.

775 {
776  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
777  return 0.;
778 }

◆ shape_second_deriv() [85/103]

Real libMesh::FE< 3, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 770 of file fe_hierarchic_shape_3D.C.

775 {
776  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
777  return 0.;
778 }

◆ shape_second_deriv() [86/103]

Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 778 of file fe_subdivision_2D.C.

783 {
784  switch (order)
785  {
786  case FOURTH:
787  {
788  switch (type)
789  {
790  case TRI3SUBDIVISION:
791  libmesh_assert_less(i, 12);
792  return FESubdivision::regular_shape_second_deriv(i,j,p(0),p(1));
793  default:
794  libmesh_error_msg("ERROR: Unsupported element type!");
795  }
796  }
797  default:
798  libmesh_error_msg("ERROR: Unsupported polynomial order!");
799  }
800 }

◆ shape_second_deriv() [87/103]

Real libMesh::FE< 3, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 783 of file fe_hierarchic_shape_3D.C.

788 {
789  libmesh_assert(elem);
790 
791  const Real eps = 1.e-6;
792  Point pp, pm;
793  unsigned int prevj = libMesh::invalid_uint;
794 
795  switch (j)
796  {
797  // d^2()/dxi^2
798  case 0:
799  {
800  pp = Point(p(0)+eps, p(1), p(2));
801  pm = Point(p(0)-eps, p(1), p(2));
802  prevj = 0;
803  break;
804  }
805 
806  // d^2()/dxideta
807  case 1:
808  {
809  pp = Point(p(0), p(1)+eps, p(2));
810  pm = Point(p(0), p(1)-eps, p(2));
811  prevj = 0;
812  break;
813  }
814 
815  // d^2()/deta^2
816  case 2:
817  {
818  pp = Point(p(0), p(1)+eps, p(2));
819  pm = Point(p(0), p(1)-eps, p(2));
820  prevj = 1;
821  break;
822  }
823 
824  // d^2()/dxidzeta
825  case 3:
826  {
827  pp = Point(p(0), p(1), p(2)+eps);
828  pm = Point(p(0), p(1), p(2)-eps);
829  prevj = 0;
830  break;
831  }
832 
833  // d^2()/detadzeta
834  case 4:
835  {
836  pp = Point(p(0), p(1), p(2)+eps);
837  pm = Point(p(0), p(1), p(2)-eps);
838  prevj = 1;
839  break;
840  }
841 
842  // d^2()/dzeta^2
843  case 5:
844  {
845  pp = Point(p(0), p(1), p(2)+eps);
846  pm = Point(p(0), p(1), p(2)-eps);
847  prevj = 2;
848  break;
849  }
850  default:
851  libmesh_error_msg("Invalid derivative index j = " << j);
852  }
853 
854  return (FE<3,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
855  FE<3,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm))
856  / 2. / eps;
857 }
const unsigned int invalid_uint
Definition: libmesh.h:245
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [88/103]

Real libMesh::FE< 3, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 783 of file fe_l2_hierarchic_shape_3D.C.

788 {
789  libmesh_assert(elem);
790 
791  const Real eps = 1.e-6;
792  Point pp, pm;
793  unsigned int prevj = libMesh::invalid_uint;
794 
795  switch (j)
796  {
797  // d^2()/dxi^2
798  case 0:
799  {
800  pp = Point(p(0)+eps, p(1), p(2));
801  pm = Point(p(0)-eps, p(1), p(2));
802  prevj = 0;
803  break;
804  }
805 
806  // d^2()/dxideta
807  case 1:
808  {
809  pp = Point(p(0), p(1)+eps, p(2));
810  pm = Point(p(0), p(1)-eps, p(2));
811  prevj = 0;
812  break;
813  }
814 
815  // d^2()/deta^2
816  case 2:
817  {
818  pp = Point(p(0), p(1)+eps, p(2));
819  pm = Point(p(0), p(1)-eps, p(2));
820  prevj = 1;
821  break;
822  }
823 
824  // d^2()/dxidzeta
825  case 3:
826  {
827  pp = Point(p(0), p(1), p(2)+eps);
828  pm = Point(p(0), p(1), p(2)-eps);
829  prevj = 0;
830  break;
831  }
832 
833  // d^2()/detadzeta
834  case 4:
835  {
836  pp = Point(p(0), p(1), p(2)+eps);
837  pm = Point(p(0), p(1), p(2)-eps);
838  prevj = 1;
839  break;
840  }
841 
842  // d^2()/dzeta^2
843  case 5:
844  {
845  pp = Point(p(0), p(1), p(2)+eps);
846  pm = Point(p(0), p(1), p(2)-eps);
847  prevj = 2;
848  break;
849  }
850  default:
851  libmesh_error_msg("Invalid derivative index j = " << j);
852  }
853 
854  return (FE<3,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
855  FE<3,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm))
856  / 2. / eps;
857 }
const unsigned int invalid_uint
Definition: libmesh.h:245
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [89/103]

Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 805 of file fe_subdivision_2D.C.

810 {
811  libmesh_assert(elem);
812  return FE<2,SUBDIVISION>::shape_second_deriv(elem->type(), order, i, j, p);
813 }
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)

◆ shape_second_deriv() [90/103]

RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 807 of file fe_lagrange_vec.C.

810 {
811  Real value = FE<2,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, j, p );
812 
813  switch( i%2 )
814  {
815  case 0:
816  return libMesh::RealGradient( value );
817 
818  case 1:
819  return libMesh::RealGradient( Real(0), value );
820 
821  default:
822  libmesh_error_msg("i%2 must be either 0 or 1!");
823  }
824 
825  //dummy
826  return libMesh::RealGradient();
827 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [91/103]

RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 877 of file fe_lagrange_vec.C.

880 {
881  Real value = FE<3,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, j, p );
882 
883  switch( i%3 )
884  {
885  case 0:
886  return libMesh::RealGradient( value );
887 
888  case 1:
889  return libMesh::RealGradient( Real(0), value );
890 
891  case 2:
892  return libMesh::RealGradient( Real(0), Real(0), value );
893 
894  default:
895  libmesh_error_msg("i%3 must be 0, 1, or 2!");
896  }
897 
898  //dummy
899  return libMesh::RealGradient();
900 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:109

◆ shape_second_deriv() [92/103]

Real libMesh::FE< 2, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 904 of file fe_l2_lagrange_shape_2D.C.

909 {
910  libmesh_assert(elem);
911 
912  // call the orientation-independent shape functions
913  return FE<2,L2_LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
914 }

◆ shape_second_deriv() [93/103]

Real libMesh::FE< 2, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 908 of file fe_lagrange_shape_2D.C.

913 {
914  libmesh_assert(elem);
915 
916  // call the orientation-independent shape functions
917  return FE<2,LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
918 }

◆ shape_second_deriv() [94/103]

Real libMesh::FE< 3, L2_LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1210 of file fe_l2_lagrange_shape_3D.C.

1215 {
1216 #if LIBMESH_DIM == 3
1217 
1218  libmesh_assert_less (j, 6);
1219 
1220  switch (order)
1221  {
1222  // linear Lagrange shape functions
1223  case FIRST:
1224  {
1225  return 0.;
1226  }
1227 
1228  // quadratic Lagrange shape functions
1229  case SECOND:
1230  {
1231  switch (type)
1232  {
1233 
1234  // serendipity hexahedral quadratic shape functions
1235  case HEX20:
1236  {
1237  static bool warning_given_HEX20 = false;
1238 
1239  if (!warning_given_HEX20)
1240  libMesh::err << "Second derivatives for 3D Lagrangian HEX20"
1241  << " elements are not yet implemented!"
1242  << std::endl;
1243  warning_given_HEX20 = true;
1244  }
1245  libmesh_fallthrough();
1246 
1247  case HEX27:
1248  // triquadratic hexahedral shape functions
1249  {
1250  libmesh_assert_less (i, 27);
1251 
1252  // Compute hex shape functions as a tensor-product
1253  const Real xi = p(0);
1254  const Real eta = p(1);
1255  const Real zeta = p(2);
1256 
1257  // The only way to make any sense of this
1258  // is to look at the mgflo/mg2/mgf documentation
1259  // and make the cut-out cube!
1260  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1261  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1262  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1263  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1264 
1265  switch(j)
1266  {
1267  // d^2()/dxi^2
1268  case 0:
1269  return (FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1270  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1271  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1272 
1273  // d^2()/dxideta
1274  case 1:
1275  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1276  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1277  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1278 
1279  // d^2()/deta^2
1280  case 2:
1281  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1282  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1283  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1284 
1285  // d^2()/dxidzeta
1286  case 3:
1287  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1288  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1289  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1290 
1291  // d^2()/detadzeta
1292  case 4:
1293  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1294  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1295  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1296 
1297  // d^2()/dzeta^2
1298  case 5:
1299  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1300  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1301  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1302 
1303  default:
1304  libmesh_error_msg("Invalid j = " << j);
1305  }
1306  }
1307 
1308  // quadratic tetrahedral shape functions
1309  case TET10:
1310  {
1311  // The area coordinates are the same as used for the
1312  // shape() and shape_deriv() functions.
1313  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
1314  // const Real zeta1 = p(0);
1315  // const Real zeta2 = p(1);
1316  // const Real zeta3 = p(2);
1317  static const Real dzetadxi[4][3] =
1318  {
1319  {-1., -1., -1.},
1320  {1., 0., 0.},
1321  {0., 1., 0.},
1322  {0., 0., 1.}
1323  };
1324 
1325  // Convert from j -> (j,k) indices for independent variable
1326  // (0=xi, 1=eta, 2=zeta)
1327  static const unsigned short int independent_var_indices[6][2] =
1328  {
1329  {0, 0}, // d^2 phi / dxi^2
1330  {0, 1}, // d^2 phi / dxi deta
1331  {1, 1}, // d^2 phi / deta^2
1332  {0, 2}, // d^2 phi / dxi dzeta
1333  {1, 2}, // d^2 phi / deta dzeta
1334  {2, 2} // d^2 phi / dzeta^2
1335  };
1336 
1337  // Convert from i -> zeta indices. Each quadratic shape
1338  // function for the Tet10 depends on up to two of the zeta
1339  // area coordinate functions (see the shape() function above).
1340  // This table just tells which two area coords it uses.
1341  static const unsigned short int zeta_indices[10][2] =
1342  {
1343  {0, 0},
1344  {1, 1},
1345  {2, 2},
1346  {3, 3},
1347  {0, 1},
1348  {1, 2},
1349  {2, 0},
1350  {0, 3},
1351  {1, 3},
1352  {2, 3},
1353  };
1354 
1355  // Look up the independent variable indices for this value of j.
1356  const unsigned int my_j = independent_var_indices[j][0];
1357  const unsigned int my_k = independent_var_indices[j][1];
1358 
1359  if (i<4)
1360  {
1361  return 4.*dzetadxi[i][my_j]*dzetadxi[i][my_k];
1362  }
1363 
1364  else if (i<10)
1365  {
1366  const unsigned short int my_m = zeta_indices[i][0];
1367  const unsigned short int my_n = zeta_indices[i][1];
1368 
1369  return 4.*(dzetadxi[my_n][my_j]*dzetadxi[my_m][my_k] +
1370  dzetadxi[my_m][my_j]*dzetadxi[my_n][my_k] );
1371  }
1372  else
1373  libmesh_error_msg("Invalid shape function index " << i);
1374  }
1375 
1376 
1377  // quadratic prism shape functions
1378  case PRISM18:
1379  {
1380  libmesh_assert_less (i, 18);
1381 
1382  // Compute prism shape functions as a tensor-product
1383  // of a triangle and an edge
1384 
1385  Point p2d(p(0),p(1));
1386  Point p1d(p(2));
1387 
1388  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1389  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1390  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1391 
1392  switch (j)
1393  {
1394  // d^2()/dxi^2
1395  case 0:
1396  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1397  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1398 
1399  // d^2()/dxideta
1400  case 1:
1401  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1402  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1403 
1404  // d^2()/deta^2
1405  case 2:
1406  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 2, p2d)*
1407  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1408 
1409  // d^2()/dxidzeta
1410  case 3:
1411  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1412  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1413 
1414  // d^2()/detadzeta
1415  case 4:
1416  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1417  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1418 
1419  // d^2()/dzeta^2
1420  case 5:
1421  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1422  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1423 
1424  default:
1425  libmesh_error_msg("Invalid shape function derivative j = " << j);
1426  }
1427  }
1428 
1429 
1430 
1431  default:
1432  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1433  }
1434  }
1435 
1436 
1437  // unsupported order
1438  default:
1439  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1440  }
1441 
1442 #endif
1443 }
OStreamProxy err(std::cerr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [95/103]

Real libMesh::FE< 3, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1301 of file fe_monomial_shape_3D.C.

1306 {
1307  libmesh_assert(elem);
1308 
1309  // call the orientation-independent shape function derivatives
1310  return FE<3,MONOMIAL>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1311 }

◆ shape_second_deriv() [96/103]

Real libMesh::FE< 2, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 1400 of file fe_szabab_shape_2D.C.

1405 {
1406  static bool warning_given = false;
1407 
1408  if (!warning_given)
1409  libMesh::err << "Second derivatives for Szabab elements "
1410  << " are not yet implemented!"
1411  << std::endl;
1412 
1413  warning_given = true;
1414  return 0.;
1415 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [97/103]

Real libMesh::FE< 2, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 1420 of file fe_szabab_shape_2D.C.

1425 {
1426  static bool warning_given = false;
1427 
1428  if (!warning_given)
1429  libMesh::err << "Second derivatives for Szabab elements "
1430  << " are not yet implemented!"
1431  << std::endl;
1432 
1433  warning_given = true;
1434  return 0.;
1435 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [98/103]

Real libMesh::FE< 3, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1448 of file fe_l2_lagrange_shape_3D.C.

1453 {
1454  libmesh_assert(elem);
1455 
1456  // call the orientation-independent shape function derivatives
1457  return FE<3,L2_LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1458 }

◆ shape_second_deriv() [99/103]

Real libMesh::FE< 3, LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 1929 of file fe_lagrange_shape_3D.C.

1934 {
1935 #if LIBMESH_DIM == 3
1936 
1937  libmesh_assert_less (j, 6);
1938 
1939  switch (order)
1940  {
1941  // linear Lagrange shape functions
1942  case FIRST:
1943  {
1944  switch (type)
1945  {
1946  // Linear tets have all second derivatives = 0
1947  case TET4:
1948  case TET10:
1949  {
1950  return 0.;
1951  }
1952 
1953  // The following elements use either tensor product or
1954  // rational basis functions, and therefore probably have
1955  // second derivatives, but we have not implemented them
1956  // yet...
1957  case PRISM6:
1958  case PRISM15:
1959  case PRISM18:
1960  {
1961  libmesh_assert_less (i, 6);
1962 
1963  // Compute prism shape functions as a tensor-product
1964  // of a triangle and an edge
1965 
1966  Point p2d(p(0),p(1));
1967  Point p1d(p(2));
1968 
1969  // 0 1 2 3 4 5
1970  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
1971  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
1972 
1973  switch (j)
1974  {
1975  // All repeated second derivatives and the xi-eta derivative are zero on PRISMs
1976  case 0: // d^2()/dxi^2
1977  case 1: // d^2()/dxideta
1978  case 2: // d^2()/deta^2
1979  case 5: // d^2()/dzeta^2
1980  {
1981  return 0.;
1982  }
1983 
1984  case 3: // d^2()/dxidzeta
1985  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
1986  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
1987 
1988  case 4: // d^2()/detadzeta
1989  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
1990  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
1991 
1992  default:
1993  libmesh_error_msg("Invalid j = " << j);
1994  }
1995  }
1996 
1997  case PYRAMID5:
1998  case PYRAMID13:
1999  case PYRAMID14:
2000  {
2001  libmesh_assert_less (i, 5);
2002 
2003  const Real xi = p(0);
2004  const Real eta = p(1);
2005  const Real zeta = p(2);
2006  const Real eps = 1.e-35;
2007 
2008  switch (j)
2009  {
2010  // xi-xi and eta-eta derivatives are all zero for PYRAMID5.
2011  case 0: // d^2()/dxi^2
2012  case 2: // d^2()/deta^2
2013  return 0.;
2014 
2015  case 1: // d^2()/dxideta
2016  {
2017  switch (i)
2018  {
2019  case 0:
2020  case 2:
2021  return 0.25/(1. - zeta + eps);
2022  case 1:
2023  case 3:
2024  return -0.25/(1. - zeta + eps);
2025  case 4:
2026  return 0.;
2027  default:
2028  libmesh_error_msg("Invalid i = " << i);
2029  }
2030  }
2031 
2032  case 3: // d^2()/dxidzeta
2033  {
2034  Real den = (1. - zeta + eps)*(1. - zeta + eps);
2035 
2036  switch (i)
2037  {
2038  case 0:
2039  case 2:
2040  return 0.25*eta/den;
2041  case 1:
2042  case 3:
2043  return -0.25*eta/den;
2044  case 4:
2045  return 0.;
2046  default:
2047  libmesh_error_msg("Invalid i = " << i);
2048  }
2049  }
2050 
2051  case 4: // d^2()/detadzeta
2052  {
2053  Real den = (1. - zeta + eps)*(1. - zeta + eps);
2054 
2055  switch (i)
2056  {
2057  case 0:
2058  case 2:
2059  return 0.25*xi/den;
2060  case 1:
2061  case 3:
2062  return -0.25*xi/den;
2063  case 4:
2064  return 0.;
2065  default:
2066  libmesh_error_msg("Invalid i = " << i);
2067  }
2068  }
2069 
2070  case 5: // d^2()/dzeta^2
2071  {
2072  Real den = (1. - zeta + eps)*(1. - zeta + eps)*(1. - zeta + eps);
2073 
2074  switch (i)
2075  {
2076  case 0:
2077  case 2:
2078  return 0.5*xi*eta/den;
2079  case 1:
2080  case 3:
2081  return -0.5*xi*eta/den;
2082  case 4:
2083  return 0.;
2084  default:
2085  libmesh_error_msg("Invalid i = " << i);
2086  }
2087  }
2088 
2089  default:
2090  libmesh_error_msg("Invalid j = " << j);
2091  }
2092  }
2093 
2094  // Trilinear shape functions on HEX8s have nonzero mixed second derivatives
2095  case HEX8:
2096  case HEX20:
2097  case HEX27:
2098  {
2099  libmesh_assert_less (i, 8);
2100 
2101  // Compute hex shape functions as a tensor-product
2102  const Real xi = p(0);
2103  const Real eta = p(1);
2104  const Real zeta = p(2);
2105 
2106  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
2107  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
2108  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
2109 
2110  switch (j)
2111  {
2112  // All repeated second derivatives are zero on HEX8
2113  case 0: // d^2()/dxi^2
2114  case 2: // d^2()/deta^2
2115  case 5: // d^2()/dzeta^2
2116  {
2117  return 0.;
2118  }
2119 
2120  case 1: // d^2()/dxideta
2121  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
2122  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
2123  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
2124 
2125  case 3: // d^2()/dxidzeta
2126  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
2127  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
2128  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
2129 
2130  case 4: // d^2()/detadzeta
2131  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
2132  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
2133  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
2134 
2135  default:
2136  libmesh_error_msg("Invalid j = " << j);
2137  }
2138  }
2139 
2140  default:
2141  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
2142  }
2143 
2144  }
2145 
2146  // quadratic Lagrange shape functions
2147  case SECOND:
2148  {
2149  switch (type)
2150  {
2151 
2152  // serendipity hexahedral quadratic shape functions
2153  case HEX20:
2154  {
2155  libmesh_assert_less (i, 20);
2156 
2157  const Real xi = p(0);
2158  const Real eta = p(1);
2159  const Real zeta = p(2);
2160 
2161  // these functions are defined for (x,y,z) in [0,1]^3
2162  // so transform the locations
2163  const Real x = .5*(xi + 1.);
2164  const Real y = .5*(eta + 1.);
2165  const Real z = .5*(zeta + 1.);
2166 
2167  switch(j)
2168  {
2169  case 0: // d^2()/dxi^2
2170  {
2171  switch(i)
2172  {
2173  case 0:
2174  case 1:
2175  return (1. - y) * (1. - z);
2176  case 2:
2177  case 3:
2178  return y * (1. - z);
2179  case 4:
2180  case 5:
2181  return (1. - y) * z;
2182  case 6:
2183  case 7:
2184  return y * z;
2185  case 8:
2186  return -2. * (1. - y) * (1. - z);
2187  case 10:
2188  return -2. * y * (1. - z);
2189  case 16:
2190  return -2. * (1. - y) * z;
2191  case 18:
2192  return -2. * y * z;
2193  case 9:
2194  case 11:
2195  case 12:
2196  case 13:
2197  case 14:
2198  case 15:
2199  case 17:
2200  case 19:
2201  return 0;
2202  default:
2203  libmesh_error_msg("Invalid i = " << i);
2204  }
2205  }
2206  case 1: // d^2()/dxideta
2207  {
2208  switch(i)
2209  {
2210  case 0:
2211  return (1.25 - x - y - .5*z) * (1. - z);
2212  case 1:
2213  return (-x + y + .5*z - .25) * (1. - z);
2214  case 2:
2215  return (x + y - .5*z - .75) * (1. - z);
2216  case 3:
2217  return (-y + x + .5*z - .25) * (1. - z);
2218  case 4:
2219  return -.25*z * (4.*x + 4.*y - 2.*z - 3);
2220  case 5:
2221  return -.25*z * (-4.*y + 4.*x + 2.*z - 1.);
2222  case 6:
2223  return .25*z * (-5 + 4.*x + 4.*y + 2.*z);
2224  case 7:
2225  return .25*z * (4.*x - 4.*y - 2.*z + 1.);
2226  case 8:
2227  return (-1. + 2.*x) * (1. - z);
2228  case 9:
2229  return (1. - 2.*y) * (1. - z);
2230  case 10:
2231  return (1. - 2.*x) * (1. - z);
2232  case 11:
2233  return (-1. + 2.*y) * (1. - z);
2234  case 12:
2235  return z * (1. - z);
2236  case 13:
2237  return -z * (1. - z);
2238  case 14:
2239  return z * (1. - z);
2240  case 15:
2241  return -z * (1. - z);
2242  case 16:
2243  return (-1. + 2.*x) * z;
2244  case 17:
2245  return (1. - 2.*y) * z;
2246  case 18:
2247  return (1. - 2.*x) * z;
2248  case 19:
2249  return (-1. + 2.*y) * z;
2250  default:
2251  libmesh_error_msg("Invalid i = " << i);
2252  }
2253  }
2254  case 2: // d^2()/deta^2
2255  switch(i)
2256  {
2257  case 0:
2258  case 3:
2259  return (1. - x) * (1. - z);
2260  case 1:
2261  case 2:
2262  return x * (1. - z);
2263  case 4:
2264  case 7:
2265  return (1. - x) * z;
2266  case 5:
2267  case 6:
2268  return x * z;
2269  case 9:
2270  return -2. * x * (1. - z);
2271  case 11:
2272  return -2. * (1. - x) * (1. - z);
2273  case 17:
2274  return -2. * x * z;
2275  case 19:
2276  return -2. * (1. - x) * z;
2277  case 8:
2278  case 10:
2279  case 12:
2280  case 13:
2281  case 14:
2282  case 15:
2283  case 16:
2284  case 18:
2285  return 0.;
2286  default:
2287  libmesh_error_msg("Invalid i = " << i);
2288  }
2289  case 3: // d^2()/dxidzeta
2290  switch(i)
2291  {
2292  case 0:
2293  return (1.25 - x - .5*y - z) * (1. - y);
2294  case 1:
2295  return (-x + .5*y + z - .25) * (1. - y);
2296  case 2:
2297  return -.25*y * (2.*y + 4.*x - 4.*z - 1.);
2298  case 3:
2299  return -.25*y * (-2.*y + 4.*x + 4.*z - 3);
2300  case 4:
2301  return (-z + x + .5*y - .25) * (1. - y);
2302  case 5:
2303  return (x - .5*y + z - .75) * (1. - y);
2304  case 6:
2305  return .25*y * (2.*y + 4.*x + 4.*z - 5);
2306  case 7:
2307  return .25*y * (-2.*y + 4.*x - 4.*z + 1.);
2308  case 8:
2309  return (-1. + 2.*x) * (1. - y);
2310  case 9:
2311  return -y * (1. - y);
2312  case 10:
2313  return (-1. + 2.*x) * y;
2314  case 11:
2315  return y * (1. - y);
2316  case 12:
2317  return (-1. + 2.*z) * (1. - y);
2318  case 13:
2319  return (1. - 2.*z) * (1. - y);
2320  case 14:
2321  return (1. - 2.*z) * y;
2322  case 15:
2323  return (-1. + 2.*z) * y;
2324  case 16:
2325  return (1. - 2.*x) * (1. - y);
2326  case 17:
2327  return y * (1. - y);
2328  case 18:
2329  return (1. - 2.*x) * y;
2330  case 19:
2331  return -y * (1. - y);
2332  default:
2333  libmesh_error_msg("Invalid i = " << i);
2334  }
2335  case 4: // d^2()/detadzeta
2336  switch(i)
2337  {
2338  case 0:
2339  return (1.25 - .5*x - y - z) * (1. - x);
2340  case 1:
2341  return .25*x * (2.*x - 4.*y - 4.*z + 3.);
2342  case 2:
2343  return -.25*x * (2.*x + 4.*y - 4.*z - 1.);
2344  case 3:
2345  return (-y + .5*x + z - .25) * (1. - x);
2346  case 4:
2347  return (-z + .5*x + y - .25) * (1. - x);
2348  case 5:
2349  return -.25*x * (2.*x - 4.*y + 4.*z - 1.);
2350  case 6:
2351  return .25*x * (2.*x + 4.*y + 4.*z - 5);
2352  case 7:
2353  return (y - .5*x + z - .75) * (1. - x);
2354  case 8:
2355  return x * (1. - x);
2356  case 9:
2357  return (-1. + 2.*y) * x;
2358  case 10:
2359  return -x * (1. - x);
2360  case 11:
2361  return (-1. + 2.*y) * (1. - x);
2362  case 12:
2363  return (-1. + 2.*z) * (1. - x);
2364  case 13:
2365  return (-1. + 2.*z) * x;
2366  case 14:
2367  return (1. - 2.*z) * x;
2368  case 15:
2369  return (1. - 2.*z) * (1. - x);
2370  case 16:
2371  return -x * (1. - x);
2372  case 17:
2373  return (1. - 2.*y) * x;
2374  case 18:
2375  return x * (1. - x);
2376  case 19:
2377  return (1. - 2.*y) * (1. - x);
2378  default:
2379  libmesh_error_msg("Invalid i = " << i);
2380  }
2381  case 5: // d^2()/dzeta^2
2382  switch(i)
2383  {
2384  case 0:
2385  case 4:
2386  return (1. - x) * (1. - y);
2387  case 1:
2388  case 5:
2389  return x * (1. - y);
2390  case 2:
2391  case 6:
2392  return x * y;
2393  case 3:
2394  case 7:
2395  return (1. - x) * y;
2396  case 12:
2397  return -2. * (1. - x) * (1. - y);
2398  case 13:
2399  return -2. * x * (1. - y);
2400  case 14:
2401  return -2. * x * y;
2402  case 15:
2403  return -2. * (1. - x) * y;
2404  case 8:
2405  case 9:
2406  case 10:
2407  case 11:
2408  case 16:
2409  case 17:
2410  case 18:
2411  case 19:
2412  return 0.;
2413  default:
2414  libmesh_error_msg("Invalid i = " << i);
2415  }
2416  default:
2417  libmesh_error_msg("Invalid j = " << j);
2418  }
2419  }
2420 
2421  // triquadratic hexahedral shape functions
2422  case HEX27:
2423  {
2424  libmesh_assert_less (i, 27);
2425 
2426  // Compute hex shape functions as a tensor-product
2427  const Real xi = p(0);
2428  const Real eta = p(1);
2429  const Real zeta = p(2);
2430 
2431  // The only way to make any sense of this
2432  // is to look at the mgflo/mg2/mgf documentation
2433  // and make the cut-out cube!
2434  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
2435  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
2436  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
2437  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
2438 
2439  switch(j)
2440  {
2441  // d^2()/dxi^2
2442  case 0:
2443  return (FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2444  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2445  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2446 
2447  // d^2()/dxideta
2448  case 1:
2449  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2450  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2451  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2452 
2453  // d^2()/deta^2
2454  case 2:
2455  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2456  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2457  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2458 
2459  // d^2()/dxidzeta
2460  case 3:
2461  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2462  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2463  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2464 
2465  // d^2()/detadzeta
2466  case 4:
2467  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2468  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2469  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2470 
2471  // d^2()/dzeta^2
2472  case 5:
2473  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2474  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2475  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2476 
2477  default:
2478  libmesh_error_msg("Invalid j = " << j);
2479  }
2480  }
2481 
2482  // quadratic tetrahedral shape functions
2483  case TET10:
2484  {
2485  // The area coordinates are the same as used for the
2486  // shape() and shape_deriv() functions.
2487  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
2488  // const Real zeta1 = p(0);
2489  // const Real zeta2 = p(1);
2490  // const Real zeta3 = p(2);
2491  static const Real dzetadxi[4][3] =
2492  {
2493  {-1., -1., -1.},
2494  {1., 0., 0.},
2495  {0., 1., 0.},
2496  {0., 0., 1.}
2497  };
2498 
2499  // Convert from j -> (j,k) indices for independent variable
2500  // (0=xi, 1=eta, 2=zeta)
2501  static const unsigned short int independent_var_indices[6][2] =
2502  {
2503  {0, 0}, // d^2 phi / dxi^2
2504  {0, 1}, // d^2 phi / dxi deta
2505  {1, 1}, // d^2 phi / deta^2
2506  {0, 2}, // d^2 phi / dxi dzeta
2507  {1, 2}, // d^2 phi / deta dzeta
2508  {2, 2} // d^2 phi / dzeta^2
2509  };
2510 
2511  // Convert from i -> zeta indices. Each quadratic shape
2512  // function for the Tet10 depends on up to two of the zeta
2513  // area coordinate functions (see the shape() function above).
2514  // This table just tells which two area coords it uses.
2515  static const unsigned short int zeta_indices[10][2] =
2516  {
2517  {0, 0},
2518  {1, 1},
2519  {2, 2},
2520  {3, 3},
2521  {0, 1},
2522  {1, 2},
2523  {2, 0},
2524  {0, 3},
2525  {1, 3},
2526  {2, 3},
2527  };
2528 
2529  // Look up the independent variable indices for this value of j.
2530  const unsigned int my_j = independent_var_indices[j][0];
2531  const unsigned int my_k = independent_var_indices[j][1];
2532 
2533  if (i<4)
2534  {
2535  return 4.*dzetadxi[i][my_j]*dzetadxi[i][my_k];
2536  }
2537 
2538  else if (i<10)
2539  {
2540  const unsigned short int my_m = zeta_indices[i][0];
2541  const unsigned short int my_n = zeta_indices[i][1];
2542 
2543  return 4.*(dzetadxi[my_n][my_j]*dzetadxi[my_m][my_k] +
2544  dzetadxi[my_m][my_j]*dzetadxi[my_n][my_k] );
2545  }
2546  else
2547  libmesh_error_msg("Invalid shape function index " << i);
2548  }
2549 
2550 
2551 
2552  // "serendipity" prism
2553  case PRISM15:
2554  {
2555  libmesh_assert_less (i, 15);
2556 
2557  const Real xi = p(0);
2558  const Real eta = p(1);
2559  const Real zeta = p(2);
2560 
2561  switch (j)
2562  {
2563  // d^2()/dxi^2
2564  case 0:
2565  {
2566  switch(i)
2567  {
2568  case 0:
2569  case 1:
2570  return 2.*(1. - zeta);
2571  case 2:
2572  case 5:
2573  case 7:
2574  case 8:
2575  case 9:
2576  case 10:
2577  case 11:
2578  case 13:
2579  case 14:
2580  return 0.;
2581  case 3:
2582  case 4:
2583  return 2.*(1. + zeta);
2584  case 6:
2585  return 4.*(zeta - 1);
2586  case 12:
2587  return -4.*(1. + zeta);
2588  default:
2589  libmesh_error_msg("Invalid i = " << i);
2590  }
2591  }
2592 
2593  // d^2()/dxideta
2594  case 1:
2595  {
2596  switch(i)
2597  {
2598  case 0:
2599  case 7:
2600  return 2.*(1. - zeta);
2601  case 1:
2602  case 2:
2603  case 4:
2604  case 5:
2605  case 9:
2606  case 10:
2607  case 11:
2608  return 0.;
2609  case 3:
2610  case 13:
2611  return 2.*(1. + zeta);
2612  case 6:
2613  case 8:
2614  return 2.*(zeta - 1.);
2615  case 12:
2616  case 14:
2617  return -2.*(1. + zeta);
2618  default:
2619  libmesh_error_msg("Invalid i = " << i);
2620  }
2621  }
2622 
2623  // d^2()/deta^2
2624  case 2:
2625  {
2626  switch(i)
2627  {
2628  case 0:
2629  case 2:
2630  return 2.*(1. - zeta);
2631  case 1:
2632  case 4:
2633  case 6:
2634  case 7:
2635  case 9:
2636  case 10:
2637  case 11:
2638  case 12:
2639  case 13:
2640  return 0.;
2641  case 3:
2642  case 5:
2643  return 2.*(1. + zeta);
2644  case 8:
2645  return 4.*(zeta - 1.);
2646  case 14:
2647  return -4.*(1. + zeta);
2648  default:
2649  libmesh_error_msg("Invalid i = " << i);
2650  }
2651  }
2652 
2653  // d^2()/dxidzeta
2654  case 3:
2655  {
2656  switch(i)
2657  {
2658  case 0:
2659  return 1.5 - zeta - 2.*xi - 2.*eta;
2660  case 1:
2661  return 0.5 + zeta - 2.*xi;
2662  case 2:
2663  case 5:
2664  case 11:
2665  return 0.;
2666  case 3:
2667  return -1.5 - zeta + 2.*xi + 2.*eta;
2668  case 4:
2669  return -0.5 + zeta + 2.*xi;
2670  case 6:
2671  return 4.*xi + 2.*eta - 2.;
2672  case 7:
2673  return -2.*eta;
2674  case 8:
2675  return 2.*eta;
2676  case 9:
2677  return 2.*zeta;
2678  case 10:
2679  return -2.*zeta;
2680  case 12:
2681  return -4.*xi - 2.*eta + 2.;
2682  case 13:
2683  return 2.*eta;
2684  case 14:
2685  return -2.*eta;
2686  default:
2687  libmesh_error_msg("Invalid i = " << i);
2688  }
2689  }
2690 
2691  // d^2()/detadzeta
2692  case 4:
2693  {
2694  switch(i)
2695  {
2696  case 0:
2697  return 1.5 - zeta - 2.*xi - 2.*eta;
2698  case 1:
2699  case 4:
2700  case 10:
2701  return 0.;
2702  case 2:
2703  return .5 + zeta - 2.*eta;
2704  case 3:
2705  return -1.5 - zeta + 2.*xi + 2.*eta;
2706  case 5:
2707  return -.5 + zeta + 2.*eta;
2708  case 6:
2709  return 2.*xi;
2710  case 7:
2711  return -2.*xi;
2712  case 8:
2713  return 2.*xi + 4.*eta - 2.;
2714  case 9:
2715  return 2.*zeta;
2716  case 11:
2717  return -2.*zeta;
2718  case 12:
2719  return -2.*xi;
2720  case 13:
2721  return 2.*xi;
2722  case 14:
2723  return -2.*xi - 4.*eta + 2.;
2724  default:
2725  libmesh_error_msg("Invalid i = " << i);
2726  }
2727  }
2728 
2729  // d^2()/dzeta^2
2730  case 5:
2731  {
2732  switch(i)
2733  {
2734  case 0:
2735  case 3:
2736  return 1. - xi - eta;
2737  case 1:
2738  case 4:
2739  return xi;
2740  case 2:
2741  case 5:
2742  return eta;
2743  case 6:
2744  case 7:
2745  case 8:
2746  case 12:
2747  case 13:
2748  case 14:
2749  return 0.;
2750  case 9:
2751  return 2.*xi + 2.*eta - 2.;
2752  case 10:
2753  return -2.*xi;
2754  case 11:
2755  return -2.*eta;
2756  default:
2757  libmesh_error_msg("Invalid i = " << i);
2758  }
2759  }
2760 
2761  default:
2762  libmesh_error_msg("Invalid j = " << j);
2763  }
2764  }
2765 
2766 
2767 
2768  // quadratic prism shape functions
2769  case PRISM18:
2770  {
2771  libmesh_assert_less (i, 18);
2772 
2773  // Compute prism shape functions as a tensor-product
2774  // of a triangle and an edge
2775 
2776  Point p2d(p(0),p(1));
2777  Point p1d(p(2));
2778 
2779  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2780  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
2781  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
2782 
2783  switch (j)
2784  {
2785  // d^2()/dxi^2
2786  case 0:
2787  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 0, p2d)*
2788  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2789 
2790  // d^2()/dxideta
2791  case 1:
2792  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 1, p2d)*
2793  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2794 
2795  // d^2()/deta^2
2796  case 2:
2797  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 2, p2d)*
2798  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2799 
2800  // d^2()/dxidzeta
2801  case 3:
2802  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
2803  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2804 
2805  // d^2()/detadzeta
2806  case 4:
2807  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
2808  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2809 
2810  // d^2()/dzeta^2
2811  case 5:
2812  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
2813  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2814 
2815  default:
2816  libmesh_error_msg("Invalid shape function derivative j = " << j);
2817  }
2818  }
2819 
2820 
2821  // Quadratic shape functions, as defined in R. Graglia, "Higher order
2822  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
2823  // vol 47, no 5, May 1999.
2824  case PYRAMID14:
2825  {
2826  libmesh_assert_less (i, 14);
2827 
2828  const Real xi = p(0);
2829  const Real eta = p(1);
2830  const Real zeta = p(2);
2831  const Real eps = 1.e-35;
2832 
2833  // The "normalized coordinates" defined by Graglia. These are
2834  // the planes which define the faces of the pyramid.
2835  Real
2836  p1 = 0.5*(1. - eta - zeta), // back
2837  p2 = 0.5*(1. + xi - zeta), // left
2838  p3 = 0.5*(1. + eta - zeta), // front
2839  p4 = 0.5*(1. - xi - zeta); // right
2840 
2841  // Denominators are perturbed by epsilon to avoid
2842  // divide-by-zero issues.
2843  Real
2844  den = (-1. + zeta + eps),
2845  den2 = den*den,
2846  den3 = den2*den,
2847  den4 = den2*den2;
2848 
2849  // These terms are used in several of the derivatives
2850  Real
2851  numer_mp = xi*eta - zeta + zeta*zeta,
2852  numer_pm = xi*eta + zeta - zeta*zeta;
2853 
2854  switch (j)
2855  {
2856  case 0: // d^2()/dxi^2
2857  {
2858  switch(i)
2859  {
2860  case 0:
2861  case 1:
2862  return -p1*eta/den2;
2863  case 2:
2864  case 3:
2865  return p3*eta/den2;
2866  case 4:
2867  case 9:
2868  case 10:
2869  case 11:
2870  case 12:
2871  return 0.;
2872  case 5:
2873  return 2.*p1*eta/den2;
2874  case 6:
2875  case 8:
2876  return 4.*p1*p3/den2;
2877  case 7:
2878  return -2.*p3*eta/den2;
2879  case 13:
2880  return -8.*p1*p3/den2;
2881  default:
2882  libmesh_error_msg("Invalid i = " << i);
2883  }
2884  }
2885 
2886  case 1: // d^2()/dxideta
2887  {
2888  switch(i)
2889  {
2890  case 0:
2891  return 0.25*numer_mp/den2
2892  - 0.5*p1*xi/den2
2893  - 0.5*p4*eta/den2
2894  + p4*p1/den2;
2895 
2896  case 1:
2897  return 0.25*numer_pm/den2
2898  - 0.5*p1*xi/den2
2899  + 0.5*p2*eta/den2
2900  - p1*p2/den2;
2901 
2902  case 2:
2903  return 0.25*numer_mp/den2
2904  + 0.5*p3*xi/den2
2905  + 0.5*p2*eta/den2
2906  + p2*p3/den2;
2907 
2908  case 3:
2909  return 0.25*numer_pm/den2
2910  + 0.5*p3*xi/den2
2911  - 0.5*p4*eta/den2
2912  - p3*p4/den2;
2913 
2914  case 4:
2915  return 0.;
2916 
2917  case 5:
2918  return p4*eta/den2
2919  - 2.*p4*p1/den2
2920  - p2*eta/den2
2921  + 2.*p1*p2/den2;
2922 
2923  case 6:
2924  return -p3*xi/den2
2925  + p1*xi/den2
2926  - 2.*p2*p3/den2
2927  + 2.*p1*p2/den2;
2928 
2929  case 7:
2930  return p4*eta/den2
2931  + 2.*p3*p4/den2
2932  - p2*eta/den2
2933  - 2.*p2*p3/den2;
2934 
2935  case 8:
2936  return -p3*xi/den2
2937  + p1*xi/den2
2938  - 2.*p4*p1/den2
2939  + 2.*p3*p4/den2;
2940 
2941  case 9:
2942  case 11:
2943  return -zeta/den;
2944 
2945  case 10:
2946  case 12:
2947  return zeta/den;
2948 
2949  case 13:
2950  return 4.*p4*p1/den2
2951  - 4.*p3*p4/den2
2952  + 4.*p2*p3/den2
2953  - 4.*p1*p2/den2;
2954 
2955  default:
2956  libmesh_error_msg("Invalid i = " << i);
2957  }
2958  }
2959 
2960 
2961  case 2: // d^2()/deta^2
2962  {
2963  switch(i)
2964  {
2965  case 0:
2966  case 3:
2967  return -p4*xi/den2;
2968  case 1:
2969  case 2:
2970  return p2*xi/den2;
2971  case 4:
2972  case 9:
2973  case 10:
2974  case 11:
2975  case 12:
2976  return 0.;
2977  case 5:
2978  case 7:
2979  return 4.*p2*p4/den2;
2980  case 6:
2981  return -2.*p2*xi/den2;
2982  case 8:
2983  return 2.*p4*xi/den2;
2984  case 13:
2985  return -8.*p2*p4/den2;
2986  default:
2987  libmesh_error_msg("Invalid i = " << i);
2988  }
2989  }
2990 
2991 
2992  case 3: // d^2()/dxidzeta
2993  {
2994  switch(i)
2995  {
2996  case 0:
2997  return 0.25*numer_mp/den2
2998  - 0.5*p1*(2.*zeta - 1.)/den2
2999  + p1*numer_mp/den3
3000  - 0.5*p1*eta/den2
3001  - 0.5*p4*eta/den2
3002  - 2.*p4*p1*eta/den3;
3003 
3004  case 1:
3005  return 0.25*numer_pm/den2
3006  - 0.5*p1*(1 - 2.*zeta)/den2
3007  + p1*numer_pm/den3
3008  + 0.5*p2*eta/den2
3009  + 0.5*p1*eta/den2
3010  + 2.*p1*p2*eta/den3;
3011 
3012  case 2:
3013  return -0.25*numer_mp/den2
3014  + 0.5*p3*(2.*zeta - 1.)/den2
3015  - p3*numer_mp/den3
3016  - 0.5*p3*eta/den2
3017  - 0.5*p2*eta/den2
3018  - 2.*p2*p3*eta/den3;
3019 
3020  case 3:
3021  return -0.25*numer_pm/den2
3022  + 0.5*p3*(1 - 2.*zeta)/den2
3023  - p3*numer_pm/den3
3024  + 0.5*p4*eta/den2
3025  + 0.5*p3*eta/den2
3026  + 2.*p3*p4*eta/den3;
3027 
3028  case 4:
3029  return 0.;
3030 
3031  case 5:
3032  return p4*eta/den2
3033  + 4.*p4*p1*eta/den3
3034  - p2*eta/den2
3035  - 4.*p1*p2*eta/den3;
3036 
3037  case 6:
3038  return -p3*xi/den2
3039  - p1*xi/den2
3040  - 4.*p1*p3*xi/den3
3041  - 2.*p2*p3/den2
3042  - 2.*p1*p3/den2
3043  - 2.*p1*p2/den2
3044  - 8.*p1*p2*p3/den3;
3045 
3046  case 7:
3047  return -p4*eta/den2
3048  - 4.*p3*p4*eta/den3
3049  + p2*eta/den2
3050  + 4.*p2*p3*eta/den3;
3051 
3052  case 8:
3053  return -p3*xi/den2
3054  - p1*xi/den2
3055  - 4.*p1*p3*xi/den3
3056  + 2.*p4*p1/den2
3057  + 2.*p1*p3/den2
3058  + 2.*p3*p4/den2
3059  + 8.*p3*p4*p1/den3;
3060 
3061  case 9:
3062  return -zeta/den
3063  + 2.*p1/den
3064  - 2.*p1*zeta/den2;
3065 
3066  case 10:
3067  return zeta/den
3068  - 2.*p1/den
3069  + 2.*p1*zeta/den2;
3070 
3071  case 11:
3072  return zeta/den
3073  - 2.*p3/den
3074  + 2.*p3*zeta/den2;
3075 
3076  case 12:
3077  return -zeta/den
3078  + 2.*p3/den
3079  - 2.*p3*zeta/den2;
3080 
3081  case 13:
3082  return -4.*p4*p1/den2
3083  - 4.*p3*p4/den2
3084  - 16.*p3*p4*p1/den3
3085  + 4.*p2*p3/den2
3086  + 4.*p1*p2/den2
3087  + 16.*p1*p2*p3/den3;
3088 
3089  default:
3090  libmesh_error_msg("Invalid i = " << i);
3091  }
3092  }
3093 
3094  case 4: // d^2()/detadzeta
3095  {
3096  switch(i)
3097  {
3098  case 0:
3099  return 0.25*numer_mp/den2
3100  - 0.5*p4*(2.*zeta - 1.)/den2
3101  + p4*numer_mp/den3
3102  - 0.5*p1*xi/den2
3103  - 0.5*p4*xi/den2
3104  - 2.*p4*p1*xi/den3;
3105 
3106  case 1:
3107  return -0.25*numer_pm/den2
3108  + 0.5*p2*(1. - 2.*zeta)/den2
3109  - p2*numer_pm/den3
3110  + 0.5*p2*xi/den2
3111  + 0.5*p1*xi/den2
3112  + 2.*p1*p2*xi/den3;
3113 
3114  case 2:
3115  return -0.25*numer_mp/den2
3116  + 0.5*p2*(2.*zeta - 1.)/den2
3117  - p2*numer_mp/den3
3118  - 0.5*p3*xi/den2
3119  - 0.5*p2*xi/den2
3120  - 2.*p2*p3*xi/den3;
3121 
3122  case 3:
3123  return 0.25*numer_pm/den2
3124  - 0.5*p4*(1. - 2.*zeta)/den2
3125  + p4*numer_pm/den3
3126  + 0.5*p4*xi/den2
3127  + 0.5*p3*xi/den2
3128  + 2.*p3*p4*xi/den3;
3129 
3130  case 4:
3131  return 0.;
3132 
3133  case 5:
3134  return -p4*eta/den2
3135  - p2*eta/den2
3136  - 4.*p2*p4*eta/den3
3137  + 2.*p4*p1/den2
3138  + 2.*p2*p4/den2
3139  + 2.*p1*p2/den2
3140  + 8.*p2*p1*p4/den3;
3141 
3142  case 6:
3143  return p3*xi/den2
3144  + 4.*p2*p3*xi/den3
3145  - p1*xi/den2
3146  - 4.*p1*p2*xi/den3;
3147 
3148  case 7:
3149  return -p4*eta/den2
3150  - p2*eta/den2
3151  - 4.*p2*p4*eta/den3
3152  - 2.*p3*p4/den2
3153  - 2.*p2*p4/den2
3154  - 2.*p2*p3/den2
3155  - 8.*p2*p3*p4/den3;
3156 
3157  case 8:
3158  return p1*xi/den2
3159  + 4.*p4*p1*xi/den3
3160  - p3*xi/den2
3161  - 4.*p3*p4*xi/den3;
3162 
3163  case 9:
3164  return -zeta/den
3165  + 2.*p4/den
3166  - 2.*p4*zeta/den2;
3167 
3168  case 10:
3169  return -zeta/den
3170  + 2.*p2/den
3171  - 2.*p2*zeta/den2;
3172 
3173  case 11:
3174  return zeta/den
3175  - 2.*p2/den
3176  + 2.*p2*zeta/den2;
3177 
3178  case 12:
3179  return zeta/den
3180  - 2.*p4/den
3181  + 2.*p4*zeta/den2;
3182 
3183  case 13:
3184  return 4.*p3*p4/den2
3185  + 4.*p2*p3/den2
3186  + 16.*p2*p3*p4/den3
3187  - 4.*p4*p1/den2
3188  - 4.*p1*p2/den2
3189  - 16.*p2*p1*p4/den3;
3190 
3191  default:
3192  libmesh_error_msg("Invalid i = " << i);
3193  }
3194  }
3195 
3196  case 5: // d^2()/dzeta^2
3197  {
3198  switch(i)
3199  {
3200  case 0:
3201  return 0.5*numer_mp/den2
3202  - p1*(2.*zeta - 1.)/den2
3203  + 2.*p1*numer_mp/den3
3204  - p4*(2.*zeta - 1.)/den2
3205  + 2.*p4*numer_mp/den3
3206  + 2.*p4*p1/den2
3207  - 4.*p4*p1*(2.*zeta - 1.)/den3
3208  + 6.*p4*p1*numer_mp/den4;
3209 
3210  case 1:
3211  return -0.5*numer_pm/den2
3212  + p2*(1 - 2.*zeta)/den2
3213  - 2.*p2*numer_pm/den3
3214  + p1*(1 - 2.*zeta)/den2
3215  - 2.*p1*numer_pm/den3
3216  + 2.*p1*p2/den2
3217  + 4.*p1*p2*(1 - 2.*zeta)/den3
3218  - 6.*p1*p2*numer_pm/den4;
3219 
3220  case 2:
3221  return 0.5*numer_mp/den2
3222  - p3*(2.*zeta - 1.)/den2
3223  + 2.*p3*numer_mp/den3
3224  - p2*(2.*zeta - 1.)/den2
3225  + 2.*p2*numer_mp/den3
3226  + 2.*p2*p3/den2
3227  - 4.*p2*p3*(2.*zeta - 1.)/den3
3228  + 6.*p2*p3*numer_mp/den4;
3229 
3230  case 3:
3231  return -0.5*numer_pm/den2
3232  + p4*(1 - 2.*zeta)/den2
3233  - 2.*p4*numer_pm/den3
3234  + p3*(1 - 2.*zeta)/den2
3235  - 2.*p3*numer_pm/den3
3236  + 2.*p3*p4/den2
3237  + 4.*p3*p4*(1 - 2.*zeta)/den3
3238  - 6.*p3*p4*numer_pm/den4;
3239 
3240  case 4:
3241  return 4.;
3242 
3243  case 5:
3244  return -2.*p1*eta/den2
3245  - 2.*p4*eta/den2
3246  - 8.*p4*p1*eta/den3
3247  - 2.*p2*eta/den2
3248  - 8.*p2*p4*eta/den3
3249  - 8.*p1*p2*eta/den3
3250  - 24.*p2*p1*p4*eta/den4;
3251 
3252  case 6:
3253  return 2.*p3*xi/den2
3254  + 2.*p2*xi/den2
3255  + 8.*p2*p3*xi/den3
3256  + 2.*p1*xi/den2
3257  + 8.*p1*p3*xi/den3
3258  + 8.*p1*p2*xi/den3
3259  + 24.*p1*p2*p3*xi/den4;
3260 
3261  case 7:
3262  return 2.*p4*eta/den2
3263  + 2.*p3*eta/den2
3264  + 8.*p3*p4*eta/den3
3265  + 2.*p2*eta/den2
3266  + 8.*p2*p4*eta/den3
3267  + 8.*p2*p3*eta/den3
3268  + 24.*p2*p3*p4*eta/den4;
3269 
3270  case 8:
3271  return -2.*p1*xi/den2
3272  - 2.*p4*xi/den2
3273  - 8.*p4*p1*xi/den3
3274  - 2.*p3*xi/den2
3275  - 8.*p1*p3*xi/den3
3276  - 8.*p3*p4*xi/den3
3277  - 24.*p3*p4*p1*xi/den4;
3278 
3279  case 9:
3280  return -2.*zeta/den
3281  + 4.*p4/den
3282  - 4.*p4*zeta/den2
3283  + 4.*p1/den
3284  - 4.*p1*zeta/den2
3285  + 8.*p4*p1/den2
3286  - 8.*p1*p4*zeta/den3;
3287 
3288  case 10:
3289  return -2.*zeta/den
3290  + 4.*p1/den
3291  - 4.*p1*zeta/den2
3292  + 4.*p2/den
3293  - 4.*p2*zeta/den2
3294  + 8.*p1*p2/den2
3295  - 8.*p2*p1*zeta/den3;
3296 
3297  case 11:
3298  return -2.*zeta/den
3299  + 4.*p2/den
3300  - 4.*p2*zeta/den2
3301  + 4.*p3/den
3302  - 4.*p3*zeta/den2
3303  + 8.*p2*p3/den2
3304  - 8.*p3*p2*zeta/den3;
3305 
3306  case 12:
3307  return -2.*zeta/den
3308  + 4.*p3/den
3309  - 4.*p3*zeta/den2
3310  + 4.*p4/den
3311  - 4.*p4*zeta/den2
3312  + 8.*p3*p4/den2
3313  - 8.*p4*p3*zeta/den3;
3314 
3315  case 13:
3316  return 8.*p3*p4/den2
3317  + 8.*p2*p4/den2
3318  + 8.*p2*p3/den2
3319  + 32.*p2*p3*p4/den3
3320  + 8.*p4*p1/den2
3321  + 8.*p1*p3/den2
3322  + 32.*p3*p4*p1/den3
3323  + 8.*p1*p2/den2
3324  + 32.*p2*p1*p4/den3
3325  + 32.*p1*p2*p3/den3
3326  + 96.*p1*p2*p3*p4/den4;
3327 
3328  default:
3329  libmesh_error_msg("Invalid i = " << i);
3330  }
3331  }
3332 
3333  default:
3334  libmesh_error_msg("Invalid j = " << j);
3335  }
3336  }
3337 
3338  // G. Bedrosian, "Shape functions and integration formulas for
3339  // three-dimensional finite element analysis", Int. J. Numerical
3340  // Methods Engineering, vol 35, p. 95-108, 1992.
3341  case PYRAMID13:
3342  {
3343  libmesh_assert_less (i, 13);
3344 
3345  const Real xi = p(0);
3346  const Real eta = p(1);
3347  const Real zeta = p(2);
3348  const Real eps = 1.e-35;
3349 
3350  // Denominators are perturbed by epsilon to avoid
3351  // divide-by-zero issues.
3352  Real
3353  den = (-1. + zeta + eps),
3354  den2 = den*den,
3355  den3 = den2*den,
3356  xi2 = xi*xi,
3357  eta2 = eta*eta,
3358  zeta2 = zeta*zeta,
3359  zeta3 = zeta2*zeta;
3360 
3361  switch (j)
3362  {
3363  case 0: // d^2()/dxi^2
3364  {
3365  switch(i)
3366  {
3367  case 0:
3368  case 1:
3369  return 0.5*(-1. + zeta + eta)/den;
3370 
3371  case 2:
3372  case 3:
3373  return 0.5*(-1. + zeta - eta)/den;
3374 
3375  case 4:
3376  case 6:
3377  case 8:
3378  case 9:
3379  case 10:
3380  case 11:
3381  case 12:
3382  return 0.;
3383 
3384  case 5:
3385  return (1. - eta - zeta)/den;
3386 
3387  case 7:
3388  return (1. + eta - zeta)/den;
3389 
3390  default:
3391  libmesh_error_msg("Invalid i = " << i);
3392  }
3393  }
3394 
3395  case 1: // d^2()/dxideta
3396  {
3397  switch(i)
3398  {
3399  case 0:
3400  return 0.25*(-1. + 2.*zeta + 2.*xi + 2.*eta)/den;
3401 
3402  case 1:
3403  return -0.25*(-1. + 2.*zeta - 2.*xi + 2.*eta)/den;
3404 
3405  case 2:
3406  return -0.25*(1. - 2.*zeta + 2.*xi + 2.*eta)/den;
3407 
3408  case 3:
3409  return 0.25*(1. - 2.*zeta - 2.*xi + 2.*eta)/den;
3410 
3411  case 4:
3412  return 0.;
3413 
3414  case 5:
3415  return -xi/den;
3416 
3417  case 6:
3418  return eta/den;
3419 
3420  case 7:
3421  return xi/den;
3422 
3423  case 8:
3424  return -eta/den;
3425 
3426  case 9:
3427  return -zeta/den;
3428 
3429  case 10:
3430  return zeta/den;
3431 
3432  case 11:
3433  return -zeta/den;
3434 
3435  case 12:
3436  return zeta/den;
3437 
3438  default:
3439  libmesh_error_msg("Invalid i = " << i);
3440  }
3441  }
3442 
3443 
3444  case 2: // d^2()/deta^2
3445  {
3446  switch(i)
3447  {
3448  case 0:
3449  case 3:
3450  return 0.5*(-1. + zeta + xi)/den;
3451 
3452  case 1:
3453  case 2:
3454  return 0.5*(-1. + zeta - xi)/den;
3455 
3456  case 4:
3457  case 5:
3458  case 7:
3459  case 9:
3460  case 10:
3461  case 11:
3462  case 12:
3463  return 0.;
3464 
3465  case 6:
3466  return (1. + xi - zeta)/den;
3467 
3468  case 8:
3469  return (1. - xi - zeta)/den;
3470 
3471  default:
3472  libmesh_error_msg("Invalid i = " << i);
3473  }
3474  }
3475 
3476 
3477  case 3: // d^2()/dxidzeta
3478  {
3479  switch(i)
3480  {
3481  case 0:
3482  return -0.25*(-1. + 2.*zeta - zeta2 + eta + 2.*eta*xi + eta2)/den2;
3483 
3484  case 1:
3485  return 0.25*(-1. + 2.*zeta - zeta2 + eta - 2.*eta*xi + eta2)/den2;
3486 
3487  case 2:
3488  return 0.25*(-1. + 2.*zeta - zeta2 - eta + 2.*eta*xi + eta2)/den2;
3489 
3490  case 3:
3491  return -0.25*(-1. + 2.*zeta - zeta2 - eta - 2.*eta*xi + eta2)/den2;
3492 
3493  case 4:
3494  return 0.;
3495 
3496  case 5:
3497  return eta*xi/den2;
3498 
3499  case 6:
3500  return -0.5*(1. + zeta2 + eta2 - 2.*zeta)/den2;
3501 
3502  case 7:
3503  return -eta*xi/den2;
3504 
3505  case 8:
3506  return 0.5*(1. + zeta2 + eta2 - 2.*zeta)/den2;
3507 
3508  case 9:
3509  return (-1. - zeta2 + eta + 2.*zeta)/den2;
3510 
3511  case 10:
3512  return -(-1. - zeta2 + eta + 2.*zeta)/den2;
3513 
3514  case 11:
3515  return (1. + zeta2 + eta - 2.*zeta)/den2;
3516 
3517  case 12:
3518  return -(1. + zeta2 + eta - 2.*zeta)/den2;
3519 
3520  default:
3521  libmesh_error_msg("Invalid i = " << i);
3522  }
3523  }
3524 
3525  case 4: // d^2()/detadzeta
3526  {
3527  switch(i)
3528  {
3529  case 0:
3530  return -0.25*(-1. + 2.*zeta - zeta2 + xi + 2.*eta*xi + xi2)/den2;
3531 
3532  case 1:
3533  return 0.25*(1. - 2.*zeta + zeta2 + xi + 2.*eta*xi - xi2)/den2;
3534 
3535  case 2:
3536  return 0.25*(-1. + 2.*zeta - zeta2 - xi + 2.*eta*xi + xi2)/den2;
3537 
3538  case 3:
3539  return -0.25*(1. - 2.*zeta + zeta2 - xi + 2.*eta*xi - xi2)/den2;
3540 
3541  case 4:
3542  return 0.;
3543 
3544  case 5:
3545  return 0.5*(1. + xi2 + zeta2 - 2.*zeta)/den2;
3546 
3547  case 6:
3548  return -eta*xi/den2;
3549 
3550  case 7:
3551  return -0.5*(1. + xi2 + zeta2 - 2.*zeta)/den2;
3552 
3553  case 8:
3554  return eta*xi/den2;
3555 
3556  case 9:
3557  return (-1. - zeta2 + xi + 2.*zeta)/den2;
3558 
3559  case 10:
3560  return -(1. + zeta2 + xi - 2.*zeta)/den2;
3561 
3562  case 11:
3563  return (1. + zeta2 + xi - 2.*zeta)/den2;
3564 
3565  case 12:
3566  return -(-1. - zeta2 + xi + 2.*zeta)/den2;
3567 
3568  default:
3569  libmesh_error_msg("Invalid i = " << i);
3570  }
3571  }
3572 
3573  case 5: // d^2()/dzeta^2
3574  {
3575  switch(i)
3576  {
3577  case 0:
3578  return 0.5*(xi + eta + 1.)*eta*xi/den3;
3579 
3580  case 1:
3581  return -0.5*(eta - xi + 1.)*eta*xi/den3;
3582 
3583  case 2:
3584  return -0.5*(xi + eta - 1.)*eta*xi/den3;
3585 
3586  case 3:
3587  return 0.5*(eta - xi - 1.)*eta*xi/den3;
3588 
3589  case 4:
3590  return 4.;
3591 
3592  case 5:
3593  return -(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi2)/den3;
3594 
3595  case 6:
3596  return (-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta2*xi)/den3;
3597 
3598  case 7:
3599  return (-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi2)/den3;
3600 
3601  case 8:
3602  return -(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta2*xi)/den3;
3603 
3604  case 9:
3605  return -2.*(-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi)/den3;
3606 
3607  case 10:
3608  return 2.*(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi)/den3;
3609 
3610  case 11:
3611  return -2.*(-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi)/den3;
3612 
3613  case 12:
3614  return 2.*(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi)/den3;
3615 
3616  default:
3617  libmesh_error_msg("Invalid i = " << i);
3618  }
3619  }
3620 
3621  default:
3622  libmesh_error_msg("Invalid j = " << j);
3623  }
3624  }
3625 
3626  default:
3627  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
3628  }
3629  }
3630 
3631 
3632  // unsupported order
3633  default:
3634  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
3635  }
3636 
3637 #else
3638  return 0.;
3639 #endif
3640 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ shape_second_deriv() [100/103]

Real libMesh::FE< 2, CLOUGH >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 2188 of file fe_clough_shape_2D.C.

2193 {
2194  libmesh_assert(elem);
2195 
2196  clough_compute_coefs(elem);
2197 
2198  const ElemType type = elem->type();
2199 
2200  const Order totalorder = static_cast<Order>(order + elem->p_level());
2201 
2202  switch (totalorder)
2203  {
2204  // 2nd-order restricted Clough-Tocher element
2205  case SECOND:
2206  {
2207  switch (type)
2208  {
2209  // C1 functions on the Clough-Tocher triangle.
2210  case TRI6:
2211  {
2212  libmesh_assert_less (i, 9);
2213  // FIXME: it would be nice to calculate (and cache)
2214  // clough_raw_shape(j,p) only once per triangle, not 1-7
2215  // times
2216  switch (i)
2217  {
2218  // Note: these DoF numbers are "scrambled" because my
2219  // initial numbering conventions didn't match libMesh
2220  case 0:
2221  return clough_raw_shape_second_deriv(0, j, p)
2222  + d1d2n * clough_raw_shape_second_deriv(10, j, p)
2223  + d1d3n * clough_raw_shape_second_deriv(11, j, p);
2224  case 3:
2225  return clough_raw_shape_second_deriv(1, j, p)
2226  + d2d3n * clough_raw_shape_second_deriv(11, j, p)
2227  + d2d1n * clough_raw_shape_second_deriv(9, j, p);
2228  case 6:
2229  return clough_raw_shape_second_deriv(2, j, p)
2230  + d3d1n * clough_raw_shape_second_deriv(9, j, p)
2231  + d3d2n * clough_raw_shape_second_deriv(10, j, p);
2232  case 1:
2233  return d1xd1x * clough_raw_shape_second_deriv(3, j, p)
2234  + d1xd1y * clough_raw_shape_second_deriv(4, j, p)
2235  + d1xd2n * clough_raw_shape_second_deriv(10, j, p)
2236  + d1xd3n * clough_raw_shape_second_deriv(11, j, p)
2237  + 0.5 * N01x * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2238  + 0.5 * N02x * d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2239  case 2:
2240  return d1yd1y * clough_raw_shape_second_deriv(4, j, p)
2241  + d1yd1x * clough_raw_shape_second_deriv(3, j, p)
2242  + d1yd2n * clough_raw_shape_second_deriv(10, j, p)
2243  + d1yd3n * clough_raw_shape_second_deriv(11, j, p)
2244  + 0.5 * N01y * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2245  + 0.5 * N02y * d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2246  case 4:
2247  return d2xd2x * clough_raw_shape_second_deriv(5, j, p)
2248  + d2xd2y * clough_raw_shape_second_deriv(6, j, p)
2249  + d2xd3n * clough_raw_shape_second_deriv(11, j, p)
2250  + d2xd1n * clough_raw_shape_second_deriv(9, j, p)
2251  + 0.5 * N10x * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2252  + 0.5 * N12x * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2253  case 5:
2254  return d2yd2y * clough_raw_shape_second_deriv(6, j, p)
2255  + d2yd2x * clough_raw_shape_second_deriv(5, j, p)
2256  + d2yd3n * clough_raw_shape_second_deriv(11, j, p)
2257  + d2yd1n * clough_raw_shape_second_deriv(9, j, p)
2258  + 0.5 * N10y * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2259  + 0.5 * N12y * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2260  case 7:
2261  return d3xd3x * clough_raw_shape_second_deriv(7, j, p)
2262  + d3xd3y * clough_raw_shape_second_deriv(8, j, p)
2263  + d3xd1n * clough_raw_shape_second_deriv(9, j, p)
2264  + d3xd2n * clough_raw_shape_second_deriv(10, j, p)
2265  + 0.5 * N20x * d2nd2n * clough_raw_shape_second_deriv(10, j, p)
2266  + 0.5 * N21x * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2267  case 8:
2268  return d3yd3y * clough_raw_shape_second_deriv(8, j, p)
2269  + d3yd3x * clough_raw_shape_second_deriv(7, j, p)
2270  + d3yd1n * clough_raw_shape_second_deriv(9, j, p)
2271  + d3yd2n * clough_raw_shape_second_deriv(10, j, p)
2272  + 0.5 * N20y * d2nd2n * clough_raw_shape_second_deriv(10, j, p)
2273  + 0.5 * N21y * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2274  default:
2275  libmesh_error_msg("Invalid shape function index i = " << i);
2276  }
2277  }
2278  default:
2279  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2280  }
2281  }
2282  // 3rd-order Clough-Tocher element
2283  case THIRD:
2284  {
2285  switch (type)
2286  {
2287  // C1 functions on the Clough-Tocher triangle.
2288  case TRI6:
2289  {
2290  libmesh_assert_less (i, 12);
2291 
2292  // FIXME: it would be nice to calculate (and cache)
2293  // clough_raw_shape(j,p) only once per triangle, not 1-7
2294  // times
2295  switch (i)
2296  {
2297  // Note: these DoF numbers are "scrambled" because my
2298  // initial numbering conventions didn't match libMesh
2299  case 0:
2300  return clough_raw_shape_second_deriv(0, j, p)
2301  + d1d2n * clough_raw_shape_second_deriv(10, j, p)
2302  + d1d3n * clough_raw_shape_second_deriv(11, j, p);
2303  case 3:
2304  return clough_raw_shape_second_deriv(1, j, p)
2305  + d2d3n * clough_raw_shape_second_deriv(11, j, p)
2306  + d2d1n * clough_raw_shape_second_deriv(9, j, p);
2307  case 6:
2308  return clough_raw_shape_second_deriv(2, j, p)
2309  + d3d1n * clough_raw_shape_second_deriv(9, j, p)
2310  + d3d2n * clough_raw_shape_second_deriv(10, j, p);
2311  case 1:
2312  return d1xd1x * clough_raw_shape_second_deriv(3, j, p)
2313  + d1xd1y * clough_raw_shape_second_deriv(4, j, p)
2314  + d1xd2n * clough_raw_shape_second_deriv(10, j, p)
2315  + d1xd3n * clough_raw_shape_second_deriv(11, j, p);
2316  case 2:
2317  return d1yd1y * clough_raw_shape_second_deriv(4, j, p)
2318  + d1yd1x * clough_raw_shape_second_deriv(3, j, p)
2319  + d1yd2n * clough_raw_shape_second_deriv(10, j, p)
2320  + d1yd3n * clough_raw_shape_second_deriv(11, j, p);
2321  case 4:
2322  return d2xd2x * clough_raw_shape_second_deriv(5, j, p)
2323  + d2xd2y * clough_raw_shape_second_deriv(6, j, p)
2324  + d2xd3n * clough_raw_shape_second_deriv(11, j, p)
2325  + d2xd1n * clough_raw_shape_second_deriv(9, j, p);
2326  case 5:
2327  return d2yd2y * clough_raw_shape_second_deriv(6, j, p)
2328  + d2yd2x * clough_raw_shape_second_deriv(5, j, p)
2329  + d2yd3n * clough_raw_shape_second_deriv(11, j, p)
2330  + d2yd1n * clough_raw_shape_second_deriv(9, j, p);
2331  case 7:
2332  return d3xd3x * clough_raw_shape_second_deriv(7, j, p)
2333  + d3xd3y * clough_raw_shape_second_deriv(8, j, p)
2334  + d3xd1n * clough_raw_shape_second_deriv(9, j, p)
2335  + d3xd2n * clough_raw_shape_second_deriv(10, j, p);
2336  case 8:
2337  return d3yd3y * clough_raw_shape_second_deriv(8, j, p)
2338  + d3yd3x * clough_raw_shape_second_deriv(7, j, p)
2339  + d3yd1n * clough_raw_shape_second_deriv(9, j, p)
2340  + d3yd2n * clough_raw_shape_second_deriv(10, j, p);
2341  case 10:
2342  return d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2343  case 11:
2344  return d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2345  case 9:
2346  return d3nd3n * clough_raw_shape_second_deriv(11, j, p);
2347 
2348  default:
2349  libmesh_error_msg("Invalid shape function index i = " << i);
2350  }
2351  }
2352  default:
2353  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2354  }
2355  }
2356  // by default throw an error
2357  default:
2358  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
2359  }
2360 }
unsigned int p_level() const
Definition: elem.h:2555
virtual ElemType type() const =0

◆ shape_second_deriv() [101/103]

Real libMesh::FE< 3, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 2965 of file fe_bernstein_shape_3D.C.

2970 {
2971  static bool warning_given = false;
2972 
2973  if (!warning_given)
2974  libMesh::err << "Second derivatives for Bernstein elements "
2975  << "are not yet implemented!"
2976  << std::endl;
2977 
2978  warning_given = true;
2979  return 0.;
2980 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [102/103]

Real libMesh::FE< 3, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)
inherited

Definition at line 2985 of file fe_bernstein_shape_3D.C.

2990 {
2991  static bool warning_given = false;
2992 
2993  if (!warning_given)
2994  libMesh::err << "Second derivatives for Bernstein elements "
2995  << "are not yet implemented!"
2996  << std::endl;
2997 
2998  warning_given = true;
2999  return 0.;
3000 }
OStreamProxy err(std::cerr)

◆ shape_second_deriv() [103/103]

Real libMesh::FE< 3, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
inherited

Definition at line 3645 of file fe_lagrange_shape_3D.C.

3650 {
3651  libmesh_assert(elem);
3652 
3653  // call the orientation-independent shape function derivatives
3654  return FE<3,LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
3655 }

◆ shapes_need_reinit() [1/54]

bool libMesh::FE< 0, SCALAR >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 137 of file fe_scalar.C.

137 { return false; }

◆ shapes_need_reinit() [2/54]

bool libMesh::FE< 1, SCALAR >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 138 of file fe_scalar.C.

138 { return false; }

◆ shapes_need_reinit() [3/54]

bool libMesh::FE< 2, SCALAR >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 139 of file fe_scalar.C.

139 { return false; }

◆ shapes_need_reinit() [4/54]

bool libMesh::FE< 3, SCALAR >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 140 of file fe_scalar.C.

140 { return false; }

◆ shapes_need_reinit() [5/54]

bool libMesh::FE< 0, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 222 of file fe_l2_hierarchic.C.

222 { return true; }

◆ shapes_need_reinit() [6/54]

bool libMesh::FE< 1, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 223 of file fe_l2_hierarchic.C.

223 { return true; }

◆ shapes_need_reinit() [7/54]

bool libMesh::FE< 2, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 224 of file fe_l2_hierarchic.C.

224 { return true; }

◆ shapes_need_reinit() [8/54]

bool libMesh::FE< 3, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 225 of file fe_l2_hierarchic.C.

225 { return true; }

◆ shapes_need_reinit() [9/54]

bool libMesh::FE< 0, CLOUGH >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 319 of file fe_clough.C.

319 { return true; }

◆ shapes_need_reinit() [10/54]

bool libMesh::FE< 1, CLOUGH >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 320 of file fe_clough.C.

320 { return true; }

◆ shapes_need_reinit() [11/54]

bool libMesh::FE< 2, CLOUGH >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 321 of file fe_clough.C.

321 { return true; }

◆ shapes_need_reinit() [12/54]

bool libMesh::FE< 3, CLOUGH >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 322 of file fe_clough.C.

322 { return true; }

◆ shapes_need_reinit() [13/54]

bool libMesh::FE< 0, HERMITE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 370 of file fe_hermite.C.

370 { return true; }

◆ shapes_need_reinit() [14/54]

bool libMesh::FE< 1, HERMITE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 371 of file fe_hermite.C.

371 { return true; }

◆ shapes_need_reinit() [15/54]

bool libMesh::FE< 2, HERMITE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 372 of file fe_hermite.C.

372 { return true; }

◆ shapes_need_reinit() [16/54]

bool libMesh::FE< 3, HERMITE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 373 of file fe_hermite.C.

373 { return true; }

◆ shapes_need_reinit() [17/54]

bool libMesh::FE< 0, HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 398 of file fe_hierarchic.C.

398 { return true; }

◆ shapes_need_reinit() [18/54]

bool libMesh::FE< 1, HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 399 of file fe_hierarchic.C.

399 { return true; }

◆ shapes_need_reinit() [19/54]

bool libMesh::FE< 2, HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 400 of file fe_hierarchic.C.

400 { return true; }

◆ shapes_need_reinit() [20/54]

bool libMesh::FE< 3, HIERARCHIC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 401 of file fe_hierarchic.C.

401 { return true; }

◆ shapes_need_reinit() [21/54]

virtual bool libMesh::FE< Dim, T >::shapes_need_reinit ( ) const
overridevirtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

◆ shapes_need_reinit() [22/54]

bool libMesh::FE< 0, MONOMIAL >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 425 of file fe_monomial.C.

425 { return false; }

◆ shapes_need_reinit() [23/54]

bool libMesh::FE< 1, MONOMIAL >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 426 of file fe_monomial.C.

426 { return false; }

◆ shapes_need_reinit() [24/54]

bool libMesh::FE< 2, MONOMIAL >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 427 of file fe_monomial.C.

427 { return false; }

◆ shapes_need_reinit() [25/54]

bool libMesh::FE< 3, MONOMIAL >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 428 of file fe_monomial.C.

428 { return false; }

◆ shapes_need_reinit() [26/54]

bool libMesh::FE< 0, BERNSTEIN >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 466 of file fe_bernstein.C.

466 { return true; }

◆ shapes_need_reinit() [27/54]

bool libMesh::FE< 1, BERNSTEIN >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 467 of file fe_bernstein.C.

467 { return true; }

◆ shapes_need_reinit() [28/54]

bool libMesh::FE< 2, BERNSTEIN >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 468 of file fe_bernstein.C.

468 { return true; }

◆ shapes_need_reinit() [29/54]

bool libMesh::FE< 3, BERNSTEIN >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 469 of file fe_bernstein.C.

469 { return true; }

◆ shapes_need_reinit() [30/54]

bool libMesh::FE< 0, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 486 of file fe_l2_lagrange.C.

486 { return false; }

◆ shapes_need_reinit() [31/54]

bool libMesh::FE< 1, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 487 of file fe_l2_lagrange.C.

487 { return false; }

◆ shapes_need_reinit() [32/54]

bool libMesh::FE< 2, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 488 of file fe_l2_lagrange.C.

488 { return false; }

◆ shapes_need_reinit() [33/54]

bool libMesh::FE< 3, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 489 of file fe_l2_lagrange.C.

489 { return false; }

◆ shapes_need_reinit() [34/54]

bool libMesh::FE< 0, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 556 of file fe_nedelec_one.C.

556 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shapes_need_reinit() [35/54]

bool libMesh::FE< 1, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 557 of file fe_nedelec_one.C.

557 { NEDELEC_LOW_D_ERROR_MESSAGE }

◆ shapes_need_reinit() [36/54]

bool libMesh::FE< 2, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 558 of file fe_nedelec_one.C.

558 { return true; }

◆ shapes_need_reinit() [37/54]

bool libMesh::FE< 3, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 559 of file fe_nedelec_one.C.

559 { return true; }

◆ shapes_need_reinit() [38/54]

bool libMesh::FE< 0, LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 889 of file fe_lagrange.C.

889 { return false; }

◆ shapes_need_reinit() [39/54]

bool libMesh::FE< 1, LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 890 of file fe_lagrange.C.

890 { return false; }

◆ shapes_need_reinit() [40/54]

bool libMesh::FE< 2, LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 891 of file fe_lagrange.C.

891 { return false; }

◆ shapes_need_reinit() [41/54]

bool libMesh::FE< 3, LAGRANGE >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 892 of file fe_lagrange.C.

892 { return false; }

◆ shapes_need_reinit() [42/54]

bool libMesh::FE< 2, SUBDIVISION >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 916 of file fe_subdivision_2D.C.

916 { return true; }

◆ shapes_need_reinit() [43/54]

bool libMesh::FE< 0, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 939 of file fe_lagrange_vec.C.

939 { return false; }

◆ shapes_need_reinit() [44/54]

bool libMesh::FE< 1, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 940 of file fe_lagrange_vec.C.

940 { return false; }

◆ shapes_need_reinit() [45/54]

bool libMesh::FE< 2, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 941 of file fe_lagrange_vec.C.

941 { return false; }

◆ shapes_need_reinit() [46/54]

bool libMesh::FE< 3, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 942 of file fe_lagrange_vec.C.

942 { return false; }

◆ shapes_need_reinit() [47/54]

bool libMesh::FE< 0, XYZ >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 948 of file fe_xyz.C.

948 { return true; }

◆ shapes_need_reinit() [48/54]

bool libMesh::FE< 1, XYZ >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 949 of file fe_xyz.C.

949 { return true; }

◆ shapes_need_reinit() [49/54]

bool libMesh::FE< 2, XYZ >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 950 of file fe_xyz.C.

950 { return true; }

◆ shapes_need_reinit() [50/54]

bool libMesh::FE< 3, XYZ >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 951 of file fe_xyz.C.

951 { return true; }

◆ shapes_need_reinit() [51/54]

bool libMesh::FE< 0, SZABAB >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1303 of file fe_szabab.C.

1303 { return true; }

◆ shapes_need_reinit() [52/54]

bool libMesh::FE< 1, SZABAB >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1304 of file fe_szabab.C.

1304 { return true; }

◆ shapes_need_reinit() [53/54]

bool libMesh::FE< 2, SZABAB >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1305 of file fe_szabab.C.

1305 { return true; }

◆ shapes_need_reinit() [54/54]

bool libMesh::FE< 3, SZABAB >::shapes_need_reinit ( ) const
virtualinherited
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1306 of file fe_szabab.C.

1306 { return true; }

◆ side_map() [1/2]

void libMesh::FE< Dim, T >::side_map ( const Elem elem,
const Elem side,
const unsigned int  s,
const std::vector< Point > &  reference_side_points,
std::vector< Point > &  reference_points 
)
overridevirtualinherited

Computes the reference space quadrature points on the side of an element based on the side quadrature points.

Implements libMesh::FEAbstract.

Definition at line 353 of file fe_boundary.C.

358 {
359  // We're calculating mappings - we need at least first order info
360  this->calculate_phi = true;
361  this->determine_calculations();
362 
363  unsigned int side_p_level = elem->p_level();
364  if (elem->neighbor_ptr(s) != nullptr)
365  side_p_level = std::max(side_p_level, elem->neighbor_ptr(s)->p_level());
366 
367  if (side->type() != last_side ||
368  side_p_level != this->_p_level ||
369  !this->shapes_on_quadrature)
370  {
371  // Set the element type
372  this->elem_type = elem->type();
373  this->_p_level = side_p_level;
374 
375  // Set the last_side
376  last_side = side->type();
377 
378  // Initialize the face shape functions
379  this->_fe_map->template init_face_shape_functions<Dim>(reference_side_points, side);
380  }
381 
382  const unsigned int n_points =
383  cast_int<unsigned int>(reference_side_points.size());
384  reference_points.resize(n_points);
385  for (unsigned int i = 0; i < n_points; i++)
386  reference_points[i].zero();
387 
388  std::vector<unsigned int> elem_nodes_map;
389  elem_nodes_map.resize(side->n_nodes());
390  for (unsigned int j = 0; j < side->n_nodes(); j++)
391  for (unsigned int i = 0; i < elem->n_nodes(); i++)
392  if (side->node_id(j) == elem->node_id(i))
393  elem_nodes_map[j] = i;
394  std::vector<Point> refspace_nodes;
395  this->get_refspace_nodes(elem->type(), refspace_nodes);
396 
397  const std::vector<std::vector<Real>> & psi_map = this->_fe_map->get_psi();
398 
399  // sum over the nodes
400  for (auto i : index_range(psi_map))
401  {
402  const Point & side_node = refspace_nodes[elem_nodes_map[i]];
403  for (unsigned int p=0; p<n_points; p++)
404  reference_points[p].add_scaled (side_node, psi_map[i][p]);
405  }
406 }
unsigned int _p_level
Definition: fe_abstract.h:587
unsigned short int side
Definition: xdr_io.C:50
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Definition: int_range.h:104
const Number zero
Definition: libmesh.h:239
long double max(long double a, double b)
static void get_refspace_nodes(const ElemType t, std::vector< Point > &nodes)
Definition: fe_abstract.C:283
std::unique_ptr< FEMap > _fe_map
Definition: fe_abstract.h:525
ElemType last_side
Definition: fe.h:480

◆ side_map() [2/2]

void libMesh::FE< 2, SUBDIVISION >::side_map ( const Elem ,
const Elem ,
const unsigned int  ,
const std::vector< Point > &  ,
std::vector< Point > &   
)
virtualinherited

Computes the reference space quadrature points on the side of an element based on the side quadrature points.

Implements libMesh::FEAbstract.

Definition at line 856 of file fe_subdivision_2D.C.

861 {
862  libmesh_not_implemented();
863 }

Member Data Documentation

◆ _counts

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _fe_map

◆ _fe_trans

std::unique_ptr<FETransformationBase<FEOutputType< T >::type > > libMesh::FEGenericBase< FEOutputType< T >::type >::_fe_trans
protectedinherited

Object that handles computing shape function values, gradients, etc in the physical domain.

Definition at line 493 of file fe_base.h.

◆ _mutex

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _p_level

unsigned int libMesh::FEAbstract::_p_level
protectedinherited

The p refinement level the current data structures are set up for.

Definition at line 587 of file fe_abstract.h.

Referenced by libMesh::FEAbstract::get_order(), and libMesh::FEAbstract::get_p_level().

◆ cached_nodes

std::vector<Point> libMesh::FE< Dim, T >::cached_nodes
protectedinherited

An array of the node locations on the last element we computed on

Definition at line 475 of file fe.h.

◆ calculate_curl_phi

bool libMesh::FEAbstract::calculate_curl_phi
mutableprotectedinherited

Should we calculate shape function curls?

Definition at line 557 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi().

◆ calculate_d2phi

◆ calculate_div_phi

bool libMesh::FEAbstract::calculate_div_phi
mutableprotectedinherited

Should we calculate shape function divergences?

Definition at line 562 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi().

◆ calculate_dphi

◆ calculate_dphiref

bool libMesh::FEAbstract::calculate_dphiref
mutableprotectedinherited

Should we calculate reference shape function gradients?

Definition at line 567 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), and libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta().

◆ calculate_phi

bool libMesh::FEAbstract::calculate_phi
mutableprotectedinherited

Should we calculate shape functions?

Definition at line 542 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi().

◆ calculations_started

bool libMesh::FEAbstract::calculations_started
mutableprotectedinherited

Have calculations with this object already been started? Then all get_* functions should already have been called.

Definition at line 537 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi(), and libMesh::FESubdivision::init_shape_functions().

◆ curl_phi

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::curl_phi
protectedinherited

Shape function curl values. Only defined for vector types.

Definition at line 508 of file fe_base.h.

◆ d2phi

std::vector<std::vector<OutputTensor> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phi
protectedinherited

Shape function second derivative values.

Definition at line 551 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ d2phideta2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phideta2
protectedinherited

Shape function second derivatives in the eta direction.

Definition at line 571 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ d2phidetadzeta

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidetadzeta
protectedinherited

Shape function second derivatives in the eta-zeta direction.

Definition at line 576 of file fe_base.h.

◆ d2phidx2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidx2
protectedinherited

Shape function second derivatives in the x direction.

Definition at line 586 of file fe_base.h.

◆ d2phidxdy

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxdy
protectedinherited

Shape function second derivatives in the x-y direction.

Definition at line 591 of file fe_base.h.

◆ d2phidxdz

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxdz
protectedinherited

Shape function second derivatives in the x-z direction.

Definition at line 596 of file fe_base.h.

◆ d2phidxi2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxi2
protectedinherited

Shape function second derivatives in the xi direction.

Definition at line 556 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ d2phidxideta

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxideta
protectedinherited

Shape function second derivatives in the xi-eta direction.

Definition at line 561 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ d2phidxidzeta

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxidzeta
protectedinherited

Shape function second derivatives in the xi-zeta direction.

Definition at line 566 of file fe_base.h.

◆ d2phidy2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidy2
protectedinherited

Shape function second derivatives in the y direction.

Definition at line 601 of file fe_base.h.

◆ d2phidydz

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidydz
protectedinherited

Shape function second derivatives in the y-z direction.

Definition at line 606 of file fe_base.h.

◆ d2phidz2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidz2
protectedinherited

Shape function second derivatives in the z direction.

Definition at line 611 of file fe_base.h.

◆ d2phidzeta2

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidzeta2
protectedinherited

Shape function second derivatives in the zeta direction.

Definition at line 581 of file fe_base.h.

◆ dim

const unsigned int libMesh::FEAbstract::dim
protectedinherited

The dimensionality of the object

Definition at line 531 of file fe_abstract.h.

Referenced by libMesh::FEAbstract::build(), and libMesh::FEAbstract::get_dim().

◆ div_phi

std::vector<std::vector<OutputDivergence> > libMesh::FEGenericBase< FEOutputType< T >::type >::div_phi
protectedinherited

Shape function divergence values. Only defined for vector types.

Definition at line 513 of file fe_base.h.

◆ dphase

std::vector<OutputGradient> libMesh::FEGenericBase< FEOutputType< T >::type >::dphase
protectedinherited

Used for certain infinite element families: the first derivatives of the phase term in global coordinates, over all quadrature points.

Definition at line 629 of file fe_base.h.

◆ dphi

std::vector<std::vector<OutputGradient> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphi
protectedinherited

Shape function derivative values.

Definition at line 503 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ dphideta

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphideta
protectedinherited

Shape function derivatives in the eta direction.

Definition at line 523 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ dphidx

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidx
protectedinherited

Shape function derivatives in the x direction.

Definition at line 533 of file fe_base.h.

◆ dphidxi

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidxi
protectedinherited

Shape function derivatives in the xi direction.

Definition at line 518 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ dphidy

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidy
protectedinherited

Shape function derivatives in the y direction.

Definition at line 538 of file fe_base.h.

◆ dphidz

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidz
protectedinherited

Shape function derivatives in the z direction.

Definition at line 543 of file fe_base.h.

◆ dphidzeta

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidzeta
protectedinherited

Shape function derivatives in the zeta direction.

Definition at line 528 of file fe_base.h.

◆ dweight

std::vector<RealGradient> libMesh::FEGenericBase< FEOutputType< T >::type >::dweight
protectedinherited

Used for certain infinite element families: the global derivative of the additional radial weight $ 1/{r^2} $, over all quadrature points.

Definition at line 636 of file fe_base.h.

◆ elem_type

ElemType libMesh::FEAbstract::elem_type
protectedinherited

The element type the current data structures are set up for.

Definition at line 581 of file fe_abstract.h.

Referenced by libMesh::FESubdivision::attach_quadrature_rule(), and libMesh::FEAbstract::get_type().

◆ fe_type

◆ last_edge

unsigned int libMesh::FE< Dim, T >::last_edge
protectedinherited

Definition at line 482 of file fe.h.

◆ last_side

ElemType libMesh::FE< Dim, T >::last_side
protectedinherited

The last side and last edge we did a reinit on

Definition at line 480 of file fe.h.

◆ phi

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::phi
protectedinherited

Shape function values.

Definition at line 498 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

◆ qrule

QBase* libMesh::FEAbstract::qrule
protectedinherited

A pointer to the quadrature rule employed

Definition at line 592 of file fe_abstract.h.

Referenced by libMesh::FESubdivision::attach_quadrature_rule().

◆ shapes_on_quadrature

bool libMesh::FEAbstract::shapes_on_quadrature
protectedinherited

A flag indicating if current data structures correspond to quadrature rule points

Definition at line 598 of file fe_abstract.h.

◆ weight

std::vector<Real> libMesh::FEGenericBase< FEOutputType< T >::type >::weight
protectedinherited

Used for certain infinite element families: the additional radial weight $ 1/{r^2} $ in local coordinates, over all quadrature points.

Definition at line 643 of file fe_base.h.


The documentation for this class was generated from the following file: