-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04218e9
commit 5591e63
Showing
6 changed files
with
111 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,109 @@ | ||
""" | ||
3x3 Coupler | ||
=========== | ||
""" | ||
|
||
# %% | ||
# Importing the script dependencies | ||
from SuPyMode.workflow import Workflow, configuration, fiber_catalogue, Boundaries | ||
|
||
# %% | ||
# Creating the fiber list for mesh | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# In this example we want to simulate a single fiber at wavelength 1550 nm. | ||
wavelength = 900e-9 | ||
|
||
# %% | ||
# Generating the fiber structure | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Here we define the cladding and fiber structure to model the problem | ||
clad_structure = configuration.ring.FusedProfile_03x03 | ||
|
||
custom_fiber_1 = fiber_catalogue.CustomFiber(wavelength=wavelength) | ||
custom_fiber_1.add_silica_pure_cladding(radius=62.5e-6, name='outer-clad') | ||
|
||
custom_fiber_1.create_and_add_new_structure( | ||
radius=11.5e-6, | ||
NA=0.2, | ||
name='inner-clad' | ||
) | ||
from SuPyMode.workflow import Workflow, configuration, fiber_catalogue, Boundaries, AlphaProfile | ||
|
||
custom_fiber_1.create_and_add_new_structure( | ||
radius=2.0e-6, | ||
NA=0.13, | ||
name='core' | ||
) | ||
wavelength = 1550e-9 | ||
|
||
|
||
custom_fiber_2 = fiber_catalogue.CustomFiber(wavelength=wavelength) | ||
custom_fiber_2.add_silica_pure_cladding(radius=62.5e-6, name='outer-clad') | ||
fiber_0 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
fiber_0.add_silica_pure_cladding() | ||
fiber_0.create_and_add_new_structure(name='core', radius=9.0e-6 / 2, NA=0.14) | ||
|
||
custom_fiber_2.create_and_add_new_structure( | ||
radius=13.1e-6, | ||
NA=0.19, | ||
name='inner-clad' | ||
) | ||
fiber_1 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
fiber_1.add_silica_pure_cladding() | ||
fiber_1.create_and_add_new_structure(name='core', radius=11.0e-6 / 2, NA=0.14) | ||
|
||
custom_fiber_2.create_and_add_new_structure( | ||
radius=2.05e-6, | ||
NA=0.117, | ||
name='core' | ||
) | ||
fiber_2 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
fiber_2.add_silica_pure_cladding() | ||
fiber_2.create_and_add_new_structure(name='core', radius=13.0e-6 / 2, NA=0.14) | ||
|
||
fiber_configuration_0 = [ | ||
fiber_0, fiber_1, fiber_2 | ||
] | ||
|
||
|
||
custom_fiber_3 = fiber_catalogue.CustomFiber(wavelength=wavelength) | ||
custom_fiber_3.add_silica_pure_cladding(radius=62.5e-6, name='outer-clad') | ||
# fiber_0 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_0.add_silica_pure_cladding() | ||
# fiber_0.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) # or 0.15 | ||
# fiber_0.create_and_add_new_structure(name='core', radius=9.0e-6 / 2, NA=0.14) | ||
|
||
custom_fiber_3.create_and_add_new_structure( | ||
radius=14.9e-6, | ||
NA=0.2, | ||
name='inner-clad' | ||
) | ||
# fiber_1 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_1.add_silica_pure_cladding() | ||
# fiber_1.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) # or 0.15 | ||
# fiber_1.create_and_add_new_structure(name='core', radius=11.0e-6 / 2, NA=0.14) | ||
|
||
custom_fiber_3.create_and_add_new_structure( | ||
radius=2.75e-6, | ||
NA=0.14, | ||
name='core' | ||
) | ||
# fiber_2 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_2.add_silica_pure_cladding() | ||
# fiber_2.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) # or 0.15 | ||
# fiber_2.create_and_add_new_structure(name='core', radius=13.0e-6 / 2, NA=0.14) | ||
|
||
fiber_list = [ | ||
custom_fiber_1, | ||
custom_fiber_2, | ||
custom_fiber_3 | ||
] | ||
# fiber_configuration_1 = [ | ||
# fiber_0, fiber_1, fiber_2 | ||
# ] | ||
|
||
|
||
# %% | ||
# Defining the boundaries of the system | ||
boundaries = [ | ||
Boundaries(), | ||
] | ||
# fiber_0 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_0.add_silica_pure_cladding() | ||
# fiber_0.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) | ||
# fiber_0.create_and_add_new_structure(name='core', radius=9.0e-6 / 2, NA=0.14) | ||
|
||
# fiber_1 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_1.add_silica_pure_cladding() | ||
# fiber_1.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) | ||
# fiber_1.create_and_add_new_structure(name='core', radius=11.0e-6 / 2, NA=0.14) | ||
|
||
# fiber_2 = fiber_catalogue.GenericFiber(wavelength=wavelength) | ||
# fiber_2.add_silica_pure_cladding() | ||
# fiber_2.create_and_add_new_structure(name='core', radius=30.0e-6 / 2, NA=0.19) | ||
# fiber_2.create_and_add_new_structure(name='core', radius=13.0e-6 / 2, NA=0.14) | ||
|
||
# fiber_configuration_1 = [ | ||
# fiber_catalogue.load_fiber('DCF1300S_42', wavelength=wavelength), | ||
# fiber_catalogue.load_fiber('DCF1300S_20', wavelength=wavelength), | ||
# fiber_catalogue.load_fiber('DCF1300S_26', wavelength=wavelength), | ||
# ] | ||
|
||
|
||
clad_profile = configuration.ring.FusedProfile_03x03 | ||
|
||
capillary_tube = fiber_catalogue.CapillaryTube( | ||
radius=150e-6, | ||
wavelength=wavelength, | ||
delta_n=-15e-3 | ||
) | ||
|
||
|
||
# %% | ||
# Generating the computing workflow | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Workflow class to define all the computation parameters before initializing the solver | ||
workflow = Workflow( | ||
fiber_list=fiber_list, # List of fiber to be added in the mesh, the order matters. | ||
clad_structure=clad_structure, # Cladding structure, if None provided then no cladding is set. | ||
fusion_degree=0.8, # Degree of fusion of the structure if applicable. | ||
fiber_list=fiber_configuration_0, # List of fiber to be added in the mesh, the order matters. | ||
clad_structure=clad_profile, # Cladding structure, if None provided then no cladding is set. | ||
capillary_tube=capillary_tube, # In this case we add a wrapping capillary tube around the fused structure. | ||
fusion_degree='auto', # Degree of fusion of the structure if applicable. | ||
wavelength=wavelength, # Wavelength used for the mode computation. | ||
resolution=220, # Number of point in the x and y axis [is divided by half if symmetric or anti-symmetric boundaries]. | ||
resolution=140, # Number of point in the x and y axis [is divided by half if symmetric or anti-symmetric boundaries]. | ||
x_bounds="centering", # Mesh x-boundary structure. | ||
y_bounds="centering", # Mesh y-boundary structure. | ||
boundaries=boundaries, # Set of symmetries to be evaluated, each symmetry add a round of simulation | ||
n_sorted_mode=5, # Total computed and sorted mode. | ||
n_added_mode=5, # Additional computed mode that are not considered later except for field comparison [the higher the better but the slower]. | ||
plot_geometry=True, # Plot the geometry mesh before computation. | ||
air_padding_factor=1.1, | ||
debug_mode=2, # Print the iteration step for the solver plus some other important steps. | ||
boundaries=[Boundaries()], # Set of symmetries to be evaluated, each symmetry add a round of simulation | ||
n_sorted_mode=4, # Total computed and sorted mode. | ||
n_added_mode=3, # Additional computed mode that are not considered later except for field comparison [the higher the better but the slower]. | ||
# plot_geometry=True, # Plot the geometry mesh before computation. | ||
plot_field=True, | ||
debug_mode=1, # Define the degree of debug printout, from 0 to 3. [Does not work properly on jupyter notebooks] | ||
auto_label=True, # Auto labeling the mode. Label are not always correct and should be verified afterwards. | ||
itr_final=0.01, # Final value of inverse taper ratio to simulate | ||
clad_rotation=0, # Rotate the geoemtry in the given angle in degree | ||
index_scrambling=1e-7 # Scrambling of refractive index value in order to lift mode degeneracy [useful for some analysis] | ||
itr_final=0.05, # Final value of inverse taper ratio to simulate | ||
itr_initial=1.00, | ||
n_step=500, | ||
index_scrambling=0e-4 # Scrambling of refractive index value in order to lift mode degeneracy [useful for some analysis] | ||
) | ||
|
||
superset = workflow.get_superset() | ||
|
||
# # %% | ||
# # Field computation: :math:`E_{i,j}` | ||
# # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# _ = superset.plot(plot_type='field', slice_list=[], itr_list=[1.0, 0.3, 0.01]).show() | ||
|
||
# # %% | ||
# # Effective index: :math:`n^{eff}_{i,j}` | ||
# # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# _ = superset.plot(plot_type='index').show() | ||
profile = AlphaProfile(symmetric=False, add_end_of_taper_section=True) | ||
|
||
# # %% | ||
# # Modal normalized coupling: :math:`C_{i,j}` | ||
# # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# _ = superset.plot(plot_type='normalized-coupling').show() | ||
|
||
# # %% | ||
# # Adiabatic criterion: :math:`\tilde{C}_{i,j}` | ||
# # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# _ = superset.plot(plot_type='adiabatic').show() | ||
profile.add_taper_segment( | ||
alpha=0, | ||
initial_heating_length=2e-3, | ||
stretching_length=0.2e-3 * 20 | ||
) | ||
|
||
# superset.save_superset_instance() | ||
superset.generate_pdf_report(filename='rodrigo_mames_las_vergas.pdf', directory='auto') | ||
profile.initialize() | ||
|
||
# - | ||
superset.plot_adiabatic(add_profile=profile) |