Skip to content

Point interpolation of shape function derivatives #3889

Discussion options

You must be logged in to vote

Yes. See the following code:

from firedrake import *

mesh = UnitSquareMesh(2, 2)

x_v = [np.r_[0, 0]]
mesh_v = VertexOnlyMesh(mesh, x_v)

V_v = FunctionSpace(mesh_v, "DG", 0)
phi_v = assemble(TestFunction(V_v)*dx)

V = FunctionSpace(mesh, "CG", 1)
phi = Cofunction(V.dual()).interpolate(phi_v)
phi_primal = phi.riesz_representation(riesz_map='l2')
grad_phi = grad(phi_primal)
grad_phi_v0 = assemble(interpolate(grad_phi[0], V_v) * dx)
grad_phi_v1 = assemble(interpolate(grad_phi[1], V_v) * dx)
print(grad_phi_v0, grad_phi_v1)

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
9 replies
@SouzaEM
Comment options

@Ig-dolci
Comment options

@SouzaEM
Comment options

@Ig-dolci
Comment options

Answer selected by SouzaEM
@SouzaEM
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants