Has the "ds" been updated after use ALE.move() to move the mesh boundary?

Hi everyone :
I’m using ALE.move() to move the mesh boundary.
I want to know that has the “ds” been updated after use ALE.move() ?
I make two experiments, but their results seem to be contradictory.
My code is:

from dolfin import * 
import matplotlib.pyplot as plt
import numpy as np
mesh = UnitSquareMesh(100, 100)
V = VectorFunctionSpace(mesh, "CG", 1)
x = SpatialCoordinate(mesh)
class Right(SubDomain):
    def __init__(self):
        SubDomain.__init__(self)
    def inside(self, x, on_boundary):
        return on_boundary and near(x[0], 1)
right = Right()
#mark the boundary
#bmesh = BoundaryMesh(mesh, "exterior", True)
bmf = MeshFunction("size_t", mesh, mesh.topology().dim() - 1, 0)
bmf.set_all(0)
right.mark(bmf, 1)
#boundary displacement
disp = project(as_vector((0.1, 0)), V)
disp_bc = DirichletBC(V, disp, bmf, 1)
b_disp = Function(V)
disp_bc.apply(b_disp.vector())
#define 'ds'
ds = Measure('ds', domain = mesh, subdomain_data = bmf)
n = FacetNormal(mesh)
v = project(as_vector((x[0] , x[0])), V)
#save files
#outfile = File("mesh.pvd")
#outfile << mesh
plot(mesh)
plt.show()
for i in range(10):
    #move boundary
    ALE.move(mesh, b_disp)
    #outfile << mesh
    i += 1
    #smooth mesh
    for i in range(10):
        mesh.smooth()
        #outfile << mesh
    plot(mesh)
    plt.show()
    print(assemble(inner(v, n)*ds(1)))

The results are always 1.0 , 1.0, 1.0 … ,but the correct results should be 1.1 , 1.2 , 1.3 … Does the ‘ds’ not update?
While, I change the boundary displacement and print

disp = project(as_vector((0.1*x[1]*(1 - x[1]), 0)), V)

print(assemble(1*ds(1)))

The results will be changed with noving boundary. The seem to be updated?

Why do you expect inner(v, n)*ds(1) to change?
In your example disp is only in x direction (constant), which means that the size of ds(1) does not change. n is also constant (1,0), and v has been set to (1, 1) with the initial projection.

as this displacement varies in y direction, you change the size of ds(1), as well as the facet normal n. However, v is constant equal to (1, 1) irregardless of the mesh movement.

Thanks for your answer. In the first example ,I understand that the ‘ds (1)’ is always

\int_0^1 (.)\dy.

While the v is (x, x), and inner(v, n) = x. When i compute assemble inner(v, n)*ds(1) which means that

\int_0^1 \x\dy.

Then x will be changed on the right boundary (1.0 → 1.1 → 1.2 …) after use ALE.move() for mesh. So, i expect inner(v, n)*ds(1) to change.

\int_0^1 \1.0\dy
→ \int_0^1 \1.1\dy
→ \int_0^1 \1.2\dy
→ \int_0^1 \1.3\dy …

If you want v to be updated, you need to either:

  1. Set v=as_vector((x[0],x[0]))
  2. re-call

Inside the loop.