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

Impose displacement gradient on boundary

0 votes

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

closed with the note: I think I answered to my own question while asking it... it happens sometimes !
asked Mar 30, 2016 by Claire L FEniCS User (2,120 points)
closed Mar 31, 2016 by Claire L
...