Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem reading file000.inp of Example2 in Calculix #43

Open
Squirrel8475 opened this issue Dec 13, 2024 · 3 comments
Open

Problem reading file000.inp of Example2 in Calculix #43

Squirrel8475 opened this issue Dec 13, 2024 · 3 comments

Comments

@Squirrel8475
Copy link

Squirrel8475 commented Dec 13, 2024

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.

@fandaL
Copy link
Collaborator

fandaL commented Dec 13, 2024

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.

@Squirrel8475
Copy link
Author

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
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants