{"id":19460195,"url":"https://github.com/boileaum/phypso","last_synced_at":"2026-06-07T21:32:09.968Z","repository":{"id":159222776,"uuid":"109450170","full_name":"boileaum/phypso","owner":"boileaum","description":"A Python HYPerbolic SOlver","archived":false,"fork":false,"pushed_at":"2018-07-12T15:06:48.000Z","size":143,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T02:18:33.780Z","etag":null,"topics":["cython","f2py","hyperbolic","pythran"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boileaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-03T23:02:15.000Z","updated_at":"2024-11-07T12:37:38.000Z","dependencies_parsed_at":"2023-04-30T23:33:41.981Z","dependency_job_id":null,"html_url":"https://github.com/boileaum/phypso","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boileaum%2Fphypso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boileaum%2Fphypso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boileaum%2Fphypso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boileaum%2Fphypso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boileaum","download_url":"https://codeload.github.com/boileaum/phypso/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240664503,"owners_count":19837563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cython","f2py","hyperbolic","pythran"],"created_at":"2024-11-10T17:35:55.474Z","updated_at":"2026-06-07T21:32:09.913Z","avatar_url":"https://github.com/boileaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHYPSO\n\nA set of very simple hyperbolic solvers using techniques to use efficient computing kernels called from a python main program. \n\n### Table of content\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Installation](#installation)\n    - [Download the source repository](#download-the-source-repository)\n    - [Using docker](#using-docker)\n    - [Using pip](#using-pip)\n- [General Godunov solver](#general-godunov-solver)\n    - [Usage](#usage)\n- [Saint-Venant's equation solver](#saint-venants-equation-solver)\n    - [Usage](#usage-1)\n- [Burgers' equation solver](#burgers-equation-solver)\n    - [Basic usage](#basic-usage)\n        - [Examples:](#examples)\n    - [Use `pythran` to accelerate Python](#use-pythran-to-accelerate-python)\n        - [Howto](#howto)\n        - [Acceleration](#acceleration)\n    - [Use `f2py` to accelerate python](#use-f2py-to-accelerate-python)\n        - [Howto](#howto-1)\n        - [Acceleration](#acceleration-1)\n- [Developers' corner](#developers-corner)\n    - [Build the docker images](#build-the-docker-images)\n    - [Test suite](#test-suite)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n## Installation \n\n### Download the source repository\n\nEither use git:\n\n```\ngit clone https://git.unistra.fr/m.boileau/phypso.git\n```\n\nor download [zip file](https://git.unistra.fr/m.boileau/phypso/repository/master/archive.zip).\n\n### Using docker\n\nTo get a full environment ready for running, [Docker](https://www.docker.com/) is a solution.\nFrom the host, clone the repository:\n\n```\n[host] git clone https://git.unistra.fr/m.boileau/phypso.git\n```\n\nthen run a docker container using the `boileaum/phypso:env` image:\n\n```\n[host] docker run -ti -v $(pwd):/home/euler/phypso boileaum/phypso:env\n```\n\n\u003e **Note:** to run docker from a Mac with support for matplotlib display, simply run:\n\n\u003e ```\n\u003e [host] ./run_docker_mac.sh\n\u003e ```\n\nNow from the container:\n\n```\n[container] cd phypso\n[container] make\n```\n\n### Using pip\n\nThe `docker/Dockerfile-deps` file provides the first required dependencies such as `python3` and `gfortran`.\n\nInstall the additional python libraries with `pip`:\n\n```\npip install -r requirements.txt\n```\n\nFrom the project root directory, compile the C-executable, C-library, Cython and pythran versions of all programs using:\n\n```\nmake\n```\n\n## General Godunov solver\n\n\n### Usage\n\n1. Go to `./godunov` subdirectory.\n- Run using the python main program:\n\n```\n./godunov.py -h\nusage: godunov.py [-h] [--problem {burgers,stvenant}] [--tmax final_time]\n                  [--nmax number_of_pts] [--profile] [--plot]\n                  [--kernel {python,numpy,pythran,bench}]\n\nSolve hyperbolic problem\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --problem {burgers,stvenant}\n                        select Problem type\n  --tmax final_time     simulation final time\n  --nmax number_of_pts  number of grid points\n  --profile             activate profiling\n  --plot                activate plotting\n  --kernel {python,numpy,pythran,bench}\n                        select kernel type\n```\n\nFor example, run a benchmark to compare different kernel versions:\n\n```\n./godunov.py --kernel bench\n```\n\n## Saint-Venant's equation solver\n\n### Usage\n\n1. Go to `./stvenant` subdirectory.\n- Run using the python main program:\n\n```\n./stvenant.py [-h] [--noplot]\n```\n\n\n\n## Burgers' equation solver\n\n\n### Basic usage\n\n1. Go to `./burgers` subdirectory.\n- Run using the python main program:\n\n```\n./burgers.py -h\nusage: burgers.py [-h] [--tmax final_time] [--nmax number_of_pts] [--profile]\n                  [--plot] [--kernel {pythran,numba,python,numpy,fortran}]\n\nSolve Burgers problem\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --tmax final_time     simulation final time\n  --nmax number_of_pts  number of grid points\n  --profile             activate profiling\n  --plot                activate plotting\n  --kernel {pythran,numba,python,numpy,fortran}\n                        select kernel type\n```\n\n#### Examples:\n\n- Using a basic python kernel (very unefficient):\n\n```\n$ ./burgers.py --nmax 1000 --profile\n```\n\n- Using the native numpy kernel (much faster but not optimal):\n\n```\n$ ./burgers.py --nmax 1000 --profile --kernel numpy\n```\n\n### Use `pythran` to accelerate Python\n\n\nFrom [Pythran website](http://pythran.readthedocs.io/en/latest/):\n\n\u003e Pythran is a Python to c++ compiler for a subset of the Python language, with a focus on scientific computing. It takes a Python module annotated with a few interface description and turns it into a native python module with the same interface, but (hopefully) faster.\n\n#### Howto\n\nPythran simply requires to explicit the signatures of python functions as comments in python file header:\n\n```\n$ head  godunov.py \n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#pythran export sol_exact(float, float)\n#pythran export riemann(float, float, float)\n#pythran export timeloop(float, int)\n#pythran export xmin, xmax\n\"\"\"\nGodunov solver for the Burgers equation\n\"\"\"\n```\n\n- Use pythran to compile the python submodule `godunov.py` as a `pythran_godunov.so` object file:\n\n```\nmake pythran\n```\n\n- Execute as if it were standard python\n\n``` \n./burgers.py --kernel pythran\n```\n\n#### Acceleration\n\n- Example of execution output using the pythran module:\n\n```\n$ ./burgers.py --nmax 1000 --profile --kernel pythran\ntmax = 1.0\nnmax = 1000\nkernel: pythran\nMean time [s] over 10 executions = 0.002362\nL2 error = 0.018877\n```\n\n- Example of execution output using the native python module:\n\n```\n$ ./burgers.py --nmax 1000 --profile --kernel python\ntmax = 1.0\nnmax = 1000\nkernel: python\nMean time [s] over 10 executions = 1.071154\nL2 error = 0.018877\n```\n\n### Use `f2py` to accelerate python\n\n#### Howto\n\n- Compile the fortran file `godunov.f90` with `f2py`\n\n```\nmake fortran\n```\n\n- Run with the `--kernel fortran` option to use the compiled module\n\n```\n./burgers.py --profile --nmax 1000 --kernel fortran\n```\n\n#### Acceleration\n\n```\n$ ./burgers.py --profile --nmax 1000 --kernel fortran\ntmax = 1.0\nnmax = 1000\nkernel: fortran\nMean time [s] over 10 executions = 0.004342\nL2 error = 0.018877\n```\n\n## Developers' corner\n\n\n### Build the docker images\n\n```\ncd docker\ndocker-compose build\n```\n\n### Test suite\n\nTests are performed with [pytest](https://docs.pytest.org). To run the tests with verbose level and standard output:\n\n```\npytest -vs\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboileaum%2Fphypso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboileaum%2Fphypso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboileaum%2Fphypso/lists"}