Package: peripy
PeriPyPeriPy, 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 inPythonand the performance critical parts are implemented inCythonandPyOpenCL.PeriPy allows users to write their code in pure Python. Simulations are then executed seamlessly using high performance OpenCL code.FeaturesEasy to use. Get started with the latest documentation atperipy.readthedocs.org2-10x faster than exisiting OpenCL solvers'Outer-loop' applications including uncertainty quantification, optimisation and feature recognition are made possibleSupport for both regular and irregular mesh files. Seemeshiofor the full list of mesh formatsSupport for composite and interface material modelsSupport for arbritrary n-linear 'microelastic' damage modelsSimulates force or displacement controlled boundary conditions and initial conditionsArbritrary subsets of particles are easily measured for their displacements, damages etc.Output files can be viewed inParaviewVarious 'partial volume correction' algorithms, 'surface correction' algorithms and 'micromodulus functions' are included. The code is easily extended to define your ownVelocity-Verlet, Euler and Euler-Cromer integrators are included and the code is easily extended to define your own higher order and/or adaptive integratorsGet started (preferred)Building and InstallationThe package requires Python 3.7+Install pyopencl, a build dependency, by following these instructionshttps://documen.tician.de/pyopencl/misc.htmlTo install pyopencl, note that pyopencl may need to be installed from(base)environmentIf using pyopencl on Windows with a CPU (rather than a GPU), first, ensure the C++ build tools for Visual Studio are installed (e.g., seehttps://youtu.be/KUTVnxCeC50)Make sure the OpenCL device driver is installed for your device:python
import pyopencl
pyopencl.get_platforms()The errorpyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHRmeans that the OpenCL device driver is not correctly installed.Install cython, a build dependency,pip install cythonInstall PeriPypip install peripyRunning examplesRun the first example by typingperipy run example1on the command lineYou can show the example code by typingperipy run example1 --catTypeperipy run --listfor a list of examplesFor usage, typeperipy run --helpRunning the testsThe tests for this project usepytest. To run
the tests yourself,Install pytest using pippip install pytestTypeperipy teston the command lineFor coverage installpytest-covand typeperipy coverageon the command lineGet started from the GitHub repository (for developers)Building and InstallationThe package requires Python 3.7+Install pyopencl, a build dependency, by following these instructionshttps://documen.tician.de/pyopencl/misc.htmlTo install pyopencl, note that pyopencl may need to be installed from(base)environmentIf using pyopencl on Windows with a CPU (rather than a GPU), first, ensure the C++ build tools for Visual Studio are installed (e.g., seehttps://youtu.be/KUTVnxCeC50)Make sure the OpenCL device driver is installed for your devicepython
import pyopencl
pyopencl.get_platforms()The errorpyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHRmeans that the OpenCL device driver is not correctly installed.Install cython, a build dependency,pip install cythonClone the repositorygit clone git@github.com:alan-turing-institute/peripy.gitInstall using pippip install -e .from the root directory of the repositoryRunning examplesYou can find examples of how to use the package under:peripy/examples/. Run the first example by typingpython peripy/examples/example1/example.pyRunning the testsThe tests for this project usepytest. To run
the tests yourself,If you haven't already, install using pippip install -e .from the root directory of the repositoryInstall pytest using pippip install pytestRunpytestfrom the root directory of the repositoryFor coverage installpytest-covand runpytest --cov=./peripy