[ Paraview Tutorial 11 ] Automating Paraview Tasks with Python Script

Ғылым және технология

In this 11th tutorial for Paraview, I will teach you:
- How you can use Python within Paraview
- How to record a Python Macro
- How to use Paraview with Python with the GUI
- How to understand a simple Paraview Python Script
- And much more!
All the tutorials are available in this playlist:
• [Tuto 1] What is Parav...
If have some difficulties to install Python, watch this video:
feaforall.com/how-to-install-...
If you like those videos, please subscribe to my channel and like the video, that will help me a lot!
Thanks,
Cyprien

Пікірлер: 79

  • @krishnapatel8526
    @krishnapatel85264 жыл бұрын

    thanks, man I watched all the tutorials of ParaView along with practice in one sitting. Huge thanks, Bro.

  • @Sumit_Sharma_Music
    @Sumit_Sharma_Music3 жыл бұрын

    Thank you. One of the best video tutorials on paraview.

  • @CoolestFlame
    @CoolestFlame4 жыл бұрын

    The tutorial is very useful. I am using the scripting outside of GUI to automate the export of scenes for animation purpose. Thank you!

  • @sawyerpaccione2611
    @sawyerpaccione26113 жыл бұрын

    Incredibly Helpful, thank you so much! You just saved me so much time trying to figure out how to get the Paraview module working on my current python distribution!

  • @Jhonson013
    @Jhonson0133 жыл бұрын

    Thank you Cyprien for this tutorial, very nice. I watched it all

  • @Gabriel-bt3nd
    @Gabriel-bt3nd3 жыл бұрын

    Thanks a lot! I think this just revolutionized my Paraview workflow!

  • @dmoored4
    @dmoored43 жыл бұрын

    Thank you so much! I was ready to give up on trying this. I'm of the opinion that this should be the method in the documentation. This was so much easier and it actually worked!

  • @Sergejs_on_sound
    @Sergejs_on_sound6 ай бұрын

    Thank you, the best ParaView tutorial series that I found :)

  • @juanandresbreme9168
    @juanandresbreme91684 жыл бұрын

    Great video! Very clear explanation and super useful stuff! Thank you very much for this material. Cheers!

  • @bhoopendragupta4782
    @bhoopendragupta47822 жыл бұрын

    Great video series, easy to follow explanations. Thanks for your hard work.

  • @SomeTechGuy666
    @SomeTechGuy6662 жыл бұрын

    Top shelf content. Great video. I'm really happy to see this video. I "knew" paraview could be controlled by Python, but so much easier/nicer to learn it via a video.

  • @prasadadhav93
    @prasadadhav934 жыл бұрын

    Thanks for this video. I did not know we can record Marcos. This is really helpful since I usually apply similar kinds of filters to view my results.

  • @jordandenev5305
    @jordandenev53054 жыл бұрын

    Very helpful - if you are a novice, you really need such kinds of examples with detailed explanations. I wanted just to learn how one can use Paraview with Python. I got a very good idea now how it could function. Thank you for that beautifule video, Cyprien!

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Glad it helped Jordan!

  • @biaohuang7957
    @biaohuang79574 жыл бұрын

    Great work! Thanks very much.

  • @CryDima
    @CryDima3 жыл бұрын

    Thank you, this was a really useful tutorial!

  • @umedina98
    @umedina984 жыл бұрын

    Thanks man. Great video!

  • @user-ye9lf4bh7s
    @user-ye9lf4bh7s3 жыл бұрын

    Thanks a lot! As a beginner, it's really helpful to me.

  • @muditmehta8317
    @muditmehta83174 жыл бұрын

    Amazing videos! It really helped a lot

  • @akritidadwal8668
    @akritidadwal86684 жыл бұрын

    This is brilliant actually. You explain v nicely. Plz make another video to show how for loop can be used to get multiple planes and plot the data. Thanks

  • @jbbarre9733
    @jbbarre97333 жыл бұрын

    Really good video to start using Paraview with Python. thanks.

  • @christinecase6398
    @christinecase6398 Жыл бұрын

    Thank you Cyprien! This really helped me get my feet wet in Paraview!!

  • @mohamedelgamal6333
    @mohamedelgamal63334 жыл бұрын

    Thanks a lot for your huge effort

  • @santi_mendez
    @santi_mendez3 жыл бұрын

    Great tutorial! I learnt a lot. thankssss

  • @evertonribeiro7327
    @evertonribeiro73274 жыл бұрын

    Thank you! Great videos

  • @rohitsinghal938
    @rohitsinghal9383 жыл бұрын

    Thanks a lot ! Really helpful

  • @heike6872
    @heike68723 ай бұрын

    Great video! Thank you very much 🙂

  • @russellquadros2948
    @russellquadros29482 жыл бұрын

    Incredible!!!!! Thank you

  • @peeolo
    @peeolo4 жыл бұрын

    Python

  • @saheldey3848
    @saheldey38484 жыл бұрын

    Thanks a lot for this well descriptive video. It will push beginners like me to use Python shell inside Paraview. If possible, can you please make some videos for 3D vector field visualization where the same field lines are tracked continuously with time? Or some aspects of wavelet analysis? It would be really helpful then.

  • @syntheticperson
    @syntheticperson Жыл бұрын

    Very helpful. Thanks

  • @santoroccuzzo4720
    @santoroccuzzo47203 жыл бұрын

    very helpful, thanks :)

  • @EW-mb1ih
    @EW-mb1ih3 жыл бұрын

    thank you for your video!

  • @oppen637
    @oppen6374 жыл бұрын

    This is great. Can you perhaps also show some tricks for saving memory when dealing with large data?

  • @youjiezhang1007
    @youjiezhang10078 күн бұрын

    Thank you so much!

  • @MohammedBEffat
    @MohammedBEffat Жыл бұрын

    You are awesome!

  • @fabiocaruso1386
    @fabiocaruso13863 жыл бұрын

    Thank you man!

  • @santafelkin
    @santafelkin3 жыл бұрын

    Hello Cyprien. Excellent tutorials. My question is regarding to Wrap Svale filter. Could you advice me about how to applied? I have had problems applying this kind of filter. Some times seems that just it doesn't work (I don't see it active). Thanks for your time and help.

  • @pedromoresco93
    @pedromoresco932 жыл бұрын

    Great video! This process u showed is useful if u are using freecad also

  • @yongfeng8336
    @yongfeng83363 жыл бұрын

    Great!

  • @mehrdadkazemi8402
    @mehrdadkazemi84023 жыл бұрын

    Thanks a lot just one thing when I click on the start trace I get the error ""vtkSMTrace (0x561097d29a70): Failed to import paraview.smtrace module. Generic Warning: In /build/paraview-vlxewD/paraview-5.7.0/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx, line 162 Trace not started since required Python modules are missing."" I tried to install other packages of the Python module it doesn't solve how can I solve this error?

  • @april6146
    @april61463 жыл бұрын

    thank you very much for making this tutorial, actually, I would like to ask if you have used python code to make calculation between the values, for example, calculating the principal stresses with the stress tensor, and shown eventually as a function of each node and time.

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    I haven’t done any video about that (yet) but it’s totally doable. You can also have a look at a python module called pyvista. It’s easy to couple that with Jupyter notebook to do some calculations of the tensor values. Good luck

  • @Buenofresser
    @Buenofresser Жыл бұрын

    Hi, great video! Thanks to you I know how to utilize Python. Maybe you can help me with that: I am trying to load a state with a specific file (selectinbg choose file name during load), but with the command LoadState(saved_state_path, LoadStateDataFileOptions='Choose File Names', filenames='D:\Simulations\out_97.xmf') I dont get the respective picture, but the initial one, as if I only load the state without specifying the file.

  • @brunoquezada1486
    @brunoquezada14863 жыл бұрын

    Thanks for the video I want to apply a Macro to a lot of different files which have the same structure but different names, so when I save a Macro and I try to use it with other files it won't work well because the names of the variables changes. Do yo know how can I modify the Macro in order to work among other files, given that they have the same structure?

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    Sure, you have some ways in python to look for files in a folder or with a certain name, that way it will automatically use the right file. Try to os.walk() function for example

  • @user-me8hv1jj1q
    @user-me8hv1jj1q2 жыл бұрын

    Thanks a lot for your work! What is a correct way to execute some external python script from disk? I use line "execfile(‘full_path/script.py’) " in the "script" window , but see ‘execfile is not found’. Where is a mistake?

  • @Feaforall

    @Feaforall

    2 жыл бұрын

    For a normal python installation you can just run « python full_path/script.py » in the terminal. I don’t know what is « execfile ». For paraview python script you will have to use the special python executable pvpython like I show in the video

  • @user-me8hv1jj1q

    @user-me8hv1jj1q

    2 жыл бұрын

    @@Feaforall Dear Cyprien! Thank you for your answer. but I use pvpython and write python script in window "script" using copy-paste procedure. It works, At that moment paraview prompts to use "execfile(‘full_path/script.py’) "! Thatis the problem.....

  • @noahzhang892
    @noahzhang8923 жыл бұрын

    Cyprien, this is a great introductory video on the topic. I have got one question. How can we enable the AutoMPI in pvpython or is there any way to run the .py file in parallel?

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    You have another executable special just to run the bigger parallel scripts... pvbatch? (From memory)

  • @noahzhang892

    @noahzhang892

    3 жыл бұрын

    @@Feaforall thanks.

  • @lucascuisset2174
    @lucascuisset21744 жыл бұрын

    Hi Cyprien, thank you for the tutorial ! I added the path for pvpython as you said, but then when I want to import all from paraview.simple in spyder (installed with anaconda) it doesn't work, can you help me please ?

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Probably because spyder is not using pvpython but it’s own python version. I am sure spyder has its own environment variable to set the python distribution used, but I am not familiar enough with it to tell you which one. Check the documentation, there is surely the answer somewhere.

  • @lucascuisset2174

    @lucascuisset2174

    4 жыл бұрын

    @@Feaforall finaly I used subprocess.run to execute my python script with pvpython.exe from spyder. Thank you for your answer :)

  • @hemanthHK45
    @hemanthHK454 жыл бұрын

    Hello Cyprien Rusu, Thank you for letting us learn more and more stuff from you..... I have a question...... Can we collect data of velocity at each mesh point in Paraview / OpenFoam! and if yes how! Thank you, Will wait for your reply

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Hi Hemanth, yes, you can. I think you need to watch this video: [Paraview Tutorial 4] How to display node and elements data in Paraview

  • @hemanthHK45

    @hemanthHK45

    4 жыл бұрын

    @@Feaforall Hello Cyprien Rusu, Thank you so much, I got the results..... Just one more doubt i have done Plot over time and imported to csv format, I am getting Temperature and Velocity as Avg, Max and min.... Is ti possible to get normal original value at each time step..... Thank you in advance.

  • @benjackson9541
    @benjackson95414 жыл бұрын

    thank you for the tutorial. How would you run the python script file from pvpython, assume that is possible?

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Go in terminal and enter “pvpython script.py” (pvpython has to be in your path and you must be located in the directory where your script is)

  • @benjackson9541

    @benjackson9541

    4 жыл бұрын

    @@Feaforall thank you!

  • @PavanYadav-lf5bu
    @PavanYadav-lf5bu4 жыл бұрын

    Can we perform mathematical operation like root mean square of field variable over the entire domain and visualize in paraFoam ? Can Python script help in any manner ?

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Sure, you just have to use the right filter (the calculator filter can do that, watch my video about paraview filters to see how it works). Then you can record the python macro and do it within a python script.

  • @sop980
    @sop9804 жыл бұрын

    Great help.. please keep up making more advanced topic. I WAS LOOKING FOR MAKING AN ANIMATED 3D MESH TO EXPORT FROM PARAVIEW TO RUN INSIDE A GAME ENGINE. If you can please teach us a way to do so will be a great help. I WAS LOOKING FOR EXPORTING any type of result data as mesh or point cloud volume to game engine. I need 3D animated mesh not a static mesh. Is it possible? Also is I tried to export fluid simulation stream line result into. csv format. Which i tried to reopen in 3ds max in cfd data import option. But the result does not look same as the paraview. If you could show a pipeline to import the animated result into game engine would be a great help.. Thanks a bunch in advanced..

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Hey Jukka, paraview is a software for scientifics and engineers. If you are looking to create game graphics and animations, you should look into Maya or Blender (open source). Paraview is not for for that purpose.

  • @nguyenkhoa9201
    @nguyenkhoa92013 жыл бұрын

    Hi sir, is it possible to execute python script with paraFoam (paraview but with openfoam case) directly?

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    Yes, of course. ParaFoam is just paraview with some added functions

  • @nguyenkhoa9201

    @nguyenkhoa9201

    3 жыл бұрын

    Sorry, since I'm new to this. May I ask one more question? When I use paraFoam, there will be an existent built-in (openFoam case) (which using paraview is not). Hence, if I want to execute code through pvpython then will I have to import that built-in or the trace-back can also trace that existent built-in?

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    Sure, just double check that your parafoam has been compiled with python (if you have the python console in it, it should be)

  • @kennydoritos
    @kennydoritos4 жыл бұрын

    is it possible to run the python macro in the terminal without opening the GUI?

  • @Feaforall

    @Feaforall

    4 жыл бұрын

    Yes, I am sure I talk about that in the video... did you watched all of it?

  • @kennydoritos

    @kennydoritos

    4 жыл бұрын

    ​@@Feaforall Yep i did... you ran pvpython and the 'from paraview.simple import *' line (which is the first line of the script). but i later figured that pvpython can is essentially the same as python. so i can run 'pvpython script.py' where script.py is the py macro generated in paraview

  • @engineeringarts4509
    @engineeringarts45093 жыл бұрын

    I did the same procedures as you mentioned, but dont know why it doesn't work in powershell, while works well in the python IDLE interface.

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    You mean it works in the Python console of paraview, but not powershell? That’s probably because of the environment. If you use the pvpython executable of paraview, it should work in powershell, but if you use another python distribution, then it will not recognize paraview if you don’t import the correct modules.

  • @engineeringarts4509

    @engineeringarts4509

    3 жыл бұрын

    @@Feaforall No, python can be worked on different interfaces - e.g. on powershell / on IDLE (just the interfaces for python, NOT for paraview). After linking up paraview to python, you work on powershell while I work on IDLE, both are working by calling in paraview with "from paraview.simple import *". But, I don't know why I can only work on IDLE, but no powershell.

  • @engineeringarts4509

    @engineeringarts4509

    3 жыл бұрын

    @@Feaforall By the way, thanks for your movie, very useful!!!

  • @Feaforall

    @Feaforall

    3 жыл бұрын

    @@engineeringarts4509 have you checked if your IDLE and the python distribution you are calling from powershell are the same python distribution? For me using “from paraview.simple import *” directly with python often does not work because some distributions are not compatible with the modules paraview is calling. That’s why I talk in the video about using the pvpython distribution provided with paraview to read the paraview/python code (this one has been tested and it is sure to work)

  • @engineeringarts4509

    @engineeringarts4509

    3 жыл бұрын

    @@Feaforall i see your point. But, can you get me a pointer how to ensure the same distribution of paraview as to the python? I'm out of context on this point from the video, sorry about that.

Келесі