I have a cell data F that is an array of 3x3 matrices. How can I calculate the sqrt(eigenvalues of F*F.T matrices) and afterwards append this new cell data?
Update 1: This is my code. It does not work because of the line
C = F.Arrays[0] * F.Arrays[0].T
How can I solve solve it?
import numpy as np
import vtk
from vtk.numpy_interface import dataset_adapter as da
from paraview.numpy_support import vtk_to_numpy
from paraview.vtk.numpy_interface import algorithms
from paraview.vtk.numpy_interface.algorithms import sqrt as sqrt
from paraview.vtk.numpy_interface.algorithms import eigenvalue as eigenvalue
# This is a VTKCompositeDataArray
F = inputs[0].GetCellData().GetArray('F')
# Of course it does not work! Error:
# ValueError: operands could not be broadcast together
# with shapes (60,3,3) #(3,3,60)
# How to solve it?
C = F.Arrays[0] * F.Arrays[0].T
Eigs = sqrt(eigenvalue(C))
output.CellData.append(Eigs, "EigenValues")