|
1 | | -''' Script that demonstrates the functionality of the superstep in 1D and 2D |
| 1 | +""" Script that demonstrates the functionality of the superstep in 1D and 2D |
2 | 2 | with an initial condition |
3 | 3 | In 1D: "Wave on a string" |
4 | 4 | In 2d: "Ripple on a pond" |
5 | | -''' |
| 5 | +""" |
6 | 6 | from argparse import ArgumentParser |
7 | 7 | from dataclasses import dataclass |
8 | 8 | from functools import reduce |
@@ -38,13 +38,6 @@ def gaussian_1d(x, mu=0, sigma_sq=1): |
38 | 38 | return np.exp(-((x - mu)**2)/(2*sigma_sq))/(np.sqrt(2*np.pi*sigma_sq)) |
39 | 39 |
|
40 | 40 |
|
41 | | -def gaussian_2d(xx, yy, mu=0, sigma_sq=1): |
42 | | - """ |
43 | | - Generate a 2D Gaussian initial condition |
44 | | - """ |
45 | | - return np.exp(-((xx - mu)**2 + (yy - mu)**2)/(2*sigma_sq))/(2*np.pi*sigma_sq) |
46 | | - |
47 | | - |
48 | 41 | def gaussian(dims, mu=0, sigma_sq=1): |
49 | 42 | """ |
50 | 43 | Generate an N-dimensional Gaussian initial condition |
@@ -73,7 +66,6 @@ def simulate_ic(parameters, step=1, snapshots=-1): |
73 | 66 | in zip(p.origin, p.extent, p.shape) |
74 | 67 | ]) |
75 | 68 | ic = gaussian(msh, mu=p.mu, sigma_sq=p.sigma_sq) |
76 | | - ic = gaussian_2d(*msh, mu=p.mu, sigma_sq=p.sigma_sq) |
77 | 69 |
|
78 | 70 | # Stencil and operator |
79 | 71 | if step == 1: |
|
0 commit comments