Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPdeS committed Jul 6, 2022
1 parent d065c23 commit 9fadf4f
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 453 deletions.
258 changes: 0 additions & 258 deletions Makefile

This file was deleted.

49 changes: 23 additions & 26 deletions Perso/ABAB.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from SuPyMode.Geometry import Geometry, Fused4, Circle
from SuPyMode.Geometry import Geometry, Fused3, Circle
from SuPyMode.Solver import SuPySolver
from SuPyMode.fibers import *
from PyOptik import ExpData
Expand All @@ -7,49 +7,46 @@

FiberA = Fiber_DCF1300S_20(Wavelength=1.55)
FiberB = Fiber_DCF1300S_33(Wavelength=1.55)
FiberC = Fiber_New(Wavelength=1.55)

nMode = 6
Xbound = [-150, 0]
Ybound = [-150, 0]
Nx = 100
Ny = 100
Xbound = [-130, 130]
Ybound = [-130, 130]
Nx = 130
Ny = 130

Index = ExpData('FusedSilica').GetRI(1.55e-6)

Clad = Fused4(Radius = 62.5, Fusion = 0.95, Index = Index)
Clad = Fused3(Radius = 62.5, Fusion = 0.95, Index = Index)


Core0 = FiberA.Get(Clad.C[0])
Core1 = FiberB.Get(Clad.C[1])
Core2 = FiberA.Get(Clad.C[2])
Core3 = FiberB.Get(Clad.C[3])
Core2 = FiberC.Get(Clad.C[2])


Geo = Geometry(Clad = Clad,
Objects = [*Core0, *Core1, *Core2, *Core3],
Objects = [*Core0, *Core1, *Core2],
Xbound = Xbound,
Ybound = Ybound,
Nx = Nx,
Ny = Ny)

#Geo.Rotate(45)
Geo.Rotate(45)

Geo.Plot()


#Geo.Plot()
Sol = SuPySolver(Coupler=Geo, Tolerance=1e-8, MaxIter = 10000)
Sol.CreateSuperSet(Wavelength=1.55, NStep=300, ITRi=1, ITRf=0.05)

Sol.AddModes(Sorting = 'Field',
Symmetries = {'Right': 0, 'Left': 0, 'Top': 0, 'Bottom': 0},
nMode = 8,
sMode = 4 )


Sol = SuPySolver(Coupler=Geo, Tolerance=1e-8, MaxIter = 10000, nMode=8, sMode=5)
Set = Sol.GetSet()

SuperSet = Sol.GetModes(wavelength = 1.55,
Nstep = 300,
ITRi = 1,
ITRf = 0.05,
Sorting = 'Index',
RightSymmetry = 1,
LeftSymmetry = 0,
TopSymmetry = -1,
BottomSymmetry = 0
)
Set.PlotAdiabatic()

#SuperSet.PlotFields(iter=-1)
#SuperSet.Plot(Input=['Index', 'Adiabatic'], iter=[-1])
SuperSet.ExportPDF(Directory='ABAB_xS_yA', iter=[0, 200, 290])
# SuperSet.ExportPDF(Directory='ABAB_xS_yA', iter=[0, 200, 290])
4 changes: 2 additions & 2 deletions SuPyMode/Geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def Plot(self):

self.CreateMesh()

Fig = Scene('SuPyMode Figure', UnitSize=(4,4))
Fig = Scene('SuPyMode Figure', UnitSize=(6,6))
Colorbar = ColorBar(Discreet=True, Position='right')

ax = Axis(Row = 0,
Expand Down Expand Up @@ -322,7 +322,7 @@ class BaseFused():
Index: float
debug: bool
Gradient: object = None

def __post_init__(self):
self.hole = None
self.N = len(self.Angle)
Expand Down
Loading

0 comments on commit 9fadf4f

Please sign in to comment.