Hi everyone
I am a new user to MPM applicaion in Kratos. When I try to complie MPM with DLAGRANGIAN_MPM_APPLICATION=ON, I encounter a error:
~
In file included from /opt/boost-install/include/boost/python/detail/prefix.hpp:13:0,
from /opt/boost-install/include/boost/python/args.hpp:8,
from /opt/boost-install/include/boost/python.hpp:11,
from /home/gaoliu/Kratos/applications/LagrangianMPMApplication/custom_python/lagrangian_mpm_python_application.cpp:27:
/opt/boost-install/include/boost/python/detail/wrap_python.hpp:57:11: fatal error: pyconfig.h: No such file or directory
# include
^~~~
compilation terminated.
applications/LagrangianMPMApplication/CMakeFiles/KratosLagrangianMPMApplication.dir/build.make:110: recipe for target 'applications/LagrangianMPMApplication/CMakeFiles/KratosLagrangianMPMApplication.dir/custom_python/lagrangian_mpm_python_application.cpp.o' failed
make[2]: * [applications/LagrangianMPMApplication/CMakeFiles/KratosLagrangianMPMApplication.dir/custom_python/lagrangian_mpm_python_application.cpp.o] Error 1
CMakeFiles/Makefile2:1190: recipe for target 'applications/LagrangianMPMApplication/CMakeFiles/KratosLagrangianMPMApplication.dir/all' failed
make[1]: [applications/LagrangianMPMApplication/CMakeFiles/KratosLagrangianMPMApplication.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: ** [all] Error 2
~
It seems that other applications like PFEM, PFEM2 could pass the complication but the MPM application could not. My system is Ubuntu18.04.
Hi @Gaoliu19910601
The LagrangianMPMApplication is legacy afaik. It was not updated for at least 1,5 years (at which we introduced what causes your error)
The current MPM-developments are in the ParticleMechanicsApplication
@KratosMultiphysics/mpm
Hi @philbucher
So can it be used in the GID ? I can not find a ParticleMechanicsApplication in GID icon but there is a MPM application icon,
Hi @Gaoliu19910601 yes, you can generate python and json files in GiD. See https://github.com/KratosMultiphysics/Kratos/tree/master/applications/ParticleMechanicsApplication for further details on how to compile MPM in ParticleMechanics.
@philbucher @bodhinandach
Firstly,Thank you both so much for your help.. I have installed the ParticleMechanicsApplication with
-DEXTERNAL_SOLVER_APPLICATION=ON
-DPARTICLE_MECHANICS_APPLICATION=ON
But when I want to run the granularflow example, see https://github.com/KratosMultiphysics/Examples/tree/master/particle_mechanics/validation/granular_flow_2D/source
An error occured:
::[PythonSolver]:: : Finished reading model part.
::[MPMSolver]:: : Models are imported.
Read materials: Started
Read materials: Finished
::[MPMSolver]:: : Constitutive law was successfully imported.
::[MPMSolver]:: : ModelPart prepared for Solver.
::[MPMSolver]:: : DOFs are added.
Traceback (most recent call last):
File "/home/gaoliu/Kratos/kratos/python_scripts/process_factory.py", line 37, in
ConstructListOfProcesses
python_module = import_module(full_module_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
File "
File "
ModuleNotFoundError: No module named
'KratosMultiphysics.ParticleMechanicsApplication.mpm_gid_output_process'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "MainKratos.py", line 18, in <module>
simulation.Run()
File "/home/gaoliu/Kratos/kratos/python_scripts/analysis_stage.py", line 49, in Run
self.Initialize()
File "/home/gaoliu/Kratos/kratos/python_scripts/analysis_stage.py", line 85, in Initialize
self.__CreateListOfProcesses() # has to be done after importing and preparing the ModelPart
File "/home/gaoliu/Kratos/kratos/python_scripts/analysis_stage.py",
__CreateListOfProcesses
self._list_of_output_processes = self._CreateProcesses("output_processes",
order_processes_initialization)
File me/gaoliu/Kratos/applications/ParticleMechanicsApplication/python_scripts/particle_mechanics_analysis.py", line 39, in _CreateProcesses
list_of_processes = super(ParticleMechanicsAnalysis,
self)._CreateProcesses(parameter_name, initialization_order)
File "/home/gaoliu/Kratos/kratos/python_scripts/analysis_stage.py", line 256, in _CreateProcesses
list_of_processes += factory.ConstructListOfProcesses(value) # Does this work? or should it be processes[name]
File "/home/gaoliu/Kratos/kratos/python_scripts/process_factory.py", line 40, in ConstructListOfProcesses
python_module = import_module(python_module_name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mpm_gid_output_process'
KRATOS TERMINATED WITH ERROR
I do not know how to install the module named 'mpm_gid_output_process' because I can not find it in the application list. In addition, when I try to use MPM in GID by clicking the MPM icon, a error occured as:
can't read "base": no such variable
can't read "base": no such variable
while executing
"spdAux::processDynamicNodes $base"
(procedure "spdAux::injectPartsByElementType" line 39)
invoked from within
"${func} $elem $ar"
(procedure "spdAux::processDynamicNodes" line 5)
invoked from within
"spdAux::processDynamicNodes $root"
(procedure "processIncludes" line 5)
invoked from within
"processIncludes"
(procedure "spdAux::SwitchDimAndCreateWindow" line 8)
invoked from within
"spdAux::SwitchDimAndCreateWindow 2Da"
invoked from within
".gid.win_example.information.img2Da invoke "
invoked from within
".gid.win_example.information.img2Da instate !disabled {
.gid.win_example.information.img2Da invoke } "
invoked from within
".gid.win_example.information.img2Da instate pressed {
.gid.win_example.information.img2Da state !pressed;
.gid.win_example.information.img2Da instate ..."
(command bound to event)
Maybe there is something wrong with my operation but I do not know how to solve it.
@Gaoliu19910601 We renamed the output function from "mpm_gid_output_process" to "particle_gid_output_process". You can change it manually, or re-download or re-git-pull, as I have modified the online version. Thanks for your patient.
@bodhinandach Thank You so much, it seems ok now.