22 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 57 libmesh_error_msg(
"Invalid shape function index i = " << i);
65 return (1./4.)*pow<2>(1.-xi);
67 return (1./4.)*pow<2>(1.+xi);
69 return (1./2.)*(1.-xi)*(1.+xi);
71 libmesh_error_msg(
"Invalid shape function index i = " << i);
79 return (1./8.)*pow<3>(1.-xi);
81 return (1./8.)*pow<3>(1.+xi);
83 return (3./8.)*(1.+xi)*pow<2>(1.-xi);
85 return (3./8.)*pow<2>(1.+xi)*(1.-xi);
87 libmesh_error_msg(
"Invalid shape function index i = " << i);
95 return (1./16.)*pow<4>(1.-xi);
97 return (1./16.)*pow<4>(1.+xi);
99 return (1./ 4.)*(1.+xi)*pow<3>(1.-xi);
101 return (3./ 8.)*pow<2>(1.+xi)*pow<2>(1.-xi);
103 return (1./ 4.)*pow<3>(1.+xi)*(1.-xi);
105 libmesh_error_msg(
"Invalid shape function index i = " << i);
114 return (1./32.)*pow<5>(1.-xi);
116 return (1./32.)*pow<5>(1.+xi);
118 return (5./32.)*(1.+xi)*pow<4>(1.-xi);
120 return (5./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
122 return (5./16.)*pow<3>(1.+xi)*pow<2>(1.-xi);
124 return (5./32.)*pow<4>(1.+xi)*(1.-xi);
126 libmesh_error_msg(
"Invalid shape function index i = " << i);
135 return ( 1./64.)*pow<6>(1.-xi);
137 return ( 1./64.)*pow<6>(1.+xi);
139 return ( 3./32.)*(1.+xi)*pow<5>(1.-xi);
141 return (15./64.)*pow<2>(1.+xi)*pow<4>(1.-xi);
143 return ( 5./16.)*pow<3>(1.+xi)*pow<3>(1.-xi);
145 return (15./64.)*pow<4>(1.+xi)*pow<2>(1.-xi);
147 return ( 3./32.)*pow<5>(1.+xi)*(1.-xi);
149 libmesh_error_msg(
"Invalid shape function index i = " << i);
154 libmesh_assert (order>6);
158 const int p_order =
static_cast<int>(order);
159 const int m = p_order-i+1;
162 Real binomial_p_i = 1;
169 static_cast<unsigned long>(n)));
174 return binomial_p_i *
std::pow((1-xi)/2, p_order);
176 return binomial_p_i *
std::pow((1+xi)/2, p_order);
179 return binomial_p_i *
std::pow((1+xi)/2,n)
192 const unsigned int i,
195 libmesh_assert(elem);
205 const unsigned int i,
206 const unsigned int libmesh_dbg_var(j),
211 libmesh_assert_equal_to (j, 0);
213 const Real xi = p(0);
228 libmesh_error_msg(
"Invalid shape function index i = " << i);
242 libmesh_error_msg(
"Invalid shape function index i = " << i);
250 return -0.375*pow<2>(1.-xi);
252 return 0.375*pow<2>(1.+xi);
254 return -0.375 -.75*xi +1.125*pow<2>(xi);
256 return 0.375 -.75*xi -1.125*pow<2>(xi);
258 libmesh_error_msg(
"Invalid shape function index i = " << i);
266 return -0.25*pow<3>(1.-xi);
268 return 0.25*pow<3>(1.+xi);
270 return -0.5 +1.5*pow<2>(xi)-pow<3>(xi);
272 return 1.5*(pow<3>(xi)-xi);
274 return 0.5 -1.5*pow<2>(xi)-pow<3>(xi);
276 libmesh_error_msg(
"Invalid shape function index i = " << i);
284 return -(5./32.)*pow<4>(xi-1.);
286 return (5./32.)*pow<4>(xi+1.);
288 return (5./32.)*pow<4>(1.-xi) -(5./8.)*(1.+xi)*pow<3>(1.-xi);
290 return (5./ 8.)*(1.+xi)*pow<3>(1.-xi) -(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
292 return -(5./ 8.)*pow<3>(1.+xi)*(1.-xi) +(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
294 return (5./ 8.)*pow<3>(1.+xi)*(1.-xi) -(5./32.)*pow<4>(1.+xi);
296 libmesh_error_msg(
"Invalid shape function index i = " << i);
304 return -( 3./32.)*pow<5>(1.-xi);
306 return ( 3./32.)*pow<5>(1.+xi);
308 return ( 3./32.)*pow<5>(1.-xi)-(15./32.)*(1.+xi)*pow<4>(1.-xi);
310 return (15./32.)*(1.+xi)*pow<4>(1.-xi)-(15./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
312 return -(15./ 8.)*xi +(15./4.)*pow<3>(xi)-(15./8.)*pow<5>(xi);
314 return -(15./32.)*(1.-xi)*pow<4>(1.+xi)+(15./16.)*pow<2>(1.-xi)*pow<3>(1.+xi);
316 return (15./32.)*pow<4>(1.+xi)*(1.-xi)-(3./32.)*pow<5>(1.+xi);
318 libmesh_error_msg(
"Invalid shape function index i = " << i);
324 libmesh_assert (order>6);
327 const int p_order =
static_cast<int>(order);
328 const int m = p_order-(i-1);
331 Real binomial_p_i = 1;
338 static_cast<unsigned long>(n)));
343 return binomial_p_i * (-1./2.) * p_order *
std::pow((1-xi)/2, p_order-1);
345 return binomial_p_i * ( 1./2.) * p_order *
std::pow((1+xi)/2, p_order-1);
349 return binomial_p_i * (1./2. * n *
std::pow((1+xi)/2,n-1) *
std::pow((1-xi)/2,m)
363 const unsigned int i,
364 const unsigned int j,
367 libmesh_assert(elem);
382 static bool warning_given =
false;
385 libMesh::err <<
"Second derivatives for Bernstein elements " 386 <<
"are not yet implemented!" 389 warning_given =
true;
403 static bool warning_given =
false;
406 libMesh::err <<
"Second derivatives for Bernstein elements " 407 <<
"are not yet implemented!" 410 warning_given =
true;
417 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
The base class for all geometric element types.
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
OStreamProxy err(std::cerr)
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
A geometric point in (x,y,z) space.
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)