Giter Club home page Giter Club logo

peripy's Introduction

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 [email protected]: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

peripy's People

Contributors

jimmadge avatar bb515 avatar tjdodwell avatar gmingas avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.