1
/* atlc - arbitrary transmission line calculator, for the analysis of
2
transmission lines are directional couplers.
4
Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License
8
as published by the Free Software Foundation; either package_version 2
9
of the License, or (at your option) any later package_version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21
Dr. David Kirkby, e-mail drkirkby@ntlworld.com
25
1
/* The function 'setup_arrays sets the cell_type[i][j] to be DIELECTRIC
26
2
if the material is non-metal. This function expands on that, checking if
27
3
the adjactent cells are dielectrics, or metals, and if dielectric,
33
9
#include "definitions.h"
35
11
extern int width, height;
36
extern signed char **cell_type;
12
extern unsigned char **oddity, **cell_type;
37
13
extern double **Er;
39
15
void check_for_boundaries(void)
42
for(j=0;j<=height-1;++j)
44
for(i=0;i<=width-1; ++i)
46
if(cell_type[i][j]==DIELECTRIC)
50
if (Er[i-1][j]== METAL_ER)
51
cell_type[i][j]+=METAL_LEFT;
53
if(i<width-1) /*if i==width-1, there can't be metal at right */
55
if(Er[i+1][j]==METAL_ER)
56
cell_type[i][j]+=METAL_RIGHT;
60
if(Er[i][j+1]==METAL_ER)
61
cell_type[i][j]+=METAL_BELOW;
65
if(Er[i][j-1]==METAL_ER)
66
cell_type[i][j]+=METAL_ABOVE;
68
}/* end of if dielectric */
69
}/* end of for w=0 to width-1 */