From 31c9b4b9ced62e720a83f1f765fdcdf4c2649c06 Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Sun, 22 Oct 2023 21:47:48 -0700 Subject: [PATCH] add check for cylindrical coordinates to get_array_metadata --- python/simulation.py | 2 +- src/array_slice.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/simulation.py b/python/simulation.py index 08eaa61a5..c7282b078 100644 --- a/python/simulation.py +++ b/python/simulation.py @@ -4053,7 +4053,7 @@ def get_array_metadata( or `center`/`size`. In both cases, the return value is a tuple `(x,y,z,w)`, where: + `x,y,z` are 1d NumPy arrays storing the $x,y,z$ coordinates of the points in the - grid slice + grid slice. Cylindrical coordinates is not supported. + `w` is a NumPy array of the same dimensions as the array returned by `get_array`/`get_dft_array`, whose entries are the weights in a cubature rule for integrating over the spatial region (with the points in the cubature rule diff --git a/src/array_slice.cpp b/src/array_slice.cpp index 37cd7791a..782994ac2 100644 --- a/src/array_slice.cpp +++ b/src/array_slice.cpp @@ -786,6 +786,8 @@ complex *fields::get_source_slice(const volume &where, component source /***************************************************************/ /***************************************************************/ std::vector fields::get_array_metadata(const volume &where) { + if (where.dim == Dcyl) + meep::abort("get_array_metadata does not support cylindrical coordinates."); /* get extremal corners of subgrid and array of weights, collapsed if necessary */ size_t dims[3];