diff --git a/test/mms/Makefile b/test/mms/Makefile index 57fff7e..d42f333 100644 --- a/test/mms/Makefile +++ b/test/mms/Makefile @@ -1,4 +1,4 @@ -all: parallel laplace delp +all: parallel radial: do_radial diff --git a/test/mms/delp_grid.py b/test/mms/delp_grid.py index fe588ff..072492f 100644 --- a/test/mms/delp_grid.py +++ b/test/mms/delp_grid.py @@ -1,3 +1,5 @@ +import warnings + import zoidberg as zb import numpy as np import xarray as xr @@ -44,6 +46,11 @@ def gen_grid(nx, ny, nz, R0, r0, r1, mode=0): "tmp.nc", metric2d=False, ) + warnings.filterwarnings( + "ignore", + message="Duplicate dimension names present: dimensions {.*} appear more than once in dims=(.*). We do not yet support duplicate dimension names, but we do allow initial construction of the object. We recommend you rename the dims immediately to become distinct, as most xa", + category=UserWarning, + ) with xr.open_dataset("tmp.nc") as ds: for k in "g11,g33,g_11,g_33,nx,ny,nz".split(","): assert np.all(ds[k] > 0) diff --git a/test/mms/mms/BOUT.inp b/test/mms/mms/BOUT.inp index fa6b0c5..52e57f1 100644 --- a/test/mms/mms/BOUT.inp +++ b/test/mms/mms/BOUT.inp @@ -1,10 +1,10 @@ MXG=0 MYG=1 + [mesh] MXG=0 MYG=1 -#file = "rotating-ellipse.4x4x4.fci.fix.nc" -file = "poloidal_const_4_2_4_1.fci.nc" +file = "parallel_const_8_16_4_1.fci.nc" extrapolate_y = false extrapolate_x = false diff --git a/test/mms/parallel_grid.py b/test/mms/parallel_grid.py index e3785e3..bb49b4a 100644 --- a/test/mms/parallel_grid.py +++ b/test/mms/parallel_grid.py @@ -1,3 +1,5 @@ +import warnings + import zoidberg as zb import numpy as np import xarray as xr @@ -47,12 +49,19 @@ def gen_grid(nx, ny, nz, R0, r0, r1, mode=0): "tmp.nc", metric2d=False, ) + warnings.filterwarnings( + "ignore", + message="Duplicate dimension names present: dimensions {.*} appear more than once in dims=(.*). We do not yet support duplicate dimension names, but we do allow initial construction of the object. We recommend you rename the dims immediately to become distinct, as most xa", + category=UserWarning, + ) with xr.open_dataset("tmp.nc") as ds: dims = ds.dz.dims ds["r_minor"] = dims, one * r[:, None, :] ds["phi"] = "y", phi ds["theta"] = dims, one * theta[:, None, :] ds["one"] = dims, one + for pre in "for", "back": + ds[f"{pre}ward_xt_prime"] = dims, one * np.arange(nx)[:, None, None] ds.to_netcdf(fn) diff --git a/test/mms/poloidal_grid.py b/test/mms/poloidal_grid.py index 0e4fbe7..7236a0e 100644 --- a/test/mms/poloidal_grid.py +++ b/test/mms/poloidal_grid.py @@ -1,3 +1,5 @@ +import warnings + import zoidberg as zb import numpy as np import xarray as xr @@ -53,7 +55,7 @@ def gen_grid(*args): pol_grid = zb.poloidal_grid.StructuredPoloidalGrid(R, Z) field = zb.field.CurvedSlab(Bz=0, Bzprime=0, Rmaj=R0) - grid = zb.grid.Grid(pol_grid, phi, 5, yperiodic=True) + grid = zb.grid.Grid(pol_grid, phi, np.pi / 2.5, yperiodic=True) fn = gen_name(*args) @@ -65,6 +67,11 @@ def gen_grid(*args): "tmp.nc", metric2d=False, ) + warnings.filterwarnings( + "ignore", + message="Duplicate dimension names present: dimensions {.*} appear more than once in dims=(.*). We do not yet support duplicate dimension names, but we do allow initial construction of the object. We recommend you rename the dims immediately to become distinct, as most xa", + category=UserWarning, + ) with xr.open_dataset("tmp.nc") as ds: dims = ds.dz.dims ds["r_minor"] = dims, one * r[:, None, :] @@ -84,7 +91,7 @@ def _togen(*args): grids = {} for mode in range(5): - grids[modes[mode][0]] = [_togen(4, 2, nz, 1, 0.1, 0.5, mode) + (nz,) for nz in lst] + grids[modes[mode][0]] = [_togen(6, 2, nz, 1, 0.1, 0.5, mode) + (nz,) for nz in lst] if __name__ == "__main__": for todos in grids.values(): diff --git a/test/mms/radial_grid.py b/test/mms/radial_grid.py index 593dfa6..497e224 100644 --- a/test/mms/radial_grid.py +++ b/test/mms/radial_grid.py @@ -1,3 +1,5 @@ +import warnings + import zoidberg as zb import numpy as np import xarray as xr @@ -38,6 +40,11 @@ def gen_grid(nx, ny, nz, R0, r0, r1, mode=0): "tmp.nc", metric2d=False, ) + warnings.filterwarnings( + "ignore", + message="Duplicate dimension names present: dimensions {.*} appear more than once in dims=(.*). We do not yet support duplicate dimension names, but we do allow initial construction of the object. We recommend you rename the dims immediately to become distinct, as most xa", + category=UserWarning, + ) with xr.open_dataset("tmp.nc") as ds: dims = ds.dz.dims ds["r_minor"] = dims, one * r[:, None, :]