Skip to content

Commit bc073c5

Browse files
committed
TL: corrected pSDC implementation
1 parent 4cb6196 commit bc073c5

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

pySDC/playgrounds/dedalus/timestepper/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,16 @@ def _sweep(self, k):
598598
# Add LX terms from iteration k and current nodes
599599
axpy(a=dt*qI[k, m, m], x=LXk[m].data, y=RHS.data)
600600

601+
# Avoid redundant linear solve
602+
if (self.diagonal and
603+
k == self.nSweeps-1 and m < self.M - 1
604+
and self.initSweep != "NN"):
605+
continue
606+
601607
# Solve system and store node solution in solver state
602608
self._solveAndStoreState(k, m)
603609

604-
# Avoid non necessary RHS evaluations work
610+
# Avoid redundant RHS evaluations
605611
if not self.forceProl and k == self.nSweeps-1 and self.initSweep != "NN":
606612
if self.diagonal:
607613
continue
@@ -934,8 +940,9 @@ def _sweep(self, k):
934940
# Add LX terms from iteration k and current nodes
935941
axpy(a=dt*qI[k], x=LXk.data, y=RHS.data)
936942

937-
# Solve system and store node solution in solver state
938-
self._solveAndStoreState(k)
943+
if k < self.nSweeps-1 or m == self.M-1:
944+
# Solve system and store node solution in solver state
945+
self._solveAndStoreState(k)
939946

940947
if k < self.nSweeps-1:
941948
tEval = t0+dt*tau

0 commit comments

Comments
 (0)