.EQ 
delim @@
.EN
.bC MESH
.NH 0
Syntax
.sp 2
.R
.in +4
.+B 8940
MESh <type> <cylindrical> <output files> <smoothing key>
.-B 8940
.in -4
.sp
.NH
Description
.IP
The mesh card either initiates the mesh generation phase
or reads a previously generated mesh.
.NH
Parameters
.sp 2
.RS
.IP "<type>: One of"
.RS
.sp 2
.IP <Previous>
.TS
l l l l.
Previous	\\=	<logical>
Infile	\\=	<filename>
ASCII.In	\\=	<logical>	(default is false)
.TE
Reads a previously generated mesh from a save file.
ASCII.IN is a flag to indicate if the save file is ascii 
as opposed to binary.
.sp 2
.IP <Rectangular>
.TS
l l l l.
Rectangular	\\=	<logical>
NX	\\=	<integer>
NY	\\=	<integer>
Diag.fli	\\=	<logical>	(default is false)
.TE
These parameters initiate the generation of a rectangular mesh. 
NX is the number
of nodes in the x-direction, NY the number in the y-direction.
DIAG.FLIP which if set, flips the diagonals in a square mesh
about the center of the grid. If DIAG.FLIP is false, all the diagonals
will be in the same direction.
.sp 2
.KS
.IP <Geometry>
.TS
l l l l.
Geometry	\\=	<logical>
Infile	\\=	<filename>
Flip.y	\\=	<logical>	(default is false)
SCale	\\=	<integer>	(default is 1)
.TE
This reads a mesh (ascii) generated by an external grid editor. 
FLIP.Y is a flag which will reverse the sign of the y-coordinate.
SCALE is a factor by which all the coordinates read are 
multiplied by.
.KE
.RE
.sp 2
.KS
.IP "<Output files>"
.RS
.sp 2
.IP "<\*(PI format>"
.TS
l l l l.
OUTFile	\\=	<filename>
ASCII.Out	\\=	<logical>	(default is false)
.TE
OUTFILE is the \*(PI format output file to be read by a later run.
If ASCII.OUT is set, OUTFILE will be written in ascii, otherwise
it will be binary.
.KE
.sp 2
.KS
.IP "<Grid editor>"
.sp 2
.TS
l l l l.
OUT.asc	\\=	<filename>
Flip.y	\\=	<logical>	(default is false)
SCale	\\=	<integer>	(default is 1)
.TE
OUT.ASC is an ascii output file intended to be read by an external
grid editor. See appendix B of [1] for details of the
format.  FLIP.Y and SCALE are as above.
.KE
.RE
.RS
.sp 2
.IP "<smoothing key>"
.TS
l l l l.
SMooth.key	\\=	<integer>
.TE
This causes mesh smoothing as described in section 4.6 of [1].
The digits of the integer are read in reverse order and decoded as
follows:
.TS
l l.
1	Triangle smoothing, maintaining all region boundaries fixed.
2	Triangle smoothing, maintaining only material boundaries.
3	Node averaging.
.TE
Options 1 and 3 are the most common; 2 is used only if a device
has several regions of the same material and the border between
the different regions is unimportant.
.sp
.RE
.+B 8940
.sp 2
.IP "<Cylindrical coordinates>"
.TS
l l l.
CYLindrical	\\=	<logical>
.TE
Using the CYL parameter specifies that the mesh, whether generated 
in the current input deck or read from a file, is to be rotated
about the y-axis to permit the simulation of cylindrically symmetrical
devices.  This information is NOT written to the mesh file;  it must
be specified in the input deck which calculates a solution.
.-B 8940
.RE
.NH
Examples
.IP
Initiate a rectangular mesh and request it to be stored in mesh1.pg :
.P1
MESH  RECTANGULAR NX=40 NY=17 OUTF=mesh1.pg
.P2
Read a previously generated mesh and generate an ascii file for a
grid editor (the y axis is inverted because the grid editor obeys
the convention that positive y is upward, while \*(PI
follows the semiconductor convention of positive y being into the
bulk) :
.P1
MESH  INF=mesh1.pg OUT.ASC=mesh1.pa FLIP ASCII.OUT
.P2
Read a geometry file, smooth the mesh, and store the file for
a later run (ascii format):
.P1
MESH  GEOM INF=geom1 SMOOTH.K=13131 OUTF=mesh1.pg
.P2
The smoothing does several averaging and flipping steps. The digits are
read in reverse order, so that the flipping comes first, followed by
node averaging, and so on.
.eC
