Skip to content

Commit

Permalink
time integration methods and multirate infinitesimal split methods (#43)
Browse files Browse the repository at this point in the history
* add RootedTrees API reference

* use RungeKuttaMethod, AdditiveRungeKuttaMethod

* update CI

* WIP: MultirateInfinitesimalSplitMethod

* fix some type instabilities

* another type stability fix

* polynomial multiplication is fast

* reexport Polynomial and add first tests

* test for MIS methods

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

* update CI to use parallel coveralls

* fix typo

* fix typo

* increase test coverage

* mode=PKGMODE_MANIFEST for Pkg.status in the docs

* fix typo

* fix typo

* add TODO note

Co-authored-by: OsKnoth <[email protected]>
  • Loading branch information
ranocha and OsKnoth authored Jan 17, 2022
1 parent 5bfa36e commit dd0e0e1
Show file tree
Hide file tree
Showing 7 changed files with 761 additions and 38 deletions.
75 changes: 74 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
group:
- Core
version:
- '1'
- '1.6'
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: 1
version: ${{ matrix.version }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
env:
Expand Down Expand Up @@ -49,7 +56,73 @@ jobs:
- uses: codecov/codecov-action@v1
with:
file: lcov.info
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: run-${{ matrix.version }}-${{ github.run_id }}
# parallel: true
# path-to-lcov: ./lcov.info
# Instead, we use a more tedious approach:
# - Store all individual coverage files as artifacts (directly below)
# - Download and merge individual coverage reports in another step
# - Upload only the merged coverage report to Coveralls
- shell: bash
run: |
cp ./lcov.info ./lcov-${{ matrix.version }}-${{ github.run_id }}.info
- uses: actions/upload-artifact@v2
with:
name: lcov-${{ matrix.version }}-${{ github.run_id }}
path: ./lcov-${{ matrix.version }}-${{ github.run_id }}.info

finish:
needs: test
runs-on: ubuntu-latest
steps:
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
# Instead, we use the more tedious approach described above.
# At first, we check out the repository and download all artifacts
# (and list files for debugging).
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- run: ls -R
# Next, we merge the individual coverage files and upload
# the combined results to Coveralls.
- name: Merge lcov files using Coverage.jl
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.activate(temp=true)
Pkg.add("Coverage")
using Coverage
coverage = LCOV.readfolder(".")
for cov in coverage
cov.filename = replace(cov.filename, "\\" => "/")
end
coverage = merge_coverage_counts(coverage)
@show covered_lines, total_lines = get_summary(coverage)
LCOV.writefile("./lcov.info", coverage)
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
# Upload merged coverage data as artifact for debugging
- uses: actions/upload-artifact@v2
with:
name: lcov
path: ./lcov.info
# That's it
- run: echo "Finished testing BSeries"
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ version = "0.1.17-pre"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
RootedTrees = "47965b36-3f3e-11e9-0dcf-4570dfd42a8c"

[compat]
Latexify = "0.15"
OrderedCollections = "1"
Polynomials = "2.0.23"
Reexport = "1"
Requires = "1"
RootedTrees = "2.6.3"
RootedTrees = "2.8.3"
julia = "1.6"
13 changes: 12 additions & 1 deletion docs/src/api_reference.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# BSeries.jl API
# API reference

## BSeries.jl API

```@meta
CurrentModule = BSeries
Expand All @@ -8,3 +10,12 @@ CurrentModule = BSeries
Modules = [BSeries]
```

## RootedTrees.jl API

```@meta
CurrentModule = RootedTrees
```

```@autodocs
Modules = [RootedTrees]
```
3 changes: 2 additions & 1 deletion docs/src/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ using InteractiveUtils
versioninfo()
using Pkg
Pkg.status(["BSeries", "RootedTrees", "SymEngine", "SymPy", "Symbolics"])
Pkg.status(["BSeries", "RootedTrees", "SymEngine", "SymPy", "Symbolics"],
mode=PKGMODE_MANIFEST)
nothing # hide
```

Expand Down
26 changes: 22 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# BSeries.jl

The Julia library
[BSeries.jl](https://github.com/ranocha/BSeries.jl)
is work in progress. Nevertheless, we follow semantic versioning. Thus, you can
safely use the package right now. Extended documentation will be provided in the
future.
is a collection of functionality around
[B-series](https://en.wikipedia.org/wiki/Butcher_group)
in [Julia](https://julialang.org/). See for example

- Philippe Chartier, Ernst Hairer, Gilles Vilmart (2010)
Algebraic Structures of B-series.
Foundations of Computational Mathematics
[DOI: 10.1007/s10208-010-9065-1](https://doi.org/10.1007/s10208-010-9065-1)

BSeries.jl re-exports everything from
[RootedTrees.jl](https://github.com/SciML/RootedTrees.jl).
Expand All @@ -13,6 +17,20 @@ you should also include it explicitly in your project dependencies
to track breaking changes, since the version numbers of RootedTrees.jl
and BSeries.jl are not necessarily synchronized.

The main API of BSeries.jl consists of the following components.

- B-series behave like `AbstractDict`s mapping
(abstract) `RootedTree`s to coefficients.
- The B-series of time integration methods such as Runge-Kutta methods
can be constructed by the function [`bseries`](@ref).
- The algebraic structures of the composition law and the substitution law are
implemented via [`compose`](@ref) and [`substitute`](@ref).
- Backward error analysis can be performed via
[`modified_equation`](@ref)s and [`modifying_integrator`](@ref)s.

Further information is provided in the following tutorials and
API documentation.


## Installation

Expand Down
Loading

0 comments on commit dd0e0e1

Please sign in to comment.