Hello,
since I don't understand what is going on in those .comm files, I decided about a week ago that i will try to write something on my own from scratch, which I at least will understand.
The idea was to use code_aster to solve simple static analysis and print VMIS of node group called "REGION" to .txt, and then use a python code to calculate new density (I have never understood why it is called density because physically it is stiffness of elements) using this file and this density distribution then map as Young's modulus onto a mesh in a new analysis and solve.
And so on..
The whole SIMP method is written in python file so it is basically code_aster + python or more precisely bash + code_aster + python coupling, thus every stage is done separately and the loops are not done inside one code_aster run. This way leads to:
- postprocessing can be done when optimization is running
- code is more comprehensible
- possibility to change parameters manually when running, for example target volume fraction, penalization factor etc.
- easily add manufacturing condition, however I didn't look into that yet
- I haven't tested it, but I think it can be used for shells or 2D/axisymmetry as well
- for small cases the most time consuming part is start up of code_aster, the solution of linear static and calculation of densities takes only a second
Element volume is considered constant so far, however to create uniform mesh is quite easy for optimization domain, since usually it have simple shape. Moreover, high mesh density is needed everywhere anyway...
I plan to play with it during Christmas. Maybe I will share it later.
Here are some results so far.
cantilever beam
minimizing VMIS instead of deformation energy