Hi,
I need to impose the gradient of a displacement field on a given part of the boundary in 2D :
\(\frac{\partial \, u_{y}}{\partial \, x}\) = 0
This part is indexed by number 4
in a MeshFunction
object :
mymesh = Mesh("meshname.xml")
exterior_facets_meshfunction = MeshFunction("size_t", mymesh, "meshboundaryname.xml")
I am trying to do it through a penalization method.
First I want to defined a Measure
object corresponding to the boundary part on which the constraint is imposed :
my_ds = Measure("ds")[exterior_facets_meshfunction]
Then, I define FunctionSpace V
and Function u
:
V = VectorFunctionSpace(mesh, "Lagrange", 1)
u = Function(V)
then define \(\frac{\partial \, u_{y}}{\partial \, x}\) :
Dx(u.sub(1), 0)
Finally, I will propose the following term to be added to the system's energy :
constraint = pen*Dx(u.sub(1),0)**2*my_ds(4)
Where pen
is a scalar parameter...
Many thanks in advance for your help !
Claire