Hello everyone,
I have the following problem. I have a mesh of a brain slice and within this slice there is another region that is supposed to mark a tumor region. Since I am building a model to describe tumor progression in the brain, I am feeling my way forward step by step. What I want to do now is to set up a differential measure for the tumor region itself. In doing so, I’m having trouble assigning the subdomain ID to this measure. Here is the relevant part of my code so far:
with XDMFFile(MPI.COMM_WORLD, "Domain.xdmf", "r") as xdmf:
msh = xdmf.read_mesh(name="Grid")
healthy_unhealthy = xdmf.read_meshtags(msh, name="Grid")
with XDMFFile(MPI.COMM_WORLD, "Domain_boundary.xdmf", "r") as xdmf:
boundary_msh = xdmf.read_mesh(name="Grid")
boundary = xdmf.read_meshtags(boundary_msh, name="Grid")
In the snippet above, healthy_unhealthy
contains the two areas of interest. The boundary_msh
contains the boundaries.
Within the given brain slice, I have 6 physical groups describing the subdomains, as seen below.
healthy = healthy_unhealthy.find(1)
unhealthy = healthy_unhealthy.find(2)
outer = boundary.find(3)
inner1 = boundary.find(4)
inner2 = boundary.find(5)
tumor_bound = boundary.find(6)
Now i want to define the differential measure for the tumor region as
dx_unhealthy = ufl.Measure("dx", domain=msh, subdomain_data=facet_tag, subdomain_id=?)
for the weak formulation
F = (dt * d * inner(grad(u), grad(v)) + dt * inner(inner(v, u), (K_u - u))) * dx_unhealthy + inner(u, v) * dx_unhealthy - inner(u0, v) * dx_unhealthy
The question I have now is how can I assign the subdomain for the tumor region (unhealthy = healthy_unhealthy.find(2)
) to my measure?
I found some similar problems, but after a few attempts I decided to post in the forum. Please let me know if I make any major mistakes or forget important things.
Any help would be great, thanks in advance.
Julian