currently there is no "TensorL2" FESpace directly available in NGSolve. You can use copies of L2 to construct a symmetric tensor space. E.g. in 2D
Code:
fesL2 = L2(mesh, order=1)
MatrixL2 = FESpace( [fesL2,fesL2,fesL2] )
(uxx,uxy,uyy),(vxx,vxy,vyy) = MatrixL2.TnT()
um = CoefficientFunction( (uxx, uxy,
uxy, uyy), dims=(2,2))
vm = CoefficientFunction( (vxx, vxy,
vxy, vyy), dims=(2,2))
...
gf = GridFunction(MatrixL2)
gfm = CoefficientFunction( (gf.components[0],gf.components[1],
gf.components[1],gf.components[2]), dims=(2,2) )
Draw(gfm,mesh,"gfm")
Attached you'll find a minimal example where a non-symmetric matrix gets projected.
There are matrix-valued spaces in NGSolve: HDivDiv, HCurlCurl, HCurlDiv (the first two are symmetric, the latter is not). The HDivDiv space is used e.g. in the
for forth-order problems.