Topology optimization
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Topology optimization
For a longer time I was working on a topology optimization script using CalculiX. I have uploaded the project to the GitHub
https://github.com/fandaL/beso
so if someone is interested, you can follow description there and try it. Current state is that I tested it on very simple examples; theoretically it should work also on more complex models, it needs slightly more FEM understanding, more model preparation, and much more computational power. I'm slowly learning programming on this so the quality of the code is corresponding, therefore critical comments are welcomed although I might not be able to correct everything. There is also still a lot of basic stuff to implement and connect to a FreeCAD functionality.
And for picture readers Transparent material is initial volume (filled by a mesh) and depicted mesh is final result after removal by algorithm. It is a proposal of material distribution in a lever loaded by the force on the right side, with horizontal fix on the top, and constrained displacement in radial and axial direction on the middle ring (so it can turn around the middle ring centre)
https://github.com/fandaL/beso
so if someone is interested, you can follow description there and try it. Current state is that I tested it on very simple examples; theoretically it should work also on more complex models, it needs slightly more FEM understanding, more model preparation, and much more computational power. I'm slowly learning programming on this so the quality of the code is corresponding, therefore critical comments are welcomed although I might not be able to correct everything. There is also still a lot of basic stuff to implement and connect to a FreeCAD functionality.
And for picture readers Transparent material is initial volume (filled by a mesh) and depicted mesh is final result after removal by algorithm. It is a proposal of material distribution in a lever loaded by the force on the right side, with horizontal fix on the top, and constrained displacement in radial and axial direction on the middle ring (so it can turn around the middle ring centre)
- Pauvres_honteux
- Posts: 728
- Joined: Sun Feb 16, 2014 12:05 am
- Location: Far side of the moon
Re: Topology optimization
fandaL, you're my hero!
I never thought I would experience an open source topology optimizer in my lifetime! I'm all cock a-hoop over this!!!
Now I've just got a couple of questions; you mention the possibility it uses 1:st order elements for calculations. If so do you think it's possible in some future to make use of 2:nd order elements? Is this somehow a limitation of Calculix?
Clock cycles: would the calculations run faster if one used a different programming language? Or would it be possible to significantly optimize the code in some way once one get familiar with the code? I'm primarely thinking of code which runs over and over again.
I never thought I would experience an open source topology optimizer in my lifetime! I'm all cock a-hoop over this!!!
Now I've just got a couple of questions; you mention the possibility it uses 1:st order elements for calculations. If so do you think it's possible in some future to make use of 2:nd order elements? Is this somehow a limitation of Calculix?
Clock cycles: would the calculations run faster if one used a different programming language? Or would it be possible to significantly optimize the code in some way once one get familiar with the code? I'm primarely thinking of code which runs over and over again.
Re: Topology optimization
This looks awesome, even 2D and documantation allrady ! Is it an research project ?fandaL wrote:For a longer time I was working on a topology optimization script using CalculiX. I have uploaded the project to the GitHub
https://github.com/fandaL/beso
FEM on FreeCAD is really growing
Re: Topology optimization
At the moment it is possible to use 1st or 2nd order triangle and 1st or 2nd order tetrahedron. Script computes centres of gravity and volume of those elements. At the moment these calculations are with certain inaccuracy for 2nd order elements because there are used the same formulas as for 1st order elements....you mention the possibility it uses 1:st order elements for calculations. If so do you think it's possible in some future to make use of 2:nd order elements?
CalxuliX can calculate volumes (may be I will use them), but I didn't found CalculiX to output centres of gravity or, even better, position of integration points. I plan to ask someone about integration over an element shape function which could solve these problems.Is this somehow a limitation of Calculix?
Clock cycles: would the calculations run faster if one used a different programming language? Or would it be possible to significantly optimize the code in some way once one get familiar with the code? I'm primarely thinking of code which runs over and over again.
Most of the time CalculiX is running a classical FEM analysis in each iteration. Commercial topology optimizers use slightly different method (SIMP), which pure form is better from the mathematical point of view – there is also an educational code available [1], not such a monster in compare to my trials :-]. I decided for BESO method because I found an explanation which I understood better at that time.
Speed of convergence can be controlled by an input parameter “evolutionary_volume_ratio”, but if you set too big value, you get result of poorer quality. Some potential to get it faster is in the more complex method or their combination, I should read more.
Hexaheral or pentahedral mesh have also theirs potential.
Not officially. Partially I worked on it during some school tasks, but it will not be possible later, not in that way, since I already passed all my courses.Is it an research project ?
[1] http://www.topopt.dtu.dk/files/matlab.pdf
Re: Topology optimization
ha, awesome, we are really not far behind, since it was just days ago since i have read that autodesk was adding something like this to inventor
https://revitstructureblog.wordpress.co ... nnections/
PS: as i understand this is something similar right? not sure since this is not really what i normally work with
https://revitstructureblog.wordpress.co ... nnections/
PS: as i understand this is something similar right? not sure since this is not really what i normally work with
Re: Topology optimization
Yes. Same workflow.as i understand this is something similar right?
In case of sheetmetal part like this, I would prefer shell mesh especially for the rough optimization. Or maybe 3d mesh was on less mouse clicks.
Re: Topology optimization
There is another OpenSource topology optimization software available. Just found http://en.z88.de/z88arion/ but did not test it.
BTW: Z88 will be available as solver for FreeCAD FEM soon.
BTW: Z88 will be available as solver for FreeCAD FEM soon.
Re: Topology optimization
Seems good. They are farther , which demotivate me a little bit in continuing my work . I should reevaluate my motivation.There is another OpenSource topology optimization software available. Just found http://en.z88.de/z88arion/ but did not test it.
Re: Topology optimization
I have written my own optimizer which is open source. (in python)
In this case i use calculiX for solving the physical equation.
You can optimize any problem and model which run on calculiX.
There are different types of optimization:
Maximize Heat-Exchange.
Maximize Stiffnes.
Multi physic topology optimization. (Solving a problem for heat exchange and stiffnes)
https://github.com/DMST1990/ToOptiX
https://www.youtube.com/watch?v=o17b7C4N1uI
In the new version which is not up to date, you can simulate optimized crash profils.
In this case i use calculiX for solving the physical equation.
You can optimize any problem and model which run on calculiX.
There are different types of optimization:
Maximize Heat-Exchange.
Maximize Stiffnes.
Multi physic topology optimization. (Solving a problem for heat exchange and stiffnes)
https://github.com/DMST1990/ToOptiX
https://www.youtube.com/watch?v=o17b7C4N1uI
In the new version which is not up to date, you can simulate optimized crash profils.
Re: Topology optimization
Hi, welcome to the FreeCAD forum.
It seems good. I put it to my candidate list on which programs to look.
It seems good. I put it to my candidate list on which programs to look.