Inverting a 4th rank tensor space function

Hello!

I am trying to calculate the inverse of a 4th rank tensorial function:
For example, let the fourth rank tensorial function be C:

VectorSpace 	= VectorFunctionSpace(mesh, 'CG', 2)
v = Function(VectorSpace)
C = outer(grad(v),grad(v))

I would like to calculate something similar to C2 = C^-1
C2 = inv(C)

C has a shape of (3,3,3,3)

How can I do this?

Hello Nikhil,
there is no way to do it explicitly using UFL operators in the general case. You can do it in 2D if C is symmetric since it can then be written as a 3x3 matrix using vector notation. For that inv will do. Otherwise, you need to do it yourself, for instance project it on some space (best advice would be a Quadrature FunctionSpace), get the array of values and perform numerical inversion quadrature point by quadrature point.
This kind of missing feature is typically what we would like to achieve in dolfin-x (see https://github.com/FEniCS/dolfinx/pull/1083)

1 Like