stress in element

Asked by kassbohm

Let's say, I am running a structural fem analysis, such as demo_hyperelasticity.

How can I extract and/or visualize the stress in a finite element?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Marie Rognes
Solved:
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

You have to tell us what you mean by the stress in a finite element.

Revision history for this message
kassbohm (kassbohm) said :
#2

Sorry...

If you use FEM to solve some boundary value problem within continuum-mechanics framework, somewhere on the way you evaluate some integrals (over the element volume) numerically (sometime Gaussian quadrature is used).

Therefore, you evaluate/compute some integrands (at the Gauss points). And the stress tensor is one term in the computation of one integrand...

What else can I say?

Revision history for this message
kassbohm (kassbohm) said :
#3

Since the stress tensor is an important field in continuum mechanics, I thought, that it might be possible, that this field can be accessed somehow in dolfin.

Regards,
Sven

Revision history for this message
Best Marie Rognes (meg-simula) said :
#4

The stress field is not somehow predefined in DOLFIN. In general, you have to specify what you want to compute and then compute it. I've attached an example of doing something that might relate to what you want to do below.

from dolfin import *

# Define your favourite formula for the stress tensor:
def stress_tensor(u):
    I = Identity(2)
    return 2*sym(grad(u)) + div(u)*I

mesh = UnitSquare(4, 4)
V = VectorFunctionSpace(mesh, "CG", 1)
# Compute displacement somehow ...
u = Function(V)

# Project trace ('tr') of stress tensor:
S = FunctionSpace(mesh, "CG", 1)
sigma = project(tr(stress_tensor(u)), S)

# Plot resulting Function
plot(sigma, interactive=True)

Revision history for this message
kassbohm (kassbohm) said :
#5

Thank you very much.

Revision history for this message
kassbohm (kassbohm) said :
#6

Thanks Marie Rognes, that solved my question.