Hello, I’m trying to solve an equation with a rank 2 tensor order parameter \sigma_{ij}, but I’ve been having some problems using tensors with Fenics. However, because it’s only rank 2 and it’s symmetric and traceless I can reformulate everything in terms of two scalar functions \sigma_{xx} and \sigma_{yy}.

However if some other equation for a vector has a coupling of the form \partial_j\sigma_{ij} = \partial_x\sigma_{ix} + \partial_y\sigma_{iy} I should now write this coupling as derivative with respect to x of one of the scalar functions and derivative with respect to y of the other. How can I do this on Fenics?

So there is a Vector function space and one of the terms is the divergence above, so I need to build a vector whose x component is \partial_x\sigma_{xx} + \partial_y\sigma_{xy} and whose y component is \partial_x\sigma_{xy} - \partial_y\sigma_{xx}, and the sigmas are part of a mixed space defined as:

```
P = FiniteElement('P', mesh.ufl_cell(), 1)
MFS = FunctionSpace(mesh, MixedElement([P,P]), constrained_domain = PeriodicBoundary())
Q_ = Function(MFS)
qxx_, qxy_ = split(Q_)
```

How can I build such a vector from these functions?

Thanks