calculix / beso

Python code for topology optimization using CalculiX FEM solver.
GNU Lesser General Public License v3.0
314 stars 47 forks source link

Error when using finer mesh settings #34

Closed joonryu69 closed 11 months ago

joonryu69 commented 11 months ago

So far I am impressed with your implementation of topology optimization in an opensource software. I appreciate the work from all the devs. I was recently playing around with this nice feature, but realized that it doesn't seem to work when I use a that has more details. I would like to use a finer mesh to get a result with better resolution, but whenever I decrease the maximum element size in Netgen, it gives an error: image

I have tried reverting the settings back to a coarse mesh, and it starts working totally fine again. Would there be a way to make this work on a finer mesh?

joonryu69 commented 11 months ago

Now I am suddenly getting this error when I made a new file directory to try out different settings: image

This seems really strange since the 'beso_lib' file is in the same directory and it used to work completely fine before.

joonryu69 commented 11 months ago

I managed to add the directory of the 'beso-master' folder into the macro codes, and now it gives a different error. image

Still cannot understand why this happens since the 'FEMMeshNetgen_femesh.inp' file is literally in the same directory with the macro py files. image

Im currently using Freecad 0.21.1 on Ubuntu 22.04

I know this macro can work on my environment since I've done it a couple of hours ago, but now I have no idea what the problem is.

joonryu69 commented 11 months ago

I figured out a fix to all these issues. I checked the running directory of the scripts, but for some reason, the directory of the script and the running directory was different. So, I just added a line os.chdir() to reset the directory to where it actually should be. That seems to solve all the issues above.