Elmer Integration (GSoC) - Activity Log

it is starting to get interesting … We are really getting into the integration …

Another week another video. The code used for the following video is already avaliable in the elmer_integration branch of the repository https://github.com/drhooves/FreeCAD.git.

Elmer in the FEM workbench now supports all three avaliable analysis types: static, frequency and thermomech. With thermo-mechanical simulations there are some inconsistencies in the results that still need to be checked/fixed. Following constraint types are supported atm: Fixed, Force, Displacement, SelfWeight, InitialTemperature and Temperature. Support for multiple materials is still missing as well as a good solution for post-processing. The video quickely goes through four examples covering all of the supported stuff.

https://ia601501.us.archive.org/31/items/elmerintegration_phase2/elmerintegration_phase2.webm

I also did some work on error reporting. When using elmer a new dialog is used that displays everything wrong with the analysis at once. It distinguishes between errors, warnings and infos.
In an extreme case this looks like that:
error_dialog.png

Good work!

As elmer exports VTK files, why don’t you simply load them into freecad and use the VTK postprocessing? That should work out of the box. And if not I would think puting some work in making the vtk file importable into freecad is worth th eeffort, as this post processing method is the most advanced and most extensible one and should IMHO be utilized more
(well of course I think so as I’m the author of this pice of code :wink: )

m42kus and I tried to elaborate some benchmark models for easier comparison between calculix and Elmer results.
Attached you find your first attempt. The results for static analysis, eigenfrequency and self-weight already be compared between Calculix, Elmer and analytics in the spreadsheet while the thermo-mech model gives wrong results in Elmer.
Benchmark_calculix_Elmer_FC0p17_v0p03_thermomech_fails.fcstd (109 KB)
Screenshot from 2017-06-26 16-47-50.png
I will update this file as soon as we have a solution for the thermomech. prob. or some more models.
BR,
HoWil

I did a quick test and tried to load one of our vtk files but even when selecting to import the results only the mesh is shown. I will post such file later on.

Good to know :wink:
So you can support us on this front? m42kus will concentrate on all elmer related issues but to deploy it’s full potential and make it easy to use we will for sure need some support on the pre - and post -processing sides.
Br,
Howil

vtk import seam broken again :frowning: We fixed it a few month ago (may be 3 o 4). I has been working, for sure …

If needed for testing… a .vtu result file.
case0001.vtu.zip (250 KB)

I usually test with vtk.

The following works …

  • load FEM3D example export result object into vtk, open vtk in ParaView, import vtk back into FreeCAD
  • load FEM2D example export result object into vtk, open vtk in ParaView, import vtk back into FreeCAD

OS: Debian GNU/Linux 8.8 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11433 (Git)
Build type: Debug
Branch: master
Hash: 3ada1416bad6518f3ee69bbcf7e11bbcbb2ff7ee
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.0.0

@HoWil:
Could you try a few examples exported from FreeCAD than in ParaView and back. This should work.

Would you provide the CalculiX Cantilever of the 3D FEM example as Elemer vtk result?



Just looked at the source and notized that the variable names that are imported are hardcoded to “Displacement” and “Temperature”. ElmerSolver names them “displacement” and 'temperature". I tried to change that but it seems like ElmerSolver ignores case… i already posted a question on elmer forum: http://www.elmerfem.org/forum/viewtopic.php?f=3&t=4541&sid=65c6672ad326d577bc1b85b5fbdbea8e . However, would you (bernd or ickby) mind supporting both variants?

Edit: If it wasn’t clear: After I changed them from “Displacement” and “Temperature” to “displacement” and “temperature” in the FreeCAD source the import worked :wink:

There is also the problem that the imported result object needs its own mesh (I’m guessing this is because of node numbering?). Also it’s quite a pain to add support for additional variables. I think in the long run side stepping the result object completely and only using generic vtk result objects would be the best way to go. What do you (everyone :wink:) think on that issue?

For sure we should support any case. Someone could even try to import a vtk created with some totally different software.

@markus:
Would it be possible for you to make the appropriate changes in FreeCAD source code ?

I just checked. The VTK postprocessing objects are very much able to read all the available vtk files. However, file import was changed to not create a Vtk postprocessing object but a Mesh and result object. That is strange and should IMHO be changed back. Th eVtkPostprocessing is by default able to handle every result type that is available within the vtk file.

Anyway, for automatic loading of results you can use FemPostPipeline read functions to circumvent the freecad load logic:
https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Fem/App/FemPostPipeline.h#L61

That was what I invisioned in the beginning. There are however two issues that need some work:

  1. The normal viewprovider has been extended for all mesh types and I think also stuff like picking, this would need to be adopted
  2. The default postprocess dialog may be redone for the vtk tools as this is a fast and convienient way of looking at things.

Annother nice property of the vtk tools is that they work on the vtkDataStructure, which is also used underneath SMESH. Hence with some clever coding it could be possible to use all the VTK postprocessing tools on the Mesh data structure. Imagine clipping while trying to create a good mesh: highly valuable!

the CFD OpenFoam guys did some changes at vtk.

I totally agree with you guys (ickby and m42kus), but I see two problems. Someone needs to do the work and the main problem, someone needs to maintain the code day by day in conjunction with pull requests and so on.

There are a few people involved in FEM already, means regulary changes come in. I try to get rid of all bugs and problems in the Python FEM code but my C++ knowledge is to small to maintain the C++ FEM code.

But anyway we should go for it if someone is willing to do the work!

bernd

in the regard of groups …
https://forum.freecadweb.org/viewtopic.php?f=18&t=21029&start=40#p176562
efb87dc1
084e163


in the regard of selecting inner faces:
https://forum.freecadweb.org/viewtopic.php?f=3&t=18776#p146374

Thanks very much for the tip. This is what I’m going to use. My plan is to use the pipeline the in the same way calculix uses the result object (meaning I will include it in the analysis as a member). Do you see any problems with this?

Thanks for the references.

Quick explanation for others: bernd, hoWil and I talked a lot about what should be done in the next two months yesterday. A big point of the discussion was meshing. We also taked about how to select hidden faces and much more. On monday I’m going to make a post about what has been discussed and decided.

@Markus:

In the regard of SMesh these posts might be interesting as well:
https://forum.freecadweb.org/viewtopic.php?f=18&t=22900&start=10#p179140
https://forum.freecadweb.org/viewtopic.php?f=18&t=22900&start=20#p179141

as said I gone try to get some contact in the regard of Smesh.

Thaks again, that would be awesome.

Last week bernd, HoWil and I sat down and laid out a detailed plan for the next month. One big point of the discussion were problems that be solved before I can start phase 3 (multiphysics).

This list is going to keep me occupied till next week. Im going to post regular updates in the next days of course :wink:. If you belief that there is another mayor issue that can’t wait up until phase 3 is finished please let me know.

Hi again,
One big point which I forgot to mention: bernd and I are preparing a pull request to get the code of phase 2 into master :smiley:. This will hopefully be done before the end of next week.