Skip to main content

Gap-averaged flow simulations with Gaussian process regression.

Project description

PyPI - Version Tests Coverage

GaPFlow

Gap-averaged flow simulations with Gaussian Process regression.

This code implements the solution of time-dependent lubrication problems as described in:

The extension to atomistic-continuum multiscale simulations with Gaussian process (GP) surrogate models has been described in:

The code uses µGrid for handling macroscale fields and tinygp as GP library. Molecular dynamics (MD) simulations run with LAMMPS through its Python interface. Elastic deformation is computed using ContactMechanics.

Installation

GaPFlow can be installed via

pip install GaPFlow

A serial build of LAMMPS is provided for most platforms which allows testing all of GaPFlow's functionality. For production simulations it is however recommended to build GaPFlow with parallel LAMMPS on your system. You need to have MPI installed (e.g. via apt install openmpi-bin libopenmpi-dev on Debian-based systems). To compile for your specific platform, run

pip install --no-binary GaPFlow GaPFlow.[parallel]

You can check your installation by running gpf_info from the command line.

==========
GaPFlow
==========
Version:  ...

==========
LAMMPS
==========
Version: ...
Shared lib: <path-to-your-python-env>/lib/pythonX.Y/site-packages/GaPFlow/_vendor/lammps/liblammps_mpi[.so, .dylib]
MPI:  True
mpi4py:  True
packages:  ['EXTRA-FIX', 'MANYBODY', 'MOLECULE']

==========
muGrid
==========
Version:  ...
NetCDF4: True
MPI: False

We currently do not use parallel functionalities of µGrid, so MPI support is not required.

Minimal example

Simulation inputs are commonly provided in YAML files. A typical input file might look like this:

# examples/journal.yaml
options:
    output: data/journal
    write_freq: 10
grid:
    dx: 1.e-5
    dy: 1.
    Nx: 100
    Ny: 1
    xE: ['D', 'N', 'N']
    xW: ['D', 'N', 'N']
    yS: ['P', 'P', 'P']
    yN: ['P', 'P', 'P']
    xE_D: 877.7007
    xW_D: 877.7007
geometry:
    type: journal
    CR: 1.e-2
    eps: 0.7
    U: 0.1
    V: 0.
numerics:
    tol: 1e-9
    dt: 1e-10
    max_it: 200
properties:
    shear: 0.0794
    bulk: 0.
    EOS: DH
    P0: 101325
    rho0: 877.7007
    T0: 323.15
    C1: 3.5e10
    C2: 1.23

Note that this example uses fixed-form constitutive laws without GP surrogate models or MD data. More example input files can be found in the [examples] (examples/) directory.

The input files can be used to start a simulation from the command line

python -m GaPFlow -i my_input_file.yaml

or from a Python script

from GaPFlow.problem import Problem

myProblem = Problem.from_yaml('my_input_file.yaml')
myProblem.pre_run()
myProblem.run()

Simulation output is stored under the location specified in the input file. After successful completion, you should find the following files.

  • config.yml: A sanitized version of your simulation input.
  • topo.nc: NetCDF file containing the gap height and gradients.
  • sol.nc: NetCDF file containing the solution and stress fields.
  • history.csv: Contains the time series of scalar quantities (step, Ekin, residual, ...)
  • gp_[xz,yz,zz].csv (Optional): Contains the time series of GP hyperparameters, database size, etc.
  • Xtrain.npy (Optional): Training data inputs
  • Ytrain.npy (Optional): Training data observations
  • Ytrain_err.npy (Optional): Training data observation error

The code comes with a few handy command line tools for visualizations like this one

journal

which shows the transient solution of a 1D journal bearing with active learning of the constitutive behavior.

License

The GaPFlow project is distributed under the terms of the GNU General Public License version 2 (GPLv2).

The original GaPFlow source files under GaPFlow/ are licensed under the MIT License (see LICENSES/MIT.txt). This repository also contains third-party software that is not covered by the MIT License, in particular the LAMMPS distribution under lammps/ and Python bindings vendored under GaPFlow/_vendor/lammps/, which are licensed under GPLv2. The full text of the GPLv2 is included in the COPYING file at the repository root.

If you distribute a packaged artifact (for example an sdist or wheel) that includes the LAMMPS sources or the vendored LAMMPS Python bindings, the combined distribution is subject to the terms of the GPLv2. In that case, recipients must be granted the rights required by the GPLv2 and the COPYING file must be included in distributed artifacts. This does not change the MIT license that applies to the original GaPFlow sources; rather, when distributed together with GPLv2-covered files the resulting artifact must comply with GPLv2.

Funding

