Re: [Libmesh-users] shape function of a triangle From: Roy Stogner - 2009-03-03 01:54 ```On Mon, 2 Mar 2009, John Peterson wrote: > On Mon, Mar 2, 2009 at 3:48 PM, yunfei zhu wrote: >> >> Considering  a tri3, as following, >> >>          3 >>          * >>        * c * >>       *  *  * >>      *       * >>     *  a*  *b * >>  1 *  *  *  *  *2 >> points a,b,c are quadrature points. >> (L[i] are the area coordinates) >> p(0) is the area coordinate L[1] at a quadrature point. >> p(1) is the area coordinate L[2] at a quadrature point. John is right, and to be more specific, here is why: for our master triangle, 1 is at the origin, 2 is at (1,0), 3 is at (0,1). So p(0) = L(2) and p(1) = L(3) --- Roy ```
 Re: [Libmesh-users] shape function of a triangle From: John Peterson - 2009-03-03 01:38 ```On Mon, Mar 2, 2009 at 3:48 PM, yunfei zhu wrote: > Hi all, > I am feeling a little confused about the following codes in the > file:fe_lagrange_shape_2D.C. > >   case TRI3: >   case TRI6: >     { >       const Real zeta1 = p(0); >       const Real zeta2 = p(1); >       const Real zeta0 = 1. - zeta1 - zeta2; > >       libmesh_assert (i<3); > >       switch(i) >  { >  case 0: >    return zeta0; > >  case 1: >    return zeta1; > >  case 2: >    return zeta2; > >  default: >    libmesh_error(); > >  } > > Considering  a tri3, as following, > >          3 >          * >        * c * >       *  *  * >      *       * >     *  a*  *b * >  1 *  *  *  *  *2 > points a,b,c are quadrature points. > (L[i] are the area coordinates) > p(0) is the area coordinate L[1] at a quadrature point. > p(1) is the area coordinate L[2] at a quadrature point. > so, > zeta1=L[1] > zeta2=L[2] > zeta0=L[3] > > we have shape function : > phi[i][a]=L[i][a] > > If i=0, we should have: phi[0][a]=L[1][a], > but the code return zeta0, which is L[3], not L[1]. zeta0 as given above is the correct basis function for node zero. -- John ```
 Re: [Libmesh-users] shape function of a triangle From: Roy Stogner - 2009-03-03 01:54 ```On Mon, 2 Mar 2009, John Peterson wrote: > On Mon, Mar 2, 2009 at 3:48 PM, yunfei zhu wrote: >> >> Considering  a tri3, as following, >> >>          3 >>          * >>        * c * >>       *  *  * >>      *       * >>     *  a*  *b * >>  1 *  *  *  *  *2 >> points a,b,c are quadrature points. >> (L[i] are the area coordinates) >> p(0) is the area coordinate L[1] at a quadrature point. >> p(1) is the area coordinate L[2] at a quadrature point. John is right, and to be more specific, here is why: for our master triangle, 1 is at the origin, 2 is at (1,0), 3 is at (0,1). So p(0) = L(2) and p(1) = L(3) --- Roy ```