How to use ALE for moving boundary problems?

Consider the following minimal example:

from dolfin import * 
mesh = UnitSquareMesh(10, 10)

V = VectorFunctionSpace(mesh, "CG", 1)
x = SpatialCoordinate(mesh)
disp = project(as_vector((x[1],0)), V)

disp_bc = DirichletBC(V, disp, "near(x[0], 1)")
b_disp = Function(V)
disp_bc.apply(b_disp.vector())

outfile = File("mesh.pvd")
outfile << mesh
ALE.move(mesh, b_disp)
outfile << mesh
for i in range(10):
    mesh.smooth()
    outfile << mesh
1 Like