# Moving frame of reference with a moving object

**URL:** https://discourse.paraview.org/t/moving-frame-of-reference-with-a-moving-object/8110
**Category:** ParaView Support
**Created:** [October 1, 2021, 3:44pm UTC](https://discourse.paraview.org/t/moving-frame-of-reference-with-a-moving-object/8110 "2021-10-01T15:44:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![szn](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@szn](https://discourse.paraview.org/u/szn)
#### Post date: [October 1, 2021, 3:44pm UTC](https://discourse.paraview.org/t/moving-frame-of-reference-with-a-moving-object/8110/1 "2021-10-01T15:44:48Z")

</div>

Dear community,

I couldn’t find any similar topics in the forum, but I am rather new to Paraview so please bear with me if this has already been answered.

I am simulating a viscous flow front moving in the x direction (2D) in an eulerian frame of reference and would like to know if paraview has built-in functions to dynamically transform the frame of reference to follow the flow front (making it lagrangian).

So for example something that’s like origin(time)=[max\_position\_X(time),0,0], so that the flow is immobile to the observer.  
(Note that I am using a particle based method (SPH) so accessing the point of maximum X position shouldn’t be a big issue! )

I tried my hand at a programmable filter doing this but have been unsuccessful.

Thanks a lot in advance!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 4, 2021, 8:48am UTC](https://discourse.paraview.org/t/moving-frame-of-reference-with-a-moving-object/8110/2 "2021-10-04T08:48:36Z")

</div>

The only tool I can think of here would be the LagrangianParticleTracker that give tools for users to simulate this kind of things, however it requires some C++ coding.

Other than that, programmable filter would be the right way to go.

---

<div class="post-metadata">

### Author: ![szn](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@szn](https://discourse.paraview.org/u/szn)
#### Post date: [October 5, 2021, 8:05am UTC](https://discourse.paraview.org/t/moving-frame-of-reference-with-a-moving-object/8110/3 "2021-10-05T08:05:34Z")

</div>

Thank you for your reply, I figured out my issue was with my data point management, I think I was using the input/output formats incorrectly, as I had only learned how to use them for meshed situations.

The following code solved it :

max\_x=max(inputs[0].PointData[“coords”][:,0])  
output.Points[:,:]=[-max\_x,0,0]+inputs[0].PointData[“coords”][:,:]

Thanks a lot !  
Regards
