diff --git a/DiffractionGratings/grating2D_conical.pro b/DiffractionGratings/grating2D_conical.pro index d0250aa3c3105547d3fc01b202d2475cbb23a0e5..d118f8458c84a7443561aa76c0ab17669b1c8f1b 100644 --- a/DiffractionGratings/grating2D_conical.pro +++ b/DiffractionGratings/grating2D_conical.pro @@ -354,6 +354,31 @@ FunctionSpace { } } + { Name Hgrad_perp; Type Form1P; + BasisFunction { + { Name sn ; NameOfCoef hn ; Function BF_PerpendicularEdge ; Support Omega; Entity NodesOf[All]; } + { Name sn2; NameOfCoef hn2; Function BF_PerpendicularEdge_2E; Support Omega; Entity EdgesOf[All]; } + If (Flag_o2_interp==1) + { Name sn3; NameOfCoef hn3; Function BF_PerpendicularEdge_2F; Support Omega; Entity FacetsOf[All]; } + { Name sn4; NameOfCoef hn4; Function BF_PerpendicularEdge_3E; Support Omega; Entity EdgesOf[All]; } + { Name sn5; NameOfCoef hn5; Function BF_PerpendicularEdge_3F; Support Omega; Entity FacetsOf[All]; } + EndIf + // BF_PerpendicularEdge_2F, 1., QUA|HEX|PRI, 0 }, + // BF_PerpendicularEdge_2V, 1., QUA|HEX, 0 }, + // BF_PerpendicularEdge_3E, 2., ALL, 0 }, + // BF_PerpendicularEdge_3F, 2., TRI|QUA|TET|HEX|PRI, 0 }, + // BF_PerpendicularEdge_3V, 2., HEX|PRI, 0 }, + } + Constraint { + { NameOfCoef hn ; EntityType NodesOf ; NameOfConstraint Bloch; } + { NameOfCoef hn2; EntityType EdgesOf ; NameOfConstraint Bloch; } + If (Flag_o2_interp==1) + { NameOfCoef hn4; EntityType EdgesOf ; NameOfConstraint Bloch; } + EndIf + } + } + + { Name L2_lambda; Type Form0; BasisFunction{ @@ -368,7 +393,6 @@ Formulation { Quantity { { Name Et; Type Local; NameOfSpace Hcurl; } { Name El; Type Local; NameOfSpace Hgrad_perp; } - // { Name ux; Type Local; NameOfSpace L2_lambda;} { Name uy; Type Local; NameOfSpace L2_lambda;} } Equation { @@ -406,8 +430,8 @@ Resolution { Operation { CreateDir[Str[myDir]]; Printf["%f",lambda0/nm]; - Generate[S] ; - Solve[S] ; + Generate[S]; + Solve[S]; } } } @@ -444,20 +468,8 @@ PostProcessing { { Name int_x_r~{i} ; Value{ Integral{ [ CompX[{Et}+E1dt[]] * expialphax~{i}[]/d ] ; In SurfCutSuper1 ; Integration Int_1 ; Jacobian JSur ; } } } { Name int_y_r~{i} ; Value{ Integral{ [({uy}+CompY[E1dt[]])* expialphax~{i}[]/d ] ; In SurfCutSuper1 ; Integration Int_1 ; Jacobian JSur ; } } } { Name int_z_r~{i} ; Value{ Integral{ [ CompZ[{El}+E1dl[]] * expialphax~{i}[]/d ] ; In SurfCutSuper1 ; Integration Int_1 ; Jacobian JSur ; } } } - EndFor - - // x3D=>zconical - // y3D=>xconical - // z3D=>yconical - // { Name eff_t~{i}~{j} ; Value { Term{Type Global; [ - // 1/(gammat~{i}~{j}[]*-k1z[]*Cos[xsi]^2) * ( (gammat~{i}~{j}[]^2+alpha~{i}~{j}[]^2)*SquNorm[$int_x_t~{i}~{j}]+ - // (gammat~{i}~{j}[]^2+ beta~{j}~{j}[]^2)*SquNorm[$int_y_t~{i}~{j}]+ - // 2*alpha~{i}~{j}[]*beta~{i}~{j}[]*Re[$int_x_t~{i}~{j}*Conj[$int_y_t~{i}~{j}]] ) ] ; In SurfIntBot ; } } } - // { Name eff_r~{i}~{j} ; Value { Term{Type Global; [ - // 1/(gammar~{i}~{j}[]*-k1z[]*Cos[xsi]^2) * ((gammar~{i}~{j}[]^2+alpha~{i}~{j}[]^2)*SquNorm[$int_x_r~{i}~{j}]+ - // (gammar~{i}~{j}[]^2+ beta~{i}~{j}[]^2)*SquNorm[$int_y_r~{i}~{j}]+ - // 2*alpha~{i}~{j}[]*beta~{i}~{j}[]*Re[$int_x_r~{i}~{j}*Conj[$int_y_r~{i}~{j}]]) ] ; In SurfIntTop ; } } } - + EndFor + // // BUGGY For i In {0:2*nb_orders} // { Name eff_t~{i} ; Value{ Term{Type Global; [ @@ -469,11 +481,11 @@ PostProcessing { // (beta_super~{i}[]^2+alpha~{i}[]^2)*SquNorm[$int_x_r~{i}]+ // 2*alpha~{i}[]*gamma[]*Re[$int_z_r~{i}*Conj[$int_x_r~{i}]]) ] ; In SurfCutSuper1 ; } } } - { Name eff_t2~{i} ; Value { Term{Type Global; [ + { Name eff_t~{i} ; Value { Term{Type Global; [ 1/(Ae^2*-beta1[]) * ( beta_subs~{i}[] * SquNorm[$int_x_t~{i}]+ beta_subs~{i}[] * SquNorm[$int_y_t~{i}]+ beta_subs~{i}[] * SquNorm[$int_z_t~{i}] ) ] ; In SurfCutSubs1 ; } } } - { Name eff_r2~{i} ; Value { Term{Type Global; [ + { Name eff_r~{i} ; Value { Term{Type Global; [ 1/(Ae^2*-beta1[]) * ( beta_super~{i}[] * SquNorm[$int_x_r~{i}]+ beta_super~{i}[] * SquNorm[$int_y_r~{i}]+ beta_super~{i}[] * SquNorm[$int_z_r~{i}] ) ] ; In SurfCutSuper1 ; } } } @@ -485,16 +497,7 @@ PostProcessing { PostOperation { { Name postop_energy; NameOfPostProcessing postpro_energy ; Operation { - // Print [ E2d , OnElementsOf Omega, File "E2d.pos" ]; - // Print [ Etot , OnElementsOf Omega, File "Etot.pos" ]; - // Print [ Htot , OnElementsOf Omega, File "Htot.pos" ]; - Print [ Etot_z , OnElementsOf Omega, File "Etot_z.pos" ]; - Print [ E1 , OnElementsOf Omega, File "E1.pos" ]; - Print [ E1t , OnElementsOf Omega, File "E1t.pos" ]; - Print [ E1l , OnElementsOf Omega, File "E1l.pos" ]; - Print [ E2d_z , OnElementsOf Omega, File "E2d.pos" ]; - Print [ E2d_t , OnElementsOf Omega, File "E2d_t.pos" ]; - Print [ H2d_z , OnElementsOf Omega, File "H2d.pos" ]; + Print [ Etot , OnElementsOf Omega, File "Etot.pos" ]; For i In {0:2*nb_orders} Print[ int_x_t~{i}[SurfCutSubs1] , OnGlobal, StoreInVariable $int_x_t~{i}, File > StrCat[myDir, "int_x_t.txt"], Format Table]; Print[ int_y_t~{i}[SurfCutSubs1] , OnGlobal, StoreInVariable $int_y_t~{i}, File > StrCat[myDir, "int_y_t.txt"], Format Table]; @@ -505,10 +508,8 @@ PostOperation { EndFor For i In {0:2*nb_orders} - // Print[ eff_t~{i}[SurfCutSubs1] , OnRegion SurfCutSubs1 , File > StrCat[myDir, "eff_t.txt"], Format Table ]; - // Print[ eff_r~{i}[SurfCutSuper1] , OnRegion SurfCutSuper1, File > StrCat[myDir, "eff_r.txt"], Format Table ]; - Print[ eff_t2~{i}[SurfCutSubs1] , OnRegion SurfCutSubs1 , File > StrCat[myDir, "eff_t.txt"], Format Table ]; - Print[ eff_r2~{i}[SurfCutSuper1], OnRegion SurfCutSuper1, File > StrCat[myDir, "eff_r.txt"], Format Table ]; + Print[ eff_t~{i}[SurfCutSubs1] , OnRegion SurfCutSubs1 , File > StrCat[myDir, "eff_t.txt"], Format Table ]; + Print[ eff_r~{i}[SurfCutSuper1] , OnRegion SurfCutSuper1, File > StrCat[myDir, "eff_r.txt"], Format Table ]; EndFor Print[ Q_tot[Plot_domain] , OnGlobal, Format FrequencyTable, File > StrCat[myDir, "absorption-Q_tot.txt"]]; Print[ Q_subs[sub] , OnGlobal, Format FrequencyTable, File > StrCat[myDir, "absorption-Q_subs.txt"]];