Hello,
I am reaching out because I am encountering an issue during my topology optimizations. To give some context, I am coupling Altair Flux with OptiStruct to perform a magneto-mechanical topology optimization. The coupling works correctly and I am able to obtain several results. However, my goal is to modify the optimization parameters used by OptiStruct, such as the algorithm (DUAL2, DUAL, MMA), the initial material density, and the penalization. It is this last parameter that is causing the issue.
To modify these parameters, I use a Python script that automates the launch of the optimizations and includes a WATCHER that monitors when Flux generates the .fem file, which is then passed to OptiStruct to start the optimization process. The watcher detects this .fem file and injects, into the BULK / OPTIMIZATION CONTROL PARAMETERS section of the .fem, one line per parameter I want to control—just before OptiStruct reads the file and keeps it in memory throughout the optimization process.
For the penalization, the parameter to modify is DOPTPRM DISCRETE. The WATCHER therefore transforms this:
DOPTPRM,FLUXOPT,YES
DOPTPRM,TOPDISC,YES,DESMAX,5
into this:
DOPTPRM,FLUXOPT,YES
DOPTPRM,TOPDISC,NO,DESMAX,5
DOPTPRM,OPTMETH,DUAL
DOPTPRM,DISCRETE,7.0
DOPTPRM,MATINIT,1
According to my understanding of the documentation, the variable TOPDISC must be set to NO in order to manually control the penalization factor.
However, the results remain the same regardless of the chosen penalization value. The WATCHER injections do work—for example, the initial material density (MATINIT) is correctly read and taken into account.
I do not understand why the penalization parameter is not being considered. If you could help me find a solution, I would be very grateful.
I am providing my code, as well as an example of the .fem and .out files.
Kind regards,
TG