Hello there,
I am working with elliposidal simulations in BallBasis, and I am running into some resolution problem that requires me to know the distribution of the grid points, namely in the boundary layers. I have tried to follow the tutorial 1.3: Basis grids and scale factors, and attempted to plot out my grid distribution as well, but I failed to do so in multidimensional bases. The error I am getting is from global_grids(dist, scales), the error reads "Spherical3DBasis.global_grids() got multiple values for argument 'scales' ". The code I have for checking the distribution is as the following:
Radius = params['Radius']
ell = params['ell']
a = params['a']
Nphi = params['Nphi']
Ntheta = params['Ntheta']
Nr = params['Nr']
Ek = params['Ek']
dealias = 3/2
timestepper = d3.SBDF2
dtype = np.float64
mesh = None
# Bases
coords = d3.SphericalCoordinates('phi', 'theta', 'r')
dist = d3.Distributor(coords, dtype=dtype, mesh=mesh)
ball = d3.BallBasis(coords, shape=(Nphi, Ntheta, Nr), radius=Radius, dealias=dealias, dtype=dtype)
sphere = ball.surface
# Substitutions
phi, theta, r = dist.local_grids(ball)
# Generating global grids for normal and dealias scales
grid_normal = ball.global_grids(dist, scales=None).ravel()
grid_dealias = ball.global_grids(dist, scales=dealias).ravel()
# Plotting the grids
plt.figure(figsize=(6, 1.5), dpi=100)
plt.plot(grid_normal, 0 * grid_normal + 1, 'o', markersize=5)
plt.plot(grid_dealias, 0 * grid_dealias - 1, 'o', markersize=5)
plt.xlabel('z')
plt.ylim([-2, 2])
plt.gca().yaxis.set_ticks([])
plt.tight_layout()
plt.save('check.pdf')
So I am emailing you to see how are the grid points distributed in BallBasis, and how can I check the distribution myself?
Best regards,
Shang