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

DanielB

  • Newbie
  • *
  • Posts: 17
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[0] =  1.0 - rCoordinates[0] - rCoordinates[1];
      rResult[1] =  rCoordinates[0];
      rResult[2] =  rCoordinates[1];
       
        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.

Thanks already in advance and best regards,
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