37 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
45 const Order libmesh_dbg_var(order),
47 const Point & point_in)
55 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
56 for (
unsigned int d = 0; d < 2; d++)
59 max_distance(d) =
std::max(distance, max_distance(d));
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;
74 const unsigned int totalorder = order + elem->
p_level();
76 libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
134 for (; i >= (o+1)*(o+2)/2; o++) { }
135 unsigned int i2 = i - (o*(o+1)/2);
137 for (
unsigned int index=i2; index != o; index++)
139 for (
unsigned int index=0; index != i2; index++)
158 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
166 const Order libmesh_dbg_var(order),
167 const unsigned int i,
168 const unsigned int j,
169 const Point & point_in)
174 libmesh_assert_less (j, 2);
175 libmesh_assert(elem);
179 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
180 for (
unsigned int d = 0; d < 2; d++)
183 max_distance(d) =
std::max(distance, max_distance(d));
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;
198 const unsigned int totalorder = order + elem->
p_level();
200 libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
234 return 3.*dx*dx/distx;
237 return 2.*dx*dy/distx;
247 return 4.*dx*dx*dx/distx;
250 return 3.*dx*dx*dy/distx;
253 return 2.*dx*dy*dy/distx;
256 return dy*dy*dy/distx;
263 for (; i >= (o+1)*(o+2)/2; o++) { }
264 unsigned int i2 = i - (o*(o+1)/2);
266 for (
unsigned int index=i2+1; index < o; index++)
268 for (
unsigned int index=0; index != i2; index++)
309 return 2.*dx*dy/disty;
312 return 3.*dy*dy/disty;
319 return dx*dx*dx/disty;
322 return 2.*dx*dx*dy/disty;
325 return 3.*dx*dy*dy/disty;
328 return 4.*dy*dy*dy/disty;
332 for (; i >= (o+1)*(o+2)/2; o++) { }
333 unsigned int i2 = i - (o*(o+1)/2);
335 for (
unsigned int index=i2; index != o; index++)
337 for (
unsigned int index=1; index <= i2; index++)
345 libmesh_error_msg(
"Invalid j = " << j);
362 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
370 const Order libmesh_dbg_var(order),
371 const unsigned int i,
372 const unsigned int j,
373 const Point & point_in)
377 libmesh_assert_less_equal (j, 2);
378 libmesh_assert(elem);
382 for (
unsigned int p = 0; p < elem->
n_nodes(); p++)
383 for (
unsigned int d = 0; d < 2; d++)
386 max_distance(d) =
std::max(distance, max_distance(d));
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;
404 const unsigned int totalorder = order + elem->
p_level();
406 libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
445 return 12.*dx*dx/dist2x;
448 return 6.*dx*dy/dist2x;
451 return 2.*dy*dy/dist2x;
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++)
464 for (
unsigned int index=0; index != i2; index++)
510 return 3.*dx*dx/distxy;
513 return 4.*dx*dy/distxy;
516 return 3.*dy*dy/distxy;
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++)
528 for (
unsigned int index=1; index < i2; index++)
574 return 2.*dx*dx/dist2y;
577 return 6.*dx*dy/dist2y;
580 return 12.*dy*dy/dist2y;
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++)
589 for (
unsigned int index=2; index < i2; index++)
596 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
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
long double max(long double a, double b)
virtual unsigned int n_nodes() const =0
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A geometric point in (x,y,z) space.
const Point & point(const unsigned int i) const
virtual Point centroid() const
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)