From 9357105e81d23436b00b1137df617ebbda892fef Mon Sep 17 00:00:00 2001 From: Alan Kaptanoglu Date: Sun, 11 Aug 2024 15:03:14 -0700 Subject: [PATCH] forgot to commit the changes I made when Will and I zoomed this week. --- examples/2_Intermediate/tokamak_dipoles.py | 2 +- examples/2_Intermediate/tokamak_exact.py | 2 +- src/simsopt/field/Bcube.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/2_Intermediate/tokamak_dipoles.py b/examples/2_Intermediate/tokamak_dipoles.py index 80093928f..b9b315f59 100755 --- a/examples/2_Intermediate/tokamak_dipoles.py +++ b/examples/2_Intermediate/tokamak_dipoles.py @@ -25,7 +25,7 @@ else: nphi = 64 # nphi = ntheta >= 64 needed for accurate full-resolution runs ntheta = nphi - Nx = 80 # cartesian bricks but note that we are not modelling the cubic geometry! + Nx = 50 # cartesian bricks but note that we are not modelling the cubic geometry! Ny = Nx Nz = Nx diff --git a/examples/2_Intermediate/tokamak_exact.py b/examples/2_Intermediate/tokamak_exact.py index 1c1dccfaf..ab63daf6f 100755 --- a/examples/2_Intermediate/tokamak_exact.py +++ b/examples/2_Intermediate/tokamak_exact.py @@ -25,7 +25,7 @@ else: nphi = 64 # nphi = ntheta >= 64 needed for accurate full-resolution runs ntheta = nphi - Nx = 80 # cartesian bricks but note that we are not modelling the cubic geometry! + Nx = 50 # cartesian bricks but note that we are not modelling the cubic geometry! Ny = Nx Nz = Nx diff --git a/src/simsopt/field/Bcube.py b/src/simsopt/field/Bcube.py index 55a57c8c5..e3cc7d3ed 100644 --- a/src/simsopt/field/Bcube.py +++ b/src/simsopt/field/Bcube.py @@ -61,7 +61,7 @@ def B_direct(points, magPos, m, dims, phiThetas): P = Pd(phiThetas[:, 0], phiThetas[:, 1]) P = np.transpose(P, axes=[2, 0, 1]) - r_loc = np.sum(P[None, :, :, :] * (points[:, None, :] - magPos[None, :, :]), axis=-1) + r_loc = np.sum(P[None, :, :, :] * (points[:, None, :] - magPos[None, :, :])[:, :, None, :], axis=-1) tx = np.heaviside(dims[0]/2 - np.abs(r_loc[:, :, 0]),0.5) ty = np.heaviside(dims[1]/2 - np.abs(r_loc[:, :, 1]),0.5) @@ -120,7 +120,7 @@ def Acube(points, magPos, norms, dims, phiThetas): t1 = time.time() P = Pd(phiThetas[:, 0], phiThetas[:, 1]) P = np.transpose(P, axes=[2, 0, 1]) - r_loc = np.sum(P[None, :, :, :] * (points[:, None, :] - magPos[None, :, :]), axis=-1) + r_loc = np.sum(P[None, :, :, :] * (points[:, None, :] - magPos[None, :, :])[:, :, None, :], axis=-1) n_loc = np.sum(P[None, :, :, :] * norms[:, None, None, :], axis=-1) A = gd_i(r_loc, n_loc, dims).reshape(N, -1) # for n in range(N):