oomph::TBubbleEnrichedElementShape< 2, 3 > Class Reference

#include <Telements.h>

Public Member Functions

unsigned n_enriched_nodes ()
 Return the number of nodes required for enrichement. More...
 
void local_coordinate_of_node (const unsigned &j, Vector< double > &s) const
 Return local coordinates of node j. More...
 
void shape (const Vector< double > &s, Shape &psi) const
 Shape function for specific TBubbleEnrichedElement<2,3> More...
 
void dshape_local (const Vector< double > &s, Shape &psi, DShape &dpsids) const
 Derivatives of shape functions for specific TBubbleElement<2,3> More...
 
void d2shape_local (const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
 

Detailed Description

//////////////////////////////////////////////////////////////////// Specific Enriched TElementShape inline functions /////////////////////////////////////////////////////////////////// Standard quadratic shape functions enriched by the addition of a cubic bubble, which consists of adding a single node at the centroid

Member Function Documentation

◆ d2shape_local()

void oomph::TBubbleEnrichedElementShape< 2, 3 >::d2shape_local ( const Vector< double > &  s,
Shape psi,
DShape dpsids,
DShape d2psids 
) const
inline

Second derivatives of shape functions for specific TBubbleElement<2,3>: d2psids(i,0) = \( \partial^2 \psi_j / \partial s_0^2 \) d2psids(i,1) = \( \partial^2 \psi_j / \partial s_1^2 \) d2psids(i,2) = \( \partial^2 \psi_j / \partial s_0 \partial s_1 \)

1053  {
1054  // ALH: Don't know why object qualifier is needed
1055  this->dshape_local(s, psi, dpsids);
1056 
1057  // Calculate derivatives of bubble functions
1058  const double d2_bubble_ds0 = -2.0 * s[1];
1059  const double d2_bubble_ds1 = -2.0 * s[0];
1060  const double d2_bubble_ds2 = 1.0 - 2.0 * s[0] - 2.0 * s[1];
1061 
1062  d2psids(0, 0) = 4.0 + 3.0 * d2_bubble_ds0;
1063  d2psids(0, 1) = 0.0 + 3.0 * d2_bubble_ds1;
1064  d2psids(0, 2) = 0.0 + 3.0 * d2_bubble_ds2;
1065 
1066  d2psids(1, 0) = 0.0 + 3.0 * d2_bubble_ds0;
1067  d2psids(1, 1) = 4.0 + 3.0 * d2_bubble_ds1;
1068  d2psids(1, 2) = 0.0 + 3.0 * d2_bubble_ds2;
1069 
1070  d2psids(2, 0) = 4.0 + 3.0 * d2_bubble_ds0;
1071  d2psids(2, 1) = 4.0 + 3.0 * d2_bubble_ds1;
1072  d2psids(2, 2) = 4.0 + 3.0 * d2_bubble_ds2;
1073 
1074  d2psids(3, 0) = 0.0 - 12.0 * d2_bubble_ds0;
1075  d2psids(3, 1) = 0.0 - 12.0 * d2_bubble_ds1;
1076  d2psids(3, 2) = 4.0 - 12.0 * d2_bubble_ds2;
1077 
1078  d2psids(4, 0) = 0.0 - 12.0 * d2_bubble_ds0;
1079  d2psids(4, 1) = -8.0 - 12.0 * d2_bubble_ds1;
1080  d2psids(4, 2) = -4.0 - 12.0 * d2_bubble_ds2;
1081 
1082  d2psids(5, 0) = -8.0 - 12.0 * d2_bubble_ds0;
1083  d2psids(5, 1) = 0.0 - 12.0 * d2_bubble_ds1;
1084  d2psids(5, 2) = -4.0 - 12.0 * d2_bubble_ds2;
1085 
1086  d2psids(6, 0) = 27.0 * d2_bubble_ds0;
1087  d2psids(6, 1) = 27.0 * d2_bubble_ds1;
1088  d2psids(6, 2) = 27.0 * d2_bubble_ds2;
1089  }
void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Derivatives of shape functions for specific TBubbleElement<2,3>
Definition: Telements.h:1015
RealScalar s
Definition: level1_cplx_impl.h:130

References s.

◆ dshape_local()

void oomph::TBubbleEnrichedElementShape< 2, 3 >::dshape_local ( const Vector< double > &  s,
Shape psi,
DShape dpsids 
) const
inline

Derivatives of shape functions for specific TBubbleElement<2,3>

1016  {
1017  // ALH: Don't know why object qualifier is needed
1018  this->shape(s, psi);
1019 
1020  // Calculate derivatives of bubble functions
1021  const double d_bubble_ds0 = s[1] * (1.0 - s[1] - 2.0 * s[0]);
1022  const double d_bubble_ds1 = s[0] * (1.0 - s[0] - 2.0 * s[1]);
1023 
1024  // Add the appropriate derivatives to the shape functions
1025  dpsids(0, 0) = 4.0 * s[0] - 1.0 + 3.0 * d_bubble_ds0;
1026  dpsids(0, 1) = 0.0 + 3.0 * d_bubble_ds1;
1027  dpsids(1, 0) = 0.0 + 3.0 * d_bubble_ds0;
1028  dpsids(1, 1) = 4.0 * s[1] - 1.0 + 3.0 * d_bubble_ds1;
1029  dpsids(2, 0) = 2.0 * (2.0 * s[0] - 1.5 + 2.0 * s[1]) + 3.0 * d_bubble_ds0;
1030  dpsids(2, 1) = 2.0 * (2.0 * s[0] - 1.5 + 2.0 * s[1]) + 3.0 * d_bubble_ds1;
1031  dpsids(3, 0) = 4.0 * s[1] - 12.0 * d_bubble_ds0;
1032  dpsids(3, 1) = 4.0 * s[0] - 12.0 * d_bubble_ds1;
1033  dpsids(4, 0) = -4.0 * s[1] - 12.0 * d_bubble_ds0;
1034  dpsids(4, 1) = 4.0 * (1.0 - s[0] - 2.0 * s[1]) - 12.0 * d_bubble_ds1;
1035  dpsids(5, 0) = 4.0 * (1.0 - 2.0 * s[0] - s[1]) - 12.0 * d_bubble_ds0;
1036  dpsids(5, 1) = -4.0 * s[0] - 12.0 * d_bubble_ds1;
1037  dpsids(6, 0) = 27.0 * d_bubble_ds0;
1038  dpsids(6, 1) = 27.0 * d_bubble_ds1;
1039  }
void shape(const Vector< double > &s, Shape &psi) const
Shape function for specific TBubbleEnrichedElement<2,3>
Definition: Telements.h:987

References s, and oomph::OneDimLagrange::shape().

◆ local_coordinate_of_node()

void oomph::TBubbleEnrichedElementShape< 2, 3 >::local_coordinate_of_node ( const unsigned j,
Vector< double > &  s 
) const
inline

Return local coordinates of node j.

930  {
931  s.resize(2);
932 
933  switch (j)
934  {
935  case 0:
936  s[0] = 1.0;
937  s[1] = 0.0;
938  break;
939 
940  case 1:
941  s[0] = 0.0;
942  s[1] = 1.0;
943  break;
944 
945  case 2:
946  s[0] = 0.0;
947  s[1] = 0.0;
948  break;
949 
950  case 3:
951  s[0] = 0.5;
952  s[1] = 0.5;
953  break;
954 
955  case 4:
956  s[0] = 0.0;
957  s[1] = 0.5;
958  break;
959 
960  case 5:
961  s[0] = 0.5;
962  s[1] = 0.0;
963  break;
964 
965  // Add the centroid as the enriched node
966  case 6:
967  s[0] = 1.0 / 3.0;
968  s[1] = 1.0 / 3.0;
969  break;
970 
971  default:
972  std::ostringstream error_message;
973  error_message
974  << "Element only has seven nodes; called with node number " << j
975  << std::endl;
976 
977  throw OomphLibError(error_message.str(),
980  }
981  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and s.

◆ n_enriched_nodes()

unsigned oomph::TBubbleEnrichedElementShape< 2, 3 >::n_enriched_nodes ( )
inline

Return the number of nodes required for enrichement.

922  {
923  return 1;
924  }

◆ shape()

void oomph::TBubbleEnrichedElementShape< 2, 3 >::shape ( const Vector< double > &  s,
Shape psi 
) const
inline

Shape function for specific TBubbleEnrichedElement<2,3>

988  {
989  // Reconstruct the third area coordinate
990  const double s_2 = 1.0 - s[0] - s[1];
991 
992  // Calculate the enrichment function
993  const double cubic_bubble = s[0] * s[1] * s_2;
994  // The appropriate amount of the cubic bubble function is
995  // added/subtracted to each original quadratic shape function to ensure
996  // that it is zero at the centroid (1/3,1/3).
997 
998  // note that s[2] needs replacing by s_2 everywhere since only
999  // two independent variables s[0],s[1] and s_2 is expressed in terms of
1000  // those later.
1001  psi[0] = 2.0 * s[0] * (s[0] - 0.5) + 3.0 * cubic_bubble;
1002  psi[1] = 2.0 * s[1] * (s[1] - 0.5) + 3.0 * cubic_bubble;
1003  psi[2] = 2.0 * s_2 * (s_2 - 0.5) + 3.0 * cubic_bubble;
1004  psi[3] = 4.0 * s[0] * s[1] - 12.0 * cubic_bubble;
1005  psi[4] = 4.0 * s[1] * s_2 - 12.0 * cubic_bubble;
1006  psi[5] = 4.0 * s_2 * s[0] - 12.0 * cubic_bubble;
1007  // The bubble function scaled to have magnitude one at (1/3,1/3)
1008  psi[6] = 27.0 * cubic_bubble;
1009  }

References s.


The documentation for this class was generated from the following file: