Comments (3)
Hey, @simbilod is currently working on an example for this.
You can just end the mesh at the symmetry plane and either use there a PMC(standard setting) or PEC (using metalic_boundaries) to have either even or odd modes.
Currently, you can already see it in the benchmark (yeah, we should add there more text, but they explain in the paper which sides are metalic :) ).
from femwell.
Indeed, you're right. That is a very simple solution and it seems to work. However, I tried to benchmark it with the rectangular waveguide and I get different results for the fundamental mode, which I don't know if I missed something or something else is going on. The code below gives an effective index of 1.871 for the fundamental TE mode when considering the full mesh and 1.899 when considering the symmetry plane, which is quite a significant difference. Did I miss something?
EDIT: Indeed I missed something. When I used the full mesh I define 'core = box(0,0,width/2, 1)', which is wrong. By replacing it with 'core = box(-width/2,0,width/2, 1)' it is solved and I now get the neff matching up to 1.899.
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants
import shapely
from shapely.ops import clip_by_rect
from shapely.geometry import LineString, box
from skfem import Basis, ElementTriP0, ElementTriP1
from skfem.io.meshio import from_meshio
from tqdm import tqdm
from femwell.maxwell.waveguide import compute_modes
from femwell.mesh import mesh_from_OrderedDict
from femwell.visualization import plot_domains
wavelength = 1.55 #um
num_modes = 8
width = 4 #um
#Find modes with full mesh
core = box(0,0,width/2, 1)
polygons = OrderedDict(
core = core,
box = clip_by_rect(core.buffer(2, resolution = 5),
-np.inf,
-np.inf,
np.inf,
0),
clad = clip_by_rect(core.buffer(2, resolution = 5),
-np.inf,
0,
np.inf,
np.inf),
)
resolutions = {"core": {"resolution": 0.1, "distance": 1}}
mesh = from_meshio(mesh_from_OrderedDict(polygons, resolutions, default_resolution_max=0.6))
basis0 = Basis(mesh, ElementTriP0())
epsilon = basis0.zeros(dtype = complex)
for subdomain, n in {"core": 1.9963, "box": 1.444, "clad": 1}.items():
epsilon[basis0.get_dofs(elements = subdomain)] = n**2
modes = compute_modes(basis0,
epsilon,
wavelength=wavelength,
num_modes=num_modes,
metallic_boundaries=True)
modes_full = modes
### Find modes with symmetry plane
polygons = OrderedDict(
core = core,
box = clip_by_rect(core.buffer(2, resolution = 5),
0,
-np.inf,
np.inf,
0),
clad = clip_by_rect(core.buffer(2, resolution = 5),
0,
0,
np.inf,
np.inf),
)
resolutions = {"core": {"resolution": 0.1, "distance": 1}}
mesh = from_meshio(mesh_from_OrderedDict(polygons, resolutions, default_resolution_max=0.6))
basis0 = Basis(mesh, ElementTriP0())
epsilon = basis0.zeros(dtype = complex)
for subdomain, n in {"core": 1.9963, "box": 1.444, "clad": 1}.items():
epsilon[basis0.get_dofs(elements = subdomain)] = n**2
modes = compute_modes(basis0,
epsilon,
wavelength=wavelength,
num_modes=num_modes,
metallic_boundaries=True)
modes_sym = modes
print(modes_full.n_effs[0])
print(modes_sym.n_effs[0])
modes_full[0].plot_component('E', 'x')
modes_sym[0].plot_component('E', 'x')
Output:
(1.8716330817857192-6.7088318229796605e-18j)
(1.8991017992315486-3.272880415020128e-17j)
from femwell.
Nice!
I am making an example with this, but it is a bit trivial, so I am also trying to add a the functionality to reflect the half-mode into a full mode so it is easier to take overlap with other modes
from femwell.
Related Issues (20)
- Calculation of effective mode area or nonlinear coefficent HOT 13
- efficient wide sweeps for waveguide dispersion HOT 2
- mode solver neff jumps HOT 6
- treating quasi-TE mode in overlap with the mode of an optical fiber HOT 1
- Capillary waveguide help HOT 14
- incorrect neff in long wavelength HOT 10
- Calculation of effective area for Spontaneous Four-wave Mixing (SFWM) HOT 3
- Possible issue with modes / overlap integrals in complex systems HOT 1
- Example to reproduce
- mesh_from_Dict does not handle MultiLineStrings() HOT 4
- Giving an initial solution to the solver (thermal and electrostatic sims) HOT 1
- Anisotropic materials HOT 11
- Bibliography file is a bit messy
- References in docs can contain both URL and doi HOT 2
- Maximum number of iterations taken when calling eigen solver from Arpack HOT 2
- plotting Waveguide mode components HOT 2
- Windows installation of femwell HOT 3
- How to Install the Julia version of femwell HOT 6
- Adjust propagation loss example to paper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from femwell.