Skip to content

Commit 58cac8f

Browse files
Prevent usage of adaptive steppers with stochastic PDEs (#633)
1 parent 0f9a6d5 commit 58cac8f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pde/solvers/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,10 @@ def make_stepper(
673673
# create stepper with fixed steps
674674
return super().make_stepper(state, dt)
675675

676+
if getattr(self.pde, "is_sde", False):
677+
# adaptive steppers cannot deal with stochastic PDEs
678+
raise RuntimeError("Cannot use adaptive stepper with stochastic equation")
679+
676680
# Support `None` as a default value, so the controller can signal that
677681
# the solver should use a default time step.
678682
if dt is None:

pde/solvers/explicit.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,6 @@ def _make_adaptive_stepper(
386386
An example for the state from which the grid and other information can
387387
be extracted
388388
"""
389-
if self.pde.is_sde:
390-
raise RuntimeError("Cannot use adaptive stepper with stochastic equation")
391-
392389
self.info["scheme"] = self.scheme
393390
if self.scheme == "euler":
394391
return self._make_adaptive_euler_stepper(state)

0 commit comments

Comments
 (0)