Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

dirichlet for y&z-direction of boundary, but not for x-direction

More
2 years 6 months ago #4038 by joey
Hi,

in my code i want to compress a beam by a unit force. The left side is clamped and the right side (where the force is applied) should only move in x direction and not in y&z-direction.

I tried:

uLeft = CoefficientFunction((0.0, 0.0, 0.0))
uRight = CoefficientFunction((1, 0.0, 0.0))

gfu.Set(mesh.BoundaryCF({ "left" : uLeft, "right" : x*uRight}), definedon=mesh.Boundaries("left|right"))

but this did not work.

Can you guys help me how to define boundaries that way?
Thanks :)


File Attachment:

File Name: nonlin-elasti.ipynb
File Size:7 KB
More
2 years 6 months ago #4041 by hvwahl
Hi joey,

I don't know much about elasticity problems, but here are a couple of principles which might help:

-Dirichlet boundary conditions are easiest set in the FE space. If you use the VectorH1 space, there are the option "dirichletx", "dirichlety"... with which you can set the Dirichlet flags for components of the boundaries. Best in this case is probably, if you construct the product space by defining the individual component spaces first.
Code:
fes1 = H1(mesh, order=2, dirichlet="left") fes2 = H1(mesh, order=2, dirichlet="left|right") fes3 = H1(mesh, order=2, dirichlet="left|right") fes = fes1 * fes2 * fes3

-If you only have non-homogeneous Dirichlet conditions on one boundary, then you don't need to set anything on the other Dirichlet boundary, as the dofs on that boundary will not be touched due to the freedofs=fes.FreeDofs() in the construction of the "inverse".

Best wishes,
Henry
Time to create page: 0.114 seconds