Postprocessing

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Postprocessing

Post by ickby »

Hello,

I'm really impressed by the work you guys currently do on the FEM workbench, such fast progress is awesome! So I thought a bit about possibilities to help out on this.

The current postprocessing (displacement and stress) works with a custom coin3d implementation, but honestly creating all postprocessing like this directly in coin is a tremendous amount of work. The de facto standard toolkit for this in the open source world is vtk (this is what powers paraview). It offers tremendous amounts of data processing power and visualisation capabilities. So why not try to use it for freecad, the philosophy here is reusing of existing stuff. So I came up with a way to use vtk for data processing while doing the visualisation in coin 3d:
The same dataset with multiple filters. I did not manage to color the hedehog and the streamlines correctly, it's my first day in vtk...
The same dataset with multiple filters. I did not manage to color the hedehog and the streamlines correctly, it's my first day in vtk...
post.png (308.36 KiB) Viewed 5545 times
Currently it is a proof of concept, but maybe you are interested? I do not have the time to work on the postprocessing infrastructure myself, but I can provide the vtk render integration. I think I can do a pretty efficient vtk-coin mapping for most visualization types.

The pros:
1. Tremendous possibilities with little effort for postprocessing
2. Unified postprocessing: all tools work with 1D, 2D and 3D data
2. The vtk filter approach can be utilized in freecad the same way as in paraview and hence offers a universal postprocessing tool (think thermal, electromagnetics, fluid...)
3. The filter approach would work very well with our document object structure (compare paraview)
4. State of the art technology used instead of self implemented hard to maintain code
5. Importer and exporter for numerous formats

The cons:
1. Not all vtk visualisation modes can be easily mapped to coin3d, but the most important ones (PolyData) works very well
2. There is overhead n the vtk - coin mapping. But IMHO the speed gain we get from the professional vtk data processing capabilities will outnumber the little transfer overhead

So let me know what you think and if this is useful for you, than we can decide if it is worth to work longer on the integration of vtk.

Stefan
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Postprocessing

Post by drei »

This is quite impressive and it seems it could be of great help to the workbench. I'm not actively working on FreeCAD so my opinion might not be useful, but thinking on the KISS philosophy it would be a great jump forward in postprocessing work.
Need help? Feel free to ask, but please read the guidelines first
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Postprocessing

Post by wmayer »

So let me know what you think and if this is useful for you, than we can decide if it is worth to work longer on the integration of vtk.
I don't know much about FEM and vtk. But when you say it's the de-facto standard in FEM then it probably makes sense to use it therefore.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Postprocessing

Post by NormandC »

VTK is in the Debian (hence Ubuntu) repositories. That's mostly the only thing I care about: not to have to create new debian packages for the PPA! ;)

It also seems to be included in the Fedora and Open Suse package databases. This is good.

But trying to install the libvtk6 package on Ubuntu 14.04 adds 147MB of files (decompressed) to the system! I'm OK with that, but this needs to be considered as optional install, for those who do not need FEM.

Might not that also make the Windows installer bigger?
wmayer wrote:I don't know much about FEM and vtk.
VTK is developed by Kitware, which also develops CMake and ParaView. http://en.wikipedia.org/wiki/VTK
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Postprocessing

Post by wmayer »

But trying to install the libvtk6 package on Ubuntu 14.04 adds 147MB of files (decompressed) to the system! I'm OK with that, but this needs to be considered as optional install, for those who do not need FEM.
Then we maybe should pick up the idea to split the freecad package into smaller ones. So, we can separate modules into their own package which needs heavy-weighted libraries.issue #857
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Postprocessing

Post by NormandC »

Good idea, but maybe that will be needed for Windows and Mac as well? As plugins.

With a freecad-fem package on Debian/Ubuntu, then we could make calculix-ccx a dependency.
User avatar
TT-RS
Posts: 70
Joined: Fri Oct 24, 2014 9:19 pm

Re: Postprocessing

Post by TT-RS »

wmayer wrote:
So let me know what you think and if this is useful for you, than we can decide if it is worth to work longer on the integration of vtk.
I don't know much about FEM and vtk. But when you say it's the de-facto standard in FEM then it probably makes sense to use it therefore.

VTK library and ParaView software are universal technology / solutions, not specific only to CAE, but this visualization engine was made for every app which has something common with data manipulation.

I don't know many FEM apps which use VTK for postprocessing (I remember only SALOME MECA), but it is heavily used in other visualization environments (I think mostly medical imaging with conjuction with ITK). In CFD it is used in OpenFoam (ParaFoam is special version of ParaView).

You can use Calculix results in FC+VTK easily with this:

http://sourceforge.net/projects/exodusii/ - Exodus II - file format made mainly for FEM data

Here:

http://homepages.wmich.edu/~pjm8969/res ... as-dl.html

is example how to use it with Calculix.

( another interesting thing on the last website I mentioned are CUDA-enabled solvers which allow to make calculations on GPU(s) ).
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Postprocessing

Post by ickby »

But trying to install the libvtk6 package on Ubuntu 14.04 adds 147MB of files (decompressed) to the system!
Good idea checking that, I did not know it is that much! This is definitly something to consider.
I don't know many FEM apps which use VTK for postprocessing
That is because AFAIK most of them write their own postprcessing like gmsh. This is of course an option for freecad too, IMHO however way more work. I do not know of many annother open soruce c++ library next to vtk which can be used for fem postprocessing, opendx comes to mind but looks rather old (only know the homepage). But having Salome and Paraview use it does already account for a large amount of the open source post processing world. (and most solvers do export vtk format)

It is true that we would only need a subset of vtk abilities and using it only for processing and not for rendering reduces the reused amount further. But I still have the feeling that using its data structures and processing / filter abilities would highly benefit the rapid postprocessing development.

But again, that is only a offer to the people actually programming the postprocessing stuff in FreeCAD, I won't do it. If they want to go a different route it would be fine.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Postprocessing

Post by bernd »

Stefan, thanks for pointing to vtk and paraview. I had heard about them not more. Have been reading about them on the weekend. Seams for sure a way we need to check if it's worth to go! And we for sure need more and better postprossesing!!

Mhh I still have a few things in mind for preprossesing (mainly support for more than one material (short term) and beam and shell element FEM (long term)). As soon as these things are gone work with FEM I will be really interested in better postprocessing for FEMWB!!!

@TT-RS: Thanks for sharing the links
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Postprocessing

Post by PrzemoF »

InVesalius is uses python/VTK
http://www.cti.gov.br/invesalius/
The source code is here: https://github.com/invesalius/invesalius3
Post Reply