Hi @cdaversin,
Thank you so much for your explanation and providing the reference material. After reviewing the demo and Internal boundary condition with mixed_dimensional branch, I tried to implement the continuity condition as following, which is not working yet
- mesh, I assume the lower mesh for the interface is correctly defined at this step, as well as the measure dxGamma.
mesh = UnitSquareMesh(30, 30)
marker = MeshFunction("size_t", mesh, mesh.topology().dim(), 0)
for c in cells(mesh):
marker[c] = c.midpoint().y() < 0.5
submesh1 = MeshView.create(marker, 1)
submesh2 = MeshView.create(marker, 0)
gamma = MeshFunction('size_t', mesh, mesh.topology().dim()-1, 0)
for f in facets(mesh):
if 0.5 - DOLFIN_EPS < f.midpoint().y() < 0.5 + DOLFIN_EPS:
gamma[f] = 1
interface_mesh = MeshView.create(gamma, 1)
dxOmega = Measure("dx", domain=mesh)
dxGamma = Measure('dx', domain=interface_mesh)
- define the functional space, I got confused at this step, as in the demo, the mixed functional space including also the functional space defined on the interface lower mesh, while in Internal boundary condition with mixed_dimensional branch, the mixed functional space only mixed by the upper and lower subdomains. Please help me figure out which way is corret.
W1 = FunctionSpace(submesh1, "Lagrange", 1)
W2 = FunctionSpace(submesh2, "Lagrange", 1)
W3 = FunctionSpace(interface_mesh, "Lagrange", 1)
# Define the mixed function space
#V = MixedFunctionSpace( W1, W2, W3 )
V = MixedFunctionSpace( W1, W2 )
# Use directly TrialFunction and TestFunction on the product space
# Subdomain 1
u1 = TrialFunction(W1)
v1 = TestFunction(W1)
# Subdomain 2
u2 = TrialFunction(W2)
v2 = TestFunction(W2)
# Mixed
(u1_m,u2_m) = TrialFunctions(V)
(v1_m,v2_m) = TestFunctions(V)
#(u1_m,u2_m, lambda_) = TrialFunctions(V)
#(v1_m,v2_m, beta_) = TestFunctions(V)
- specifying the continuity at the interface. I tried
F_coupling = va*ub*ds_int
from Internal boundary condition with mixed_dimensional branch, but it ends up with error below:
Traceback (most recent call last):
File "test_+Lagrange_multiplier.py", line 89, in <module>
solve(a == L, sol, bcs, solver_parameters={"linear_solver":"direct"})
File "/usr/local/lib/python3.6/dist-packages/fenics_dolfin-2019.2.0.dev0-py3.6-linux-x86_64.egg/dolfin/fem/solving.py", line 233, in solve
_solve_varproblem(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/fenics_dolfin-2019.2.0.dev0-py3.6-linux-x86_64.egg/dolfin/fem/solving.py", line 259, in _solve_varproblem
form_compiler_parameters=form_compiler_parameters)
File "/usr/local/lib/python3.6/dist-packages/fenics_dolfin-2019.2.0.dev0-py3.6-linux-x86_64.egg/dolfin/fem/problem.py", line 126, in __init__
cpp.fem.MixedLinearVariationalProblem.__init__(self, a_list, L_list, u_comps, bcs)
RuntimeError: Cannot find common parent mesh
so is this way of implementing the continuity condition at the interface correct? If so, how should I solve this RuntimeError issue? Thanks a lot!