Skip to content
Snippets Groups Projects
Commit 708bc243 authored by Guillaume Demesy's avatar Guillaume Demesy
Browse files

Bermudez PML

parent 3ef833db
No related branches found
No related tags found
No related merge requests found
Pipeline #10020 passed
......@@ -125,27 +125,37 @@ Function{
a_pml = 1.;
b_pml = 1.;
// bermu
n1[] = Sqrt[epsr1[]];
n2[] = Sqrt[epsr2[]];
k1norm[]= k0*n1[];
k2norm[]= k0*n2[];
Zmax = PML_top_hh;
Zmin = hh_L_6;
Damp_pml_top[] = 1/Abs[Zmax + PML_top - Z[]];
Damp_pml_bot[] = 1/Abs[Zmin - PML_bot - Z[]];
// DampingProfileX[] = 1/(Xmax + SizePMLX - Fabs[X[]]) - 1/(SizePMLX);
sx = 1.;
sz[] = Complex[a_pml,b_pml];
sz_bermutop[] = Complex[1,Damp_pml_top[]/k1norm[]];
sz_bermubot[] = Complex[1,Damp_pml_bot[]/k2norm[]];
sy = 1.;
n1[] = Sqrt[epsr1[]];
n2[] = Sqrt[epsr2[]];
k1norm[] = k0*n1[];
k2norm[] = k0*n2[];
Zmax = PML_top_hh;
Zmin = hh_L_6;
Damp_pml_top[] = 1/(Zmax + PML_top - Fabs[Z[]]) - 1/(PML_top);
Damp_pml_bot[] = 1/(Zmin + PML_top - Fabs[Z[]]) - 1/(PML_bot);
Sigma_top[] = 0.5*(Damp_pml_top[] + Fabs[Damp_pml_top[]]);
Sigma_bot[] = 0.5*(Damp_pml_bot[] + Fabs[Damp_pml_bot[]]);
If (PML_TYPE==0)
sz[] = Complex[a_pml,b_pml];
Else
sz[PMLtop] = Complex[1,Damp_pml_top[]/k1norm[]];
sz[PMLbot] = Complex[1,Damp_pml_bot[]/k2norm[]];
EndIf
sx = 1.;
sy = 1.;
epsr[PMLtop] = Re[epsr1[]]*TensorDiag[sz[]*sy/sx,sx*sz[]/sy,sx*sy/sz[]];
mur[PMLtop] = TensorDiag[sz[]*sy/sx,sx*sz[]/sy,sx*sy/sz[]];
epsr[PMLbot] = Re[epsr2[]]*TensorDiag[sz[]*sy/sx,sx*sz[]/sy,sx*sy/sz[]];
mur[PMLbot] = TensorDiag[sz[]*sy/sx,sx*sz[]/sy,sx*sy/sz[]];
// epsr[PMLtop] = Re[epsr1[]]*TensorDiag[sz_bermutop[]*sy/sx,sx*sz_bermutop[]/sy,sx*sy/sz_bermutop[]];
// mur[PMLtop] = TensorDiag[sz_bermutop[]*sy/sx,sx*sz_bermutop[]/sy,sx*sy/sz_bermutop[]];
// epsr[PMLbot] = Re[epsr2[]]*TensorDiag[sz_bermubot[]*sy/sx,sx*sz_bermubot[]/sy,sx*sy/sz_bermubot[]];
// mur[PMLbot] = TensorDiag[sz_bermubot[]*sy/sx,sx*sz_bermubot[]/sy,sx*sy/sz_bermubot[]];
// epsr[PMLbot] = epsr2[];
// mur[PMLbot] = TensorDiag[1,1,1];
......
......@@ -62,6 +62,7 @@ DefineConstant[
refine_mesh_L_5= {0.3 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {0.3 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 30 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 0 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
......
......@@ -62,7 +62,8 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 30 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
......@@ -62,7 +62,8 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 30 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
......@@ -63,7 +63,8 @@ DefineConstant[
refine_mesh_L_5 = {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6 = {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 10 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
......@@ -7,8 +7,7 @@ pp5 = "5Computational Parameters";
pp6 = "6Output";
DefineConstant[
FLAG_TOTAL = {0 , Name StrCat[pp1,"/0Formulation"],Choices {0="scattered field",1="total field"}},
// lambda0 = {495 , Name StrCat[pp1,"/1lambda0 [nm]"]},
lambda0 = {400 , Min 400, Max 800, Step 200, Name StrCat[pp1, "0wavelength [nm]"] , Loop 1},
lambda0 = {495 , Name StrCat[pp1,"/1lambda0 [nm]"]},
thetadeg = {40 , Name StrCat[pp1,"/2theta0 [deg]"]},
phideg = {36 , Name StrCat[pp1,"/3phi0 [deg]"]},
psideg = {72 , Name StrCat[pp1,"/4psi0 [deg]"]},
......@@ -63,6 +62,7 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 10 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 0 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
......
......@@ -68,7 +68,8 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 30 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
......@@ -62,6 +62,7 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 50 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
......
......@@ -63,7 +63,8 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 10 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
......@@ -63,7 +63,7 @@ DefineConstant[
refine_mesh_L_5= {2 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {2 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {0 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = { 20 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
......
......@@ -62,7 +62,8 @@ DefineConstant[
refine_mesh_L_5= {1 , Name StrCat[pp5,"/7refine layers/5refine mesh layer 5 [-]"]},
refine_mesh_L_6= {1 , Name StrCat[pp5,"/7refine layers/6refine mesh layer 6 [-]"]},
FlagLinkFacets = {1 , Name StrCat[pp5,"/8FlagLinkFacets? [-]"], Choices {0,1}, Visible 0},
PML_TYPE = {0 , Name StrCat[pp5,"/9PML damping profile [-]"], Choices {0="constant profile",1="Bermudez profile"}, Visible 0},
InterpSampling = {15 , Name StrCat[pp6,"/0Interpolation grid step [nm]"]},
Flag_interp_cubic = { 1 , Name StrCat[pp6,"/1Interpolate on cubic grid?"], Choices {0,1} },
FlagOutEtotCuts = { 1 , Name StrCat[pp6,"/2Output Total Electric Field cuts?"] , Choices {0,1} },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment