Skip to main content

PeriPy

Build Status codecov

PeriPy, a collaboration between Exeter, Cambridge & the Alan Turing Institute, is a lightweight, open-source and high-performance python package for solving bond-based peridynamics (BBPD) problems in solid mechanics. It is implemented in Python and the performance critical parts are implemented in Cython and PyOpenCL.

PeriPy allows users to write their code in pure Python. Simulations are then executed seamlessly using high performance OpenCL code.

Features

  • Easy to use. Get started with the latest documentation at peripy.readthedocs.org
  • 2-10x faster than exisiting OpenCL solvers
  • 'Outer-loop' applications including uncertainty quantification, optimisation and feature recognition are made possible
  • Support for both regular and irregular mesh files. See meshio for the full list of mesh formats
  • Support for composite and interface material models
  • Support for arbritrary n-linear 'microelastic' damage models
  • Simulates force or displacement controlled boundary conditions and initial conditions
  • Arbritrary subsets of particles are easily measured for their displacements, damages etc.
  • Output files can be viewed in Paraview
  • Various 'partial volume correction' algorithms, 'surface correction' algorithms and 'micromodulus functions' are included. The code is easily extended to define your own
  • Velocity-Verlet, Euler and Euler-Cromer integrators are included and the code is easily extended to define your own higher order and/or adaptive integrators

Get started (preferred)

Building and Installation

  • The package requires Python 3.7+
  • Install pyopencl, a build dependency, by following these instructions https://documen.tician.de/pyopencl/misc.html
  • To install pyopencl, note that pyopencl may need to be installed from (base) environment
  • If using pyopencl on Windows with a CPU (rather than a GPU), first, ensure the C++ build tools for Visual Studio are installed (e.g., see https://youtu.be/KUTVnxCeC50)
  • Make sure the OpenCL device driver is installed for your device:
    python
    import pyopencl
    pyopencl.get_platforms()
    
    The error pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR means that the OpenCL device driver is not correctly installed.
  • Install cython, a build dependency, pip install cython
  • Install PeriPy pip install peripy

Running examples

  • Run the first example by typing peripy run example1 on the command line
  • You can show the example code by typing peripy run example1 --cat
  • Type peripy run --list for a list of examples
  • For usage, type peripy run --help

Running the tests

The tests for this project use pytest. To run the tests yourself,

  • Install pytest using pip pip install pytest
  • Type peripy test on the command line
  • For coverage install pytest-cov and type peripy coverage on the command line

Get started from the GitHub repository (for developers)

Building and Installation

  • The package requires Python 3.7+
  • Install pyopencl, a build dependency, by following these instructions https://documen.tician.de/pyopencl/misc.html
  • To install pyopencl, note that pyopencl may need to be installed from (base) environment
  • If using pyopencl on Windows with a CPU (rather than a GPU), first, ensure the C++ build tools for Visual Studio are installed (e.g., see https://youtu.be/KUTVnxCeC50)
  • Make sure the OpenCL device driver is installed for your device
    python
    import pyopencl
    pyopencl.get_platforms()
    
    The error pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR means that the OpenCL device driver is not correctly installed.
  • Install cython, a build dependency, pip install cython
  • Clone the repository git clone git@github.com:alan-turing-institute/peripy.git
  • Install using pip pip install -e . from the root directory of the repository

Running examples

  • You can find examples of how to use the package under:peripy/examples/. Run the first example by typing python peripy/examples/example1/example.py

Running the tests

The tests for this project use pytest. To run the tests yourself,

  • If you haven't already, install using pip pip install -e . from the root directory of the repository
  • Install pytest using pip pip install pytest
  • Run pytest from the root directory of the repository
  • For coverage install pytest-cov and run pytest --cov=./peripy

Metadata

Release files for peripy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peripy 1.0.0
File Size Uploaded Provenance Actions
peripy-1.0.0.tar.gz 5.1 MB Without provenance Details for peripy-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for peripy 1.0.0
File Interpreter ABI Platform Actions
peripy-1.0.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for peripy-1.0.0-cp37-cp37m-win_amd64.whl

Total release size: 10.7 MB

Release files / peripy-1.0.0.tar.gz

Download URL peripy-1.0.0.tar.gz
Size 5.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b88874ae777454a794700a2b105713d47869c302d9201c058528dd9f16c759cb
BLAKE2b-256 checksum
How to use checksums
bbd80649d03f630104591b18da77bb233a6c949831108b880078bea802abff42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release files / peripy-1.0.0-cp37-cp37m-win_amd64.whl

Download URL peripy-1.0.0-cp37-cp37m-win_amd64.whl
Size 5.5 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d3fe21fa0592d871f8fa298f3ab7526aab56d0ae0c4e651a386ee938af0c255f
BLAKE2b-256 checksum
How to use checksums
0a0a17c74926a3fc13bdc4653684d60abe4078fc6e22c32a4f066f45e76d9506
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Security for peripy 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page