~ubuntu-branches/ubuntu/maverick/atlc/maverick

« back to all changes in this revision

Viewing changes to src/non_gui/check_for_boundaries.c

  • Committer: Bazaar Package Importer
  • Author(s): Bdale Garbee
  • Date: 2005-06-03 04:53:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050603045328-pohnuy5yryiv9s6o
Tags: 4.6.0-1
* new upstream version
* move make check from binary to build target so it doesn't run as root
* lose --with-threads from configure call, since it causes regression suite
  to fail many tests and upstream's README.threads is discouraging
* various tweaks to make lintian happier

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* atlc - arbitrary transmission line calculator, for the analysis of
2
 
transmission lines are directional couplers. 
3
 
 
4
 
Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
5
 
 
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.
10
 
 
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.
15
 
 
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,
19
 
USA.
20
 
 
21
 
Dr. David Kirkby, e-mail drkirkby@ntlworld.com 
22
 
 
23
 
*/
24
 
 
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"
34
10
 
35
11
extern int width, height;
36
 
extern signed char **cell_type;
 
12
extern unsigned char **oddity, **cell_type; 
37
13
extern double **Er;
38
14
 
39
15
void check_for_boundaries(void) 
40
16
{
41
 
  int i, j;
42
 
  for(j=0;j<=height-1;++j)
43
 
  {
44
 
    for(i=0;i<=width-1; ++i)
45
 
    {  
46
 
      if(cell_type[i][j]==DIELECTRIC)
47
 
      {
48
 
        if( i > 0) 
49
 
        {
50
 
          if (Er[i-1][j]== METAL_ER) 
51
 
            cell_type[i][j]+=METAL_LEFT;
52
 
        }
53
 
        if(i<width-1) /*if i==width-1, there can't be metal at right */
54
 
        {
55
 
          if(Er[i+1][j]==METAL_ER)
56
 
            cell_type[i][j]+=METAL_RIGHT;
57
 
        }
58
 
        if( j > 0)
59
 
        {
60
 
          if(Er[i][j+1]==METAL_ER)
61
 
            cell_type[i][j]+=METAL_BELOW;
62
 
        }
63
 
        if( j < height-1)
64
 
        {
65
 
          if(Er[i][j-1]==METAL_ER)
66
 
            cell_type[i][j]+=METAL_ABOVE;
67
 
        }
68
 
      }/* end of if dielectric */
69
 
    }/* end of for w=0 to width-1 */
70
 
  }
71
17
}
72
18