FDTD quick start Lumerical scripting language Pickup (three) structure (Structure) construction


Preface

In this article, we will introduce how to build a simulation model (Structure) of an object. The simulation model in the FDTD solution consists of two core parts: material and structure. Usually the complex refractive index of the material containing the absorption parameter is used to control the material property, and the 3D model parameter is used to control the structure property. Here are several commonly used structures.


1. (Cuboid) Rectangle

A typical rectangular structure can be generated by the following code:

addrect;
set("name","rect");#名称                   
set("material","SiO2 (Glass) - Palik");#材料
set("render type","wireframe");   # 渲染方式:线框,减小显卡压力
set("x",0);#设置x中心点坐标   
set("y",0);#设置y中心点坐标
set("x span",1e-6);#设置x方向宽度
set("y span",1e-6);#设置y方向宽度
set("z max",1e-7);#设置z方向最大值
set("z min",-1e-6);#设置z方向最小值
set("first axis","x");#设置第一转轴
set("rotation 1",45);#设置第一旋转角

The effect is as follows:
Insert picture description here

The purpose of each
piece of code is described in detail below: addrect : randomly generate a rectangular model of a certain size and a certain refractive index dielectric material.
set("name","rect") : name. Set the name of the rectangle to "rect"
set("material","SiO2 (Glass)-Palik") : Material-the material here must exist in the material library and must be named according to the original name in the material library. Set the rectangular material as silica
set("render type","wireframe") : Rendering method-there are two types of detailed and wireframe. The system defaults to detailed. If necessary, it can be changed to wireframe. Set the rendering mode of the rectangle as wireframe
set("x", "0") : center coordinates (x axis), similarly, you can also set the center coordinates of y and z. Set the center coordinate (x-axis) of the rectangle to 0
set("x span","1e-6") : the width (or range) in the x-axis direction, similarly, the y and z-axis widths can also be set. Set the x-axis width of the rectangle to 1e-6, that is, 1 micron
set ("z max", "1e-7") : the maximum value in the z direction, similarly there are z min, x max, x min, y max , Y min. Set the maximum z direction of the rectangle to 1e-7, that is, 100 nanometers.
set("first axis","x") : the first axis of rotation. Set the first axis of the rectangle as the x axis
set("rotation 1",45) : the angle of rotation around the first axis of rotation. Set the rotation angle of the rectangle around the x-axis to 45°


2. Polygonal cylinder (Ploygon)

1. Polygonal column

A typical polygon structure can be generated by the following code:

um=1e-6;
nm=1e-9;
vtx=[2,0;1,1;-1,1;
     -2,0;-1,-1;1,-1]*um;  #向量组
addpoly;
set("name","poly");#名称
set("index",1.5);#折射率
set("vertices",vtx);#控制向量组
set("x",0.5*um);#中心坐标
set("y",1*um);
set("z",-0.5*um);
set("z span",0.4*um);#z方向宽度

The effect is as follows:
Insert picture description here

We won’t introduce too much about the same parts as the rectangle. Here we only introduce the parts that are different from the rectangle:
addpoly : Add a polygon structure with random parameters.
set("index",1.5) : refractive index. The polygonal material is a dielectric material with a refractive index of 1.5
set("vertices",vtx) : vector group. Set the two-dimensional shape of the xy plane of the polygon, which is controlled by the parameters in the incoming vector group vtx

About the parameter explanation in
vtx : vtx is an n*2 matrix, each row is the relative coordinate of a vertex on the polygon, with the set "x", "y", "z" parameters as the relative coordinate origin, press on The order in the matrix is ​​connected to form a polygon.

2. Triangular column

A typical triangular column structure can be generated by the following code:

um=1e-6;
nm=1e-9;
vtx=[3,0;0,4;-2,0]*um;  #向量组
addtriangle;
set("name","triangle");#名称
set("index",1.5);#折射率
set("vertices",vtx);#控制向量组
set("x",0.5*um);#中心坐标
set("y",1*um);
set("z",-0.5*um);
set("z span",0.4*um);#z方向宽度