This work received funding from the German Research Foundation (DFG) through GRK 2450 and from the Alexander von Humboldt Foundation through a Feodor Lynen Fellowship.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gapflow-1.0.2rc1.tar.gz (77.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gapflow-1.0.2rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gapflow-1.0.2rc1-cp314-cp314-macosx_14_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

gapflow-1.0.2rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gapflow-1.0.2rc1-cp313-cp313-macosx_14_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

gapflow-1.0.2rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gapflow-1.0.2rc1-cp312-cp312-macosx_14_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

gapflow-1.0.2rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gapflow-1.0.2rc1-cp311-cp311-macosx_14_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

gapflow-1.0.2rc1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gapflow-1.0.2rc1-cp310-cp310-macosx_14_0_arm64.whl (6.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file gapflow-1.0.2rc1.tar.gz.

File metadata

  • Download URL: gapflow-1.0.2rc1.tar.gz
  • Upload date:
  • Size: 77.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gapflow-1.0.2rc1.tar.gz
Algorithm Hash digest
SHA256 7d52414ab79f92443b2ec960918557951b716700f92aebdbeae35d201e01bb4f
MD5 7ec36132dce16fcb6e63973329b67ba0
BLAKE2b-256 57afbc07b5ac682e57d76203fe63dc3c9745e2f0c7d49aa0bf28fb1e3fbee197

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1.tar.gz:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 940a3027a863735715519f2689e657c66054be349974fedd4cd898e7c2748ca7
MD5 008ab078ba0cdaa7691c7f273cae4fc1
BLAKE2b-256 d153e49602f42f56c76415900b58fc76e2a48045fb3f6ca31d239cd76a3f203e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 407241fb4ac2aba89f7ef8c4e6c9cc45afb0f283a8e62a19dd51b24df4da31de
MD5 d8383dc54b1afcda0b9d1af6a36c375d
BLAKE2b-256 8933707b2c9497247e732b15418261322d882ef62c787c34f9471f646ee8a835

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp314-cp314-macosx_14_0_arm64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e207a1b273c45c0c8be323e6a179d32c19a980083fa7211aadf98934985f710a
MD5 99acfba6e9d6ff84f79e1ff969b9edb4
BLAKE2b-256 4349de38927c22f363071a06c77348c4eadfc1869c54821341a533221f95a6f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 894181e8a73d69fb41c5345a74cacfd628fa059be4f29313d16756c39768c966
MD5 5812d1ff999ae807c32b5c88b3265f94
BLAKE2b-256 3b32298bf032fc461598d4d46a0fa5704e1338a581722b3b2a38a73375db4c80

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76ba67a4065cb867aca45da777f764b86c726707e6931bdf6ea2192887230097
MD5 466a7308c1f55446cc27b3d2f5652a30
BLAKE2b-256 df71732780498758d613e69f285b7f05afbe8bf9e43884e18f75ca02cdf64db0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 93145284cb5410ab488729cc7fb453128672015b0cf6c7a408b1db86e085a35b
MD5 1e1ea22dccf58f9030a568005bddeccc
BLAKE2b-256 42f72ff51c3fe4d4a41a2add80001ab04ce123aae9b6f7c5c93f8148f5aa1910

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a51b6401a336961c0778b2f843ca196975b958e19a81ee6832094a9cd4f4642
MD5 571493da776647e787b90bd10ed58264
BLAKE2b-256 5bd50f4f61a3780e979cdaf4f65fd8991387c8c583b5ff74d52e2e40d4c5901d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 94ae04b79cb480d1569a33344b2612bfa1b9bfa72215448b5e10902a29885cb4
MD5 a4ddf65180ecac330d2d92f223bc492d
BLAKE2b-256 0da0798b320dc3aeb0f0d6daa88effbcf80f69bcccf0a88fb13f0cff82e951d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 16a61fcef14ec587fc5c957dd253aab62aa78b3670a7d43a803a4a33b8cc174b
MD5 a4bc33a6e42587abeb030653e275210b
BLAKE2b-256 d3092103ca56f1bda9a6d16a85ca4b9d6b2c42257ec74f9f852bd568a02f408e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gapflow-1.0.2rc1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gapflow-1.0.2rc1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 22840a59497ff2ad1f153b8824fcededab8e48cac81d642ac64b6d01e48b3077
MD5 4885fd9ff89fe73dded189b9f0527580
BLAKE2b-256 6ec7be1ce99188be717ca4a2df60d431fcd9d985851936957393c5e7c7b93526

See more details on using hashes here.

Provenance

The following attestation bundles were made for gapflow-1.0.2rc1-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: wheels.yaml on hannes-holey/GaPFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page