Problem witch boundary conditions

More
4 years 11 months ago #2224 by LilBeng
Hello to all,

is there any way to enable the boundary conditions of gluing between bodies?

For example, if there are two boundaries, then the displacements u | Г1 = u | Г2 should be equal at these boundaries. Tell me please.
More
4 years 11 months ago #2225 by mneunteufel
Hi LilBeng,

if you have for example two Poisson equations decoupled like this
Code:
fes1 = H1(mesh, order=2, definedon= "left_dom", dirichlet="left|top|bottom") fes2 = H1(mesh, order=2, definedon= "right_dom", dirichlet="right|top|bottom") fes = FESpace( [fes1,fes2] ) (u1,u2),(v1,v2) = fes.TnT() a = BilinearForm(fes) a += 0.1*grad(u1)*grad(v1)*dx(definedon=mesh.Materials("left_dom")) a += 0.15*grad(u2)*grad(v2)*dx(definedon=mesh.Materials("right_dom")) a.Assemble() f = LinearForm(fes) f += 1*v1*dx(definedon=mesh.Materials("left_dom")) f += 1*v2*dx(definedon=mesh.Materials("right_dom")) f.Assemble()

then you can either use a penalty formulation by adding
Code:
a += 1e5*(u1-u2)*(v1-v2)*ds(definedon=mesh.Boundaries("interface"))

or introduce a hybrid facet variable (one additional FESpace).

Attached you'll find the full example.

Best,
Michael

File Attachment:

File Name: gluing.py
File Size:2 KB
Attachments:
More
4 years 11 months ago #2226 by LilBeng
Thanks for the quick response!
But what about in theory, when we have such a situation?
Code:
eo = SplineGeometry() pnts = [(0, 0), (0.4999, 0), (0.4999, 1), (0, 1), (0.5, 0), (1, 0), (1, 1), (0.5, 1)] pind = [ geo.AppendPoint(*pnt) for pnt in pnts ] geo.Append(['line',pind[0],pind[1]],leftdomain=1,rightdomain=0,bc="bottom") geo.Append(['line',pind[1],pind[2]],leftdomain=1,rightdomain=0,bc="interface") geo.Append(['line',pind[2],pind[3]],leftdomain=1,rightdomain=0,bc="top") geo.Append(['line',pind[3],pind[0]],leftdomain=1,rightdomain=0,bc="left") geo.Append(['line',pind[4],pind[5]],leftdomain=2,rightdomain=0,bc="bottom") geo.Append(['line',pind[5],pind[6]],leftdomain=2,rightdomain=0,bc="right") geo.Append(['line',pind[6],pind[7]],leftdomain=2,rightdomain=0,bc="top") geo.Append(['line',pind[7],pind[4]],leftdomain=2,rightdomain=0,bc="interface")

File Attachment:

File Name: gluing.py
File Size:2 KB
Attachments:
Time to create page: 0.099 seconds