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

Make the initial number of azimuthal grid points in near-to-far field transformation in cylindrical coordinates a user parameter #2764

Closed
oskooi opened this issue Jan 19, 2024 · 0 comments · Fixed by #2766

Comments

@oskooi
Copy link
Collaborator

oskooi commented Jan 19, 2024

Currently, the computation of the far fields in cylindrical coordinates involves an integration in $\phi$ (azimuthal angle) which is based on repeatedly doubling a grid of $\phi$ points using a hard-coded initial value:

meep/src/near2far.cpp

Lines 288 to 291 in 04fa305

/* Perform phi integral. Since phi integrand is smooth, quadrature with equally spaced points
should converge exponentially fast with the number N of quadrature points. We
repeatedly double N until convergence to tol is achieved, re-using previous points. */
const int N0 = 4;

The value of 4 turns out to be too small in some cases which produces discretization artifacts in the output as demonstrated in #2726 (comment). As such, it would be useful to make the initial number of $\phi$ grid points a user parameter in the routines get_farfield and get_farfields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant