What does this function do?

Hi,

So since I am a beginner, my question my be trivial, but still…

I was looking at this example and there is a function within the example, I do not quite understand:

def eps(v):
    e = sym(grad(v))
    return as_tensor([[e[0, 0], e[0, 1], 0],
                      [e[0, 1], e[1, 1], 0],
                      [0, 0, 0]])

At first I thought eps(u) is the strain tensor but since it is later multiplied with strian

metadata = {"quadrature_degree": deg_stress, "quadrature_scheme": "default"}
dxm = dx(metadata=metadata)

a_Newton = inner(eps(v), sigma_tang(eps(u_)))*dxm

the eps can’t be the strain tensor but it must do something else. I think that simply because I don’t think multiplying strain tensor with stress tensor has any meaning. Or does it?

question

Is there a mathematical interpretation of what the eps does? I am trying to rewrite the example in a different framework.

Is this the strain-displacement matrix, usually denoted by B?

You might want to take a step back from plasticity, and first make sure you understand @bleyerj’s 2D elasticity tutorial here. It seems like the root of the misunderstanding may be with the concept of weak forms of partial differential equations (PDEs), in which case you might even start with the Poisson demo.

I’ll answer your questions directly in the context of the 2D elasticity tutorial:

Is there a mathematical interpretation of what the eps does?

eps(v) returns the symmetric gradient of its argument, v, i.e.,

\boldsymbol{\varepsilon}(\mathbf{v}) = \operatorname{sym}\nabla\mathbf{v} = \frac{1}{2}(\nabla\mathbf{v} + \nabla\mathbf{v}^T)\text{ .}

If v is the displacement, then this is the strain, but notice that the Cauchy stress is contracted with eps(v), where v is a test function. (In the plasticity demo, the 2D symmetric gradient is then padded with zeros to fit into a 3D formulation.)

I don’t think multiplying strain tensor with stress tensor has any meaning. Or does it?

The contraction \frac{1}{2}\boldsymbol{\sigma}(\boldsymbol{\varepsilon}(\mathbf{u})):\boldsymbol{\varepsilon}(\mathbf{u}) = \frac{1}{2}\boldsymbol{\varepsilon}(\mathbf{u}):\mathbf{c}:\boldsymbol{\varepsilon}(\mathbf{u}) is the elastic potential energy density (where \mathbf{c} is the rank-4 stiffness tensor). One way to get the weak problem is to take a variation of the sum of elastic potential energy and change in external potential energy (associated with conservative force field \mathbf{f}):

\delta\int_\Omega\left(\frac{1}{2}\boldsymbol{\varepsilon}(\mathbf{u}):\mathbf{c}:\boldsymbol{\varepsilon}(\mathbf{u}) - \mathbf{f}\cdot\mathbf{u}\right)\,d\Omega = \int_\Omega\left(\boldsymbol{\sigma}(\boldsymbol{\varepsilon}(\mathbf{u})):\boldsymbol{\varepsilon}(\delta\mathbf{u}) - \mathbf{f}\cdot\delta\mathbf{u}\right)\,d\Omega = 0\text{ ,}

where the arbitrary “virtual displacement” \delta\mathbf{u} is the test function, denoted in \mathbf{v} in the tutorial.

Is this the strain-displacement matrix, usually denoted by B ?

The strain–displacement matrix in your example is essentially a discrete representation of the symmetric gradient operator. However, when using the FEniCS Unified Form Language (UFL), you simply state the weak PDE system, and lower-level details of the discretization beyond that point are all automated.

2 Likes

Thank you for your answer.

Since my next question is related to the sMe fenics plasticity example let me just ask it here.
Do you happen to know how to plot the components of the stress tensor and not only the von misses stress?

Stress components expressed symbolically in UFL (e.g., sigma(u)[0,0] in the elasticity demo) can be projected to the space P0 and written to files, similar to the way in which p is projected to P0, assigned to p_avg, and written to file_results in the plasticity demo.