CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   ParaView (http://www.cfd-online.com/Forums/paraview/)
-   -   Normalizing data (http://www.cfd-online.com/Forums/paraview/121762-normalizing-data.html)

flotus1 August 5, 2013 04:49

Normalizing data
 
This question is so basic that I almost dont dare to ask.

How can I produce "normalized" variables directly in ParaView?
Say I have a scalar field "Velocity_X" on a Multi-block Dataset and I want to divide it by its maximum or average value.
The intuitive way with a calculator expression Velocity_X/max(Velocity_X) does not work/results in an error.

Quote:

ERROR: In /home/utkarsh/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release/paraview/src/paraview/VTK/Common/Misc/vtkFunctionParser.cxx, line 1484
vtkFunctionParser (0x4acef00): Syntax Error: two parameters separated by commas expected; see position 26

Warning: In /home/utkarsh/Dashboards/MyTests/NightlyMaster/ParaViewSuperbuild-Release/paraview/src/paraview/VTK/Filters/Core/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0x4ecc410): An error occurred when parsing the calculator's function. See previous errors.

Edit:
Versions I tried are 3.14 and 3.98

flotus1 August 6, 2013 09:30

Any Ideas?

If this is a RTFM-question please tell me, then I can continue to search for the answer myself.
Otherwise I would appreciate any hint that can guide me towards a solution.

wyldckat August 18, 2013 19:55

Hi Alex,

What you're looking for is the filter "Python Calculator" and then you can use the expression:
Code:

U/max(U)
Keep in mind that to use the "Python Calculator", you need a ParaView version built-in with Python.

Best regards,
Bruno

flotus1 August 29, 2013 03:28

Thank you so much.
It took me a while to figure out how to access single components of vectors, but now it works like a charm.

immortality September 3, 2013 10:23

Hi Alex
how could you do that?
@Bruno:
what python code should add in paraview?

flotus1 September 3, 2013 15:08

The wiki covers this topic:

http://www.paraview.org/Wiki/ParaVie...hon_Calculator

Quote:

A common use case in a calculator is to work on one component of an array. This can be accomplished with the following:

Normals[:, 0]
The zero here stands for the first component of the array

immortality September 3, 2013 15:33

what's its difference from ordinary calculator filter?is there anything on top of working with components of vectors?
and how can I have a field of area's of cells?

immortality September 3, 2013 15:59

I used this expression,but that error is shown.
Code:

area(inputs[2])
Code:

Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 146, in RequestData
NameError: name 'Normals' is not defined

Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 146, in RequestData
NameError: name 'Normals' is not defined

Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 146, in RequestData
NameError: name 'Normals' is not defined

Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 153, in RequestData
TypeError: area() takes exactly 1 argument (0 given)

Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 153, in RequestData
TypeError: area() takes exactly 1 argument (0 given)

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Filtering/vtkDataSet.cxx, line 405
vtkUnstructuredGrid (0x51fcb80): Point array result with 1 components, only has 37800 tuples but there are 77440 points


Traceback (most recent call last):
  File "<string>", line 19, in <module>
  File "<string>", line 153, in RequestData
IndexError: list index out of range


wyldckat September 7, 2013 11:51

Hi Ehsan,

Quote:

Originally Posted by immortality (Post 449648)
I used this expression,but that error is shown.
Code:

area(inputs[2])

If should be:
Code:

area(inputs[0])
Best regards,
Bruno

edit: Further discussion on this topic is being done here: http://www.cfd-online.com/Forums/par...alculator.html


All times are GMT -4. The time now is 18:47.