Coupled 1D-2D-problem

More
2 years 3 months ago - 2 years 3 months ago #4497 by welahi
Coupled 1D-2D-problem was created by welahi
Dear all,

I want to solve coupled equation for two function (u1, u2), one in 1D, the other one in 2D. I wanted to start by solving basically two non-coupled problems simultaneously, following the tutorials mixed.py and compound.py, but the code crashes with a segfault... Am I approaching this correctly in the first place?

Best, welahi

Code:

from ngsolve import *
from netgen.occ import unit_square
from ngsolve.meshes import Make1DMesh

mesh1 = Make1DMesh(10)
mesh2 = Mesh(unit_square.GenerateMesh(maxh=0.2))

fes1 = H1(mesh1, order=2, dirichlet="left")
fes2 = H1(mesh2, order=2, dirichlet="left|right|bottom|top")
fes = fes1*fes2

u1, u2 = fes.TrialFunction()
v1, v2 = fes.TestFunction()

a = BilinearForm(fes)
a1, a2 = a.components
a1 += grad(u1)*grad(v1)*dx
a2 += grad(u2)*grad(v2)*dx
a.Assemble() # Crashes here
Last edit: 2 years 3 months ago by welahi.
More
2 years 6 days ago #4593 by str
Replied by str on topic Coupled 1D-2D-problem
Hello!
Did you figure out how to handle the compound space which is based on two different meshes? I suspect that this was the case, and I'm wondering if anyone knows a workaround.
Many thanks for the help!
Time to create page: 0.119 seconds