See: Why use DG space to project stress/strain? - #3 by bhaveshshrimali
or: How to store diferential operator in a Function object - #2 by dokken
Which both suggest projecting the stresses into a suitable function space.
Please use markdown formatting when posting code; i.e.
```python
def f(x):
return x
```