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

Measuring the distance to boundary defined by CellFunction

0 votes

Hello

So I am implementing the Fluid-Structure interaction validation benchmark from Turek, where I solve the equations of FSI on a tube with an elastic flag behind a tube --> Turek Paper
In order to experiment with some different extrapolation operators of the solid deformation into the fluid, I need to calculate the distance from an interior node in the fluid to the solid flag.
This is further to be used in a basic poisson equation on the form

$$ \nabla \cdot alfa * \nabla u$$

where alfa is some diffusion parameter based on this distance

Øyvind Evju answered here, how to calculate the distance from a node to the outer boundary, which comes close to what I need. However, my boundary is defined by CellFunctions

Bar_area = AutoSubDomain(lambda x: (0.19 <= x[1] <= 0.21) and 0.24<= x[0] <= 0.6) 
domains = CellFunction("size_t", mesh)
domains.set_all(1)
Bar_area.mark(domains, 2) #Overwrites structure domain
dx = Measure("dx", subdomain_data = domains)
plot(domains,interactive = True)
dx_f = dx(1, subdomain_data = domains)
dx_s = dx(2, subdomain_data = domains)

and using this approach leaves me with

Distance boundary

What I want is to extend this method to let me measure the distance from an internal node in the fluid to the closest point on the solid flag.

Link to my mesh

Happy Easter

Andreas

asked Apr 14, 2017 by Andreas Slyngstad FEniCS Novice (170 points)
...