Skip to content

Design preconditioners with a CNN to accelerate the conjugate gradient method.

Notifications You must be signed in to change notification settings

jsappl/DeepPreconditioning

Repository files navigation

Deep Preconditioning

Design preconditioners with a CNN to accelerate the conjugate gradient method.

python pdm-managed Ruff

Setup (Linux)

This has been tested with

  • Debian 10.2.1-6 (GNU/Linux 5.10.0-28-amd64 x86_64)
  • Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz
  • NVIDIA GeForce RTX 3070
  • NVIDIA Driver Version 550.54.15
  • CUDA Version 12.4
  • Python 3.11.9

Clone this repository and cd into the project root.

git clone git@github.com:jsappl/DeepPreconditioning.git
cd DeepPreconditioning/

We use PDM to build the package and manage dependencies so make sure it is installed. After selecting a Python interpreter, PDM will ask you whether you want to create a virtual environment for the project. Having one is optional but highly recommended. PDM will try to auto-detect possible virtual environments. Run pdm install to install dependencies from the pdm.lock file and restore the project environment.

Generating Data Set

The data set of linear systems resulting from the discretization of the pressure correction equation is generated using OpenFOAM 7. The most convenient way to use OpenFOAM 7 is to download and run the official Docker container. For further instructions please visit https://openfoam.org/download/7-linux/. First, compile our custom newInterFoam solver inside the container.

openfoam7-linux  # run in root folder
cd foam/newInterFoam/  # inside Docker container
wmake

After compiling the solver keep the Docker container up and running. In another shell run the generate stage of the dvc pipeline. The data set is automatically generated making use of the OpenFOAM 7 Docker container.

Developing

Use PDM to add another dependency and update the projects pdm.lock file afterward.

pdm add <some-dependency>
pdm update

Run pdm sync --clean to remove packages that are no longer in the pdm.lock file.

Version numbers are (roughly) assigned and incremented according to Semantic Versioning 2.0.0. Write commit messages according to the Conventional Commits 1.0.0 convention. Keep a changelog and stick to this style guide https://common-changelog.org/. Use these tools for code formatting and linting.

  • ruff (includes isort and flake8)
  • yapf

They are automatically configured by the pyproject.toml file.

About

Design preconditioners with a CNN to accelerate the conjugate gradient method.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published