Skip to content

Commit

Permalink
Fixed spelling error in Crank-Nicolson (no h) scheme thanks to (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen authored Sep 19, 2024
1 parent 1708ab2 commit 2848895
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pySDC/implementations/sweeper_classes/Runge_Kutta.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class BackwardEuler(RungeKutta):
nodes, weights, matrix = generator.genCoeffs()


class CrankNicholson(RungeKutta):
class CrankNicolson(RungeKutta):
"""
Implicit Runge-Kutta method of second order, A-stable.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_imex_Euler(t0, dt, Tend):
return err, radius, exact_radius


def run_CrankNicholson(t0, dt, Tend):
def run_CrankNicolson(t0, dt, Tend):
"""
Routine to run particular SDC variant
Expand Down Expand Up @@ -202,8 +202,8 @@ def main_radius(cwd=''):
radii['implicit-Euler'] = radius
_, radius, exact_radius = run_imex_Euler(t0=t0, dt=dt, Tend=Tend)
radii['imex-Euler'] = radius
_, radius, exact_radius = run_CrankNicholson(t0=t0, dt=dt, Tend=Tend)
radii['CrankNicholson'] = radius
_, radius, exact_radius = run_CrankNicolson(t0=t0, dt=dt, Tend=Tend)
radii['CrankNicolson'] = radius

xcoords = [t0 + i * dt for i in range(int((Tend - t0) / dt))]
plot_radius(xcoords, exact_radius, radii)
Expand All @@ -219,8 +219,8 @@ def main_error(cwd=''):
# errors['implicit-Euler'] = err
# err, _, _ = run_imex_Euler(t0=t0, dt=0.001/512, Tend=Tend)
# errors['imex-Euler'] = err
err, _, _ = run_CrankNicholson(t0=t0, dt=0.001 / 64, Tend=Tend)
errors['CrankNicholson'] = err
err, _, _ = run_CrankNicolson(t0=t0, dt=0.001 / 64, Tend=Tend)
errors['CrankNicolson'] = err


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions pySDC/projects/DAE/sweepers/rungeKuttaDAE.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pySDC.implementations.sweeper_classes.Runge_Kutta import (
RungeKutta,
BackwardEuler,
CrankNicholson,
CrankNicolson,
EDIRK4,
DIRK43_2,
)
Expand Down Expand Up @@ -171,7 +171,7 @@ class BackwardEulerDAE(RungeKuttaDAE, BackwardEuler):
pass


class TrapezoidalRuleDAE(RungeKuttaDAE, CrankNicholson):
class TrapezoidalRuleDAE(RungeKuttaDAE, CrankNicolson):
pass


Expand Down
10 changes: 5 additions & 5 deletions pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SWEEPER_NAMES = [
'ForwardEuler',
'ExplicitMidpointMethod',
'CrankNicholson',
'CrankNicolson',
'BackwardEuler',
'ImplicitMidpointMethod',
'RK4',
Expand Down Expand Up @@ -135,7 +135,7 @@ def test_order(sweeper_name, useGPU=False):
'ExplicitMidpointMethod': 3,
'ImplicitMidpointMethod': 3,
'RK4': 5,
'CrankNicholson': 3,
'CrankNicolson': 3,
'Cash_Karp': 6,
'EDIRK4': 5,
'ESDIRK53': 6,
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_stability(sweeper_name, useGPU=False):
'ExplicitMidpointMethod': False,
'ImplicitMidpointMethod': True,
'RK4': False,
'CrankNicholson': True,
'CrankNicolson': True,
'Cash_Karp': False,
'EDIRK4': True,
'ESDIRK53': True,
Expand Down Expand Up @@ -338,7 +338,7 @@ def test_sweeper_equivalence(sweeper_name, useGPU=False):


@pytest.mark.cupy
@pytest.mark.parametrize("sweeper_name", ['BackwardEuler', 'CrankNicholson'])
@pytest.mark.parametrize("sweeper_name", ['BackwardEuler', 'CrankNicolson'])
def test_RK_sweepers_equivalence_GPU(sweeper_name):
test_sweeper_equivalence(sweeper_name, useGPU=True)

Expand All @@ -357,5 +357,5 @@ def test_RK_sweepers_with_GPU(test_name, sweeper_name):

if __name__ == '__main__':
# test_rhs_evals('ARK54')
test_order('CrankNicholson')
test_order('CrankNicolson')
# test_order('ARK54')

0 comments on commit 2848895

Please sign in to comment.