dirichlet boundary conditions

Asked by Dupront

Hello,
  The Dirichlet boundary conditions for the hyperelasticity demo are implemented as follows:

        # Mark boundary subdomians
       left, right = compile_subdomains(["(std::abs(x[0]) < DOLFIN_EPS) && on_boundary",
                                  "(std::abs(x[0] - 1.0) < DOLFIN_EPS) && on_boundary"])

       # Define Dirichlet boundary (x = 0 or x = 1)
      c = Expression(("0.0", "0.0", "0.0"))
      r = Expression(("scale*0.0",
                "scale*(y0 + (x[1] - y0)*cos(theta) - (x[2] - z0)*sin(theta) - x[1])",
                "scale*(z0 + (x[1] - y0)*sin(theta) + (x[2] - z0)*cos(theta) - x[2])"),
                scale = 0.5, y0 = 0.5, z0 = 0.5, theta = pi/3)

     bcl = DirichletBC(V, c, left)
     bcr = DirichletBC(V, r, right)
     bcs = [bcl, bcr]

 In this case the three components of the displacement are imposed on each point
of the boundary.
 Is it possible (and how?) to impose only one component of the displacement ?
 For example if u=(ux,uy,uz) I would like to impose only ux=0,uy=0 and let uz free
on a corner point.

Thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Dupront
Solved:
Last query:
Last reply:
Revision history for this message
Anders E. Johansen (andersej) said :
#1

You can try giving V.sub(0) (for the x-component, 1 for y, 2 for z) to DirichletBC to set bc for only one component.

Anders

Revision history for this message
Dupront (michel-dupront) said :
#2

beautiful !
Thank you very much !