peridynamics
Python code for solving some 2D peridynamic problems based on Tulio Patriota's PDLAB. It was done for my mechanical engineergin college's degree and it's not complete and probably contains a few bugs here and there.
- Python 3.10 or newer;
- numpy;
- scipy;
- matplotlib.
-
Clone this repository with any git tool, such as GitHub Desktop;
-
Make sure the peridynamics folder is in your IDE search path or in the same folder as your current working directory;
-
Test it by importing the peridynamics module by typing:
import peridynamics as pd
-
If there are no errors, the instalation should be complete.
One can follow the following diagram when using the code. For a more in-depth explanation, please see examples in the folder notebooks.
Consist of importing the peridynamics library and any other needed library such as numpy and matplotlib.
It's needed to specify the material Young's modulus, Poisson's ratio, density and energy release rate. The peridynamics parameters needed are: horizon, mesh ratio and two influence function parameters.
The mesh is an instantiated object containing the mesh points, plus with conventional attributes and methods, such as plotting. It's possible to create both rectangular and non rectangular meshes.
The peridynamic family is also an instantiated object containing useful information regarding family and partial area. One particular interesting feature is the implementation of vectorized algorithms found in the literature, which can be much faster than standard ones!
Here we put a combination of prescribed body forces, displacements or velocities, dependind on the application and the solver used. It's also possible to define the initial crack segment.
It's necessary to choose a peridynamic model used in the calculations considerations.
It's possible to choose between a quasi-static solver and a dynamic one.
Requires no user input, but most of the calculations happens there.
It's possible to generate 2D and 3D graphics with the calculated numbers and also save the resulting images using a convenient function and also save objects using the provided pickle based function (warning: pickle might containg vulnerabilites and it's only recomended to save and open your own files).
- Displacement;
- Strain;
- Energy;
- Damage index;
- Track crack.