This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Double derivative of Shape Function

0 votes

Hi, I am novice user of Fenics.
How can I calculate and visualize double derivate of the shape function ?

d2N/dx2

my problem is simple but i am not getting any idea, small help save my time.

Thanks

asked Oct 15, 2016 by hirshikesh FEniCS User (1,890 points)

2 Answers

+1 vote
 
Best answer

I think that this question may help you
https://fenicsproject.org/qa/2878/visualising-shape-functions

Sample code adapted from the accepted answer

from dolfin import *
mesh = UnitSquareMesh(10,10)
plot(mesh)

V = FunctionSpace(mesh, 'CG', 2)
v = Function(V)
v.vector()[51] = 1

mesh2 = UnitSquareMesh(100,100)
V2 = FunctionSpace(mesh2, 'CG', 2)
v2 = project(v.dx(0).dx(0), V2)
plot(v2)
interactive()
answered Oct 15, 2016 by francesco.ballarin FEniCS User (4,070 points)
selected Oct 16, 2016 by hirshikesh

Thanks, I seems working

+1 vote

Elements in FEniCS are only piecewise continuous. This means that
the derivatives are discontinuous and the second order derivatives are
delta function at element boundaries. Hence, second order derivatives should
be use with care. In usual FEM methods the second order derivative is defined
only weakly.

answered Oct 16, 2016 by Kent-Andre Mardal FEniCS Expert (14,380 points)
...