The effect is as follows: the
Insert picture description here
polygon generation code is basically the same as the triangle generation code, so I won't introduce too much here.


3. (Ellipse) Cylinder (Circle)

A typical (elliptical) cylindrical structure can be generated by the following code:

um=1e-6;
nm=1e-9;

addcircle;
set("name","circle");
set("material","Au (Gold) - Palik");
set("x",0);
set("y",0);
set("z",0);
set("z span",400*nm);
set("radius",600*nm);#半径/x轴半径
set("make ellipsoid",1);#生成椭圆
set("radius 2",800*nm);#y轴半径

The effect is as follows:
Insert picture description here
Similarly, here is only the part that is different from the rectangular structure generated code:
set("radius",600*nm) : radius/x-axis radius. If it is a cylinder, the radius is the radius of the circle; if it is an elliptical cylinder, the radius is the semi-axis length of the ellipse in the x-axis direction (it may be the semi-major axis or the semi-minor axis, depending on the relative size of radius and radius). Here it means that the semi-minor axis of the ellipse is 600nm
set("make ellipsoid",1) : generate an ellipse. "Make ellipsoid" can take two values: 0 and 1. Among them, 0 indicates that the generated cylinder is a cylinder, and 1 indicates that the generated elliptical cylinder is generated (it can also be considered that 1 is the enable ellipse parameter radius 2, and if it is 0, the radius 2 is disabled, and only a cylinder with a radius of radius is generated). Here the parameter is 1 means to generate an elliptical cylinder.
set("radius 2",800*nm) : y-axis radius, the second semi-axis length of the ellipse. Generate an elliptical cylinder with a second semi-axis length of 800*nm.

4. (Ellipse) Sphere

A typical (ellipsoid) sphere can be generated by the following code:

um=1e-6;
nm=1e-9;

addsphere;
set("name","sphere");
set("index",1.5);
set("x",0);
set("y",0);
set("z",0);
set("radius",200*nm);#半径/x轴半径
set("make ellipsoid",1);#生成椭球
set("radius 2",400*nm);#y轴半径
set("radius 3",2*um);#z轴半径

The effect is as follows:
Insert picture description here
the code of the sphere is very similar to the code of the elliptical cylinder, the difference is only that there is an extra third radius (radius 3) (in fact, it controls the size of the z-axis direction), so I won't explain too much here.

5. Ring (body) (Ring)

A typical torus cylinder can be generated by the following code:

um=1e-6;
nm=1e-9;

addring;
set("name","ring");
set("index",1.5);
set("x",0);
set("y",0);
set("z",0);
set("z span",600*nm);
set("outer radius",400*nm);#外圆半径
set("inner radius",200*nm);#内圆半径
set("theta start",0);#起始角
set("theta stop",135);#终止角

The effect is as follows: the
Insert picture description here
cylinder defaults to the xy plane as the bottom surface, and the z-axis direction width as the height. For detailed description of the parameter control of the ring cylinder, please refer to the comment section

6. Pyramid

A typical pyramid can be generated by the following code:

um=1e-6;
nm=1e-9;

addpyramid;
set("name","pyramid");
set("index",1.5);
set("x",0);
set("x span bottom",600*nm);#梯形下底长(x轴向)
set("x span top",100*nm);#梯形上底长(x轴向)
set("y",0);
set("y span bottom",400*nm);#梯形下底长(y轴向)
set("y span top",200*nm);#梯形上底长(y轴向)
set("z",0);
set("z span",600*nm);

The effect is as follows:
Insert picture description here
The parameters "x span bottom", "y span bottom", "x span top", and "y span top" control the size of the rectangle on the bottom and top of the pyramid respectively.

Guess you like

Origin blog.csdn.net/weixin_44224652/article/details/112712634