SCOREC / fep

Finite Element Programming course materials
6 stars 4 forks source link

Parametric coordinates clarification #22

Closed goinea closed 3 years ago

goinea commented 3 years ago

Just to be clear the coordinates in the shape and dshape commands in the Lagrange element file are to be used for shape functions and derivatives calculations and not the node coordinates in the notes above the quad elements.

mortezah commented 3 years ago

@goinea the input to CalcShape and CalcDShape named ip is a general parametric coordinate in the element, and not necessarily just the node locations. For example, for quads ip.x and ip.y could have any value in the interval [0,1].

goinea commented 3 years ago

Got it, so we can still use coordinates like dshape(6,0) even though 6 is outside of the interval?

mortezah commented 3 years ago

@goinea I am not sure if I understand your question. If by dshape you mean the DenseMatrix object shown here https://github.com/SCOREC/fep/blob/d16f0b636671f519bcfb8ea91d07fc04638ad091/a4/LagrangeElements.hpp#L269, then an expression like

dshape(6,0) = ...

will set the (6,0) component of that matrix. You will need to put the expression in terms of ip.x and ip.y on the right hand side. That would be, for this specific case, the derivative with respect to the 0th parametric coordinate (i.e., ip.x) of the 6th shape function.