diff --git a/DiffractionGratings/grating2D.pro b/DiffractionGratings/grating2D.pro index e5e9b8dec4ed049e3b3aee758222117d9ce398d0..607b7daf65b27d8c0538a9ffb2e40ae4d637a1b0 100644 --- a/DiffractionGratings/grating2D.pro +++ b/DiffractionGratings/grating2D.pro @@ -427,55 +427,55 @@ PostProcessing { { Name Q_tot ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[Im[CompZZ[epsilonr[]]]] * ( SquNorm[-CompY[{Grad u2d}]*I[]/(omega0*epsilon0*CompXX[epsilonr[]])+Ex1[]/CompXX[epsilonr[]]*CompXX[epsilonr_annex[]] ] + SquNorm[CompX[{Grad u2d}]*I[]/(omega0*epsilon0*CompYY[epsilonr[]])+Ey1[]/CompYY[epsilonr[]]*CompYY[epsilonr_annex[]] ] ) / (Pinc[]*d) ] ; In Plot_domain ; Integration Int_1 ; Jacobian JVol ; } } } { Name lambda_step ; Value { Local { [ lambda0/nm ]; In Omega ; Jacobian JVol; } } } EndIf - If (flag_Hparallel==0) - { Name testte ; Value { Local { [ {u2d} ]; In Omega; Jacobian JVol; } } } - { Name epsr ; Value { Local { [ CompZZ[epsilonr[]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_diff ; Value { Local { [ {u2d}+u1d[] ]; In Omega; Jacobian JVol; } } } - { Name Ez_tot ; Value { Local { [ {u2d}+u1[] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totp1 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 1*-alpha[]*d],Sin[ 1*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totp2 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 2*-alpha[]*d],Sin[ 2*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totp3 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 3*-alpha[]*d],Sin[ 3*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totp4 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 4*-alpha[]*d],Sin[ 4*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totm1 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-1*-alpha[]*d],Sin[-1*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totm2 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-2*-alpha[]*d],Sin[-2*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totm3 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-3*-alpha[]*d],Sin[-3*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name Ez_totm4 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-4*-alpha[]*d],Sin[-4*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } - { Name boundary ; Value { Local { [ bndCol[] ] ; In Plot_bnd ; Jacobian JVol ; } } } - { Name u ; Value { Local { [ {u2d} ]; In Omega; Jacobian JVol; } } } - - // modif effic - For i In {0:2*nb_orders} - { Name s_r~{i} ; Value { - Integral{ [ expialpha_orders~{i}[] * ({u2d}+u1d[])/d ] ; - In SurfCutSuper1 ; Jacobian JSur ; Integration Int_1 ; } } } - { Name s_t~{i} ; Value { - Integral{ [ expialpha_orders~{i}[] * ({u2d}+u1d[])/d ] ; - In SurfCutSubs1 ; Jacobian JSur ; Integration Int_1 ; } } } - { Name order_t_angle~{i} ; Value { - Local{ [-Atan2[Re[alpha_orders~{i}[]],Re[betat_sub~{i}[]]]/deg2rad ] ; - In Omega; Jacobian JVol; } } } - { Name order_r_angle~{i} ; Value { - Local{ [ Atan2[Re[alpha_orders~{i}[]],Re[betat_sup~{i}[]]]/deg2rad ] ; - In Omega; Jacobian JVol; } } } - EndFor - For i In {0:2*nb_orders} - { Name eff_r~{i} ; Value { - Term{ Type Global; [ SquNorm[#i]*betat_sup~{i}[]/beta_sup[] ] ; - In SurfCutSuper1 ; } } } - { Name eff_t~{i} ; Value { - Term{ Type Global; [ SquNorm[#(2*nb_orders+1+i)]*(betat_sub~{i}[]/beta_sup[])] ; - In SurfCutSubs1 ; } } } - EndFor - For i In {0:N_rods-1:1} - { Name Q_rod~{i} ; Value { Integral { [0.5 * epsilon0*omega0*Fabs[epsr_rods_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In rod~{i} ; Integration Int_1 ; Jacobian JVol ; } } } - EndFor - { Name Q_sub ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_sub_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In sub ; Integration Int_1 ; Jacobian JVol ; } } } - { Name Q_rod_out ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_rod_out_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In rod_out ; Integration Int_1 ; Jacobian JVol ; } } } - { Name Q_layer_dep ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_layer_dep_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In layer_dep ; Integration Int_1 ; Jacobian JVol ; } } } - { Name Q_layer_cov ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_layer_cov_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In layer_cov ; Integration Int_1 ; Jacobian JVol ; } } } - { Name Q_tot ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[Im[CompXX[epsilonr[]]]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In Plot_domain ; Integration Int_1 ; Jacobian JVol ; } } } - { Name lambda_step ; Value { Local { [ lambda0/nm ]; In Omega ; Jacobian JVol; } } } - EndIf + If (flag_Hparallel==0) + { Name testte ; Value { Local { [ {u2d} ]; In Omega; Jacobian JVol; } } } + { Name epsr ; Value { Local { [ CompZZ[epsilonr[]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_diff ; Value { Local { [ {u2d}+u1d[] ]; In Omega; Jacobian JVol; } } } + { Name Ez_tot ; Value { Local { [ {u2d}+u1[] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totp1 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 1*-alpha[]*d],Sin[ 1*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totp2 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 2*-alpha[]*d],Sin[ 2*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totp3 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 3*-alpha[]*d],Sin[ 3*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totp4 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[ 4*-alpha[]*d],Sin[ 4*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totm1 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-1*-alpha[]*d],Sin[-1*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totm2 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-2*-alpha[]*d],Sin[-2*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totm3 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-3*-alpha[]*d],Sin[-3*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name Ez_totm4 ; Value { Local { [ ({u2d}+u1[])*Complex[Cos[-4*-alpha[]*d],Sin[-4*-alpha[]*d]] ]; In Omega; Jacobian JVol; } } } + { Name boundary ; Value { Local { [ bndCol[] ] ; In Plot_bnd ; Jacobian JVol ; } } } + { Name u ; Value { Local { [ {u2d} ]; In Omega; Jacobian JVol; } } } + + // modif effic + For i In {0:2*nb_orders} + { Name s_r~{i} ; Value { + Integral{ [ expialpha_orders~{i}[] * ({u2d}+u1d[])/d ] ; + In SurfCutSuper1 ; Jacobian JSur ; Integration Int_1 ; } } } + { Name s_t~{i} ; Value { + Integral{ [ expialpha_orders~{i}[] * ({u2d}+u1d[])/d ] ; + In SurfCutSubs1 ; Jacobian JSur ; Integration Int_1 ; } } } + { Name order_t_angle~{i} ; Value { + Local{ [-Atan2[Re[alpha_orders~{i}[]],Re[betat_sub~{i}[]]]/deg2rad ] ; + In Omega; Jacobian JVol; } } } + { Name order_r_angle~{i} ; Value { + Local{ [ Atan2[Re[alpha_orders~{i}[]],Re[betat_sup~{i}[]]]/deg2rad ] ; + In Omega; Jacobian JVol; } } } + EndFor + For i In {0:2*nb_orders} + { Name eff_r~{i} ; Value { + Term{ Type Global; [ SquNorm[#i]*betat_sup~{i}[]/beta_sup[] ] ; + In SurfCutSuper1 ; } } } + { Name eff_t~{i} ; Value { + Term{ Type Global; [ SquNorm[#(2*nb_orders+1+i)]*(betat_sub~{i}[]/beta_sup[])] ; + In SurfCutSubs1 ; } } } + EndFor + For i In {0:N_rods-1:1} + { Name Q_rod~{i} ; Value { Integral { [0.5 * epsilon0*omega0*Fabs[epsr_rods_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In rod~{i} ; Integration Int_1 ; Jacobian JVol ; } } } + EndFor + { Name Q_sub ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_sub_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In sub ; Integration Int_1 ; Jacobian JVol ; } } } + { Name Q_rod_out ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_rod_out_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In rod_out ; Integration Int_1 ; Jacobian JVol ; } } } + { Name Q_layer_dep ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_layer_dep_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In layer_dep ; Integration Int_1 ; Jacobian JVol ; } } } + { Name Q_layer_cov ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[epsr_layer_cov_im[]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In layer_cov ; Integration Int_1 ; Jacobian JVol ; } } } + { Name Q_tot ; Value { Integral { [ 0.5 * epsilon0*omega0*Fabs[Im[CompXX[epsilonr[]]]] * (SquNorm[{u2d}+u1[]]) / (Pinc[]*d) ] ; In Plot_domain ; Integration Int_1 ; Jacobian JVol ; } } } + { Name lambda_step ; Value { Local { [ lambda0/nm ]; In Omega ; Jacobian JVol; } } } + EndIf } } } @@ -614,14 +614,15 @@ PostOperation { } } DefineConstant[ - R_ = {"helmoltz_scalar", Name "GetDP/1ResolutionChoices", Visible 1}, - C_ = {"-solve -pos -petsc_prealloc 100 -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps", Name "GetDP/9ComputeCommand", Visible 1}, - P_ = {"postop_energy", Name "GetDP/2PostOperationChoices", Visible 1}]; + R_ = {"helmoltz_scalar", Name "GetDP/1ResolutionChoices", Visible 1}, + C_ = {"-solve -pos -petsc_prealloc 100 -ksp_type preonly -pc_type lu -pc_factor_mat_solver_type mumps", Name "GetDP/9ComputeCommand", Visible 1}, + P_ = {"postop_energy", Name "GetDP/2PostOperationChoices", Visible 1} +]; If(plotRTgraphs) -DefineConstant[ - refl_ = {0, Name "GetDP/R0", ReadOnly 1, Graph "02000000", Visible 1}, - abs_ = {0, Name "GetDP/total absorption", ReadOnly 1, Graph "00000002", Visible 1}, - trans_ = {0, Name "GetDP/T0", ReadOnly 1, Graph "000000000002", Visible 1} - ]; + DefineConstant[ + refl_ = {0, Name "GetDP/R0", ReadOnly 1, Graph "02000000", Visible 1}, + abs_ = {0, Name "GetDP/total absorption", ReadOnly 1, Graph "00000002", Visible 1}, + trans_ = {0, Name "GetDP/T0", ReadOnly 1, Graph "000000000002", Visible 1} + ]; EndIf