oomph::TElementShape< 2, 3 > Class Reference

#include <Telements.h>

Public Member Functions

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 TElement<2,3> More...
 
void dshape_local (const Vector< double > &s, Shape &psi, DShape &dpsids) const
 Derivatives of shape functions for specific TElement<2,3> More...
 
void d2shape_local (const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
 

Member Function Documentation

◆ d2shape_local()

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

Second derivatives of shape functions for specific TElement<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 \)

677  {
678  // ALH: Don't know why object qualifier is needed
679  this->dshape_local(s, psi, dpsids);
680 
681  d2psids(0, 0) = 4.0;
682  d2psids(0, 1) = 0.0;
683  d2psids(0, 2) = 0.0;
684 
685  d2psids(1, 0) = 0.0;
686  d2psids(1, 1) = 4.0;
687  d2psids(1, 2) = 0.0;
688 
689  d2psids(2, 0) = 4.0;
690  d2psids(2, 1) = 4.0;
691  d2psids(2, 2) = 4.0;
692 
693  d2psids(3, 0) = 0.0;
694  d2psids(3, 1) = 0.0;
695  d2psids(3, 2) = 4.0;
696 
697  d2psids(4, 0) = 0.0;
698  d2psids(4, 1) = -8.0;
699  d2psids(4, 2) = -4.0;
700 
701  d2psids(5, 0) = -8.0;
702  d2psids(5, 1) = 0.0;
703  d2psids(5, 2) = -4.0;
704  }
void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Derivatives of shape functions for specific TElement<2,3>
Definition: Telements.h:647

References s.

◆ dshape_local()

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

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

648  {
649  // ALH: Don't know why object qualifier is needed
650  this->shape(s, psi);
651 
652  dpsids(0, 0) = 4.0 * s[0] - 1.0;
653  dpsids(0, 1) = 0.0;
654  dpsids(1, 0) = 0.0;
655  dpsids(1, 1) = 4.0 * s[1] - 1.0;
656  dpsids(2, 0) = 2.0 * (2.0 * s[0] - 1.5 + 2.0 * s[1]);
657  dpsids(2, 1) = 2.0 * (2.0 * s[0] - 1.5 + 2.0 * s[1]);
658  dpsids(3, 0) = 4.0 * s[1];
659  dpsids(3, 1) = 4.0 * s[0];
660  dpsids(4, 0) = -4.0 * s[1];
661  dpsids(4, 1) = 4.0 * (1.0 - s[0] - 2.0 * s[1]);
662  dpsids(5, 0) = 4.0 * (1.0 - 2.0 * s[0] - s[1]);
663  dpsids(5, 1) = -4.0 * s[0];
664  }
void shape(const Vector< double > &s, Shape &psi) const
Shape function for specific TElement<2,3>
Definition: Telements.h:627
RealScalar s
Definition: level1_cplx_impl.h:130

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

◆ local_coordinate_of_node()

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

Return local coordinates of node j.

576  {
577  s.resize(2);
578 
579  switch (j)
580  {
581  case 0:
582  s[0] = 1.0;
583  s[1] = 0.0;
584  break;
585 
586  case 1:
587  s[0] = 0.0;
588  s[1] = 1.0;
589  break;
590 
591  case 2:
592  s[0] = 0.0;
593  s[1] = 0.0;
594  break;
595 
596  case 3:
597  s[0] = 0.5;
598  s[1] = 0.5;
599  break;
600 
601  case 4:
602  s[0] = 0.0;
603  s[1] = 0.5;
604  break;
605 
606  case 5:
607  s[0] = 0.5;
608  s[1] = 0.0;
609  break;
610 
611  default:
612  std::ostringstream error_message;
613  error_message
614  << "Element only has six nodes; called with node number " << j
615  << std::endl;
616 
617  throw OomphLibError(error_message.str(),
620  }
621  }
#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.

◆ shape()

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

Shape function for specific TElement<2,3>

628  {
629  // Reconstruct the third area coordinate
630  double s_2 = 1.0 - s[0] - s[1];
631 
632  // note that s[2] needs replacing by s_2 everywhere since only
633  // two independent variables s[0],s[1] and s_2 is expressed in terms of
634  // those later.
635  psi[0] = 2.0 * s[0] * (s[0] - 0.5);
636  psi[1] = 2.0 * s[1] * (s[1] - 0.5);
637  psi[2] = 2.0 * s_2 * (s_2 - 0.5);
638  psi[3] = 4.0 * s[0] * s[1];
639  psi[4] = 4.0 * s[1] * s_2;
640  psi[5] = 4.0 * s_2 * s[0];
641  }

References s.


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