Skip to content
This repository was archived by the owner on Jun 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a580cc3
Adds implicit capability to convergence checking utility
cmikida2 Oct 27, 2020
4d53ad8
Refactors generate_butcher for use for bootstrapping with Adams methods
cmikida2 Oct 27, 2020
9e58682
Moves implicit solve into implicit.py as a utility function
cmikida2 Oct 27, 2020
430ae0b
Adds Adams-Moulton - both AM and AB now draw from common AdamsMethod
cmikida2 Oct 27, 2020
2d46b59
Adds tests for Adams-Moulton, renames test_ab to test_adams to
cmikida2 Oct 27, 2020
2930f0c
Remove excess poorly formatted documentation
cmikida2 Oct 27, 2020
bfce40a
More documentation for RK
cmikida2 Oct 27, 2020
41afd41
Flake8 issues
cmikida2 Oct 27, 2020
a9511ec
Add scipy to ci.yml so implicit tests run
cmikida2 Oct 27, 2020
ba44c05
Pylint fix for implicit RK
cmikida2 Oct 27, 2020
ae9d04f
Removes outdated extra_bootstrap option, makes suggested change to
cmikida2 Nov 16, 2020
6d93fee
Add accuracy testing for DIRK methods
cmikida2 Nov 23, 2020
1bc50be
Fix bug in implicit order bootstrap mapping
cmikida2 Nov 23, 2020
4a87ba9
Fixes "history" naming conventions in Adams methods, removes confusing
cmikida2 Nov 23, 2020
0e03294
Placate Flake8
cmikida2 Nov 23, 2020
3803398
Address "else" conditions in solve, mostly by raising value errors
cmikida2 Nov 23, 2020
4066a5e
Remove todo from generate_solve
cmikida2 Dec 4, 2020
61277d8
Review fixes: adding docstring to set_up_time_data,
cmikida2 Dec 4, 2020
a48dd1c
Merge branch 'main' into cory-adams-moulton
cmikida2 Aug 31, 2021
31fc9ad
Merge branch 'cory-adams-moulton' of https://github.com/cmikida2/leap…
cmikida2 Aug 31, 2021
10d9b94
Merge branch 'main' into cory-adams-moulton
cmikida2 Aug 31, 2021
afa13b2
Merge branch 'cory-adams-moulton' of https://github.com/cmikida2/leap…
cmikida2 Aug 31, 2021
4401fe8
Placate Flake8
cmikida2 Aug 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: "Main Script"
run: |
EXTRA_INSTALL="numpy"
EXTRA_INSTALL="numpy scipy"
sudo apt update
sudo apt install gfortran-7 liblapack-dev libblas-dev
sudo ln -sf /usr/bin/gfortran-7 /usr/bin/gfortran
Expand Down
24 changes: 24 additions & 0 deletions leap/implicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,27 @@ def solver_hook(expr, var, id, **kwargs):
new_phases[phase_name] = phase.copy(statements=new_statements)

return dag.copy(phases=new_phases)


def generate_solve(cb, unknowns, equations, var_to_unknown, guess):

assert len(unknowns) == len(equations)
assignees = [unk.name for unk in unknowns]

from pymbolic import substitute
subst_dict = {
rhs_var.name: var_to_unknown[rhs_var]
for rhs_var in unknowns}

cb.assign_implicit(
assignees=assignees,
solve_components=[
var_to_unknown[unk].name
for unk in unknowns],
expressions=[
substitute(eq, subst_dict)
for eq in equations],

other_params={
"guess": guess},
solver_id="solve")
Loading