Hello all,
I am trying to solve a problem where I have a circular sub-domain moving through a region in space, and I am trying to calculate an integral over this sub-domain (originating from a Lagrange multiplier constraint implementation). Right now the way I am doing this is to mark the domains using CellFunctions
at every time step, then create a measure out of it, and then re-calculate the form for the integral.
while time <= finalTime
domains = CellFunction("size_t", mesh)
domains.set_all(0)
circle = Circle()
circle = circle.mark(domains, 1)
dx = Measure("dx")[domains]
... other lines of code ....
intCircle = inner(lambda, v)*dx(1)
I am wondering whether it is needed for me to define the form for the integral inside the loop or defining it outside will work. Additionally, can I specify a deformation to dx(1)
. Since I know the velocity and position, I can specify a rigid-body transformation to the domain dx(1)
in theory - but I don't know whether that can be done in FEniCs in practice.
Any help whatsoever will be appreciated.