|
[Sponsors] |
[General] Programmable filter - eigenvalue/lambda2 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 30, 2023, 14:29 |
Programmable filter - eigenvalue/lambda2
|
#1 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
Crosspost from https://discourse.paraview.org/t/pro...-lambda2/12188
I followed this guide in an attempt to get Eigenvalues / Lambda2 calculated by ParaView: https://discourse.paraview.org/t/eig...mputation/9307 My script looks like this: Code:
import numpy as np from vtk.numpy_interface import algorithms as algs input=inputs[0] Velocity_Vector = input.PointData[‘velocity’] STRAIN = strain(Velocity_Vector) V_gradient = gradient(Velocity_Vector) AAA=STRAIN**2+(V_gradient - STRAIN)**2 print(shape(AAA)) Lambda_2 = np.linalg.eigvals(AAA[:]) Lambda_2 = np.real(Lambda_2) output.PointData.append(Lambda_2, ‘Lambda_2’) Here I get the error “numpy.linalg.LinAlgError: 0-dimensional array given. Array must be at least two-dimensional” The shape of AAA is printed as (12058557,3,3) The input for this filter is point data with a velocity field in vector form. PV version 5.11.0 I am new to programmable filters and Python in general. A nudge into the right direction would be greatly appreciated. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Listing the inputs of a grouped dataset with a programmable python filter in Paraview | NadineHS | ParaView | 3 | December 12, 2021 15:54 |
[General] Programmable filter | halal | ParaView | 0 | March 19, 2018 10:49 |
[General] Pass variable from programmable filter to Plot Over Line Filter | Jack001 | ParaView | 0 | March 29, 2016 14:18 |
Programmable Filter Problem | quantenmaschine | OpenFOAM Post-Processing | 0 | August 22, 2015 10:44 |
[General] Programmable Filter: when multiple inputs, how to verify which input is which? | macfly | ParaView | 0 | July 12, 2014 12:14 |