Skip to content

Commit

Permalink
make the initial number of grid points linearly scale with m
Browse files Browse the repository at this point in the history
  • Loading branch information
oskooi committed Jan 23, 2024
1 parent 37d778f commit c729a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/near2far.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void greencyl(std::complex<double> *EH, const vec &x, double freq, double eps, d
/* 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 = 128;
const int N0 = 16 + int(4 * abs(m));
double dphi = 2.0 / N0; // factor of 2*pi*r is already included in add_dft weight
for (int N = N0; N <= 65536; N *= 2) {
std::complex<double> EH_sum[6];
Expand Down

0 comments on commit c729a44

Please sign in to comment.