Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes zoidberg #3054

Merged
merged 9 commits into from
Jan 9, 2025
Merged
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
4 changes: 4 additions & 0 deletions .ci_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ else
export OMPI_MCA_rmaps_base_oversubscribe=yes
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
export TRAVIS=true
# Try limiting openmp threads
export FLEXIBLAS=NETLIB
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OMP_NUM_THREADS=1
cd
cd BOUT-dev
echo "starting configure"
Expand Down
15 changes: 8 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Jinja2~=3.1.4
numpy~=2.0.0
scipy>=1.11.0
netcdf4~=1.7.1
Jinja2>=3.1.4
numpy>=2.0.0
scipy>=1.14.1
netcdf4>=1.7.1
matplotlib>=3.7.0
Cython~=3.0.0
boututils~=0.2.1
boutdata~=0.2.1
Cython>=3.0.0
boututils>=0.2.1
boutdata>=0.2.1
zoidberg>=0.2.2
16 changes: 11 additions & 5 deletions tests/MMS/spatial/fci/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# Cores: 2
# requires: zoidberg

from __future__ import division
from __future__ import print_function

from boututils.run_wrapper import build_and_log, launch_safe
from boutdata.collect import collect
import boutconfig as conf
Expand Down Expand Up @@ -61,7 +58,7 @@ for nslice in nslices:
# Note that the Bz and Bzprime parameters here must be the same as in mms.py
field = zb.field.Slab(Bz=0.05, Bzprime=0.1)
# Create rectangular poloidal grids
poloidal_grid = zb.poloidal_grid.RectangularPoloidalGrid(nx, n, 0.1, 1.0)
poloidal_grid = zb.poloidal_grid.RectangularPoloidalGrid(nx, n, 0.1, 1.0, MXG=1)
# Set the ylength and y locations
ylength = 10.0

Expand All @@ -74,7 +71,16 @@ for nslice in nslices:
# Create the grid
grid = zb.grid.Grid(poloidal_grid, ycoords, ylength, yperiodic=yperiodic)
# Make and write maps
maps = zb.make_maps(grid, field, nslice=nslice, quiet=True)
from scipy.interpolate import RectBivariateSpline as RBS

def myRBS(a, b, c):
mx, my = c.shape
kx = max(mx - 1, 1)
kx = min(kx, 3)
return RBS(a, b, c, kx=kx)

zb.poloidal_grid.RectBivariateSpline = myRBS
maps = zb.make_maps(grid, field, nslice=nslice, quiet=True, MXG=1)
zb.write_maps(
grid, field, maps, new_names=False, metric2d=conf.isMetric2D(), quiet=True
)
Expand Down
13 changes: 7 additions & 6 deletions tests/integrated/test-fci-boundary/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ mthread = 2
directory = "data"

with DataFile("grid.fci.nc") as grid:
xfwd = grid.read("forward_xt_prime")[1:-1]
xbwd = grid.read("backward_xt_prime")[1:-1]
MXG = grid.get("MXG", default=1)
xfwd = grid.read("forward_xt_prime")[MXG:-MXG]
xbwd = grid.read("backward_xt_prime")[MXG:-MXG]

nx = xfwd.shape[0]

regions = {
"xin_fwd": xfwd < 1,
"xout_fwd": xfwd > nx,
"xin_bwd": xbwd < 1,
"xout_bwd": xbwd > nx,
"xin_fwd": xfwd < MXG,
"xout_fwd": xfwd > nx + MXG - 1,
"xin_bwd": xbwd < MXG,
"xout_bwd": xbwd > nx + MXG - 1,
}
regions = {k: v.astype(int) for k, v in regions.items()}

Expand Down
Loading