Skip to content

Commit

Permalink
Improved documentation and performance tests for multistep solver (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker authored Apr 3, 2024
1 parent 7548016 commit 1eba064
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pde/solvers/adams_bashforth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Defines an explicit solver supporting various methods
Defines an explicit Adams-Bashforth solver
.. codeauthor:: David Zwicker <[email protected]>
"""

Expand All @@ -17,7 +17,7 @@


class AdamsBashforthSolver(SolverBase):
"""solving partial differential equations using an Adams-Bashforth scheme"""
"""explicit Adams-Bashforth multi-step solver"""

name = "adams–bashforth"

Expand Down
2 changes: 1 addition & 1 deletion pde/solvers/crank_nicolson.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class CrankNicolsonSolver(SolverBase):
"""solving partial differential equations using the Crank-Nicolson scheme"""
"""Crank-Nicolson solver"""

name = "crank-nicolson"

Expand Down
9 changes: 8 additions & 1 deletion scripts/performance_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
import numpy as np

from pde import CahnHilliardPDE, Controller, DiffusionPDE, ScalarField, UnitGrid
from pde.solvers import CrankNicolsonSolver, ExplicitSolver, ImplicitSolver, ScipySolver
from pde.solvers import (
AdamsBashforthSolver,
CrankNicolsonSolver,
ExplicitSolver,
ImplicitSolver,
ScipySolver,
)


def main(
Expand Down Expand Up @@ -57,6 +63,7 @@ def main(
"Runge-Kutta, fixed": (1e-2, ExplicitSolver(eq, scheme="rk", adaptive=False)),
"Runge-Kutta, adaptive": (1e-2, ExplicitSolver(eq, scheme="rk", adaptive=True)),
"Implicit": (1e-2, ImplicitSolver(eq)),
"Adams-Bashforth": (1e-2, AdamsBashforthSolver(eq)),
"Crank-Nicolson": (1e-2, CrankNicolsonSolver(eq)),
"Scipy": (None, ScipySolver(eq)),
}
Expand Down

0 comments on commit 1eba064

Please sign in to comment.