How to apply triangular distributed load to beam?

26 days ago by
Hello All,

I am trying to solve the following problem in FEniCS and being new to FEniCS I would greatly appreciate any hint/suggestion for implementing it.

As shown in figure, I have to implement a beam (L*B=10*1) with its left end having fixed and right end having roller boundary condition. I have written the following code for boundary conditions. Is it right?
#Fixed boundary condition to the bottom left corners
w_D1 = Constant((0,0))

#roller boundary condition to the right bottom corner
w_D2 = Constant(0)

def boundary_left(x,on_boundary):
return (near(x[0],0) and near(x[1],0))

def boundary_right(x,on_boundary):
return (near(x[0],10) and near(x[1],0))


Next I would like to implement a non-uniform distributed load on the top edge of the beam (as shown in the figure). I have written the following code for it.

class Top(SubDomain):
def inside(self,x,on_boundary):
return near(x[1],1.0)

#initialize the sub domain:
top=Top() #represents the top edge

# define load
g_T = Constant((0.0,-0.02))

#Variational problem
L = dot(v,g_T)*ds(1)​

But this applies uniformly distributed load. Can I please get some help on how I could implement the non-uniformly/triangular distributed load? I tried to express it as an expression y=mx+c, but it does not work.

Thank you very much for your valuable guidance.
Community: FEniCS Project

1 Answer

26 days ago by

If I understood your problem correctly: you want to have a term in your equation L that is space dependent. You could use the Expression object.

The syntax would then be:

# define load
g_T = Expression('m*x[0]+c',m=1,c=2,degree=1)

Though I'm not really sure to get what's the field you want to solve.

Good luck,


Please login to add an answer/comment or follow this question.

Similar posts:
Search »