Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(
L = np.array([self.L] * ndim, dtype=float)

# get local mesh
X = np.ogrid[self.fft.local_slice(False)]
X = list(np.ogrid[self.fft.local_slice(False)])
N = self.fft.global_shape()
for i in range(len(N)):
X[i] = X[i] * L[i] / N[i]
Expand All @@ -135,7 +135,7 @@ def __init__(
k = [np.fft.fftfreq(n, 1.0 / n).astype(int) for n in N[:-1]]
k.append(np.fft.rfftfreq(N[-1], 1.0 / N[-1]).astype(int))
K = [ki[si] for ki, si in zip(k, s)]
Ks = np.meshgrid(*K, indexing='ij', sparse=True)
Ks = list(np.meshgrid(*K, indexing='ij', sparse=True))
Lp = 2 * np.pi / L
for i in range(ndim):
Ks[i] = (Ks[i] * Lp[i]).astype(float)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(
)

# get local mesh
X = self.xp.ogrid[self.fft.local_slice(False)]
X = list(self.xp.ogrid[self.fft.local_slice(False)])
N = self.fft.global_shape()
for i in range(len(N)):
X[i] = x0 + (X[i] * L[i] / N[i])
Expand All @@ -113,7 +113,7 @@ def __init__(
N = self.fft.global_shape()
k = [self.xp.fft.fftfreq(n, 1.0 / n).astype(int) for n in N]
K = [ki[si] for ki, si in zip(k, s)]
Ks = self.xp.meshgrid(*K, indexing='ij', sparse=True)
Ks = list(self.xp.meshgrid(*K, indexing='ij', sparse=True))
Lp = 2 * np.pi / self.L
for i in range(self.ndim):
Ks[i] = (Ks[i] * Lp[i]).astype(float)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ def main(nprocs_space=None, cwd='.'):
print(f'Order of accuracy: {orders[-1]:4.2f}\n')

assert errors[2 + 1] < 8e-10, f'Errors are too high, got {errors[2 + 1]}'
assert np.isclose(orders[1], 4.6, rtol=7e-02), f'Order of accuracy is not within tolerance, got {orders[1]}'
assert np.isclose(
orders[1].view(np.ndarray), 4.6, rtol=7e-02
), f'Order of accuracy is not within tolerance, got {orders[1]}'


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion pySDC/projects/DAE/tests/test_SemiImplicitDAE.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def testComputeEndpoint(quad_type):

L.sweep.compute_end_point()

assert np.isclose(L.u[-1], L.uend), "Endpoint is not computed correctly!"
assert np.allclose(L.u[-1], L.uend), "Endpoint is not computed correctly!"


@pytest.mark.base
Expand Down
2 changes: 1 addition & 1 deletion pySDC/projects/parallelSDC/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
dependencies:
- numpy>=1.15.4
- scipy>=0.17.1
- matplotlib>=3.0,<=3.5.3
- matplotlib>=3.0
- dill>=0.2.6
- mpich
- mpi4py>=3.0.0