Catalog PyPI
Back to packageRELEASE DETAILS

0.93

PyPI

Adhesion

Surface forces in contact calculations

Published19 Jul 2026
Direct dependencies18
Transitive dependenciesNot calculated

README

Version 0.93 documentation

Adhesion

Adhesion. This code implements adhesive interaction for ContactMechanics.

The methods that are implemented in this code are described in the following papers:

Build status

The following badge should say build passing. This means that all automated tests completed successfully for the master branch.

Tests: Weekly tests

Building documentation: CI

Documentation

Computer-generated overview of code structure: Ask DeepWiki

Sphinx built documentation

Installation

You need Python 3 and FFTW3 to run Adhesion. All Python dependencies can be installed automatically by invoking

Installation directly with pip

# install Adhesion
pip  install Adhesion

The last command will install other dependencies including muFFT, NuMPI and runtests

Note: sometimes muFFT will not find the FFTW3 installation you expect. You can specify the directory where you installed FFTW3
by setting the environment variable FFTWDIR (e.g. to $USER/.local)

Installation from source directory

If you cloned the repository. You can install the dependencies with

pip install [--user] numpy
pip install [--user] pylint
pip install [--user] cython
pip install [--user] mpi4py #optional
pip3 install [--user] -r requirements.txt

in the source directory. Adhesion can be installed by invoking

pip3 install [--user] .

in the source directoy. The command line parameter --user is optional and leads to a local installation in the current user's $HOME/.local directory.

Installation problems with lapack and openblas

bicubic.cpp is linked with lapack, that is already available as a dependency of numpy.

If during build, setup.py fails to link to one of the lapack implementations provided by numpy, as was experienced for mac, try providing following environment variables:

export LDFLAGS="-L/usr/local/opt/openblas/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/openblas/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig:$PKG_CONFIG_PATH"

export LDFLAGS="-L/usr/local/opt/lapack/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/lapack/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/lapack/lib/pkgconfig:$PKG_CONFIG_PATH"

where the paths have probably to be adapted to your particular installation method (here it was an extra homebrew installation).

Updating Adhesion

If you update Adhesion (whether with pip or git pull if you cloned the repository), you may need to uninstall NuMPI, muSpectre and or runtests, so that the newest version of them will be installed.

Testing

To run the automated tests, go to the main source directory and execute the following:

pytest

Tests that are parallelizable have to run with runtests

python run-tests.py 

You can choose the number of processors with the option --mpirun="mpirun -np 4". For development purposes you can go beyond the number of processors of your computer using --mpirun="mpirun -np 10 --oversubscribe"

Other usefull flags:

  • --xterm: one window per processor
  • --xterm --pdb: debugging

Development

To use the code without installing it, e.g. for development purposes, use the env.sh script to set the environment:

source /path/to/Adhesion/env.sh [python3]

Note that the parameter to env.sh specifies the Python interpreter for which the environment is set up. Adhesion contains portions that need to be compiled, make sure to run

python setup.py build

whenever any of the Cython (.pyx) sources are modified.

Please read CONTRIBUTING if you plan to contribute to this code.

Usage

The code is documented via Python's documentation strings that can be accesses via the help command or by appending a questions mark ? in ipython/jupyter. There are two command line tools available that may be a good starting point. They are in the commandline subdirectory:

  • soft_wall.py: Command line front end for calculations with soft (possibly adhesive) interactions between rigid and elastic flat. This is a stub rather than a fully featured command line tool that can be used as a starting point for modified script. The present implementation is set up for a solution of Martin Müser's contact mechanics challenge.

Compiling the documentation

  • After changes to the Adhesion source, you have to build again: python setup.py build
  • Navigate into the docs folder: cd docs/
  • Automatically generate reStructuredText files from the source: sphinx-apidoc -o source/ ../Adhesion Do just once, or if you have added/removed classes or methods. In case of the latter, be sure to remove the previous source before: rm -rf source/
  • Build html files: make html
  • The resulting html files can be found in the Adhesion/docs/_build/html/ folder. Root is Adhesion/docs/_build/html/index.html.

For convenience, all these steps are implemented in compile_doc.sh.

Funding

Development of this project is funded by the European Research Council within Starting Grant 757343 and by the Deutsche Forschungsgemeinschaft within projects PA 2023/2 and EXC 2193.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 18

Native requirements
18 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
DiscoverVersion
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
DiscoverVersionruntime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
numpyruntime
scipy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
scipy>=1.9.0runtime
NuMPI
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
NuMPI>=0.5.0runtime
muGrid
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
muGrid>=0.105.0runtime
SurfaceTopography
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
SurfaceTopography>=1.20.0runtime
ContactMechanics
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
ContactMechanics>=1.8.1runtime
netCDF4
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
netCDF4runtime
sphinx
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
sphinx; extra == "docs"runtime
sphinx-rtd-theme
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
sphinx-rtd-theme; extra == "docs"runtime
myst_nb
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
myst_nb; extra == "docs"runtime
numpydoc
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
numpydoc; extra == "docs"runtime
jupytext
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
jupytext; extra == "docs"runtime
flake8
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
flake8<8; extra == "test"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "test"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov; extra == "test"runtime
pytest-flake8
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
pytest-flake8; extra == "test"runtime
runtests
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10.0",
  "evaluation": "NOT_EVALUATED"
}
runtests; extra == "test"runtime

Distribution files

2 collected
adhesion-0.93-py3-none-any.whl

bdist_wheel · 78.38 KB · Python py3

Source file
adhesion-0.93.tar.gz

sdist · 49.78 KB · Python source

Source file

Repository

PENDING
contactengineering/adhesion

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:29 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:b62a3bf4d6789dad9912603fb1632bbb96b261357bd63b504ef04f7ca8b97e0d

Other collected versions

View all collected versions →