### Author Topic: [Solved] Evaluation of shape function values for different geometries  (Read 270 times)

#### DanielB

• Newbie
• • Posts: 17 ##### [Solved] Evaluation of shape function values for different geometries
« on: January 10, 2017, 11:42:21 AM »
Dear all,

for mapping purposes we need to evaluate the shape function values for all the integration points on a particular geometry. Therefore, we run:

Code: [Select]
`Geometry< Node<3> >& geom = some_condition_or_element_pointer->GetGeometry();Matrix NContainer = geom.ShapeFunctionsValues(GeometryData::GI_GAUSS_2);`
After playing a bit with different geometries we assume that an implementation of the function "ShapeFunctionsValues(..)" is missing for the "triangle_3d_3". More in particular, if we apply the above code in case of a triangular mesh the following error message pops up:

Code: [Select]
`RuntimeError: Error: Calling base class ShapeFunctionsValues method instead of derived class one. Please check the definition of derived class.2 dimensional triangle with three nodes in 3D space    Dimension               : 2    working space dimension : 3    Local space dimension   : 2`
The may be solved by implementing the following function in "triangle_3d_3.h":

Code: [Select]
`    virtual Vector& ShapeFunctionsValues (Vector &rResult, const CoordinatesArrayType& rCoordinates) const    {      if(rResult.size() != 3) rResult.resize(3,false);      rResult =  1.0 - rCoordinates - rCoordinates;      rResult =  rCoordinates;      rResult =  rCoordinates;                return rResult;    }    `
Now I was just wondering if this function is really missing or if there is a particular reason not to implement it? Any clarification is much appreciated.

Daniel

« Last Edit: January 11, 2017, 08:31:16 AM by DanielB »

#### DanielB

• Newbie
• • Posts: 17 ##### Re: Evaluation of shape function values for different geometries
« Reply #1 on: January 11, 2017, 08:24:24 AM »
Obviously the missing function was added to the repository. Thanks a lot for this.

Best regards,
Daniel