beso icon indicating copy to clipboard operation
beso copied to clipboard

Problem reading file000.inp of Example2 in Calculix

Open Squirrel8475 opened this issue 1 year ago • 3 comments

Hello all,

I ran the first example (beam) successfully but I have problem with the second one (engine bracket).

I have created the model Analysis-1.inp in Prepomax v2.1.1 (Windows) based on the provided examples *.inp files. So far so good, the model could be created and also the case ran fine with Calculix v2.21.

Then the BESO python files were copied in the folder, the path to the executable was modified as well as the filename. Running the Python script, the output is :

_domains: 2
nodes  : 53900
TRIA3  : 0
TRIA6  : 0
QUAD4  : 0
QUAD8  : 0
TETRA4 : 266382
TETRA10: 0
HEXA8  : 0
HEXA20 : 0
PENTA6 : 0
PENTA15: 0

initial optimization domains mass 2034.9481618007928

iterations_limit set automatically to 101
Traceback (most recent call last):

  File ~\xxx\xxx\example2\beso_lib.py:578 in import_FI_int_pt
    f = open(file_nameW + ".dat", "r")

FileNotFoundError: [Errno 2] No such file or directory: 'file000.dat'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File ~\.conda\envs\xxx\xxx\xxx\xxx\xxx.py:356 in xxx
    exec(code, globals, locals)

  File c:\users\xxx\xxx\xxx\example2\beso_main.py:299
    [FI_step, energy_density_step] = beso_lib.import_FI_int_pt(reference_value, file_nameW, domains, criteria,

  File ~\xxx\xxx\example2\beso_lib.py:582 in import_FI_int_pt
    assert False, msg

AssertionError: CalculiX result file not found, check your inputs_

In other words there is an error already at the beginning. The first file provided by the BESO algorithm file000.inp cannot be read properly with Calculix. A quick check of loading in Prepomax lead to following error messages :

ticket_pics_0001

Any help would be appreciated.

Squirrel8475 avatar Dec 13 '24 12:12 Squirrel8475

Hello, try to check the path to Calculix and to the original file. Make sure there are no spaces in the path. It is also better to double (back)slashes.

fandaL avatar Dec 13 '24 20:12 fandaL

Thank you for your feedback @fandaL , but as described, the first example (beam) ran perfectly, there is no problem with the path. The problem is the inp file generated by the beso algorithm for first iteration, this one cannot be read in Calculix. See first message for the list of errors.

Squirrel8475 avatar Dec 13 '24 20:12 Squirrel8475

@fandaL I have replaced the command:

subprocess.call(os.path.normpath(path_calculix) + " " + os.path.join(path, file_nameW), shell=True)

by:

command=os.path.normpath(path_calculix) + " " + os.path.join(path, file_nameW)
a=subprocess.run(command, stdout=subprocess.PIPE)
print(a.stdout.decode('utf-8'))

to monitor the Calculix output, and surprisingly it fixed the problem.

Squirrel8475 avatar Dec 14 '24 17:12 Squirrel8475