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

Running Kratos #12428

Open
polenalit opened this issue Jun 5, 2024 · 5 comments
Open

Running Kratos #12428

polenalit opened this issue Jun 5, 2024 · 5 comments

Comments

@polenalit
Copy link

Dear all,

I am completely new to Kratos, so I have some very basic questions.

I was able to compile Kratos in the debug mode. However, I don't know how to run it. I always get an error :

import KratosMultiphysics
ModuleNotFoundError: No module named 'KratosMultiphysics'

I found that I should add Kratos to the python path and lib folder to the system path. However, I am not sure which folder I should add to the python path and I don't have any kratos/lib folder.

Is there any documentation which explains the theory behind the implementation? I am particularly interested in large strain shell elements and contact formulation.

Best,
Polen

@mcgicjn2
Copy link
Contributor

mcgicjn2 commented Jun 5, 2024

PythonPath = '.../.../bin/debug'
Path = '../../bin/debug/libs'

Hope this helps you

@polenalit
Copy link
Author

Thank you for the help. It is running now. However, I am getting some errors. I tried some examples with contact such as
Examples-master/contact_structural_mechanics/validation/shallow_ironing_3D
I run it as python3 MainKratos.py and I get
/Kratos/bin/Debug/KratosMultiphysics/StructuralMechanicsApplication/structural_mechanics_solver.py", line 365, in import_constitutive_laws
KratosMultiphysics.ReadMaterialsUtility(material_settings, self.model)
RuntimeError: Error: Kratos components missing "HyperElastic3DLaw"
Am I doing something wrong?

@rubenzorrilla
Copy link
Member

Most probably you did not compile the ConstitutiveLawsApplication.

@polenalit
Copy link
Author

Thank, I recompiled with ConstitutiveLawsApplication. However, I got the following error
-- Trying to install python stub files to enable python hinting support for cpp libraries in IDEs...
Traceback (most recent call last):
File "/Kratos/scripts/post_install/stub_generation.py", line 218, in
Main()
File "/Kratos/scripts/post_install/stub_generation.py", line 202, in Main
MoveKratosModuleStubFilesToPythonModule(kratos_library_path, list_of_cpp_libs)
File "/Kratos/scripts/post_install/stub_generation.py", line 106, in MoveKratosModuleStubFilesToPythonModule
shutil.copytree(stub_source_file_name, stub_dest_file_name, dirs_exist_ok=True)
File "/usr/lib/python3.10/shutil.py", line 557, in copytree
with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: '/Kratos/bin/Release/libs/KratosStructuralMechanicsApplication'
Traceback (most recent call last):
File "/Kratos/scripts/post_install/stub_generation.py", line 216, in
subprocess.run([sys.executable] + args, stdout = subprocess.PIPE, stderr = sys.stderr, check=True)
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Kratos/scripts/post_install/stub_generation.py', '/Kratos/bin/Release']' returned non-zero exit status 1.

Anyway, it seems it is running fine, so I don't understand it.

@rubenzorrilla
Copy link
Member

It seems to be some minor issue with the Python stubs @sunethwarna. In principle, you should be able to run cases. You can either disable the Python stubs generation or leave it as it is while we fix it.

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

No branches or pull requests

3 participants