File: CreateCRLH.m

package info (click to toggle)
openems 0.0.35%2Bgit20190103.6a75e98%2Bdfsg.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,424 kB
  • sloc: cpp: 40,407; python: 2,028; yacc: 580; makefile: 458; lex: 350; sh: 176; ruby: 19
file content (55 lines) | stat: -rw-r--r-- 1,984 bytes parent folder | download | duplicates (3)
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
function [CSX mesh] = CreateCRLH(CSX, mesh, CRLH, resolution, translate)
% function [CSX mesh] = CreateCRLH(CSX, mesh, CRLH, resolution, translate)
% 
% support function to create a CRLH unit cell
% 
% currently used by Tutorials/CRLH_Extraction
% 
% Tested with
%  - Matlab 2009b
%  - openEMS v0.0.23
%
% (C) 2011 Thorsten Liebig <thorsten.liebig@gmx.de>

if (nargin<5)
    translate = [0 0 0];
end

CSX = AddMetal(CSX, 'metal_top');
one_two_third = [-resolution/3 2*resolution/3];

start = [-CRLH.LL/2 -CRLH.LW/2 CRLH.TopSig]+translate;
stop  = [-CRLH.GLT/2  CRLH.LW/2 CRLH.TopSig]+translate;
CSX = AddBox(CSX, 'metal_top', 10, start, stop);
mesh.x = [mesh.x start(1) stop(1)+one_two_third];
mesh.y = [mesh.y start(2)-one_two_third stop(2)+one_two_third];

start = [+CRLH.LL/2  -CRLH.LW/2 CRLH.TopSig]+translate;
stop  = [+CRLH.GLT/2  CRLH.LW/2 CRLH.TopSig]+translate;
CSX = AddBox(CSX, 'metal_top', 10, start, stop);
mesh.x = [mesh.x start(1) stop(1)-one_two_third];

CSX = AddMetal(CSX, 'metal_bot');
start = [-(CRLH.LL-CRLH.GLB)/2 -CRLH.LW/2 CRLH.BottomSig]+translate;
stop  = [+(CRLH.LL-CRLH.GLB)/2  CRLH.LW/2 CRLH.BottomSig]+translate;
CSX = AddBox(CSX, 'metal_bot', 10, start, stop);
mesh.x = [mesh.x start(1)-one_two_third stop(1)+one_two_third];

start = [-CRLH.SW/2 -CRLH.LW/2-CRLH.SL CRLH.BottomSig]+translate;
stop  = [+CRLH.SW/2  CRLH.LW/2+CRLH.SL CRLH.BottomSig]+translate;
CSX = AddBox(CSX, 'metal_bot', 10, start, stop);
mesh.x = [mesh.x start(1)-one_two_third stop(1)+one_two_third];
mesh.y = [mesh.y start(2) stop(2)];

CSX = AddMetal(CSX, 'via');
start = [0 -CRLH.LW/2-CRLH.SL+CRLH.SW/2 0]+translate;
stop  = [0 -CRLH.LW/2-CRLH.SL+CRLH.SW/2 CRLH.BottomSig]+translate;
CSX = AddCylinder(CSX, 'via', 10, start, stop, CRLH.VR);
mesh.x = [mesh.x start(1)+[-1 0 1]*CRLH.VR];
mesh.y = [mesh.y start(2)+[-1 0 1]*CRLH.VR];

start(2) = -start(2);
stop(2)  = -stop(2);
CSX = AddCylinder(CSX, 'via', 10, start, stop, CRLH.VR);
mesh.y = [mesh.y start(2)+[-1 0 1]*CRLH.VR];
end