Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions pySDC/helpers/spectral_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,13 @@ def get_conv(self, name, N=None):
'''
N = N if N else self.N
sp = self.sparse_lib
xp = self.xp

def get_forward_conv(name):
if name == 'T2U':
mat = (sp.eye(N) - sp.diags(xp.ones(N - 2), offsets=+2)).tocsc() / 2.0
mat = (sp.eye(N) - sp.eye(N, k=2)).tocsc() / 2.0
mat[:, 0] *= 2
elif name == 'D2T':
mat = sp.eye(N) - sp.diags(xp.ones(N - 2), offsets=+2)
mat = sp.eye(N) - sp.eye(N, k=2)
elif name[0] == name[-1]:
mat = self.sparse_lib.eye(self.N)
else:
Expand Down Expand Up @@ -585,9 +584,8 @@ def get_Dirichlet_recombination_matrix(self):
'''
N = self.N
sp = self.sparse_lib
xp = self.xp

return sp.eye(N) - sp.diags(xp.ones(N - 2), offsets=+2)
return sp.eye(N) - sp.eye(N, k=2)


class UltrasphericalHelper(ChebychevHelper):
Expand Down Expand Up @@ -632,7 +630,7 @@ def get_S(self, lmbda):

if lmbda == 0:
sp = scipy.sparse
mat = ((sp.eye(N) - sp.diags(np.ones(N - 2), offsets=+2)) / 2.0).tolil()
mat = ((sp.eye(N) - sp.eye(N, k=2)) / 2.0).tolil()
mat[:, 0] *= 2
else:
sp = self.sparse_lib
Expand Down