## [Libmesh-users] Shape functions at boundaries

 [Libmesh-users] Shape functions at boundaries From: Robert - 2012-01-03 17:06:20 ```Hello, I am trying to implement a formulation for contact mechanics using the FEMSystem. This involves some contributions at the surface being in contact. I add these contributions in FEMSystem::side_time_derivative(bool, DiffContext& c). For this contribution I need the derivatives of the shape-functions in the direction of the surface coordinates, but c.side_fe_var[0]->get_dphi() and _dphidxi(), _dphideta() and _dphidzeta() are even for this boundary FE still related to the orientation of the whole element (HEX8 in my case). So when looking at a cube c.side_fe_var[0]->get_dphi() gives a different results for e.g. the surface at the button and a surface on the side differ. So how do I get the derivatives of the shape functions in the direction of the two surface coordinates/tangents in a way that is independet of what side of a three dimensional element I am looking at? Regards, Robert ```

 [Libmesh-users] Shape functions at boundaries From: Robert - 2012-01-03 17:06:20 ```Hello, I am trying to implement a formulation for contact mechanics using the FEMSystem. This involves some contributions at the surface being in contact. I add these contributions in FEMSystem::side_time_derivative(bool, DiffContext& c). For this contribution I need the derivatives of the shape-functions in the direction of the surface coordinates, but c.side_fe_var[0]->get_dphi() and _dphidxi(), _dphideta() and _dphidzeta() are even for this boundary FE still related to the orientation of the whole element (HEX8 in my case). So when looking at a cube c.side_fe_var[0]->get_dphi() gives a different results for e.g. the surface at the button and a surface on the side differ. So how do I get the derivatives of the shape functions in the direction of the two surface coordinates/tangents in a way that is independet of what side of a three dimensional element I am looking at? Regards, Robert ```
 Re: [Libmesh-users] Shape functions at boundaries From: Roy Stogner - 2012-01-03 18:18:53 ```On Tue, 3 Jan 2012, Robert wrote: > I am trying to implement a formulation for contact mechanics using the > FEMSystem. This involves some contributions at the surface being in > contact. I add these contributions in > FEMSystem::side_time_derivative(bool, DiffContext& c). > For this contribution I need the derivatives of the shape-functions in > the direction of the surface coordinates, but > c.side_fe_var[0]->get_dphi() and _dphidxi(), _dphideta() and > _dphidzeta() are even for this boundary FE still related to the > orientation of the whole element (HEX8 in my case). > > So when looking at a cube c.side_fe_var[0]->get_dphi() gives a different > results for e.g. the surface at the button and a surface on the side > differ. So how do I get the derivatives of the shape functions in the > direction of the two surface coordinates/tangents in a way that is > independet of what side of a three dimensional element I am looking at? get_dphi(), then dot product it with each of the outputs of get_tangents()? --- Roy ```