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

Dielectric smoothing/averaging #22

Open
sp94 opened this issue May 13, 2021 · 2 comments
Open

Dielectric smoothing/averaging #22

sp94 opened this issue May 13, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@sp94
Copy link
Owner

sp94 commented May 13, 2021

Accuracy of FDFD and PWEM solutions can be improved by dielectric averaging

Resources

@sp94 sp94 added the enhancement New feature or request label May 13, 2021
@sp94
Copy link
Owner Author

sp94 commented May 13, 2021

Could signed distance functions be a fast way to implement this smoothing?

Such as in this example for blurred rectangles

@kabume
Copy link
Contributor

kabume commented May 13, 2021

A simple example can be used:

for m=1:Nx # grid length of x-axis
    for n=1:Ny # grid length of y-axis
        index=(n-1)*Nx+m
        # flag function: Determine whether the lattice is medium or air, if medium return 1, else return 0
        flag1 = flag((m-1)*deltax, (n-1)*deltay)
        flag2 = flag((m-1)*deltax, (n)*deltay)
        flag3 = flag((m)*deltax, (n-1)*deltay)
        flag4 = flag((m)*deltax, (n)*deltay)
        eps[index] = 1 + (flag1 + flag2 +flag3 +flag4) / 4 * (eps0[index] - 1)
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants