Skip to content

Commit cbdfa4e

Browse files
committed
adding trapezoidal rule
1 parent b29d797 commit cbdfa4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pySDC/core/Sweeper.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def rho(x):
8686
QT = coll.Qmat[1:, 1:].T
8787
[_, _, U] = scipy.linalg.lu(QT, overwrite_a=True)
8888
QDmat[1:, 1:] = 2 * U.T
89+
elif qd_type == 'TRAP':
90+
for m in range(coll.num_nodes + 1):
91+
QDmat[m, 1:m + 1] = coll.delta_m[0:m]
92+
for m in range(coll.num_nodes + 1):
93+
QDmat[m, 0:m] += coll.delta_m[0:m]
94+
QDmat /= 2.0
8995
elif qd_type == 'IE':
9096
for m in range(coll.num_nodes + 1):
9197
QDmat[m, 1:m + 1] = coll.delta_m[0:m]

0 commit comments

Comments
 (0)