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

[General] How to move a slice following the particle coordinates (defined in a text file)?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 6, 2014, 12:08
Default How to move a slice following the particle coordinates (defined in a text file)?
  #1
New Member
 
Bruno Guerrero
Join Date: Aug 2014
Posts: 4
Rep Power: 12
Bombacar is on a distinguished road
Hi everyone!

I would like to know how to define the origin property of a "slice filter" using a specific sphere's center (with its coordinates)?.

Until now, I am able to slice with the "slice filter" and I fix the values manually. But I would like a way to make it automatically. The goal is try to create an animation that only shows the intersection plane (that it moves with the choosen particle).

Some idea? Thanks in advance.
Bombacar is offline   Reply With Quote

Old   March 29, 2015, 12:10
Default
  #2
Member
 
Join Date: Aug 2012
Posts: 68
Blog Entries: 1
Rep Power: 14
Nucleophobe is on a distinguished road
Did you ever figure this our Bomcar? I'm trying to do the same thing.

You can do it with a programmable filter, but the details are a bit tricky. Here's some example code that does something similar:
http://permalink.gmane.org/gmane.com...view.user/6807

I think the code above is supposed to create a slice through the center of an object independent of the object's location. So, if the object moves, the slice moves. We want to do the same thing, but the slice should be applied to the volume field data rather than the object itself.

Anyway, hope you were able to figure something out. I'll post back if I get results.
-Nuc

Edit:
For my case, this script works. I am using Lagrangian particle cloud data to drive the position of a slice that cuts through the fluid domain. I apply the "Programmable Filter" to the Lagrangian data and run:
Code:
from paraview import simple
input0=inputs[0]
x = input0.GetPoints()[0][0]._Arrays[0]
y = input0.GetPoints()[0][1]._Arrays[0]
z = input0.GetPoints()[0][2]._Arrays[0]
print (x, y, z)
slice1 = simple.FindSource('Slice1')
slice1.SliceType.Origin = [x, y, z]
where 'Slice1' is the name of the slice that I am animating.

The only problem is the script fails to run in client-server mode, giving me the error:
Quote:
TypeError: 'NoneType' object is not subscriptable
which basically means that the "Programmable Filter" isn't receiving any data... Anyone know how to fix this?

Last edited by Nucleophobe; March 29, 2015 at 18:59. Reason: Found a (partial) solution
Nucleophobe is offline   Reply With Quote

Reply

Tags
animation, paraview, slice


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
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 towanda OpenFOAM Community Contributions 6 September 5, 2015 22:03
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


All times are GMT -4. The time now is 09:51.