Pypd
A bond-based peridynamics code written in pure Python
Install / Use
/learn @mark-hobbs/PypdREADME
pypd
A simple and performant Python implementation of the bond-based peridynamic model. pypd offers an intuitive class structure with fully interchangeable material models and integration schemes.
Features
- Pure Python: Written entirely in Python, leveraging the power of Numba for optimal performance
- Material Models: Seamlessly switch between various material models including linear, trilinear and nonlinear
- Integration schemes: Fully interchangeable integration schemes
- Examples: Several examples are provided and validated using published experimental data
Usage
Explore examples using pypd in Google Colab
| Example description | Notebook | | ------- | -------- | | Crack branching in Homalite | <a href="https://colab.research.google.com/github/mark-hobbs/pypd/blob/main/examples/crack_branching.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | | Half-notched quasi-brittle beam in three-point bending | <a href="https://colab.research.google.com/github/mark-hobbs/pypd/blob/main/examples/half_notched_beam.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | | Plate with a hole under tension | <a href="https://colab.research.google.com/github/mark-hobbs/pypd/blob/main/examples/plate_with_hole.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
Getting started
Development version from GitHub:
pip install git+https://github.com/mark-hobbs/pypd.git
or for contributors using Pipenv:
git clone https://github.com/mark-hobbs/pypd.git
cd pypd/
pipenv install --dev
pipenv shell
Usage with uv
Build and install pypd:
uv pip install -e .
Run examples:
uv run -m examples.crack_branching
Dependencies
- NumPy
- Numba
- scikit-learn
- Matplotlib
- tqdm
Development dependencies
- Black
- Ruff
- Jupyter
Examples
<details> <summary>Expand for a summary of the examples provided</summary>- Crack branching in notched Homalite sheets
- Plate with a hole in tension
- Three-point bending test of a half-notched concrete beam
- Nuclear graphite ring compression test
- Mixed-mode fracture in concrete
Crack branching
python -m examples.crack_branching

Mixed-mode fracture
python -m examples.mixed_mode_fracture
Example with validation using experimental data.
<span style="font-family: 'Courier New', monospace;"> García-Álvarez, V. O., Gettu, R., and Carol, I. (2012). Analysis of mixed-mode fracture in concrete using interface elements and a cohesive crack model. Sadhana, 37(1):187–205.</span>

Flexural three-point bending test - half-notched beam
python -m examples.half_notched_beam

Minimal example
:white_check_mark: TODO
- [ ] Write unit tests
- [ ] Write documentation
- [ ] Publish on PyPI
- [ ] Add support for different compute backends:
numba-cudajaxwarp
- [ ]
feature/space-filling-curve- sort particles spatially to improve memory access (see this notebook on understanding the Hilbert curve) - [ ] Implement a volume correction scheme to improve spatial integration accuracy
- [ ]
Bondsare always derivable fromParticles. LetModelmanageBondsinternally. - [ ] Benchmark GPU kernel performance (roofline model)
- [ ] Add additional examples
Completed tasks
- [x]
feature/animation- add native capabilities to generate animations - [x] Implement a surface correction scheme to correct the peridynamic surface effect
- [x] Implement different influence functions (constant/triangular/quartic)
- [x] Separate model and simulation logic:
simulation.run(model) - [x] GPU acceleration using
numba cuda
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
