Dear @IUF,
What do you mean when you say one part of the multimesh? Do you want to integrate over just the i-th grid?.
If so you should do something like this:
V = MultiMeshFunctionSpace(multimesh, "DG", 0)
f = MultiMeshFunction(V)
j = 2 # Mesh you would like to integrate over.
for i in range(multimesh.num_parts()):
Vi = FunctionSpace(multimesh.part(i), "DG", 0)
if i==j:
f.assign_part(i, project(Constant(1), Vi))
else:
f.assign_part(i, project(Constant(0), Vi))
a = f*inner(u,v)*dX
A = assemble_multimesh(a)
Thank you for your answer. This already helps me a lot.
However, I. also would like to integrate say the second variable on the first mesh for instance.
The reasoning behind would be for instance a porous media in a fluid domain.
mesh1 = fluid domain
mesh2 = porous media domain
Then the variables on the first mesh corresponds say to the velocity and the “pressure” of the fluid and on the second mesh to the displacements and “pressure”.
My variational formulation then contains scalar products on the first mesh and on the second mesh, and one additional mixed term.
Dear @IUF,
We are developing a framework dedicated to mixed-domains problems that might be appropriate for what you would like to do. It is not yet in the main branch of FEniCS, but if you are interested, you can have a look to the dedicated mixed-dimensional branch.
If you want to avoid installing from source, there is also a Docker container with a basic demo.