How to calculate Strain and Stress by applying external displacement to a 3D Mesh?

Hi Guys,

I am a newbie to FENICS.

I have developed my own code to calculate the displacement of a 3D mesh and

I want to extend the program by adding post-processing i.e., calculating the strain and stress from the displacement of mesh in 3D.

Can anyone tell me how can I externally input displacement to a 3D mesh in FENICS and calculate strain and stress?

Thanks a lot

Hello,
you can define a FunctionSpace V of the same kind that you used in your own code and instantiate a function on this FunctionSpace. You can then fill in its degrees of freedom with your own Numpy array and then compute stresses or strains:

V = FunctionSpace(mesh, ... )
u = Function(V)
u.vector().set_local(my_numpy_array)
epsilon = sym(grad(u))

you will just need to figure out how your dofs are arranged compared to the dofmap used by FEniCS

1 Like

Thanks a lot for the reply. I will try the suggestions you made.

I would also like to clarify,

  1. How to assign the natural boundary conditions after import the mesh and displacements

  2. What is the format of the mesh and displacement (format of the Numpy array) to import into the FENICS?

Can you suggest some references / documents / tutorials related to this?

Thank you