CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

Normalizing data

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By flotus1
  • 1 Post By wyldckat
  • 1 Post By flotus1

Reply
 
LinkBack Thread Tools Display Modes
Old   August 5, 2013, 04:49
Unhappy Normalizing data
  #1
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
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
aylalisa likes this.

Last edited by flotus1; August 5, 2013 at 17:09.
flotus1 is offline   Reply With Quote

Old   August 6, 2013, 09:30
Default
  #2
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
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.
flotus1 is offline   Reply With Quote

Old   August 18, 2013, 19:55
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,307
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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 likes this.
wyldckat is online now   Reply With Quote

Old   August 29, 2013, 03:28
Default
  #4
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
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.
flotus1 is offline   Reply With Quote

Old   September 3, 2013, 10:23
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi Alex
how could you do that?
@Bruno:
what python code should add in paraview?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 3, 2013, 15:08
Default
  #6
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
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
wyldckat likes this.
flotus1 is offline   Reply With Quote

Old   September 3, 2013, 15:33
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
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?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 3, 2013, 15:59
Default
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
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
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 7, 2013, 11:51
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,307
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ehsan,

Quote:
Originally Posted by immortality View Post
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: how assign dataset in python calculator?

Last edited by wyldckat; September 7, 2013 at 12:07. Reason: see
wyldckat is online now   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 12 May 2, 2013 10:52
export data at nodes Meenu FLUENT 1 December 30, 2011 02:24
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
CGNS vs Tecplot Data Format LWhitson2 Main CFD Forum 3 July 1, 2011 13:50
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27


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