Class xlifepp::LagrangeStdSegment#

class LagrangeStdSegment : public xlifepp::LagrangeSegment#

Inheritence diagram for xlifepp::LagrangeStdSegment:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::LagrangeSegment" tooltip="xlifepp::LagrangeSegment"] "1" [label="xlifepp::LagrangeStdSegment" tooltip="xlifepp::LagrangeStdSegment" fillcolor="#BFBFBF"] "4" [label="xlifepp::RefElement" tooltip="xlifepp::RefElement"] "3" [label="xlifepp::RefSegment" tooltip="xlifepp::RefSegment"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "3" -> "4" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::LagrangeStdSegment:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "17" [label="std::list< std::vector< PolynomialT< real_t > > >" tooltip="std::list< std::vector< PolynomialT< real_t > > >"] "20" [label="std::map< xlifepp::Quadrature *, std::vector< xlifepp::ShapeValues > >" tooltip="std::map< xlifepp::Quadrature *, std::vector< xlifepp::ShapeValues > >"] "18" [label="std::list< T >" tooltip="std::list< T >"] "21" [label="std::map< K, T >" tooltip="std::map< K, T >"] "7" [label="std::vector< T >" tooltip="std::vector< T >"] "8" [label="std::vector< ShapeType >" tooltip="std::vector< ShapeType >"] "6" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "22" [label="std::vector< std::pair< ShapeType, std::vector< number_t > > >" tooltip="std::vector< std::pair< ShapeType, std::vector< number_t > > >"] "10" [label="std::vector< std::vector< int_t > >" tooltip="std::vector< std::vector< int_t > >"] "9" [label="std::vector< std::vector< number_t > >" tooltip="std::vector< std::vector< number_t > >"] "11" [label="std::vector< xlifepp::GeomRefElement * >" tooltip="std::vector< xlifepp::GeomRefElement * >"] "13" [label="std::vector< xlifepp::Interpolation * >" tooltip="std::vector< xlifepp::Interpolation * >"] "19" [label="std::vector< xlifepp::PolynomialsBasisT >" tooltip="std::vector< xlifepp::PolynomialsBasisT >"] "14" [label="std::vector< xlifepp::RefDof * >" tooltip="std::vector< xlifepp::RefDof * >"] "15" [label="std::vector< xlifepp::RefElement * >" tooltip="std::vector< xlifepp::RefElement * >"] "5" [label="xlifepp::GeomRefElement" tooltip="xlifepp::GeomRefElement"] "12" [label="xlifepp::Interpolation" tooltip="xlifepp::Interpolation"] "2" [label="xlifepp::LagrangeSegment" tooltip="xlifepp::LagrangeSegment"] "1" [label="xlifepp::LagrangeStdSegment" tooltip="xlifepp::LagrangeStdSegment" fillcolor="#BFBFBF"] "16" [label="xlifepp::PolynomialsBasisT< K >" tooltip="xlifepp::PolynomialsBasisT< K >"] "4" [label="xlifepp::RefElement" tooltip="xlifepp::RefElement"] "3" [label="xlifepp::RefSegment" tooltip="xlifepp::RefSegment"] "17" -> "18" [dir=forward tooltip="template-instance"] "20" -> "21" [dir=forward tooltip="template-instance"] "8" -> "7" [dir=forward tooltip="template-instance"] "6" -> "7" [dir=forward tooltip="template-instance"] "22" -> "7" [dir=forward tooltip="template-instance"] "10" -> "7" [dir=forward tooltip="template-instance"] "9" -> "7" [dir=forward tooltip="template-instance"] "11" -> "7" [dir=forward tooltip="template-instance"] "13" -> "7" [dir=forward tooltip="template-instance"] "19" -> "7" [dir=forward tooltip="template-instance"] "14" -> "7" [dir=forward tooltip="template-instance"] "15" -> "7" [dir=forward tooltip="template-instance"] "5" -> "6" [dir=forward tooltip="usage"] "5" -> "8" [dir=forward tooltip="usage"] "5" -> "9" [dir=forward tooltip="usage"] "5" -> "10" [dir=forward tooltip="usage"] "5" -> "11" [dir=forward tooltip="usage"] "12" -> "13" [dir=forward tooltip="usage"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "22" [dir=forward tooltip="usage"] "16" -> "17" [dir=forward tooltip="public-inheritance"] "4" -> "5" [dir=forward tooltip="usage"] "4" -> "12" [dir=forward tooltip="usage"] "4" -> "14" [dir=forward tooltip="usage"] "4" -> "15" [dir=forward tooltip="usage"] "4" -> "9" [dir=forward tooltip="usage"] "4" -> "16" [dir=forward tooltip="usage"] "4" -> "19" [dir=forward tooltip="usage"] "4" -> "20" [dir=forward tooltip="usage"] "3" -> "4" [dir=forward tooltip="public-inheritance"] }

