define_geometry.m

来自「this a 3d fdtd code using matlab and it 」· M 代码 · 共 37 行

M
37
字号
disp('defining the problem geometry');

bricks  = [];
spheres = [];

% define a brick with material type 4
bricks(1).min_x = 0;
bricks(1).min_y = 0;
bricks(1).min_z = 0;
bricks(1).max_x = 24e-3;
bricks(1).max_y = 20e-3;
bricks(1).max_z = 11e-3;
bricks(1).material_type = 4; 

% define a brick with material type 2 
bricks(2).min_x = -20e-3;
bricks(2).min_y = -20e-3;
bricks(2).min_z = -11e-3;
bricks(2).max_x = 0;
bricks(2).max_y = 0;
bricks(2).max_z = 0;
bricks(2).material_type = 2; 

% define a sphere with material type 5 
spheres(1).radius   = 20e-3;
spheres(1).center_x = 0;
spheres(1).center_y = 0;
spheres(1).center_z = 40e-3;
spheres(1).material_type = 5; 

% define a sphere with material type 1 
spheres(2).radius   = 15e-3;
spheres(2).center_x = 0;
spheres(2).center_y = 0;
spheres(2).center_z = 40e-3;
spheres(2).material_type = 1; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?