CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Pvpython find centroid dataset

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2014, 07:52
Default Pvpython find centroid dataset
  #1
New Member
 
Anonymous
Join Date: Aug 2013
Location: Europe
Posts: 24
Rep Power: 13
maero21 is on a distinguished road
Dear Paraview users,

I am working on a script to automatically generate pictures from my OpenFOAM cases. In order for it to be fully automated, I want to know the centroid of my dataset in order to focus the camera on it.
Is there any way to find that? Or perhaps a method to convert the VTK data to a numpy array and then use mean?

Thanks!
maero21 is offline   Reply With Quote

Old   February 16, 2014, 13:32
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings maero21,

I believe what you are looking for is a combination of the following:
  1. Use the "Integrate Variables" filter to calculate the centroid. It will be the array "Points" that gives you the centroid.
  2. On this post: Get data from Calculator filter in python script post #6 - you can see how to get access to this value.
  3. On this post: http://www.cfd-online.com/Forums/ope...tml#post446333 post #6 - you can see how to update values with each time change.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply

Tags
pvpython vtk openfoam


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a code parallel? Bruno Machado Fluent UDF and Scheme Programming 15 May 27, 2016 10:18
[General] pvpython can't find numpy seanread ParaView 0 April 4, 2016 22:40
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 Attesz OpenFOAM Installation 45 January 13, 2012 13:38
Problem Building OF on Centos cluster (no admin rights) CKH OpenFOAM Installation 5 November 13, 2011 07:32


All times are GMT -4. The time now is 07:39.