child class of LagrangeHexahedron with standard interpolation

Public Functions

LagrangeStdSegment(const Interpolation *interp_p)#

constructor by interpolation

Lagrange segment Reference Element for Pk interpolation at equidistant nodes.

inline ~LagrangeStdSegment()#

destructor

virtual void computeShapeFunctions()#

compute polynomials representation

compute shape functions as polynomials using general algorithm

virtual void computeShapeValues(std::vector<real_t>::const_iterator it_pt, ShapeValues &shv, const bool withDeriv = true, const bool with2Deriv = false) const#

compute shape functions at given point

shapeFunctions defines Lagrange Reference Element shape functions

Shape functions (Lagrange polynomials at \(n_0=1, n_1=0, n_2=1-1/n, n_3=1-2/n, \ldots n_n=1/n\)) with \(w_i(n_j)=\delta_{ij} \; (0 <= i,j <= n)\), are given by

\(\begin{array}{rl} w_0 & \displaystyle = \frac{n^{n-1}}{(n-1)!} x \prod_{j=1,n-1} (x-j/n) \\ & \displaystyle = \frac{x}{(n-1)!} \prod_{j=1,n-1} (nx-j) \\ w_1 & \displaystyle = (-1)^n n^{n-1}C_n^n (x-1)\frac{x-1/n}{1}\ldots\frac{x-(n-1)/n}{n-1} \\ & \displaystyle = (-1)^n \frac{n^{n-1}}{(n-1)!} (x-1) \prod_{j=1,n-1} (x-j/n) \\ & \displaystyle = (-1)^n \frac{x-1}{(n-1)!} \prod_{j=1,n-1} (nx-j) \\ w_2 & \displaystyle = (-1) n^{n-1} C_n^1 x(x-1)\frac{(x-1/n)}{1}\ldots\frac{(x-(j-1)/n)}{(j-1)}\frac{(x-j)/n)}{j}*\frac{(x-(j+1)/n)}{(j+1)}\ldots\frac{(x-(n-2)/n)}{(n-2)} \\ & \displaystyle = (-1) \frac{n^{n-1}}{(n-1)!} \frac{n!}{((n-2)2!)} \prod_{j=0,n \& j!= n-1} (x-j/n) \\ & \displaystyle = (-1) \frac{nx(x-1)}{((n-2)2!)} \prod_{j=1,n-2} (nx-j) \\ \forall i=3,n \; w_i & \displaystyle = (-1)^{i-1} n^{n-1} C_n^{i-1} x(x-1)\frac{(x-1/n)}{1}\ldots\frac{(x-(k-1)/n)}{(k-1)}\frac{(x-(k+1)/n)}{(k+1)}\ldots\frac{(x-(n-1)/n)}{(n-1)} \\ & \displaystyle = (-1)^{i-1} \frac{n^{n-1}}{(n-1)!} \frac{n!}{((n-i)i!)} \prod_{j=1,n-1 \& j!=k} (x-j/n) \\ & \displaystyle = (-1)^{i-1} \frac{n*x(x-1)}{((n-i)i!)} \prod_{j=1,n-1 \& j!=k} (n*x-j) \end{array}\)

where \(k=n+1-i\) and \(\displaystyle C_n^j=\frac{n!}{(n-j)! j!}\) are Pascal’s triangle binomial coefficients.

Examples:

  • n=1

    • \( w_0 = 1*1^0 x = x\)

    • \( w_1 = -1*1^(x-1) = 1-x\)

  • n=2

    • \( w_0 = 1*2^1/1 \;x (x-1/2) = x *(2x-1)\)

    • \( w_1 = 1*2^1/1 \;(x-1)(x-1/2) = (x-1)*(2x-1)\)

    • \( w_2 = -2*2^1/1 \;x(x-1) = -4x(x-1)\)

  • n=3

    • \( w_0 = 1*3^2/2 \; x(x-1/3)(x-2/3) = 1/2 \; x(3x-1)(3x-2)\)

    • \( w_1 = -1*3^2/2 \; (x-1)(x-1/3)(x-2/3) = -1/2 \; (x-1)(3x-1)(3x-2)\)

    • \( w_2 = -3*3^2/2 \; x(x-1)(x-1/3) = -9/2 \; x(x-1)(3x-1)\)

    • \( w_3 = 3*3^2/2 \; x(x-1)(x-2/3)= 9/2 \; x(x-1)(3x-2)\)

    Note: shv has to be sized before

inline virtual const splitvec_t &getO1splitting() const#

returns reference to splitting scheme computed by splitO1

virtual void pointCoordinates()#

point coordinates (!) (equidistant on [0,1])

pointCoordinates defines Lagrange Reference Element point coordinates

Local numbering of Lagrange Pk 1D elements

--1-- 2---1  2---3---1  2---4---3---1  2---5---4---3---1  2---6---5---4---3---1
 k=0   k=1      k=2          k=3              k=4                  k=5