Feature #5966 - Export transient FEM results to vtk/vtu for ParaView

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Luftschraube
Posts: 4
Joined: Thu Jul 11, 2019 2:12 pm
Location: Halle (Saale)

Feature #5966 - Export transient FEM results to vtk/vtu for ParaView

Post by Luftschraube »

Hi everybody,

I'm using FreeCAD for almost two years now for CAD and FEM applications. First of all a big thank you to all the developers who dedicate their time to improving the software! Keep the good work going ;)

To give a little back to the community, I would like to share my macro with you: I used to perform quite a lot FEM analyses with FreeCAD, however, I prefer to export the results to VTK and then to visualise them using ParaView, which has a lot more options for that. Unfortunately, FreeCAD can only export one VTK file at a time, so I came up with a little macro that I use for transient analyses. The macro exports the FEM results and also writes a VTU file in the same folder. The VTU file can be simply opened in ParaView, and that way you directly have the transient results with the correct timestamps.

Tested with FreeCAD 0.18.16117 and ParaView 5.6.0 on Windows 10. Doesn't work with ä/ö/ü/ß in the file path or name (I think that's still an issue with the FEM workbench, too?).

Best Regards,
Thomas
Attachments
metal_rod_example.FCStd
(155.84 KiB) Downloaded 97 times
ExportMultipleVTK_190711a.FCMacro
(2.75 KiB) Downloaded 115 times
Last edited by Kunda1 on Sat Dec 03, 2022 4:37 pm, edited 1 time in total.
Reason: Added GH ticket number to thread title
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Export transient FEM results to vtk/vtu for ParaView

Post by mario52 »

hi welcome

thanks for sharing your macro

if you want i create (or create your account How to get wiki editing permissions) one page for the wiki in the section Fem (create your ToolBar icon)

mario
Last edited by mario52 on Fri Jul 12, 2019 3:34 pm, edited 1 time in total.
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Export transient FEM results to vtk/vtu for ParaView

Post by Kunda1 »

Luftschraube wrote: Thu Jul 11, 2019 2:41 pm
Cool, can you make some screenshots or screencast demonstrating the macro ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Export transient FEM results to vtk/vtu for ParaView

Post by bernd »

wow, someone who uses FreeCAD FEM for two years and never had a question FEM in FreeCAD :shock: FreeCAD FEM seams to get more and more stable and userfriendly :D

Thanks for sharing. What you could do too is make a feature report on mantis assign it to me and make a link to this topic. IMHO it is worth to integrating this into main FreeCAD FEM. But ATM I am overwhelmed with other stuff.

cheers bernd

PS hopefully it will not take another two years to your second post :mrgreen:
Luftschraube
Posts: 4
Joined: Thu Jul 11, 2019 2:12 pm
Location: Halle (Saale)

Re: Export transient FEM results to vtk/vtu for ParaView

Post by Luftschraube »

Hi everyone,

glad you like the macro and I would certainly like too see it becoming part of the FEM workbench :) I'm out of office the next two weeks, but when I get back I'll be happy to add something to the wiki and do the feature report.

Best regards,
Thomas
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Export transient FEM results to vtk/vtu for ParaView

Post by Kunda1 »

I created issue #4060 JIC.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Export transient FEM results to vtk/vtu for ParaView

Post by bernd »

Luftschraube wrote: Wed Jul 17, 2019 2:39 pm I'm out of office the next two weeks,
happy holidays
Luftschraube
Posts: 4
Joined: Thu Jul 11, 2019 2:12 pm
Location: Halle (Saale)

Re: Export transient FEM results to vtk/vtu for ParaView

Post by Luftschraube »

Hi everyone,
sorry it took a longer time - I should have known that I have to catch up with a lot of work after the holidays :D I just asked the wiki admins to create an account for me to write a short how-to - I'll let you know when it's there...
Best,
Thomas
Luftschraube
Posts: 4
Joined: Thu Jul 11, 2019 2:12 pm
Location: Halle (Saale)

Re: Export transient FEM results to vtk/vtu for ParaView

Post by Luftschraube »

Hi,

the tutorial is now in the wiki:
https://www.freecadweb.org/wiki/Transient_FEM_analysis
https://www.freecadweb.org/wiki/Macro_e ... EM_results

Hope it helps!

Edit: I'd like to add the tutorial to the FEM workbench page https://www.freecadweb.org/wiki/FEM_Module#Tutorials - in the source code I see some numbers after the "T". Are the tutorials numbered in any way? I'm not (yet) used to Wiki editing at all ;)

Best,
Thomas
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Export transient FEM results to vtk/vtu for ParaView

Post by mario52 »

hi

good now the toolbar icon (same name of the macro (see)) and copy the complete link of the icon in section "Download" all info write in the section Description is visible in the AddonManager (maybe adding the creator name ?)

you must also adding the macro link in the page Macros_recipes (done) AddonManager load the macro list in this page
Luftschraube wrote: Fri Aug 30, 2019 12:20 pm Edit: I'd like to add the tutorial to the FEM workbench page https://www.freecadweb.org/wiki/FEM_Module#Tutorials - in the source code I see some numbers after the "T". Are the tutorials numbered in any way? I'm not (yet) used to Wiki editing at all ;)
<!--T:xx--> this code is created by the translate system "not touch" you adding your comment with one line space by paragraph

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply