Applying pressure as boundary condition

Hi,

Let’s take the official elasticity example from here. Let’s remove the body force f and add another boundary condition at the right side (label = 2). This boundary condition is a pressure p that will elongate the beam in x direction.

Is this the right way to assign a pressure boundary condition to the right side? I would say it is not, however, I can’t figure out what is.

25 solve lame([u, v], [uu, vv])
26    = int2d(Th)(
27         lambda * div(u, v) * div(uu, vv)
28       + 2.*mu * ( epsilon(u,v)' * epsilon(uu,vv) )
29    )
30    - int1d(Th, 2)(
31         p*uu
32    )
33    + on(4, u=0, v=0)
34    ;