CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] Normalizing data (https://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

vidyadhar August 6, 2018 06:48

rescaling axes grid while displaying contours or vectors
 
Hi Bruno,


I want to show temperature contours in paraview.
But, I want to display re-scaled or non-dimensionalized axes.
I tried in using 'x axes custom labels' under 'Axes Grid'. But I am unsuccessful.

I request you to help me how to do this.


Thanks in advance!

wyldckat August 17, 2018 16:28

Quote:

Originally Posted by vidyadhar (Post 701646)
I want to show temperature contours in paraview.
But, I want to display re-scaled or non-dimensionalized axes.
I tried in using 'x axes custom labels' under 'Axes Grid'. But I am unsuccessful.

Quick answer: If I understood you correctly, the trick is fairly simple: apply the "Transform" filter to the "contours" entry in the "Pipeline Browser". The idea is that you need to physically apply the offset position to place the 3D object where you want it and then also apply scale factors to it. You may need to apply 2 "Transform" filters, one hanging to the other, so that you can first do one operation and then do the other one.

vidyadhar August 18, 2018 05:35

Thank you Bruno,


I could re-scale my coordinates using Data Scale option under Data Transform in the Axes Grid available under View(Render View).


Thanks for your reply too.


All times are GMT -4. The time now is 17:42.