-
Notifications
You must be signed in to change notification settings - Fork 641
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
subpixel averaging using adaptive cubature #764
Comments
To enable this, basically I think you need two things:
In principle, we could also do subpixel averaging from a high-resolution epsilon-input-file, but I suspect that will be insanely slow because the corresponding bilinear interpolation ε(x) is only piecewise linear, which will destroy the convergence of the adaptive cubature scheme we are using. In the long run, there is the potential for a more efficient scheme:
The reason this works is that, for smooth surfaces, in the limit of small pixels the intersection with the pixels is always approximately planar (plus higher-order corrections that don't affect 2nd-order accuracy). |
Beyond just enabling a |
Instead of a |
|
An optimization: in This will eliminate the averaging from regions where ε is uniform. (In principle, |
It looks like the for (int i = 0; i < 3; ++i)
chi1inv_row[i] = n[rownum] * n[i] * (minveps - 1 / meps);
chi1inv_row[rownum] += 1 / meps; code in meepgeom.cpp is wrong. In particular, the correct formula for the effective ε⁻¹ in the scalar case is for (int i = 0; i < 3; ++i)
chi1inv_row[i] = n[rownum] * n[i] * (minveps - 1 / meps);
chi1inv_row[rownum] = 1 / meps + n[rownum] * n[rownum] * (minveps - 1 / meps); Update: I take that back. The previous code was correct. The |
The ε integrand ( |
I just noticed a bug: these lines should use |
Also, we can change the |
The routines
fallback_chi1inv_row
insrc/meepgeom.cpp
andnormal_vector
insrc/anisotropic_averaging.cpp
provide fallback methods using adaptive cubature for computing the effective permittivity tensor and interface normal for subpixel averaging in cases not involvingGeometricObject
s such as amaterial-function
orepsilon-input-file
. Because these numerical integration routines tend to be rather slow, these functions have been disabled and no smoothing is performed formaterial-function
orepsilon-input-file
.It would be useful to enable the fallback adaptive cubature routines as an option mainly for e.g. testing purposes. Currently, they seem to be inaccessible from the interface. As an example, the following script which is adapted from the tutorial example for the ring resonator creates the ring geometry using a material function rather than two
Cylinder
s.The output from
Harminv
is the same regardless of whethereps_averaging
isTrue
orFalse
.The text was updated successfully, but these errors were encountered: