getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Behaviour of compute_gradient


From: Eloi Martinet
Subject: Behaviour of compute_gradient
Date: Wed, 1 Jun 2022 09:56:04 +0200 (CEST)

Hello,
I'm using the python interface of GetFEM. I am a bit confused about the behaviour of the function compute_gradient. I would expect to use it the following way (for a planar 2D mesh) :

V = gf.MeshFem(mesh_2D, 1)
V.set_fem(gf.Fem("FEM_PK(2, 1)"))
VD = gf.MeshFem(V.linked_mesh(), 2)   # HERE
VD.set_fem(gf.Fem("FEM_PK_DISCONTINUOUS(2, 0)"))
f = some function over V
grad_f = gf.compute_gradient(V, f, VD)

However, when I do this, I have a Dimension mismatch, whereas there is no error when I put
VD = gf.MeshFem(V.linked_mesh(), 1)
even if grad_f is of size [2, VD.nbdof()] afterward.

Could you please explain this behaviour ? 
Sincerly yours,

Eloi MARTINET,
LJK, PhD Student.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]