CM2S / piglot

A package for the optimisation of numerical responses
https://piglot.readthedocs.io
MIT License
11 stars 5 forks source link

Second run error of abaqus_solver #23

Closed Lyu721 closed 1 month ago

Lyu721 commented 2 months ago

Hi, thanks for your useful package.! I'm recently using piglot to calibrate my constitutive parameter with abaqus and umat. I have add the commmand "user=xxx.f" into piglot.solver.solver.AbaqusSolver. But when I run "python config.py" in the cmd, I get this error:

PermissionError: [WinError 32] Another program is using this file and the process cannot access it. : 'config\tmp\sample'

More strangely, after this failure, I can't even run examples that I used to run successfully. The error information of an example is shown in the following figure: bug

I'm not sure what caused the problem. I hope someone can help me. Thanks a lot!

QamarQQ commented 2 months ago

I also get the same error.

ruicoelhopedro commented 2 months ago

Hello!

We have recently added the support for passing additional command line arguments to Abaqus in #18, but we forgot to add the new option to the YAML template. If this is a simple calibration problem as the one in the template, we strongly encourage you to convert your problem into a YAML file similar to the one in the example and to add the new extra_args: user=xxx.f option alongside the abaqus_path one (in line 19, for example).

From the errors, it seems like some process is accessing the temporary files generated by piglot during the optimisation, and thus is preventing it from deleting them between function calls. It is not clear what is causing this.

Can try commenting out the lines https://github.com/CM2S/piglot/blob/7f7f27a32172195c6b3bc5826211b8e0b86532c2/piglot/solver/abaqus/solver.py#L114-L115 https://github.com/CM2S/piglot/blob/7f7f27a32172195c6b3bc5826211b8e0b86532c2/piglot/solver/abaqus/solver.py#L130-L131 to avoid suppressing Abaqus' output and post here the output? Maybe this can hint to the problem.

Lyu721 commented 2 months ago

Hi Mr Coelho @ruicoelhopedro, thanks for your reply!

I have commented those lines in abaqus/solver.py, but the issue still exists.

Fortunately, I find the problem may be due to the fact that I installed an old version. When I replaced my current version with the up-to-date version manually, the issue was solved !!
(I wonder if the version that installed via "pip install piglot" is the latest one?)

Additionally, since I am not familiar with pipx, using piglot with YAML directly is not very convenient for me. Anyway, I am appreciated that this tool solved my problem!

ruicoelhopedro commented 2 months ago

I'm glad to see that the issue solved itself with the update. The version in PyPI is a little bit outdated, but not by much.

There is no need to use pipx for using YAML files. A regular pip install should register the piglot and piglot-plot commands in the terminal, from which you can run YAML configuration files!