Skip to content

Commit

Permalink
Merge pull request #94 from ContactEngineering/DOC/23_api
Browse files Browse the repository at this point in the history
MAINT/23 api
  • Loading branch information
pastewka committed Oct 13, 2023
2 parents c39518d + 91f912e commit e1de72c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ on:
jobs:
tests:
runs-on: ubuntu-20.04
timeout-minutes: 45
timeout-minutes: 90

strategy:
matrix:
mpi: ['yes', 'no']
python-version: ['3.8', '3.9', '3.10', '3.11']
mpi: ['no'] # FIXME!! error when installing netCDF, not finding mpi4py see issue #95
python-version: ['3.8','3.9','3.10','3.11']
mpi4py-version: [3.1.4]
netcdf4-python-version: [1.6.3]

Expand All @@ -41,6 +41,7 @@ jobs:
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip pip-tools
if [ "${{ matrix.mpi }}" == "yes" ]; then
sudo apt-get install -y \
openmpi-bin \
Expand Down Expand Up @@ -76,6 +77,7 @@ jobs:
echo "Installing ${MUSPECTRE_VERSION}"
pip install -v --no-binary muspectre ${MUSPECTRE_VERSION}
else
# Serial installation of muSpectre with FFTW support
sudo apt-get install -y \
libfftw3-dev \
libnetcdf-dev
Expand All @@ -88,6 +90,8 @@ jobs:
fi
python3 -m pip install build
python3 -m pip list
# export LD_LIBRARY_PATH=$PWD/venv/lib/python${{ matrix.python-version }}/site-packages/.muspectre.mesonpy.libs/
- name: Install extension module
run: |
Expand All @@ -97,6 +101,7 @@ jobs:
- name: Test with pytest
run: |
source venv/bin/activate
python3 .check_netcdf_capabilities.py ${{ matrix.mpi }}
python3 .check_mufft_capabilities.py ${{ matrix.mpi }}
python3 -m pip list
Expand Down
6 changes: 3 additions & 3 deletions Adhesion/ReferenceSolutions/JKR.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _contact_radius_from_penetration_force(
for the contact radius :math:`a`.
If you want to determine the energy release rate, call `JKR.nonequilibrium_elastic_energy_release_rate`
If you want to determine the energy release rate, call `JKR.elastic_energy_release_rate`
using the penetration and the contact radius afterwards.
Parameters
Expand Down Expand Up @@ -185,7 +185,7 @@ def contact_radius(force=None,
for the contact radius :math:`a`.
If you want to determine the energy release rate, call `JKR.nonequilibrium_elastic_energy_release_rate`
If you want to determine the energy release rate, call `JKR.elastic_energy_release_rate`
using the penetration and the contact radius afterwards.
Parameters
Expand Down Expand Up @@ -421,7 +421,7 @@ def equilibrium_elastic_energy(contact_radius):
# * (1/5 + (1 - R * np.sqrt(9 * np.pi * w / (2*a**3 * Es)))**2)


def nonequilibrium_elastic_energy(penetration, contact_radius):
def elastic_energy(penetration, contact_radius):
r"""
.. math::
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ requires-python = ">=3.8.0"
dynamic = [ "version" ]
dependencies = [
"numpy>=1.16.3",
"scipy>=1.9.0",
"scipy>=1.9.0,<1.11.0",
"NuMPI>=0.3.1",
"muSpectre>=0.25.1",
"muSpectre>=0.26.4",
"SurfaceTopography>=1.3.0",
"ContactMechanics>=1.1.0",
"netCDF4"
Expand Down
2 changes: 1 addition & 1 deletion test/ReferenceSolutions/test_sphere_jkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_equilibrium_elastic_energy_vs_nonequilibrium():
Eel = JKR.equilibrium_elastic_energy(a)

np.testing.assert_allclose(Eel,
JKR.nonequilibrium_elastic_energy(
JKR.elastic_energy(
JKR.penetration(a), a))


Expand Down

0 comments on commit e1de72c

Please sign in to comment.