Skip to content

Commit 6acf76a

Browse files
committed
Doing a few fewer matrix multiplications in 3D RBC setup
1 parent c4ef614 commit 6acf76a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pySDC/helpers/spectral_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class ChebychevHelper(SpectralHelper1D):
257257
that moves to Chebychev U basis during differentiation, which is sparse. When using this technique, problems need to
258258
be formulated in first order formulation.
259259
260-
This implementation is largely based on the Dedalus paper (arXiv:1905.10388).
260+
This implementation is largely based on the Dedalus paper (https://doi.org/10.1103/PhysRevResearch.2.023068).
261261
"""
262262

263263
def __init__(self, *args, x0=-1, x1=1, **kwargs):

pySDC/implementations/problem_classes/RayleighBenard3D.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,19 @@ def __init__(
158158
self.nu = (Ra / Prandtl) ** (-1 / 2.0)
159159

160160
# construct operators
161+
_D = U02 @ (Dxx + Dyy) + Dzz
161162
L_lhs = {
162163
'p': {'u': U01 @ Dx, 'v': U01 @ Dy, 'w': Dz}, # divergence free constraint
163-
'u': {'p': U02 @ Dx, 'u': -self.nu * (U02 @ (Dxx + Dyy) + Dzz)},
164-
'v': {'p': U02 @ Dy, 'v': -self.nu * (U02 @ (Dxx + Dyy) + Dzz)},
165-
'w': {'p': U12 @ Dz, 'w': -self.nu * (U02 @ (Dxx + Dyy) + Dzz), 'T': -U02 @ Id},
166-
'T': {'T': -self.kappa * (U02 @ (Dxx + Dyy) + Dzz)},
164+
'u': {'p': U02 @ Dx, 'u': -self.nu * _D},
165+
'v': {'p': U02 @ Dy, 'v': -self.nu * _D},
166+
'w': {'p': U12 @ Dz, 'w': -self.nu * _D, 'T': -U02 @ Id},
167+
'T': {'T': -self.kappa * _D},
167168
}
168169
self.setup_L(L_lhs)
169170

170171
# mass matrix
171-
M_lhs = {i: {i: U02 @ Id} for i in ['u', 'v', 'w', 'T']}
172+
_U02 = U02 @ Id
173+
M_lhs = {i: {i: _U02} for i in ['u', 'v', 'w', 'T']}
172174
self.setup_M(M_lhs)
173175

174176
# BCs

0 commit comments

Comments
 (0)