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

Basic Questions Regarding Kratos Usage #12755

Open
duribes opened this issue Oct 15, 2024 · 7 comments
Open

Basic Questions Regarding Kratos Usage #12755

duribes opened this issue Oct 15, 2024 · 7 comments

Comments

@duribes
Copy link

duribes commented Oct 15, 2024

Dear all,

I am a completely new user of Kratos, so I have some very basic questions:

  1. Is it mandatory to use GiD? Are there any examples using plain text files?

  2. I was able to compile Kratos in release mode on Ubuntu 22.04. It compiled well. However, I am not sure how to run it.

    After the compilation, I already did the following:

    export PYTHONPATH=$PYTHONPATH:$HOME/Kratos/bin/Release
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Kratos/bin/Release/libs

    But when I try in the terminal "from KratosMultiphysics import *"

    I get the follwoing error:

    Command 'from' not found, but can be installed with:
    sudo apt install mailutils

    I tried downloading the “2_Kratos_input_files_and_IO” files but when I type “python3 ./MainKratos.py”, I get the following error: “Traceback (most recent call last):
    File "/home/diego_uribe/Software/2_Kratos_input_files_and_IO/./MainKratos.py", line 3, in
    import KratosMultiphysics
    ModuleNotFoundError: No module named 'KratosMultiphysics'”

Is there any documentation explaining the theory behind the implementation without using GiD? I am particularly interested in MPM applications.

Best regards,
Diego Uribe

@AlejandroCornejo
Copy link
Member

Hi,
This error is usually related to a bad PATH definition. These kratos folders are indeed those ones?

Can you try to run a file with:

import KratosMultiphysics

pinging @KratosMultiphysics/mpm

@takeshimg92
Copy link

Is it mandatory to use GiD? Are there any examples using plain text files?

Absolutely not mandatory, as long as you can write MDPA files and project parameters as JSON files, you can use instances of AnalysisStage to run Kratos regardless of any GUI.

@andimkatili
Copy link
Collaborator

Hi Diego,

The error that you get “Command 'from' not found” is most likely because you use the command without launching python.

To test your installation, you can run a python script (some-name.py) with
from KratosMultiphysics import *
inside the script. Like Alejandro mentioned before.

However, since you got “ModuleNotFoundError: No module named 'KratosMultiphysics'”, it means that you have a bad PATH definition.

Are you sure the path in these commands are correct? Where did you put your Kratos folder?

export PYTHONPATH=$PYTHONPATH:$HOME/Kratos/bin/Release
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Kratos/bin/Release/libs

@rubenzorrilla
Copy link
Member

Is it mandatory to use GiD? Are there any examples using plain text files?

Absolutely not mandatory, as long as you can write MDPA files and project parameters as JSON files, you can use instances of AnalysisStage to run Kratos regardless of any GUI.

Adding to @takeshimg92 's comment that you can also use Salome as preprocessor and write the mesh input file in MED format.

@sunethwarna
Copy link
Member

Small guide on how to read in MED files from SALOME can be found in the following link
https://kratosmultiphysics.github.io/Kratos/pages/Kratos/For_Users/Getting_Started/Input_Output_and_Visualization/Salome_input.html

@duribes
Copy link
Author

duribes commented Oct 15, 2024

Thank you very much for all your answers. In fact, I had issues related to a bad PATH definition, but I managed to fix it. As Andi mentioned, I’ve already tested my installation by running a Python script with:

from KratosMultiphysics import *

and it worked perfectly!"

I will try to follow Suneth's advice to work with MED files!

@gzjing
Copy link
Contributor

gzjing commented Oct 15, 2024

2. I was able to compile Kratos in release mode on Ubuntu 22.04. It compiled well. However, I am not sure how to run it.

For the compilation, did you check if the configuration file used (configuration.sh or configuration.bat file) include the MPMApplication? If not, it may be possible that the import failed because the MPMApplication was not compiled.

See https://github.com/KratosMultiphysics/Kratos/tree/master/applications/MPMApplication under Getting Started -> Prerequisites for which lines to look for

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

7 participants