Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

Running Kratos

Open polenalit opened this issue 1 year ago • 5 comments

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

polenalit avatar Jun 05 '24 11:06 polenalit

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

Hope this helps you

mcgicjn2 avatar Jun 05 '24 12:06 mcgicjn2

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?

polenalit avatar Jun 05 '24 12:06 polenalit

Most probably you did not compile the ConstitutiveLawsApplication.

rubenzorrilla avatar Jun 05 '24 14:06 rubenzorrilla

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.

polenalit avatar Jun 06 '24 12:06 polenalit

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.

rubenzorrilla avatar Jun 07 '24 06:06 rubenzorrilla