A Python module to generate CB-Geo MPM’s input files #720
Replies: 3 comments 2 replies
-
Hi @SchDvr - this looks like a great addition and an easy way to make some straight-forward MPM input files. I'll give this a try. |
Beta Was this translation helpful? Give feedback.
-
Hi @SchDvr This is great! Really appreciate your work!! I'm planning to host the MPM code on https://designsafe-ci.org/ to run large-scale problems on HPC easily. DesignSafe supports Jupyter/Python and having your Python package for generating code and then launching it directly from a Jupyter notebook would be a wonderful addition. Does this support both normal and GIMP meshes? |
Beta Was this translation helpful? Give feedback.
-
@SchDvr Dear colleagues, I have managed to use the script to generate the input files, but I am still struggling to fully understand how to use the program properly. I am simulating slope sliding, and in other MPM programs, the mesh typically covers a larger region than the particles, allowing space for movement. However, in this case, I was only able to generate particles throughout the entire domain, even though I attempted to use the script to generate particles only in the desired region. I created a separate script to either generate particles only within the desired region or delete particles, but the results did not show any newly created particles. This issue might be related to the compatibility of the entity_sets.txt file with the new particles. Someone have any suggestions or tips to help resolve this? Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I'm a PhD student at Aix-Marseille University and INRAE institute (south of France) working on coupling MPM with DEM, under the supervision of Jerome Duriez, Pierre Philippe and Stephane Bonelli.
Using CB-Geo MPM (thank you for this code !), I felt it would be appropriate to have a Python module that would automatically generate CB-Geo MPM’s input files. I then created one, named PyCBG, documented and packaged it and I would like to share it with you.
Hoping this is the right place for such things, any feedback / discussion for a greater integration into your repository would be much welcome.
Where to find PyCBG Python module
A repository of the module source code is found here, with an automatic build of the doc there.
It has been uploaded to PyPI so it can be easily installed with
pip install pycbg
.Also, PyCBG was published on Zenodo :
What it does
It enables a Python generation of expected
.json
input files, offering all Python capabilities to CB-Geo MPM users for this preprocessing stage.Typing a few Python lines is usually enough for a user to define all necessary ingredients for a MPM simulation:
pycbg.preprocessing.setup_batch
has a complete docstring)While PyCBG is primarily designed to generate input files, it is also able to read the results from the
hdf5
files and organize them in a Python object. For this reason, the module was splitted into two parts:preprocessing
andpostprocessing
.An example
Simulation of a settling column made with two different materials would be Python-defined as follows:
This creates in the working directory a folder
Two_materials_column
where all the necessary input files are located. The paths of the input files are automatically chosen so the simulation can be started from the working directory with the following bash command:And the simulation's results could eventually be Python-postprocessed (also from the working directory) as follows:
Beta Was this translation helpful? Give feedback.
All reactions