Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
ExtGnuplot = ".dat";
ExtGmsh = ".pos";
myDir = "output/";
po = "Output/";
// -------------------------------------------------------------------------
// Microwave formulations
// 2D and 3D
//--------------------------------------------------------------------------
DefineConstant[ Flag_Model = 2, k0, Freq ];
Group {
DefineGroup[ Domain, DomAir, DomCond, DomPml, DomainTot ] ;
DefineGroup[ Boundary, BndBC, BndPEC, BndSM ] ;
}
Function {
DefineFunction[ epsilon, sigma, nu, eInc, I ];
}
Jacobian {
{ Name JVol ; Case { { Region All ; Jacobian Vol ; } } }
{ Name JSur ; Case { { Region All ; Jacobian Sur ; } } }
}
Integration {
{ Name I1 ;
Case {
{ Type Gauss ;
Case {
{ GeoElement Point ; NumberOfPoints 1 ; }
{ GeoElement Line ; NumberOfPoints 3 ; }
{ GeoElement Triangle ; NumberOfPoints 4 ; }
{ GeoElement Quadrangle ; NumberOfPoints 4 ; }
{ GeoElement Tetrahedron ; NumberOfPoints 4 ; }
{ GeoElement Hexahedron ; NumberOfPoints 6 ; }
{ GeoElement Prism ; NumberOfPoints 6 ; }
}
}
}
}
{ Name I2 ;
Case {
{ Type Gauss ;
Case {
{ GeoElement Point ; NumberOfPoints 1 ; }
{ GeoElement Line ; NumberOfPoints 4 ; }
{ GeoElement Triangle ; NumberOfPoints 7 ; }
{ GeoElement Quadrangle ; NumberOfPoints 7 ; }
{ GeoElement Tetrahedron ; NumberOfPoints 15 ; }
{ GeoElement Hexahedron ; NumberOfPoints 34 ; }
{ GeoElement Prism ; NumberOfPoints 21 ; }
}
}
}
}
}
Constraint {
{ Name ElectricField ;
Case {
If(Flag_Model==2)
{ Region BndBC ; Type Assign ; Value -CompZ[eInc[]] ; }
EndIf
If(Flag_Model==3)
{ Region BndBC ; Type AssignFromResolution ; NameOfResolution Resol_BC ; }
EndIf
{ Region BndPEC ; Type Assign ; Value 0. ; }
}
}
}
FunctionSpace {
{ Name Hcurl_e_2D; Type Form1P;
BasisFunction {
{ Name sn; NameOfCoef en; Function BF_PerpendicularEdge; Support DomainTot; Entity NodesOf[All]; }
}
Constraint {
{ NameOfCoef en; EntityType NodesOf ; NameOfConstraint ElectricField; }
}
}
{ Name Hcurl_e_3D; Type Form1;
BasisFunction {
{ Name se; NameOfCoef ee; Function BF_Edge; Support DomainTot ; Entity EdgesOf[All]; }
}
Constraint {
{ NameOfCoef ee; EntityType EdgesOf ; NameOfConstraint ElectricField; }
}
}
}
Formulation {
// Imposing the source: circulation of e on edges
{ Name Form_BC ;
Quantity {
{ Name e; Type Local; NameOfSpace Hcurl_e_3D; }
}
Equation {
Galerkin { [ Dof{e} , {e} ];
In BndBC; Integration I2; Jacobian JSur; }
Galerkin { [ eInc[] , {e} ];
In BndBC; Integration I2; Jacobian JSur; }
}
}
// Electric field formulation
{ Name Microwave_e ; Type FemEquation;
Quantity {
If(Flag_Model==2)
{ Name e; Type Local; NameOfSpace Hcurl_e_2D; }
EndIf
If(Flag_Model==3)
{ Name e; Type Local; NameOfSpace Hcurl_e_3D; }
EndIf
}
Equation {
Galerkin { [ nu[] * Dof{d e} , {d e} ];
In Domain; Integration I1; Jacobian JVol; }
Galerkin { DtDof [ sigma[] * Dof{e} , {e} ];
In DomCond; Integration I1; Jacobian JVol; }
Galerkin { DtDtDof [ epsilon[] * Dof{e} , {e} ];
In Domain; Integration I1; Jacobian JVol; }
Galerkin { [ I[] * k0 * nu[] * ( Normal[] /\ Dof{e} ) /\ Normal[] , {e} ];
In BndSM; Integration I1; Jacobian JSur; }
}
}
}
Resolution {
{ Name Resol_BC;
System {
{ Name B; NameOfFormulation Form_BC; Type Complex; DestinationSystem A; }
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
}
Operation {
Generate B; Solve B; TransferSolution B;
}
}
{ Name Analysis;
System {
{ Name A; NameOfFormulation Microwave_e; Type Complex; Frequency Freq; }
}
Operation {
CreateDir[Str[myDir]];
Generate A; Solve A; SaveSolution A;
}
}
}
PostProcessing {
{ Name Microwave_e ; NameOfFormulation Microwave_e ;
Quantity {
{ Name eScatt; Value{ Local{ [{e}]; In DomainTot; Jacobian JVol;} } }
{ Name eTot; Value{ Local{ [{e}+eInc[]]; In DomainTot; Jacobian JVol;} } }
{ Name eInc; Value{ Local{ [eInc[]]; In DomainTot; Jacobian JVol;} } }
{ Name SE; Value{ Local{ [20*Log10[ Norm[eInc[]] / Norm[{e}+eInc[]] ]]; In DomainTot; Jacobian JVol;} } }
}
}
}
PostOperation {
{ Name Get_Fields ; NameOfPostProcessing Microwave_e ;
Operation {
Print[ eScatt, OnElementsOf Region[{Domain}], File StrCat[myDir, "eScatt.pos"] ] ;
Print[ eTot, OnElementsOf Region[{Domain}], File StrCat[myDir, "eTot.pos"] ] ;
Print[ eInc, OnElementsOf Region[{Domain}], File StrCat[myDir, "eInc.pos"] ] ;
}
}
{ Name Get_ShieldingEffectiveness ; NameOfPostProcessing Microwave_e ;
Operation {
Print[ SE, OnPoint {0,0,0}, Format Table, File StrCat[myDir,"temp",ExtGnuplot],
SendToServer StrCat(po,"0Shielding effectiveness [dB]")];
}
}
}
DefineConstant[
R_ = {"Analysis", Name "GetDP/1ResolutionChoices", Visible 0},
C_ = {"-solve -pos -v2", Name "GetDP/9ComputeCommand", Visible 0},
MyPostOp = {"Get_ShieldingEffectiveness", Name "Input/1Post-processing",
Choices{"Get_Fields", "Get_ShieldingEffectiveness"}, MultipleSelection "01"},
P_ = { Str[MyPostOp], Name "GetDP/2PostOperationChoices", Visible 0, ReadOnly 1}
];