Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
models
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documentation
models
Commits
f9ffffda
Commit
f9ffffda
authored
4 years ago
by
Guillaume Demesy
Browse files
Options
Downloads
Patches
Plain Diff
enable plotting over multiple periods in conical incidence
parent
8c29ddfd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
DiffractionGratings/grating2D_conical.pro
+75
-52
75 additions, 52 deletions
DiffractionGratings/grating2D_conical.pro
DiffractionGratings/grating2D_scalar.pro
+1
-3
1 addition, 3 deletions
DiffractionGratings/grating2D_scalar.pro
with
76 additions
and
55 deletions
DiffractionGratings/grating2D_conical.pro
+
75
−
52
View file @
f9ffffda
...
@@ -442,6 +442,10 @@ PostProcessing {
...
@@ -442,6 +442,10 @@ PostProcessing {
{
Name
lambda_step
;
Value
{
Local
{
[
lambda0
/
nm
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
lambda_step
;
Value
{
Local
{
[
lambda0
/
nm
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E2d
;
Value
{
Local
{
[
{
Et
}
+
{
El
}
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E2d
;
Value
{
Local
{
[
{
Et
}
+
{
El
}
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
Etot
;
Value
{
Local
{
[
{
Et
}
+
{
El
}
+
E1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
Etot
;
Value
{
Local
{
[
{
Et
}
+
{
El
}
+
E1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
boundary
;
Value
{
Local
{
[
bndCol
[]
];
In
Plot_bnd
;
Jacobian
JVol
;
}
}
}
For
i
In
{
-
nb_plot_periods
:
nb_plot_periods
}
{
Name
Etot
~
{
i
}
;
Value
{
Local
{
[
({
Et
}
+
{
El
}
+
E1
[])
*
Exp
[
I
[]
*
i
*
CompX
[
k1
[]]
*
d
]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
EndFor
{
Name
H2d
;
Value
{
Local
{
[
(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
H2d
;
Value
{
Local
{
[
(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
Htot
;
Value
{
Local
{
[
(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
+
H1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
Htot
;
Value
{
Local
{
[
(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
+
H1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E2d_z
;
Value
{
Local
{
[
CompZ
[{
Et
}
+
{
El
}]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E2d_z
;
Value
{
Local
{
[
CompZ
[{
Et
}
+
{
El
}]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
...
@@ -450,7 +454,6 @@ PostProcessing {
...
@@ -450,7 +454,6 @@ PostProcessing {
{
Name
Htot_z
;
Value
{
Local
{
[
CompZ
[(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
+
H1
[]]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
Htot_z
;
Value
{
Local
{
[
CompZ
[(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})
+
H1
[]]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
H2d_z
;
Value
{
Local
{
[
CompZ
[(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
H2d_z
;
Value
{
Local
{
[
CompZ
[(
-
I
[]
/
(
mur
[]
*
mu0
*
om0
))
*
({
Curl
Et
}
+
{
Curl
El
})]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1
;
Value
{
Local
{
[
E1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1
;
Value
{
Local
{
[
E1
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1t
;
Value
{
Local
{
[
E1t
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1t
;
Value
{
Local
{
[
E1t
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1l
;
Value
{
Local
{
[
E1l
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
{
Name
E1l
;
Value
{
Local
{
[
E1l
[]
];
In
Omega
;
Jacobian
JVol
;
}
}
}
...
@@ -471,17 +474,7 @@ PostProcessing {
...
@@ -471,17 +474,7 @@ PostProcessing {
{
Name
int_z_r
~
{
i
}
;
Value
{
Integral
{
[
CompZ
[{
El
}
+
E1dl
[]]
*
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
EndFor
// // BUGGY
For
i
In
{
0
:
2
*
nb_orders
}
For
i
In
{
0
:
2
*
nb_orders
}
// { Name eff_t~{i} ; Value{ Term{Type Global; [
// 1/(Ae^2*beta_subs~{i}[]*-beta1[]) * ((beta_subs~{i}[]^2+gamma[]^2 )*SquNorm[$int_z_t~{i}]+
// (beta_subs~{i}[]^2+alpha~{i}[]^2)*SquNorm[$int_x_t~{i}]+
// 2*alpha~{i}[]*gamma[]*Re[$int_z_t~{i}*Conj[$int_x_t~{i}]] ) ] ; In SurfCutSubs1 ; } } }
// { Name eff_r~{i} ; Value { Term{Type Global; [
// 1/(Ae^2*beta_super~{i}[]*-beta1[]) * ((beta_super~{i}[]^2+gamma[]^2 )*SquNorm[$int_z_r~{i}]+
// (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_t
~
{
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
}]
+
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_y_t
~
{
i
}]
+
...
@@ -490,6 +483,15 @@ PostProcessing {
...
@@ -490,6 +483,15 @@ PostProcessing {
1
/
(
Ae
^
2
*-
beta1
[])
*
(
beta_super
~
{
i
}[]
*
SquNorm
[
$
int_x_r
~
{
i
}]
+
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_y_r
~
{
i
}]
+
beta_super
~
{
i
}[]
*
SquNorm
[
$
int_z_r
~
{
i
}]
)
]
;
In
SurfCutSuper1
;
}
}
}
beta_super
~
{
i
}[]
*
SquNorm
[
$
int_z_r
~
{
i
}]
)
]
;
In
SurfCutSuper1
;
}
}
}
// // BUGGY
// { Name eff_t~{i} ; Value{ Term{Type Global; [
// 1/(Ae^2*beta_subs~{i}[]*-beta1[]) * ((beta_subs~{i}[]^2+gamma[]^2 )*SquNorm[$int_z_t~{i}]+
// (beta_subs~{i}[]^2+alpha~{i}[]^2)*SquNorm[$int_x_t~{i}]+
// 2*alpha~{i}[]*gamma[]*Re[$int_z_t~{i}*Conj[$int_x_t~{i}]] ) ] ; In SurfCutSubs1 ; } } }
// { Name eff_r~{i} ; Value { Term{Type Global; [
// 1/(Ae^2*beta_super~{i}[]*-beta1[]) * ((beta_super~{i}[]^2+gamma[]^2 )*SquNorm[$int_z_r~{i}]+
// (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 ; } } }
EndFor
EndFor
}
}
}
}
...
@@ -508,7 +510,6 @@ PostOperation {
...
@@ -508,7 +510,6 @@ PostOperation {
Print
[
int_y_r
~
{
i
}[
SurfCutSuper1
],
OnGlobal
,
StoreInVariable
$
int_y_r
~
{
i
},
File
>
StrCat
[
myDir
,
"int_y_r.txt"
],
Format
Table
];
Print
[
int_y_r
~
{
i
}[
SurfCutSuper1
],
OnGlobal
,
StoreInVariable
$
int_y_r
~
{
i
},
File
>
StrCat
[
myDir
,
"int_y_r.txt"
],
Format
Table
];
Print
[
int_z_r
~
{
i
}[
SurfCutSuper1
],
OnGlobal
,
StoreInVariable
$
int_z_r
~
{
i
},
File
>
StrCat
[
myDir
,
"int_z_r.txt"
],
Format
Table
];
Print
[
int_z_r
~
{
i
}[
SurfCutSuper1
],
OnGlobal
,
StoreInVariable
$
int_z_r
~
{
i
},
File
>
StrCat
[
myDir
,
"int_z_r.txt"
],
Format
Table
];
EndFor
EndFor
For
i
In
{
0
:
2
*
nb_orders
}
For
i
In
{
0
:
2
*
nb_orders
}
Print
[
eff_t
~
{
i
}[
SurfCutSubs1
]
,
OnRegion
SurfCutSubs1
,
File
>
StrCat
[
myDir
,
"eff_t.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
];
Print
[
eff_r
~
{
i
}[
SurfCutSuper1
]
,
OnRegion
SurfCutSuper1
,
File
>
StrCat
[
myDir
,
"eff_r.txt"
],
Format
Table
];
...
@@ -518,6 +519,28 @@ PostOperation {
...
@@ -518,6 +519,28 @@ PostOperation {
Print
[
Q_rod_out
[
rod_out
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_rod_out.txt"
]];
Print
[
Q_rod_out
[
rod_out
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_rod_out.txt"
]];
Print
[
Q_layer_dep
[
layer_dep
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_layer_dep.txt"
]];
Print
[
Q_layer_dep
[
layer_dep
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_layer_dep.txt"
]];
Print
[
Q_layer_cov
[
layer_cov
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_layer_cov.txt"
]];
Print
[
Q_layer_cov
[
layer_cov
]
,
OnGlobal
,
Format
FrequencyTable
,
File
>
StrCat
[
myDir
,
"absorption-Q_layer_cov.txt"
]];
If
(
multiplot
)
Echo
[
Str
[
"For i In {PostProcessing.NbViews-1:0:-1}"
,
" If(!StrCmp(View[i].Name, 'boundary') || !StrCmp(View[i].Name, 'boundary_Combine'))"
,
" Delete View[i];"
,
" EndIf"
,
"EndFor"
],
File
StrCat
[
myDir
,
"tmp1.geo"
]]
;
For
i
In
{
-
nb_plot_periods
:
nb_plot_periods
}
Print
[
Etot
~
{
i
},
OnElementsOf
Plot_domain
,
File
StrCat
[
myDir
,
Sprintf
(
"u_tot_lambda%.2fnm_%g.pos"
,
lambda0
/
nm
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
},
Name
Sprintf
(
"Hz_tot_%.2fnm.pos"
,
lambda0
/
nm
)
]
;
Print
[
boundary
,
OnElementsOf
Plot_bnd
,
File
StrCat
[
myDir
,
Sprintf
(
"boundary_%g.pos"
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
}
]
;
EndFor
Echo
[
Str
[
"Combine ElementsByViewName;"
,
"Hide {"
,
"Point{1,2,7,8,9,10,20,22};"
,
"Line{1,7,8,9,10,30,32,34,2,3,4,5,6,12,16,20,24,28};"
,
"Surface{36,48};}"
,
"Geometry.Color.Lines = {0,0,0};"
,
"l=PostProcessing.NbViews-1; View[l].ColorTable={Black}; "
,
"View[l-1].Visible=1; View[l-1].ShowScale=0;"
,
"View[l].ShowScale=0; View[l].LineWidth=1.5; View[l].LineType=1;Geometry.LineWidth=0;"
],
File
StrCat
[
myDir
,
"tmp3.geo"
]]
;
EndIf
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
DiffractionGratings/grating2D_scalar.pro
+
1
−
3
View file @
f9ffffda
...
@@ -458,9 +458,7 @@ PostOperation {
...
@@ -458,9 +458,7 @@ PostOperation {
" EndIf"
,
" EndIf"
,
"EndFor"
],
File
StrCat
[
myDir
,
"tmp1.geo"
]]
;
"EndFor"
],
File
StrCat
[
myDir
,
"tmp1.geo"
]]
;
For
i
In
{
-
nb_plot_periods
:
nb_plot_periods
}
For
i
In
{
-
nb_plot_periods
:
nb_plot_periods
}
If
(
i
!=
0
)
Print
[
u_tot
~
{
i
},
OnElementsOf
Plot_domain
,
File
StrCat
[
myDir
,
Sprintf
(
"u_tot_lambda%.2fnm_%g.pos"
,
lambda0
/
nm
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
},
Name
Sprintf
(
"Hz_tot_%.2fnm.pos"
,
lambda0
/
nm
)
]
;
Print
[
u_tot
~
{
i
},
OnElementsOf
Plot_domain
,
File
StrCat
[
myDir
,
Sprintf
(
"u_tot_lambda%.2fnm_%g.pos"
,
lambda0
/
nm
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
},
Name
Sprintf
(
"Hz_tot_%.2fnm.pos"
,
lambda0
/
nm
)
]
;
EndIf
Print
[
boundary
,
OnElementsOf
Plot_bnd
,
File
StrCat
[
myDir
,
Sprintf
(
"boundary_%g.pos"
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
}
]
;
Print
[
boundary
,
OnElementsOf
Plot_bnd
,
File
StrCat
[
myDir
,
Sprintf
(
"boundary_%g.pos"
,
i
+
nb_plot_periods
)],
ChangeOfCoordinates
{
$
X
+
i
*
d
,
$
Y
,
$
Z
}
]
;
EndFor
EndFor
Echo
[
Str
[
"Combine ElementsByViewName;"
,
Echo
[
Str
[
"Combine ElementsByViewName;"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment