Skip to content

Commit

Permalink
Make create_gitlab_ci branch up-to-date before merging into master (#418
Browse files Browse the repository at this point in the history
)

* first working SDC version (M and Minv)

* Update playground.py

* cleaning up

* Added some hyphens in plots (#389)

* Removed seperate file for GPU Dahlquist implementation (#391)

Co-authored-by: Thomas <[email protected]>

* Review (#388)

* Bug is fixed and added new code

* new code for the table

* Edits in markdown file

* some edits in test

* Bugs fix

* Codecov

* I cleaned up my code and separated classes to make it easier to work with. It is not ready yet; if Codecov fails, I will include more tests.

* forgot black

* flake8

* bug fix

* Edits codes according to the comments

* Edited codes according to the comments in the GitHub

* Defined new function in stability_simulation.py to check stability for
given points and excluded codecov function that generates a table.

* small edits for codecov

* removed no cover

* NCCL communicators (#392)

* Added wrapper for MPI communicator to use NCCL under the hood

* Small fix

* Moved NCCL communicator wrapper to helpers

---------

Co-authored-by: Thomas <[email protected]>

* Version bump for new release

* proper readme and link

* Started playground for machine learning generated initial guesses for (#394)

SDC

* playing with FEniCS

* blackening

* Bug fix (#395)

* readme file changes

* fixed bugs for stability plots and some edits in README file

* some edits

* typo in citation

* Bump version

* Bug fix (#396)

* Clear documentation and some edits in the code

* forgot black

* some changes

* bump version

* Cosmetic changes (#398)

* Parallel SDC (Reloaded) project (#397)

TL: Added efficient diagonal preconditioners and associated project. Coauthored by @caklovicka

* Generic multi-component mesh  (#400)

* Generic multicomponent mesh

* new try

* Added a test for MultiComponentMesh

* Test that the type is conserved also after numpy operations

* Added documentation for how to use `MultiComponentMesh`

* Changed formatting of the documentation

* Update ci_pipeline.yml

* version freak show

* version freak show II

* version freak show III

* version freak show IV

* Update ci_pipeline.yml

* version freak show V

* 2D Brusselator problem (#401)

* Added 2D Brusselator problem from Hairer-Wanner II. Thanks @grosilho for
the suggestion!

* Added forgotten pytest marker

* Fix brain afk error

* Added work counter for right hand side evaluations

* Removed file for running Brusselator from project

* Retry at removing the file

* I need to go to git school

* Datatype `DAEMesh` for DAEs (#384)

* Added DAE mesh

* Updated all DAE problems and the SDC-DAE sweeper

* Updated playgrounds with new DAE datatype

* Adapted tests

* Minor changes

* Black.. :o

* Added DAEMesh only to semi-explicit DAEs + update for FI-SDC and ProblemDAE.py

* Black :D

* Removed unnecessary approx_solution hook + replaced by LogSolution hook

* Update WSCC9 problem class

* Removed unnecessary comments

* Removed test_misc.py

* Removed registering of newton_tol from child classes

* Update test_problems.py

* Rename error hook class for logging global error in differential variable(s)

* Added MultiComponentMesh - @brownbaerchen + @tlunet + @pancetta Thank ugit add pySDC/implementations/datatype_classes/MultiComponentMesh.py

* Updated stuff with new version of DAE data type

* (Hopefully) faster test for WSCC9

* Test for DAEMesh

* Renaming

* ..for DAEMesh.py

* Bug fix

* Another bug fix..

* Preparation for PDAE stuff (?)

* Changes + adapted first test for PDAE stuff

* Commented out test_WSCC9_SDC_detection() - too long runtime

* Minor changes for test_DAEMesh.py

* Extended test for DAEMesh - credits for @brownbaerchen

* Test for HookClass_DAE.py

* Update for DAEMesh + tests

* 🎉 - speed up test a bit (at least locally..)

* Forgot to enable other tests again

* Removed if-else-statements for mesh type

* View for unknowns in implSysFlatten

* Fix for RK sweeper - changed nodes in BackwardEuler class (#403)

* Made aborting the step at growing residual optional (#405)

* `pySDC`-build-in `LagrangeApproximation` class in `SwitchEstimator` (#406)

* SE now uses LagrangeApproximation class + removed Lagrange class in SE

* Removed log message again (not corresponding to PR)

* version bump

* Added hook for logging to file (#410)

* Monodomain project (#407)

* addded some classes from oldexplicit_stabilized branch. Mainly, the problems description, datatype classes, explicit stabilized classes. Tested for IMEX on simple problems

* added implicit,explicit,exponential integrator (in electrophysiology aka Rush-Larsen)

* added exponential imex and mES, added parabolic_system in vec format

* added new stabilized integrators using multirate, splitting and exponential approaches

* before adding exponential_runge_kutta as underlying method, instead of the traditional collocation methods

* added first order exponential runge kutta as underlying collocation method. To be generalized to higher order

* generalized exponential runge kutta to higher order. Added exponential multirate stabilized method using exponential RK but must tbe checked properly

* fixed a few things

* optimized a few things

* renamed project ExplicitStabilized to Monodomain

* removed deprecated problems

* fixed some renaming issues

* did refactoring of code and put in Monodomain_NEW

* removed old code and renamed new code

* added finite difference discretization

* added many things, cant remember

* old convergence_controller

* addded some classes from oldexplicit_stabilized branch. Mainly, the problems description, datatype classes, explicit stabilized classes. Tested for IMEX on simple problems

* added implicit,explicit,exponential integrator (in electrophysiology aka Rush-Larsen)

* added exponential imex and mES, added parabolic_system in vec format

* added new stabilized integrators using multirate, splitting and exponential approaches

* before adding exponential_runge_kutta as underlying method, instead of the traditional collocation methods

* added first order exponential runge kutta as underlying collocation method. To be generalized to higher order

* generalized exponential runge kutta to higher order. Added exponential multirate stabilized method using exponential RK but must tbe checked properly

* fixed a few things

* optimized a few things

* renamed project ExplicitStabilized to Monodomain

* removed deprecated problems

* fixed some renaming issues

* did refactoring of code and put in Monodomain_NEW

* removed old code and renamed new code

* added finite difference discretization

* added many things, cant remember

* added smooth TTP model for conv test, added DCT for 2D and 3D problems

* added plot stuff and run scripts

* fixed controller to original

* removed explicit stabilized files

* fixed other files

* removed obsolete splittings from ionic models

* removed old sbatch scripts

* removed mass transfer and sweeper

* fixed something

* removed my base transfer

* removed hook class pde

* removed FD files

* fixed some calls to FD stuff

* removed FEM FEniCSx files

* renamed FD_Vector to DCT_Vector

* added hook for output and visualization script

* removed plot scripts

* removed run scripts, except convergence

* removed convergence experiments script

* fixed TestODE

* added stability test in run_TestODE

* added stability test in run_TestODE

* added stability test in run_TestODE

* removed obsolete stuff in TestODE

* removed unneeded stuff from run_MonodomainODE

* cleaned a bit run_MonodomainODE

* removed utils/

* added few comments, cleaned a bit

* removed schedule from workflow

* restored tutorial step 7 A which I has modified time ago

* run black on monodomain project

* fixed a formatting thing

* reformatted everything with black

* Revert "revert formatted with black"

This reverts commit 82c82e9.

* added environment file for monodomain project, started to add stuff in workflow

* added first test

* added package tqdm to monodomain environment

* added new TestODE using DCT_vectors instead of myfloat, moved phi_eval_lists from MonodomainODE to the sweeper

* deleted old TestODE and myfloat stuff

* renamed TestODEnew to TestODE

* cleaned a bit

* added stability, convergence and iterations tests. Changed a bit other scripts as needed

* reactivated other tests in workflow

* removed my tests temporarly

* added monodomain marker to project pyproject.toml

* changed files and function names for tests

* fixed convergence test

* made one test a bit shorter

* added test for SDC on HH and fixed missing feature in SDC imex sweeper for monodomain

* reformatted with correct black options

* fixed a lint error

* another lint error

* adding tests with plot

* modified convergence test

* added test iterations in parallel

* removed plot from tests

* added plots without writing to file

* added write to file

* simplified plot

* new plot

* fixed plot in iterations parallel

* added back all tests and plots

* cleaned a bit

* added README

* fixed readme

* modified comments in controllers

* try to compute phi every step

* removed my controllers, check u changed before comuting phis

* enabled postprocessing in pipeline

* added comments to data_type classes, removed unnecessary methods

* added comments to hooks

* added comments to the problem classes

* added comments to the run scripts

* added comments to sweepers and transfer classes

* fixed the readme

* decommented if in pipeline

* removed recv_mprobe option

* changed back some stuff outiside of monodomain project

* same

* again

* fixed Thomas hints

* removed old unneeded move coverage folders

* fixed previously missed Thomas comments

* begin change datatype

* changed run_Monodomain

* added prints

* fixed prints

* mod print

* mod print

* mod print

* mod print

* rading init val

* rading init val

* removed prints

* removed prints

* checking longer time

* checking longer time

* fixed call phi eval

* trying 2D

* trying 2D

* new_data type passing tests

* removed coverage folders

* optmized phi eval lists

* before changing phi type

* changed eval phi lists

* polished a bit

* before switch indeces

* reformatted phi computaiton to its traspose

* before changing Q

* optimized integral of exp terms

* changed interfate to c++ code

* moved definition of dtype u f

* tests passed after code refactoring

* Generic MPI FFT class (#408)

* Added generic MPIFFT problem class

* Fixes

* Generalized to `xp` in preparation for GPUs

* Fixes

* Ported Allen-Cahn to generic MPI FFT implementation

* Ported Gray-Scott to generic MPI FFT (#412)

* Ported Gray-Scott to generic MPI FFT class

* `np` -> `xp`

* Reverted poor changes

* Update README.md (#413)

Added the ExaOcean grant identified and the "Supported by the European Union - NextGenerationEU." clause that they would like us to display.

* TIME-X Test Hackathon @ TUD: Test for `SwitchEstimator` (#404)

* Added piecewise linear interpolation to SwitchEstimator

* Started with test for SwitchEstimator [WIP]

* Test to proof sum_restarts when event occuring at boundary

* Started with test to check adapt_interpolation_info [WIP]

* Added test for SE.adapt_interpolation_info()

* Update linear interpolation + logging + changing tolerances

* Test for linear interpolation + update of other test

* Correction for finite difference + adaption tolerance

* Added test for DAE case for SE

* Choice of FD seems to be important for performance of SE

* Removed attributes from dummy probs (since the parent classes have it)

* Test for dummy problems + using functions from battery_model.py

* Moved standard params for test to function

* Updated hardcoded solutions for battery models

* Updated hardcoded solutions for DiscontinuousTestODE

* Updated docu in SE for FDs

* Lagrange Interpolation works better with baclward FD and alpha=0.9

* Added test for state function + global error

* Updated LogEvent hooks

* Updated hardcoded solutions again

* Adapted test_problems.py

* Minor changes

* Updated tests

* Speed-up test for buck converter

* Black..

* Use msg about convergence info in Newton in SE

* Moved dummy problem to file

* Speed up loop using mask

* Removed loop

* SDC-DAE sweeper for semi-explicit DAEs (#414)

* Added SI-SDC-DAE sweeper

* Starte with test for SemiImplicitDAE

* Test for SI-SDC sweeper

* Clean-up

* Removed parameter from function

* Removed test + changed range of loop in SI-sweeper

---------

Co-authored-by: Robert Speck <[email protected]>
Co-authored-by: Thomas Baumann <[email protected]>
Co-authored-by: Thomas <[email protected]>
Co-authored-by: Ikrom Akramov <[email protected]>
Co-authored-by: Thibaut Lunet <[email protected]>
Co-authored-by: Lisa Wimmer <[email protected]>
Co-authored-by: Giacomo Rosilho de Souza <[email protected]>
Co-authored-by: Daniel Ruprecht <[email protected]>
  • Loading branch information
9 people authored Apr 24, 2024
1 parent 24cdf05 commit cbaae05
Show file tree
Hide file tree
Showing 172 changed files with 17,271 additions and 2,241 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ data/*
step_*.png
*.pkl
*.swp
*_data.json
!_dataRef.json

# Created by https://www.gitignore.io

Expand Down Expand Up @@ -158,3 +160,7 @@ Temporary Items
.vscode
*.cpp
pySDC/playgrounds/FEniCS/jitfailure-dolfin_expression_fc28530d435fa2de045af3312fc07c3b/recompile.sh

# videos
*.mp4
*.mkv
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

:arrow_left: [Back to main page](./README.md)

- January 24, 2024: Version 5.4.0 contains the code for the [second order SDC paper](https://arxiv.org/abs/2310.08352) by [\@ikrom96git](https://github.com/ikrom96git). It also has some changes to the FEniCS
part, including correct treatment of boundary conditions and first steps with FEniCS-x.
- July 28, 2023: For Version 5.3 a lot of pull requests got merged, thanks to [\@brownbaerchen](https://github.com/brownbaerchen),
[\@tlunet](https://github.com/tlunet), [\@lisawim](https://github.com/lisawim), [\@ikrom96git](https://github.com/ikrom96git) for all the contributions.
Besides the usual bugfixing and polishing, `pySDC` now comes with linear multistep methods, classical Runge Kutta methods, DAE sweepers, and more/improved projects.
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ authors:
orcid: https://orcid.org/0000-0002-8869-0784
affiliation: "Hamburg University of Technology, Institute of Mathematics, 21073 Hamburg, Germany"

version: 5.3.0
version: 5.4.3
doi: 10.5281/zenodo.594191
date-released: 2023-07-25
date-released: 2024-03-27
keywords:
- "parallel-in-time"
- "spectral deferred corrections"
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ implemented.
- Continuous integration via [GitHub
Actions](https://github.com/Parallel-in-Time/pySDC/actions) and
[Gitlab CI](https://gitlab.hzdr.de/r.speck/pysdc/-/pipelines)
- Fully compatible with Python 3.7 - 3.10, runs at least on Ubuntu and
MacOS
- Fully compatible with Python 3.8 - 3.10, runs at least on Ubuntu

## Getting started

Expand Down Expand Up @@ -106,7 +105,7 @@ The JU receives support from the European Union's Horizon 2020 research
and innovation programme and Belgium, France, Germany, and Switzerland.
This project also received funding from the [German Federal Ministry of
Education and Research](https://www.bmbf.de/bmbf/en/home/home_node.html)
(BMBF) grant 16HPC047. The project also received help from the
(BMBF) grants 16HPC047 and 16ME0679K. Supported by the European Union - NextGenerationEU. The project also received help from the
[Helmholtz Platform for Research Software Engineering - Preparatory
Study (HiRSE_PS)](https://www.helmholtz-hirse.de/).

Expand Down
13 changes: 10 additions & 3 deletions docs/contrib/02_continuous_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ done
# apply black and stage the changes that black made
if [[ $files != "" ]]
then
then
black $files
git add $files
fi
```
You may need to run `chmod +x` on the file to allow it to be executed.
Be aware that the hook will alter files you may have opened in an editor whenever you make a commit, which may confuse you(r editor).
Be aware that the hook will alter files you may have opened in an editor whenever you make a commit, which may confuse you(r editor).

To automate flakeheaven, we want to write a hook that alters the commit message in case any errors are detected. This gives us the choice of aborting the commit and fixing the issues, or we can go ahead and commit them and worry about flakeheaven only when the time comes to do a pull request.
To obtain this functionality, add the following to `<pySDC-root-directory>/.git/hooks/prepare-commit-msg`:
Expand Down Expand Up @@ -91,7 +91,7 @@ This is done using [pytest](https://docs.pytest.org/en/7.2.x/), and runs all the

```bash
# Install required packages (works also with conda/mamba)
pip install pytest<7.2.0 pytest-benchmark coverage[toml]
pip install pytest pytest-benchmark pytest-timeout coverage[toml]
# Run tests
pytest -v pySDC/tests
```
Expand All @@ -102,6 +102,13 @@ pytest -v pySDC/tests
> ```bash
> pytest -v pySDC/tests/test_nodes.py # only test nodes generation
> ```
>
> You can also run one specific test only like this:
>
> ```bash
> pytest -v pySDC/tests/test_nodes.py::test_nodesGeneration # only test_nodesGeneration function
> pytest -v pySDC/tests/test_nodes.py::test_nodesGeneration[LEGENDRE] # only test_nodesGeneration with LEGENDRE nodes
> ```
## Running CI on HPC from pull requests
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@

# General information about the project.
project = 'pySDC'
copyright = '2023, Robert Speck'
copyright = '2024, Robert Speck'
author = 'Robert Speck, Thibaut Lunet, Thomas Baumann, Lisa Wimmer, Ikrom Akramov'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '5.3'
version = '5.4'
# The full version, including alpha/beta/rc tags.
release = '5.3.0'
release = '5.4.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Projects
projects/Resilience.rst
projects/DAE.rst
projects/compression.rst
projects/second_order.rst
projects/monodomain.rst


API documentation
Expand Down
1 change: 1 addition & 0 deletions docs/source/projects/monodomain.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: /../../pySDC/projects/Monodomain/README.rst
1 change: 1 addition & 0 deletions docs/source/projects/parallelSDC_reloaded.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: /../../pySDC/projects/parallelSDC_reloaded/README.rst
1 change: 1 addition & 0 deletions docs/source/projects/second_order.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: /../../pySDC/projects/Second_orderSDC/README.rst
2 changes: 1 addition & 1 deletion etc/environment-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- numpy<1.25
- numpy
- scipy>=0.17.1
- matplotlib>=3.0
- sympy>=1.0
Expand Down
16 changes: 15 additions & 1 deletion pySDC/core/Lagrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class LagrangeApproximation(object):
The associated barycentric weights
"""

def __init__(self, points):
def __init__(self, points, fValues=None):
points = np.asarray(points).ravel()

diffs = points[:, None] - points[None, :]
Expand All @@ -110,6 +110,20 @@ def analytic(diffs):
self.points = points
self.weights = weights

# Store function values if provided
if fValues is not None:
fValues = np.asarray(fValues)
if fValues.shape != points.shape:
raise ValueError(f'fValues {fValues.shape} has not the correct shape: {points.shape}')
self.fValues = fValues

def __call__(self, t):
assert self.fValues is not None, "cannot evaluate polynomial without fValues"
t = np.asarray(t)
values = self.getInterpolationMatrix(t.ravel()).dot(self.fValues)
values.shape = t.shape
return values

@property
def n(self):
return self.points.size
Expand Down
29 changes: 29 additions & 0 deletions pySDC/core/Problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,32 @@ def generate_scipy_reference_solution(self, eval_rhs, t, u_init=None, t_init=Non

u_shape = u_init.shape
return solve_ivp(eval_rhs, (t_init, t), u_init.flatten(), **kwargs).y[:, -1].reshape(u_shape)

def get_fig(self):
"""
Get a figure suitable to plot the solution of this problem
Returns
-------
self.fig : matplotlib.pyplot.figure.Figure
"""
raise NotImplementedError

def plot(self, u, t=None, fig=None):
r"""
Plot the solution. Please supply a figure with the same structure as returned by ``self.get_fig``.
Parameters
----------
u : dtype_u
Solution to be plotted
t : float
Time to display at the top of the figure
fig : matplotlib.pyplot.figure.Figure
Figure with the correct structure
Returns
-------
None
"""
raise NotImplementedError
Loading

0 comments on commit cbaae05

Please sign in to comment.