Hello all,
My research focuses on topology optimization and additive manufacturing. Currently, I use Python as my main framework, but it is limited to structured homogeneous grids, or better said, all hex meshes of the same size. I am planning to implement topology optimization (SIMP method — Solid Isotropic Material with Penalization) within CalculiX. Several ideas have come to mind.
Already 12 years ago, I managed to create an ESO (Evolutionary Structural Optimization) topology based on the input (.inp) and result (.frd) files from CalculiX. At that time, my programming skills were quite limited. Here is an easy example post-processed in CGX: (see next post)
I am aware that there is a BESO (Bi-directional Evolutionary Structural Optimization) script vailable for CCX, but the limitations are known.
It seems that an implementation of the SIMP method already exists in CCX. I have been in contact with the author, who claimed that changes in the CCX version were quite challenging, resulting in a lot of work to maintain the optimization code.
Therefore, I prefer to stick as much as possible with Python and just use CalculiX as a solver. I have added approximately 50 lines of code (in Fortran and C), which mainly consist of:
- Checking if topology optimization is enabled via a specific initialization file
- Writing element matrices, volumes, and centers of gravity (done only once during the initialization run)
→ This is necessary for the SIMP method’s sensitivity evaluation and filtering purposes - Reading density values per element
That’s all. The magic happens in Python. There might be potential for improvement by splitting the sensitivity loop into chunks to utilize available CPU cores and reduce computation time. Additionally ccx works as before, if there is no initialization file for the topology optimization.
Overall, I have conducted several examples, as shown here (GE-bracket and Nacelle bracket). The properties and simulation durations are listed. Convergence was reached probably at iteration 25-ish. Shortening the duration by half, ~15 min and 1.5 hours respectively.
Further development ideas:
- Element set definition for design and non-design regions
- Multiple load cases
- Compiling CCX for Windows (currently Linux with Pardiso)
REQUEST:
Currently, the results are stored in a txt file with the following format:
ElementID\tDensity
1\t1.
2\t0.5
3\t0.1239
…
The txt file is generated for each iteration and process it in ParaView or PyVista. In the next step, the elemental results are extrapolated to the nodes, creating a much smoother visualization. The values are then limited using the “Iso Volume” to 0.5.
Is there a possibility to perform this in PrePoMax, to view the results directly within the software instead of using the VTK file format and ParaView.
Would this be a feasible request?
Thanks and best regards,
Stoli (from Germany)