Added fem framework manual.
authorMilind Bhandarkar <milind@cs.uiuc.edu>
Tue, 5 Dec 2000 06:13:39 +0000 (06:13 +0000)
committerMilind Bhandarkar <milind@cs.uiuc.edu>
Tue, 5 Dec 2000 06:13:39 +0000 (06:13 +0000)
doc/Makefile
doc/fem/Makefile [new file with mode: 0644]
doc/fem/create_field.eps [new file with mode: 0644]
doc/fem/create_field.png [new file with mode: 0644]
doc/fem/manual.tex [new file with mode: 0644]
doc/fem/partitioned_mesh.eps [new file with mode: 0644]
doc/fem/partitioned_mesh.png [new file with mode: 0644]
doc/fem/simple_mesh.eps [new file with mode: 0644]
doc/fem/simple_mesh.png [new file with mode: 0644]

index cbb21d6a29eb7d710e3a96e01732a94a47197c1a..95a2f2af4b4b006b2280d31a591e1cd75a9c0ae6 100644 (file)
@@ -12,6 +12,7 @@ ps:
        ( cd ck; make ps )
        ( cd libraries; make ps )
        ( cd f90charm; make ps )
+       ( cd fem; make ps )
 
 pdf:
        if [ ! -d $(IDIR)/pdf ] ; then mkdir $(IDIR)/pdf ; fi
@@ -23,6 +24,7 @@ pdf:
        ( cd ck; make pdf )
        ( cd libraries; make pdf )
        ( cd f90charm; make pdf )
+       ( cd fem; make pdf )
 
 html:
        if [ ! -d $(IDIR)/html ] ; then mkdir $(IDIR)/html ; fi
@@ -34,6 +36,7 @@ html:
        ( cd ck; make html )
        ( cd libraries; make html )
        ( cd f90charm; make html )
+       ( cd fem; make html )
 
 clean:
        ( cd install; make clean )
@@ -44,3 +47,4 @@ clean:
        ( cd ck; make clean )
        ( cd libraries; make clean )
        ( cd f90charm; make clean )
+       ( cd fem; make clean )
diff --git a/doc/fem/Makefile b/doc/fem/Makefile
new file mode 100644 (file)
index 0000000..88e0000
--- /dev/null
@@ -0,0 +1,36 @@
+PSDIR=../../../doc/ps
+PDFDIR=../../../doc/pdf
+HDIR=../../../doc/html
+
+all: ps pdf html
+
+ps:
+       make clean
+       touch index.tex
+       latex manual.tex
+       latex manual.tex
+       if [ -f manual.idx ] ; then makeindex -o index.tex manual.idx ; fi
+       latex manual.tex
+       dvips -o manual.ps manual.dvi
+       /bin/cp manual.ps $(PSDIR)/fem.ps
+
+html:
+       make clean
+       touch index.tex
+       latex manual.tex
+       latex2html -local_icons manual.tex
+       /bin/rm -rf $(HDIR)/fem
+       /bin/cp -R manual $(HDIR)/fem
+
+pdf:
+       make clean
+       touch index.tex
+       pdflatex manual.tex
+       if [ -f manual.idx ] ; then makeindex -o index.tex manual.idx ; fi
+       pdflatex manual.tex
+       /bin/cp manual.pdf $(PDFDIR)/fem.pdf
+
+clean:
+       /bin/rm -f *.ps *.pdf *.ilg *.aux *.log *.dvi *.idx *.toc 
+       /bin/rm -f index.tex *.blg *.bbl
+       /bin/rm -rf manual
diff --git a/doc/fem/create_field.eps b/doc/fem/create_field.eps
new file mode 100644 (file)
index 0000000..a72922c
--- /dev/null
@@ -0,0 +1,755 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: (ImageMagick)
+%%Title: (create_field.eps)
+%%CreationDate: (Mon Dec  4 23:36:31 2000)
+%%BoundingBox: 0 0 374.84 238
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 1
+%%Pages: 0
+%%EndComments
+
+%%BeginDefaults
+%%PageOrientation: Portrait
+%%EndDefaults
+
+%%BeginProlog
+%
+% Display a color image.  The image is displayed in color on
+% Postscript viewers or printers that support color, otherwise
+% it is displayed as grayscale.
+%
+/buffer 512 string def
+/byte 1 string def
+/color_packet 3 string def
+/pixels 768 string def
+
+/DirectClassPacket
+{
+  %
+  % Get a DirectClass packet.
+  %
+  % Parameters:
+  %   red.
+  %   green.
+  %   blue.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/DirectClassImage
+{
+  %
+  % Display a DirectClass image.
+  %
+  systemdict /colorimage known
+  {
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { DirectClassPacket } false 3 colorimage
+  }
+  {
+    %
+    % No colorimage operator;  convert to grayscale.
+    %
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { GrayDirectClassPacket } image
+  } ifelse
+} bind def
+
+/GrayDirectClassPacket
+{
+  %
+  % Get a DirectClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   red
+  %   green
+  %   blue
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/GrayPseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassImage
+{
+  %
+  % Display a PseudoClass image.
+  %
+  % Parameters:
+  %   class: 0-PseudoClass or 1-Grayscale.
+  %
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  class 0 gt
+  {
+    currentfile buffer readline pop
+    token pop /depth exch def pop
+    /grays columns 8 add depth sub depth mul 8 idiv string def
+    columns rows depth
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { currentfile grays readhexstring pop } image
+  }
+  {
+    %
+    % Parameters:
+    %   colors: number of colors in the colormap.
+    %   colormap: red, green, blue color packets.
+    %
+    currentfile buffer readline pop
+    token pop /colors exch def pop
+    /colors colors 3 mul def
+    /colormap colors string def
+    currentfile colormap readhexstring pop pop
+    systemdict /colorimage known
+    {
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { PseudoClassPacket } false 3 colorimage
+    }
+    {
+      %
+      % No colorimage operator;  convert to grayscale.
+      %
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { GrayPseudoClassPacket } image
+    } ifelse
+  } ifelse
+} bind def
+
+/DisplayImage
+{
+  %
+  % Display a DirectClass or PseudoClass image.
+  %
+  % Parameters:
+  %   x & y translation.
+  %   x & y scale.
+  %   label pointsize.
+  %   image label.
+  %   image columns & rows.
+  %   class: 0-DirectClass or 1-PseudoClass.
+  %   compression: 0-RunlengthEncodedCompression or 1-NoCompression.
+  %   hex color packets.
+  %
+  gsave
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  x y translate
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  currentfile buffer readline pop
+  token pop /pointsize exch def pop
+  /Helvetica findfont pointsize scalefont setfont
+  x y scale
+  currentfile buffer readline pop
+  token pop /columns exch def
+  token pop /rows exch def pop
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  currentfile buffer readline pop
+  token pop /compression exch def pop
+  class 0 gt { PseudoClassImage } { DirectClassImage } ifelse
+  grestore
+} bind def
+%%EndProlog
+%%Page:  1 1
+%%PageBoundingBox: 0 0 376 239
+userdict begin
+%%BeginData:
+DisplayImage
+0 0
+375.84 239.04
+12
+261 166
+1
+0
+0
+256
+000000
+0e0e0e
+151515
+191919
+1c1c1c
+262626
+2d2d2d
+363636
+3f3f3f
+404040
+4b4b4b
+565656
+5e5e5e
+6f6f6f
+838383
+898989
+8b8b8b
+969696
+a2a2a2
+a3a3a3
+b8b8b8
+bcbcbc
+dfdfdf
+f2f2f2
+f7f7f7
+fdfdfd
+ffffff
+000800
+44845c
+f0ef00
+ffff00
+bfbf00
+a0021c
+750056
+13001b
+400008
+007c6c
+000dee
+020cff
+0040bf
+74207b
+192583
+1c1c07
+404008
+909cf8
+f0ef4e
+ffff1b
+bfbf08
+f2cf86
+4ebf00
+130480
+404003
+000468
+00008d
+02001b
+000008
+74785f
+19ef00
+1cff00
+40bf00
+20f810
+05ef00
+c0045d
+fb0000
+010000
+008412
+d0ef00
+21ff00
+08bf00
+0004a0
+000079
+00001a
+800008
+188c7c
+55efee
+1bffff
+08bfbf
+000c00
+00f08a
+02ff07
+00bf08
+080420
+0e007c
+009801
+00ef00
+00ff00
+00bf00
+001831
+10f02d
+00ff17
+7aae01
+0003ff
+18e094
+5555ee
+1b1bff
+0808bf
+3d98c9
+bcef7d
+05ff07
+08bf08
+88eaa0
+f02379
+ff131a
+bf4008
+817471
+411900
+dd1c80
+394003
+20ff04
+05fff4
+1cffff
+4003bf
+a8b8c5
+f0ef72
+ffff05
+5452c0
+492ef1
+1313ff
+4040bf
+a0fc67
+98ef75
+17ff05
+40000d
+95ac00
+171600
+080800
+9cab00
+080c00
+f80004
+c100f4
+2100ff
+0800bf
+f47404
+f019f4
+ff1cff
+bf40bf
+f49c7c
+f0f00d
+ffff0c
+bfbf40
+5aab24
+6af269
+081206
+084040
+0dfc03
+92ef00
+0dff00
+001284
+0080ef
+000dff
+0008bf
+7ccc04
+f1f000
+80fce8
+caefee
+1dffff
+ff0068
+00acef
+0016ff
+80ff04
+caff00
+1dff00
+08ff00
+ff00f4
+00acee
+50fc74
+46efef
+00ffff
+00bfbf
+020000
+ff74a4
+001957
+001c1b
+004008
+002000
+002d00
+001700
+003100
+c2f000
+008c00
+00f000
+ba0404
+bd00f4
+2300ff
+3a1800
+c6f000
+1fff00
+249800
+9b1801
+a7f000
+07ff00
+80010d
+ca00ff
+1dad00
+08fb00
+0500e0
+01acd3
+00160b
+000840
+a600f8
+00ac4e
+00161b
+000808
+000004
+00ac08
+001600
+040000
+f4ac00
+ff1600
+bf0800
+002928
+01a1b4
+003069
+001806
+004040
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+1aff1aff1aff1a3e180016a618001a5a0500000007000ca40700000016001a5803000500
+070016001aa41600070003000c001a5603000c001a000c0016001aa416000c001a000500
+0c001a5403000c001a010c0016001aa416000c001a01070014001a5203000c001a020c00
+16001aa416000c001a02030016001a500c0005001a030c0016001aa416000c001a021900
+00001a4f160003001a040c0016001aa416000c001a030c011a4d160003001a050c001600
+1aa416000c001a040c011a4b160000001a060c0016001aa416000c001a05030018001a49
+1600000016001a060c0016001aa416000c001a05140007001a481600030019001a070c00
+16001aa416000c001a06030018001a47000018001a080c0016001a0818000c0918001a00
+0c011a1b0c021a0514000c031a110c001a4f16000c001a0614000c001a460c0012001a09
+0c0016001a09160000021a021600000116001a0000011a1c00010c001a050c0000001200
+1a1000021a4f16000c001a0700001a4603001a0a0c0016001a0a120000000c001a040c00
+16001a000c011a1c1600000116001a050c001a120c0000001a4f16000c001a0707001600
+1a44070014001a0a0c0016001a0a120000000c001a0516001a1514001a08160000021a05
+0c001a120c0000001a4f16000c001a07140005001a43140007001a0b0c0016001a0a1200
+00000c001a1b180003001a08160110000000030018001a030c001a120c0000001a4f1600
+0c001a08000018001a4200001a0c0c0016001a0a120000000c001a0318001a0216011a03
+18011a0016001a011900160118011a01160007000000160018001a061601180000011000
+1a030c001a05160118001a051900160118000c0000001a04160118001a4716000c001a08
+050010001a41070014001a0c0c0016001a0a120000000c001a030c001a010c0000011a01
+16000c0003000c001000000014001a000500100016000c0003001a011600070000001600
+18001a0616011a001600000118001a020c001a0318000c00160103000c001a0318000500
+10001600030100001a021400070010000700030018001a4616000c001a0812000c001a40
+0c0007001a0d0c0016001a0a1200000003000c02070000001a0200011a02160000011000
+160018000c0012001a0207001a020c0000001a0816011a01100000011a020c001a021800
+000016001a0207011a011800000012001a02070000001a0200001a021000000016001a45
+16000c001a0900001a3f1600000019001a0d0c0016001a0a120000000c001a0216000000
+1a0200011a02160000000c001a020c00000016001a010c001a020c0000001a0816011a02
+0c0000000c001a010c001a0216000c001a030c0000001a0116000c001a030c0000001a01
+0c0016001a021600000012001a4516000c001a09000019001a3e0c011a0e0c0016001a0a
+120000000c001a030c001a0200011a02160000000c001a021400000116001a040c000000
+1a0816011a03000110001a000c001a0200000c001a0400000c001a0000000c001a030c00
+00001a010c0007000c0416001a4516000c001a090c0016001a3e00001a0f0c0016001a0a
+120000000c001a0318001a0200011a02160000000c001a0312000c000000070014001a02
+0c0000001a0816011a03100000011a000c001a0200000c001a0400000c001a0000000c00
+1a030c0000001a010c0016001a4b16000c001a090c0016001a3d10011a0f0c0016001a0a
+120000000c001a0700011a02160000000c001a0516000700000014001a010c0000001a08
+16011a041000000007000c001a0200000c001a0400000c001a0000000c001a030c000000
+1a010c0007001a4b16000c001a0916000c001a0a16011a01180016001a2c00001a100c00
+16001a0a120000000c001a0700011a02160000000c001a020c001a02180003000c001a01
+0c0000001a0816011a050c0000000c001a021600000016001a02180000001a0107000000
+12001a02070000001a011400000018001a02180012001a4516000c001a0916000c001a09
+030019001000160010001400100016001a2a14000c001a100c0016001a0a0c0000000700
+1a0700011a02160000000c001a020c0012001a02070014001a010c00000016011a061001
+1a05180003000c001a03070118001a01070014001a01180000000500140016000c000300
+0000160019001a0003010c00160014000c0019001a4516000c001a0a03001a0816000000
+1a02000016001a0c16001a1e070018001a100c0016001a081800070000020c0018001a04
+0c0000010c001a00160007000000030014001a010c0107000c00070010001a0214000000
+070018001a050c0000010c001a0518000c001a04160003000c00100016001a0316000c00
+000118000c001000160019001a0018001000000116001a4716000c001a0a00001a041801
+1a01100000001600180016000000100018001a00160118001a02160018001a010c001000
+18001a1d03001a110c0016001aa416000c001a0a00001a0216000c001a0016000c001a00
+160000001a02000016001a0010001a010c001a00180010001a000c0012001a000c001600
+1a1d16000c001a110c0016001aa416000c001a0a00001a0205001a020500190016000000
+1a02000016001a000c0012001a0019001a000c0012010c0000001a000c0016001a1d0c00
+16001a110c0016001aa416000c001a09180007001a0200001a020c00160100001a020000
+16001a010700000010001a000c001a040c0016001a1d00001a120c0016001aa416000c00
+1a0916000c001a02030019001a010c001800160000001a02000016001a03030016000c00
+16001a0119001a000c0016001a1c16000c001a120c0016001aa416000c001a0914001000
+1a021600050016001a000c001a001400000019001a01000014001a0010001a0114001801
+03001000140012001a000c00100016001a1b0c0016001a120c0016001aa416000c001a09
+0c0016001a0418011a0116021a0016021a01160118001a0216001a0316001a1c00001a13
+0c0016001aa416000c001a09070016001a3a03001a130c0016001aa416000c001a090000
+1a3a16000c001a130c0016001aa416000c001a08170005001a3a100014001a130c001600
+1aa416000c001a0812000c001a3a070016001a130c0016001aa416000c001a0800001400
+1a3a00001a140c0016001aa416000c001a07180000001a3a180007001a140c0016001aa4
+16000c001a0710000c001a3a16000c001a140c0016001aa416000c001a07030019001a3a
+0c0016001a140c0016001aa416000c001a06180007001a3b0c0016001a140c0016001aa4
+16000c001a060c0012001a3b00001a150c0016001aa416000c001a0600001a3b19000300
+1a150c0016001aa416000c001a0316001a0010011a3b12000c001a150c0016001aa41600
+0c001a030000030000001a3c0c0010001a150c0016001aa416000c001a02100000021a3c
+000016001a150c0016001aa416000c001a02000303001a3b000016001a150c0016001aa4
+16000c001a010700000207001a3c000016001a150c0016001aa416000c001a0017000002
+0c001a2a14000c001a000c0000001a0d000016001a150c0016001aa416000c001a000500
+000110001a2b16000c001a0916001a04180000001a160c0016001aa416000c0014000000
+030018001a2c16000c001a08160012001a04160000001a160c0016001aa4160007000000
+12001a2b19000c00160007000c001a00070000001a001600140110001a0007000c001600
+1a03160000001a160c0000a603001a2d00001a0116000c001a000c0000001a000c001600
+1a0018001a000c0012001a04160000001a160c000d00158f0d000b0015120d000c001a2c
+160000001a0116000c001a000c0000001a010700030016001a000c0012001a0418000000
+1a160c000d00150d0f000100157f0600040015120d000c001a2c160000001a0116000c00
+1a000c0000001a02180000001a000c0012001a05000016001a150c000d00150e0000151b
+0f00156200010d0015110d000c001a2d00000c001a0005000c001a000c0000001a001200
+1a010c001a000c0012001a0019001a03000016001a150c000d00150e0000151a11000d00
+15610d00000215110d000c001a2d190010000c0016001400180010000c00180016001400
+16011a0016000c0014001a04000016001a150c000d00150e000013000600090015010d01
+09001300150011000b010d001500130009000b000a0015061300040009000f000d000600
+0b001500130009000f000900130006000a0013001500130009000b000d00154f09000002
+0f0015100d000c001a43000016001a150c000d00150e00000f0013000400060015000100
+15000d00060015000000130015000b0015000600150106000900150606000d0015010100
+0900150013000b00150000000f0013000600040015000600150104000f00154e01000002
+060015100d000c001a430c0010001a150c000d00150e000015010d000000150013000900
+060115000a00010009001300150004000d020f00150606000d0015010b00000015000b00
+13001500000015020000150004000d021300154d0f0000041300150f0d000c001a431200
+0c001a150c000d00150e000015010d0000001500060015000d0006001501130009000100
+15000100150a06000d00150206000a000d0015010000150200001500010015510b000004
+0d00150f0d000c001a43190003001a150c000d00150e0000150109000d01040015000900
+06001300060015010400150004000b00130011000b00150606000d00130015010f000000
+0b00150100000f0015000d000900150004000b0013000d000f00154e1300090001000d00
+15110d000c001a4400001a150c000d00150e0b0009000b000d001501090006000f000600
+13000a000b000d0115001300090006000d0015070d0006000f0015020200150200000b01
+0d0015011300090006000f0015500d00060015120d000c001a440c0016001a140c000d00
+152f11000a001502000015590d00060015120d000c001a440c0016001a140c000d001523
+0b0006040b001502130006011503000015590d00060015120d000c001a4416000c001a14
+0c000d00152d130006000d0015020f0006000d00130015570d00060015120d000c001a44
+180007001a140c0009000d8f090004000d1209000c001a4500001a140c000400068f0400
+0100061204000c001a45070016001a130c000d0015750d0015180d00060015120d000c00
+1a45100014001a130c000d0015740900000015180d00060015120d000c001a4516000c00
+1a130c000d0015740d00000015180d00060015120d000c001a4603001a130c000d001574
+0d00000015180d00060015120d000c001a4600001a130c000d00155c0600000009001500
+09000d00130009000a0006000d0015000d0006000d000200130015060d00000015001300
+09000b0002000d001300060009000b0001000d00150c0d00060015120d000c001a460c00
+16001a120c000d00155c13000000060015000900150009000b000d010000150004001501
+0a000f0015060d000000150009000b000d010000150006000d0015000d000600150c0d00
+060015120d000c001a4616000c001a120c000d00155d0d0001000f000b00150006001504
+0600150a0d00000015000600150406000d0015000d000600150c0d00060015120d000c00
+1a4700001a120c000d00155e06000400150106000d001501130015000000150213001506
+0d000000150006000d0015011300150006000d0015000d000600150c0d00060015120d00
+0c001a470c0016001a110c000d00155e0f00040015010f00010006000d00090015000900
+04000b000a000d0015060d00000015000f00010009000d000900150006000d0015000d00
+0600150c0d00060015120d000c001a4716000c001a110c000d00155f1100150211000a00
+0d0015020a0115080a010d00150011000a000e00150011000a0111000a010e00150b0d00
+060015120d000c001a4803001a110c000d00156d0f000d041100151a0d00060015120d00
+0c001a48070018001a100c000d00156d0f000d041100151a0d00060015120d000c001a48
+14000c001a100c0009000d8f090004000d1209000c001a4900001a100c000400068f0400
+0100061204000c001a4910011a0f0c000d00158f0d00060015120d000c001a4a00001a0f
+0c000d00158f0d00060015120d000c001a4a0c0012001a0e0c000d00158f0d0006001512
+0d000c001a4a140000001a0e0c000d00158e1300090001000d0015110d000c001a4b0c00
+07001a0d0c000d00158d0b0000040d00150f0d000c001a4c070014001a0c0c000d00158d
+0f0000041300150f0d000c001a4d00001a0c0c000d00158e01000002060015100d000c00
+1a4d140007001a000c011a080c000d00158e090000020f0015100d000c001a4e03000002
+12001a070c000d00158e0f000001020015110d000c001a4d0c00000418001a060c000d00
+158f01000000110015110d000c001a4d000505001a060c000d00158f060115120d000c00
+1a4c1000000616001a050c000d00158f0d000b0015120d000c001a4b1900000703001a05
+0c0000a60c001a4b0c00000810001a040c0016001aa416000c001a4c1400030000071a04
+0c0016001aa416000c001a4e1000000607001a030c0016001aa416000c001a500c000005
+14001a020c0016001aa416000c001a511600000405001a020c0016001aa416000c001a53
+1000000314001a010c0016001aa416000c001a550c0000021a010c0016001aa416000c00
+1a561800070000000c001a000c0016001aa416000c001a581400030016000c0016001aa4
+16000c001a5a120007010ca407000c001a5b0c00100016a410000c001a5b0c0016001aa4
+16000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa4
+16000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa4
+16000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa4
+16000c001a5b0c0016001a0c0c02140018011a2f0c001a060c021a0514000c031a110c00
+1a3816000c001a5b0c0016001a0a0c00000014001a010700000016001a2d0c0003000000
+1a070700000007001a051400000014001a100c00030000001a3816000c001a5b0c001600
+1a091000000010001a03000016001a2e0c0000001a07160000010c001a0500001a120c00
+00001a3816000c001a5b0c0016001a090c00000016001a03160010001a2e0c0000001a07
+16000700000118001a0400001a120c0000001a3816000c001a5b0c0016001a090c000001
+1a340c0000001a071602000116001a0300001a120c0000001a3816000c001a5b0c001600
+1a091000000107001a081800160119001a0516021a0616011a0516001a0116021a041800
+160118000c0000001a0716011800000110001a0300001a05160118001a06160118000c00
+00001a04160118001a3016000c001a5b0c0016001a0a0c0000010c0018001a050c000300
+16000000050018001a021400070010001600070014001a0316000c001600100007001400
+1a010c01000016000c00000218001a02180003001601030100001a0716011a0016000001
+18001a0200001a0318000c00160103000c001a04070010001600030100001a0214000700
+10000700030016001a2f16000c001a5b0c0016001a0b1800000203001a0316000c001a02
+0c00000018001a01000018001a010c00000016001a011000000016001a01180000001400
+1a011600000010001a01180000011a011800000016001a02070000001a0716011a011000
+00011a0200001a021800000016001a0207011a01180000000c001a02070000001a020000
+1a02100012001a2f16000c001a5b0c0016001a0d0c000300000007001a02000016030c00
+000016001a000c0007001a030c0018001a01070012001a0307011a011600000016001a02
+00011a0110000c001a030c0000001a0716011a021400000007001a0100001a0210000c00
+1a031400000018001a00100000001a030c0000001a010c0010001602100012001a2f1600
+0c001a5b0c0016001a0e1800000107001a01000016051a010c0016001a06160000001200
+1a031600000016001a001600000016001a0200011a0100000c001a030c0000001a071601
+1a03000107001a0000001a0200000c001a0400000c001a0000011a030c0000001a010c00
+1000160319001a2f16000c001a5b0c0016001a0818011a0500011a0100001a070c001600
+1a061600000012001a031600000016001a001600000016001a0200011a0100000c001a03
+0c0000001a0716011a0318000001180000001a0200000c001a0400000c001a0000011a03
+0c0000001a010c0016001a3416000c001a5b0c0016001a08160014001a0500011a010000
+0c001a060c0000001a06180003000c001a031600030018001a001600000016001a020001
+1a01000007001a030c0000001a0716011a041800030000011a0207011a04000014001a00
+000118001a020c0000001a010c0000001a3416000c001a5b0c0016001a08160005001700
+1a0400000c001a010c00050019001a0216011a001600000016001a02190012001a010c00
+000016001a020c011a011600000016001a0200011a010c00000016001a01190005000000
+1a0716011a050c0000011a021600000016001a02160000001a010c0000000c001a011900
+050000001a011600000016001a3316000c001a5b0c0016001a0907000500140018001a00
+18001400030018001a011800000007001000160012000c001a0203010c0016010c001600
+1a0116000500070018001a001800030018001a011600000016001a0200011a0118000000
+070016010c000300000016001a0610011a051800030000001a03070118001a0107001400
+1a01180000000300140016000c0003000000160018001a0003010c001600140016001a2f
+16000c001a5b0c0016001a090c01160003000c000300000018001a031600070000000700
+16001a0318000002100018001a031900160003000c00140018001a010c00070000000700
+140018000c0000010c0018001a0016000700000118000c00100016001a050c0000010c00
+1a05180000001a04160003000c00100016001a0316001000000118000c00100016001800
+1a00180010000001160019001a2f16000c001a5b0c0016001aa416000c001a5b0c001600
+1aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c001600
+1aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c001600
+1aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c001600
+1aa416000c001a5b0c0016001aa416000c001a5b0c0016001aa416000c001a5b0c001600
+1aa416000c001a5b0c0016001aa416000c001a5b100014001a1c160010001a2712001000
+1a220c0014001a211600100019001a1116000c001a5c03000c001a1a0c00030010000000
+10001a23100000000c001000000010001a1e1400000012000700030014001a1e0c000300
+10000000070018001a0f16000c001a5d1000030016001a161200030010001a0210000000
+0c0018001a1e1000000010001a031000000010001a1b07011a0218000700030014001a1a
+1600030010001a0214000300070018001a0d16000c001a5e1600000012001a1405000000
+16001a041900080000000c001a1b16000000050019001a0519000500000016001a171900
+00000c001a0516000000050019001a171200000016001a050c0000000c001a0c16000c00
+1a5f18000300050018001a10180003000c0019001a0718000700030014001a1714000500
+030014001a0914000300050014001a141400000014001a08100000000c0018001a131900
+0c00030018001a0718000700030012001a0a16000c001a611200030010001a0e10000300
+16001a0b18000700030014001a1314000300070016001a0d16000700030014001a101600
+050007001a0c12000300070018001a101000000010001a0b18000c00000010001a081600
+0c001a630c00030018001a0a180003000c001a0f18000700000010001a0f140003000700
+18001a1118000700030014001a0d0c00030016001a0f14000300070018001a0c18000300
+0c0019001a0f1000000010001a0616000c001a641600030010001a080c00030016001a12
+19001000000010001a0b14000300070018001a1518000700030012001a09160003001000
+1a1314000300070016001a091000030016001a131000000010001a0416000c001a660c00
+030016001a041400000012001a171000000010001a0710000000070018001a1918000c00
+000010001a060c00030018001a1614000500030014001a05180003000c001a1710000000
+0c0018001a0116000c001a671600050007001a0207011a1b10000000100019001a021000
+0000100019001a1e1000000010001a021200030010001a1a18000700030014001a020c00
+030016001a1a120003000700180016000c001a69140000001000000014001a1e10000000
+07001000000010001a231000000010000300050018001a1d180007000300100000001200
+1a1e140003010c001a6a1900000019001a210c00050019001a251900050012001a211600
+000019001a210c011aff1aff1aff1aff1a3f
+%%EndData
+end
+%%PageTrailer
+%%Trailer
+%%BoundingBox: 0 0 375 238
+%%EOF
diff --git a/doc/fem/create_field.png b/doc/fem/create_field.png
new file mode 100644 (file)
index 0000000..3995a5c
Binary files /dev/null and b/doc/fem/create_field.png differ
diff --git a/doc/fem/manual.tex b/doc/fem/manual.tex
new file mode 100644 (file)
index 0000000..4208173
--- /dev/null
@@ -0,0 +1,834 @@
+\documentclass[11pt]{article}
+
+\newif\ifpdf
+\ifx\pdfoutput\undefined
+  \pdffalse
+\else
+  \pdfoutput=1
+  \pdftrue
+\fi
+
+\ifpdf
+  \pdfcompresslevel=9
+  %\usepackage[pdftex,colorlinks=true,plainpages=false]{hyperref}
+\else
+\fi
+
+\usepackage{graphicx,calc}
+\usepackage{makeidx}
+\usepackage{alltt}
+
+\setcounter{topnumber}{2}
+\def\topfraction{1}
+\setcounter{bottomnumber}{1}
+\def\bottomfraction{1}
+\setcounter{totalnumber}{3}
+\def\textfraction{0.2}
+\def\floatpagefraction{0.8}
+
+\setlength{\parindent}{0.0in}
+\setlength{\parskip}{0.1in}
+\setlength{\textwidth}{6.5in}
+\setlength{\itemindent}{1in}
+\setlength{\textheight}{9.5in}
+\addtolength{\oddsidemargin}{0in}
+\addtolength{\topmargin}{-0.4in}
+
+\parskip 0.05in
+
+\newcommand{\internal}[1]{}
+\newcommand{\function}[1]{{\noindent{\bf {#1}}\\}}
+\newcommand{\args}[1]{{\tt {#1}}\\}
+\newcommand{\param}[1]{{\tt {#1}}}
+\newcommand{\kw}[1]{{\tt {#1}}}
+\newcommand{\note}[1]{\noindent{(Note: {\em {#1}})}}
+\newcommand{\desc}[1]{{#1}}
+
+\newcommand{\basea}{\renewcommand{\baselinestretch}{1.0}}
+\newcommand{\baseb}{\renewcommand{\baselinestretch}{1.8}}
+\newcommand{\mycomment}[1]{}
+\basea
+
+\textwidth 6.4in
+\textheight 8.9in
+\topmargin -.4in
+\oddsidemargin 0.25in
+\evensidemargin 0.25in
+\parskip 0.1in
+
+\makeindex
+
+\begin{document}
+
+\begin{titlepage}
+\vspace*{2in}
+\Huge
+\begin{center}
+Charm++\\
+Finite Element Framework\\
+Manual\\
+Version 1.0\\
+\vspace*{0.7in}
+\today
+\end{center}
+\normalsize
+
+\vspace*{2.5in}\large
+
+Initial version of Charm++ Finite Element Framework was developed
+by Milind Bhandarkar with inputs from Timothy Hinrichs and Kathikeyan
+Mahesh. The current version is almost completely rewritten by
+Orion Lawlor.
+
+\normalsize
+\end{titlepage}
+
+\tableofcontents
+\newpage
+
+\section{Motivation}
+
+The Finite Element Method (FEM) approach is used in many engineering
+applications with irregular domains, from elastic deformation problems to
+crack propagation to fluid flow.  Charm++ is a free message-passing parallel
+runtime system for machines from clusters of workstations to tightly-coupled
+SMPs.  The Charm++ FEM framework allows you to write a parallel FEM program,
+in C or Fortran 90, with minor additional effort over the serial version.
+Using the FEM framework also allows you to take advantage of all the
+features of Charm++, including run-time load balancing,  performance
+monitoring and visualization, and checkpoint/restart, with no additional
+effort.
+
+
+\section{Introduction/Terminology}
+
+A FEM program manipulates elements and nodes.  An element is a portion of
+the problem domain, typically in the shape of a triangle, square, or hexagon
+in 2D; or tetrahedron or rectangular solid in 3D.  A node is a point in the
+domain.  An element knows which nodes surround it via the connectivity
+table, which lists adjacent nodes.
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=4in]{simple_mesh}
+\end{center}
+\caption{3-element, 5 node mesh.}
+\label{fig:simplemesh}
+\end{figure}
+
+\begin{table}
+\begin{tabular}{||l||r|r|r||}
+\hline
+Element & Adjacent Nodes \\ \hline
+e1 & n1 & n3 & n4 \\
+e2 & n1 & n2 & n4 \\
+e3 & n2 & n4 & n5 \\
+\hline
+\end{tabular}
+\caption{Connectivity table for this mesh.}
+\label{table:simplemesh}
+\end{table}
+
+A typical FEM program performs some element-by-element calculations which
+update adjacent node values; then some node-by-node calculations.  For
+example, a material dynamics program has the structure:
+
+\begin{alltt}
+     time loop\\
+          element loop-- Element deformation applies forces to
+          surrounding nodes\\
+          node loop-- Forces and boundary conditions change node
+          positions\\
+     end time loop\\
+\end{alltt}
+
+We can parallelize such FEM programs by partitioning the serial mesh
+elements into several chunks  (at least one chunk per processor; perhaps
+even more).  During partitioning, we give nodes and elements new,
+chunk-local numbers.  Below, we partition the mesh above into two chunks, A
+and B.
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=4in]{partitioned_mesh}
+\end{center}
+\caption{Partitioned mesh.}
+\label{fig:partitionedmesh}
+\end{figure}
+
+\begin{table}
+\begin{tabular}{||l||r|r|r||}
+\hline
+Element & Adjacent Nodes \\ \hline
+e1 & n1 & n3 & n4 \\
+e2 & n1 & n2 & n4 \\
+\hline
+\end{tabular}
+\caption{Connectivity table for chunk A.}
+\label{table:chunkA}
+\end{table}
+
+\begin{table}
+\begin{tabular}{||l||r|r|r||}
+\hline
+Element & Adjacent Nodes \\ \hline
+e1 & n1 & n2 & n3 \\
+\hline
+\end{tabular}
+\caption{Connectivity table for chunk B.}
+\label{table:chunkB}
+\end{table}
+
+Note that chunk A's node n2 and B's node n1 were actually the same node in
+the original mesh-- partitioning split this single node into two shared
+copies (one on each chunk).  However, since adding forces is associative, we
+can handle shared nodes by computing the forces normally (ignoring the
+existence of the other chunk), then adding both chunks' net force for the
+shared node together.  This ``node update'' will give us the same resulting
+force on each shared node as we would get without partitioning, thus the
+same positions, thus the same final result.  Hence, each chunk's time loop
+has the structure:
+
+\begin{alltt}
+     chunk time loop\\
+          element loop-- Element deformation applies forces to
+          surrounding nodes\\
+          <update forces on shared nodes>\\
+          node loop-- Forces and boundary conditions change node
+          positions\\
+     end time loop\\
+\end{alltt}
+
+This is exactly the form of the time loop for a Charm++ FEM framework
+program.  The framework will accept a serial mesh, partition it, distribute
+the chunks to each processor, allow the user to run their time loop, and
+handle the node-updates.
+
+
+\section{Structure of a FEM Framework Program}
+
+A FEM framework program consists of three subroutines: init, driver, and
+finalize.  init and finalize are called by the FEM framework only on the
+first processor -- these routines typically do specialized I/O, startup and
+shutdown tasks.  driver is called for every chunk on every processor, and
+does the main work of the program.
+
+\begin{alltt}
+     subroutine init\\
+          read the serial mesh and configuration data\\
+     end subroutine\\
+     subroutine driver\\
+          get local mesh chunk\\
+          time loop\\
+               FEM computations\\
+               update shared node fields\\
+               more FEM computations\\
+          end time loop\\
+     end subroutine\\
+     subroutine mesh\_updated\\
+          write intermediate results; modify serial mesh\\
+     end subroutine\\
+     subroutine finalize\\
+           write results\\
+     end subroutine\\
+\end{alltt}
+
+\section{Compilation and Execution}
+
+A FEM framework program is a Charm++ program, so you must begin by
+downloading the latest source version of Charm++ from
+{\tt http://charm.cs.uiuc.edu/}.  Build the source with 
+{\tt ./SUPER\_INSTALL FEM version} or {\tt cd} into the build directory, 
+{\tt version/tmp}, and type {\tt make FEM}.
+To compile a FEM program, pass the {\tt -language fem} (for C) or 
+{\tt -language femf} (for Fortran) option to {\tt charmc}.
+
+
+\section{FEM Framework API Reference}
+
+\subsection{Utility}
+
+\function{int FEM\_Num\_Partitions();}
+\function{function integer :: FEM\_Num\_Partitions()}
+\desc{
+     Return the number of mesh chunks in the current computation.  Can
+     only be called from the driver routine.
+}
+
+\function{int FEM\_My\_Partition();}
+\function{function integer :: FEM\_My\_Partition()}
+\desc{
+     Return the number of the current chunk, from 0 to
+     num\_partitions-1.  Can only be called from the driver routine.
+}
+
+\function{double FEM\_Timer();}
+\function{function double precision :: FEM\_Timer()}
+\desc{
+     Return the current wall clock time, in seconds.  Resolution is
+     machine-dependent, but is at worst 10ms.
+}
+
+\function{void FEM\_Print\_Partition();}
+\function{subroutine FEM\_Print\_Partition()}
+\desc{
+     Print a debugging representation of the current chunk's mesh.
+     Prints the entire connectivity array, and data associated with
+     each local node and element.
+}
+
+\function{void FEM\_Print(const char *str);}
+\function{subroutine FEM\_Print(str)}
+\args{  character*, intent(in) :: str}
+\desc{
+     Print the given string.  Works on all machines; unlike printf or
+     print *, which may not work on all parallel machines.
+}
+
+\subsection{Mesh}
+
+These routines describe and retreive the finite element mesh for this
+computation.  A mesh, from the framework's perspective, is a list of
+elements, nodes, uninterpreted data associated with each, and the
+connectivity table.  Elements and nodes have both a global number (number in
+the serial mesh) as well as a chunk-local number (number in the partitioned
+mesh chunk).  The FEM framework currently uses the free Metis package for
+partitioning.
+
+A simple program would set the serial mesh in init, get the partitioned
+chunk in driver, and work on that chunk.  A more complex program would set
+the initial mesh in init; get, work on, update and repartition the mesh
+several times in driver; and perform post-processing on the reassembled,
+modified mesh in finalize.
+
+From init(), the FEM\_Set\_ routines describe the serial mesh, which will be
+partitioned into chunks.
+
+From driver(), the FEM\_Get\_ routines ask for the current mesh chunk; the
+FEM\_Set\_ routines describe a new partitioned mesh chunk.  The new chunk need
+not have the same number of elements or nodes as the old chunk; but any new
+added nodes are assumed private (not shared).  FEM\_Update\_Mesh will
+reassemble a serial version of the mesh from the new pieces and optionally
+repartition the serial mesh.
+
+From mesh\_updated(), the FEM\_Get and FEM\_Set routines manipulate the serial
+mesh.   Mesh\_updated is only executed if you call FEM\_Update\_Mesh during
+driver-- otherwise, mesh\_updated can be an empty procedure.  The parameter
+callMeshUpdated is passed down to mesh\_update.
+
+From finalize(), the FEM\_Get\_ routines ask for the reassembled serial mesh--
+for this, you must have previously called FEM\_Update\_Mesh during driver.
+
+\function{void FEM\_Set\_Mesh(int nElem, int nNodes, int nodePerEl,const int* conn);}
+\desc{
+     This is a convenience routine equivalent to:
+
+\begin{alltt}
+          FEM\_Set\_Node(nNodes,0);\\
+          FEM\_Set\_Elem(0,nElem,0,nodePerEl);\\
+          FEM\_Set\_Elem\_Conn(0,conn);\\
+\end{alltt}
+}
+
+\function{subroutine FEM\_Set\_Mesh(nElem,nNodes,nodePerEl,conn)}
+    \args{integer, intent(in) :: nElem, nNodes, nodePerEl}
+    \args{integer, intent(in), dimention(nElem,nodePerEl) :: conn;}
+\desc{
+     This is a convenience routine equivalent to:
+
+\begin{alltt}
+          CALL FEM\_Set\_Node(nNodes,0)\\
+          CALL FEM\_Set\_Elem(1,nElem,0,nodePerEl)\\
+          CALL FEM\_Set\_Elem\_Conn\_c(1,conn)\\
+\end{alltt}
+}
+
+\function{void FEM\_Set\_Elem(int elType,int  nEl,int  doublePerEl,int  nodePerEl);}
+\function{void FEM\_Get\_Elem(int elType,int *nEl,int *doublePerEl,int *nodePerEl);}
+\function{subroutine FEM\_Set\_Elem(elType,nEl,doublePerEl,nodePerEl)}
+  \args{integer, intent(in)  :: elType,nEl,doublePerEl,nodePerEl}
+\function{subroutine FEM\_Get\_Elem(elType,nEl,doublePerEl,nodePerEl)}
+  \args{integer, intent(in)  :: elType}
+  \args{integer, intent(out) :: nEl,doublePerEl,nodePerEl}
+\desc{
+     Describe/retreive the number and type of elements.  ElType is the
+     number of element types registered so far (the first element type
+     is 1, then 2, etc.).  nEl is the number of elements being
+     registered.  doublesPerEl and nodePerEl are the number of doubles
+     of user data, and nodes (respectively) associated with each
+     element.
+
+     doublePerEl or nodePerEl may be zero, indicating that no user data
+     or connectivity data (respectively) is associated with the
+     element.
+}
+
+\function{void FEM\_Set\_Elem\_Conn(int elType,const int *conn);}
+\function{void FEM\_Get\_Elem\_Conn(int elType,int *conn);}
+\function{subroutine FEM\_Set\_Elem\_Conn\_r(elType,conn)}
+  \args{integer, intent(in)  :: elType}
+  \args{integer, intent(in),  dimention(nodePerEl,nEl) :: conn}
+\function{subroutine FEM\_Get\_Elem\_Conn\_r(elType,conn)}
+  \args{integer, intent(in)  :: elType}
+  \args{integer, intent(out), dimention(nodePerEl,nEl) :: conn}
+\function{subroutine FEM\_Set\_Elem\_Conn\_c(elType,conn)}
+  \args{integer, intent(in)  :: elType}
+  \args{integer, intent(in),  dimention(nEl,nodePerEl) :: conn}
+\function{subroutine FEM\_Get\_Elem\_Conn\_c(elType,conn)}
+  \args{integer, intent(in)  :: elType}
+  \args{integer, intent(out), dimention(nEl,nodePerEl) :: conn}
+\desc{
+     Describe/retreive the element connectivity array for this element
+     type.  The connectivity array is indexed by the element number,
+     and gives the indices of the nodes surrounding the element.  It is
+     hence nodePerEl*nEl integers long.
+
+     The C version array indices are zero-based, and must be stored in
+     row-major order (a given element's surrounding nodes are stored
+     contiguously in the conn array).  The Fortran version indices are
+     one-based, and are available in row-major (named \_r) and
+     column-major (named \_c) versions.  We recommend row-major storage
+     because it results in better cache utilization (because the nodes
+     around an element are stored contiguously).
+}
+
+\function{void FEM\_Set\_Node(int  nNode,int  doublePerNode);}
+\function{void FEM\_Get\_Node(int *nNode,int *doublePerNode);}
+\function{subroutine FEM\_Set\_Node(nNode,doublePerNode)}
+  \args{integer, intent(in)  :: nNode,doublePerNode}
+\function{subroutine FEM\_Get\_Node(nNode,doublePerNode)}
+  \args{integer, intent(out) :: nNode,doublePerNode}
+\desc{
+     Describe/retreive the number of nodes and doubles of user data
+     associated with each node.  There is only one type of node, so no
+     nodeType identifier is needed.
+
+     doublePerNode may be zero, indicating that no user data is
+     associated with each node.
+}
+
+\function{void FEM\_Set\_Node\_Data(const double *data);}
+\function{void FEM\_Get\_Node\_Data(double *data);}
+\function{void FEM\_Set\_Elem\_Data(int elType,const double *data);}
+\function{void FEM\_Get\_Elem\_Data(int elType,double *data);}
+\function{subroutine FEM\_Set\_Node\_Data\_r(data)}
+  \args{REAL*8, intent(in),  dimention(doublePerNode,nNode)  :: data}
+\function{subroutine FEM\_Get\_Node\_Data\_r(data)}
+  \args{REAL*8, intent(out), dimention(doublePerNode,nNode)  :: data}
+\function{subroutine FEM\_Set\_Elem\_Data\_r(data)}
+  \args{REAL*8, intent(in),  dimention(doublePerElem,nElem)  :: data}
+\function{subroutine FEM\_Get\_Elem\_Data\_r(data)}
+  \args{REAL*8, intent(out), dimention(doublePerElem,nElem)  :: data}
+\function{subroutine FEM\_Set\_Node\_Data\_c(data)}
+  \args{REAL*8, intent(in),  dimention(nNode,doublePerNode)  :: data}
+\function{subroutine FEM\_Get\_Node\_Data\_c(data)}
+  \args{REAL*8, intent(out), dimention(nNode,doublePerNode)  :: data}
+\function{subroutine FEM\_Set\_Elem\_Data\_c(data)}
+  \args{REAL*8, intent(in),  dimention(nElem,doublePerElem)  :: data}
+\function{subroutine FEM\_Get\_Elem\_Data\_c(data)}
+  \args{REAL*8, intent(out), dimention(nElem,doublePerElem)  :: data}
+\desc{
+     Describe/retrieve the optional, uninterpreted user data associated
+     with each node and element.  This user data is partitioned and
+     reassembled along with the connectivity matrix, and may include
+     initial conditions, boundary values, or any other data needed or
+     produced by the program.   The Fortran arrays can be row- or
+     column- major (see FEM\_Set\_Elem\_Conn for details).  The row-major
+     form is preferred.
+}
+
+\function{void FEM\_Update\_Mesh(int callMeshUpdated,int doRepartition);}
+\function{subroutine FEM\_Update\_Mesh(callMeshUpdated,doRepartition)}
+    \args{integer, intent(in) :: callMeshUpdated,doRepartition}
+\desc{
+     Reassemble the mesh chunks from each partition into a single
+     serial mesh.  Can only be called from driver; and must be called
+     by the driver routine for every chunk.  The call is blocking only
+     if doRepartition is true; otherwise the call will immediately
+     return.  FEM\_Get calls from driver() will only return the new mesh
+     after a FEM\_Update\_Mesh call where doRepartition is true;
+     otherwise FEM\_Get returns the old mesh.
+
+     If callMeshUpdated is not zero, mesh\_updated(callMeshUpdated) will
+     be called on the first processor after the mesh is reassembled.
+
+     If doRepartition is 1, the reassembled serial mesh will be
+     repartitioned back into chunks and redistributed.  Otherwise,
+     FEM\_Update\_Mesh will return immediately.
+
+     If both doRepartition and callMeshUpdated are nonzero, the serial
+     mesh will be reassembled on the first processor, mesh\_updated will
+     be called, and the resulting mesh (which mesh\_updated may change)
+     is repartitioned into chunks and redistributed.
+
+     If both doRepartition and callMeshUpdated are 0, the serial mesh
+     will be reassembled on the first processor for use in the
+     finalize() routine.  Note that to use the serial mesh in
+     finalize(), you must call this routine from driver().
+
+     FEM\_Update\_Mesh reassembles the serial mesh with an attempt to
+     preserve the element and node global numbering.  If the new mesh
+     has the same number and type of elements and nodes, the global
+     numbers (and hence serial mesh) will be unchanged.  If new
+     elements or nodes are added at each chunk, they will be assigned
+     new unique global numbers.  If elements or nodes are removed,
+     their global numbers are not re-used-- you can detect the
+     resulting holes in the serial mesh since the user data associated
+     with the deleted elements will be all zero.
+
+     It may be easier to perform major mesh modifications from
+     mesh\_updated, since the entire serial mesh is available there.
+}
+
+\subsection{Node Fields}
+
+The FEM framework handles the updating of the values of shared nodes-- that
+is, it combines shared nodes' values across all processors.  The basic
+mechanism to do this update is the field-- numeric data items associated
+with each node. We make no assumptions about the meaning of the node data,
+and allow various data types and non-communicated data associated with each
+node.  To do this, the framework must be able to find the data items
+associated with each node in memory.
+
+Each field represents a (set of) node data items stored in a contiguous
+array, indexed by node number.  You create a field once, with
+FEM\_Create\_Field, then pass the resulting field ID to FEM\_Update\_Field
+(which does the shared node communication) and/or FEM\_Reduce\_Field (which
+applies a reduction over node values).
+
+\function{int FEM\_Create\_Field(int base\_type,int vec\_len,int offset,int dist);}
+\function{function integer :: FEM\_Create\_Field(base\_type, vec\_len, offset, dist)}
+  \args{integer, intent(in)  :: base\_type, vec\_len, offset, dist}
+\desc{
+     Creates and returns a FEM field ID, which can be passed to
+     FEM\_Update\_Field and FEM\_Reduce\_Field.  Can only be called from
+     driver().  A field is a range of values associated with each local
+     node-- the FEM framework uses the information you pass to find the
+     values associated with shared nodes (for FEM\_Update\_Field) and
+     primary nodes (for FEM\_Reduce\_Field).
+
+     base\_type describes the kind of data item associated with each
+     node, one of:
+
+     \begin{itemize}
+        \item FEM\_BYTE-- unsigned char, INTEGER*1, or CHARACTER*1
+        \item FEM\_INT-- int or INTEGER*4
+        \item FEM\_REAL-- float or REAL*4
+        \item FEM\_DOUBLE-- double, DOUBLE PRECISION, or REAL*8
+     \end{itemize}
+
+     vec\_len describes the number of data items associated with each
+     node, an integer at least 1.
+
+     offset is the byte offset from the start of the nodes array to the
+     data items, a non-negative integer.
+
+     dist is the byte offset from the first node's data item to the
+     second, a positive integer.
+
+\begin{figure}
+\begin{center}
+\includegraphics[width=4in]{create_field}
+\end{center}
+\caption{Creating a Node Field.}
+\label{fig:createfield}
+\end{figure}
+
+     For example, if you store a 3D force for each node n, in an array
+     indexed by 3*n, vec\_len is 3, offset is 0, and dist is 3*8=24.
+     You can register the node force for update with:
+
+\begin{alltt}
+          /* C */\\
+          double *nodeForce;\\
+          ... allocate nodeForce as 3*n\_nodes...\\
+          int fid=FEM\_Create\_Field(FEM\_DOUBLE,3,0,24);\\
+ \\
+          ! - Fortran90\\
+          REAL*8 ALLOCATABLE, DIMENTION(:) :: nodeForce\\
+          INTEGER :: fid\\
+          ... allocate nodeForce as 3*n\_nodes...\\
+          fid=FEM\_Create\_Field(FEM\_DOUBLE,3,0,24)\\
+\end{alltt}
+
+     If the 3D force is a member fXYZ of a structure (in C) or named
+     type (in Fortran 90) node\_type, in an array called nodes, you can
+     register this node force for update with:
+
+\begin{alltt}
+          /* C */\\
+          node\_type *nodes;\\
+          ...allocate nodes array as n\_nodes...\\
+          int fid=FEM\_Create\_Field(FEM\_DOUBLE,3,\\
+              (int)((char *)\&nodes[0].fXYZ-(char *)nodes),\\
+              (int)((char *)\&nodes[1]-(char *)\&nodes[0]) );\\
+ \\
+          ! - Fortran90\\
+          TYPE(node\_type), ALLOCATABLE, DIMENTION(:) :: nodes\\
+          INTEGER :: fid\\
+          ...allocate nodes array as n\_nodes...\\
+          fid=FEM\_Create\_Field(FEM\_DOUBLE,3,\\
+              offsetof(nodes(1), nodes(1)%fXYZ),\\
+              offsetof(nodes(1), nodes(2)) )\\
+\end{alltt}
+
+     This example uses the Fortran-only helper routine offsetof, which
+     returns the offset in bytes of memory between its two given
+     variables.  The C version uses pointer arithmetic to achieve the
+     same result.
+}
+
+\function{void FEM\_Update\_Field(int fid,void *nodes);}
+\function{subroutine FEM\_Update\_Field(fid,nodes)}
+  \args{integer, intent(in)  :: fid}
+  \args{varies, intent(inout) :: nodes}
+\desc{
+     Combine a field of all shared nodes with the other chunks.  Sums
+     the value of the given field across all chunks that share each
+     node.  For the example above, once each chunk has computed the net
+     force on each local node, this routine will sum the net force
+     across all shared nodes.
+
+     FEM\_Update\_Field can only be called from driver, and to be useful,
+     must be called from every chunk's driver routine.
+
+     After this routine returns, the given field of each shared node
+     will be the same across all processors that share the node.
+}
+
+\function{void FEM\_Read\_Field(int fid,void *nodes,char *fName);}
+\function{subroutine FEM\_Read\_Field(fid,nodes,fName)}
+  \args{integer, intent(in)  :: fid}
+  \args{varies, intent(out) :: nodes}
+  \args{character*, intent(in) :: fName}
+\desc{
+     Read a field out of the given serial input file.  The serial input
+     file is line-oriented ASCII-- each line begins with the global
+     node number (which must match the line order in the file),
+     followed by the data to be read into the node field.  The
+     remainder of each line is unread.  If called from Fortran, the
+     first line must be numbered 1; if called from C, the first line
+     must be numbered zero.  All fields are separated by white space
+     (any number of tabs or spaces).
+
+     For example, if we have called Create\_Field to describe 3 doubles,
+     the input file could begin with
+
+\begin{alltt}
+          1    0.2    0.7    -0.3      First node\\
+          2    0.4    1.12   -17.26    another node\\
+          ...\\
+\end{alltt}
+
+     FEM\_Read\_Field must be called from driver at any time, independent
+     of other chunks.
+}
+
+\function{void FEM\_Reduce\_Field(int fid,const void *nodes,void *out,int op);}
+\function{subroutine FEM\_Reduce\_Field(fid,nodes,outVal,op)}
+  \args{integer, intent(in)  :: fid,op}
+  \args{varies, intent(in) :: nodes}
+  \args{varies, intent(out) :: outVal}
+\desc{
+     Combine a field from each node, according to op, across all
+     chunks.  Shared nodes are not double-counted-- only once copy will
+     contribute to the reduction.  After Reduce\_Field returns, all
+     chunks will have identical values in outVal, which must be vec\_len
+     copies of base\_type.
+
+     May only be called from driver, and to complete, must be called
+     from every chunk's driver routine.
+
+     op must be one of:
+
+\begin{itemize}
+        \item FEM\_SUM-- each element of outVal will be the sum of the
+          corresponding fields of all nodes
+        \item FEM\_MIN-- each element of outVal will be the smallest value
+          among the corresponding field of all nodes
+        \item FEM\_MAX-- each element of outVal will be the largest value
+          among the corresponding field of all nodes
+\end{itemize}
+}
+
+\function{void FEM\_Reduce(int fid,const void *inVal,void *outVal,int op);}
+\function{subroutine FEM\_Reduce(fid,inVal,outVal,op)}
+  \args{integer, intent(in)  :: fid,op}
+  \args{varies, intent(in) :: inVal}
+  \args{varies, intent(out) :: outVal}
+\desc{
+     Combine a field from each chunk, acoording to op, across all
+     chunks.  Fid is only used for the base\_type and vec\_len-- offset
+     and dist are not used.  After this call returns, all chunks will
+     have identical values in outVal.  Op has the same values and
+     meaning as FEM\_Reduce\_Field.
+
+     May only be called from driver, and to complete, must be called
+     from every chunk's driver routine.
+}
+
+\subsection{Migration}
+
+The Charm++ runtime framework includes an automated, run-time load balancer,
+which will automatically monitor the performance of your parallel program.
+If needed, the load balancer can "migrate" mesh chunks from heavily-loaded
+processors to more lightly-loaded processors, improving the load balance and
+speeding up the program.  For this to be useful, pass the "+vpn" argument
+with a larger number of chunks n than processors-- typically, between 4 and
+32 chunks per processor acheive a good trade-off between ability to load
+balance and communication overhead.  Because this is somewhat involved, you
+may refrain from calling FEM\_Migrate and migration will never take place.
+
+The runtime system can automatically move your thread stack to the new
+processor, but you must write a PUP function to move any global or
+heap-allocated data to the new processor (global data is declared at file
+scope or "static" in C and "COMMON" in Fortran77; heap allocated data comes
+from C "malloc", C++ "new", or Fortran90 "ALLOCATE").  A PUP (Pack/UnPack)
+function performs both packing (converting heap data into a message) and
+unpacking (converting a message back into heap data).  All your global and
+heap data must be collected into a single block (struct in C; user-defined
+TYPE in Fortran) so the PUP function can access it all.
+
+Your PUP function will be passed a pointer to your heap data block and a
+special handle called a "pupper", which contains the network message to be
+sent.  Your PUP function returns a pointer to your heap data block.  In a
+PUP function, you pass all your heap data to routines named pup\_type, where
+type is either a basic type (such as int, char, float, or double) or an
+array type (as before, but with a "s" suffix).  Depending on the direction
+of packing, the pupper will either read from or write to the values you
+pass-- normally, you shouldn't even know which.  The only time you need to
+know the direction is when you are leaving a processor or just arriving.
+Correspondingly, the pupper passed to you may be deleting (indicating that
+you are leaving the processor, and should delete your heap storage after
+packing), unpacking (indicating you've just arrived on a processor, and
+should allocate your heap storage before unpacking), or neither (indicating
+the system is merely sizing a buffer, or checkpointing your values).
+
+PUP functions are much easier to write than explain-- a simple C heap block
+and the corresponding PUP function is:
+
+\begin{alltt}
+     typedef struct {\\
+       int n1;/*Length of first array below*/\\
+       int n2;/*Length of second array below*/\\
+       double *arr1; /*Some doubles, allocated on the heap*/\\
+       int *arr2; /*Some ints, allocated on the heap*/\\
+     } my\_block;\\
+ \\
+     my\_block *pup\_my\_block(pup\_er p,my\_block *m)\\
+     {\\
+       if (pup\_isUnpacking(p)) m=malloc(sizeof(my\_block));\\
+       pup\_int(p,\&m->n1);\\
+       pup\_int(p,\&m->n2);\\
+       if (pup\_isUnpacking(p)) {\\
+         m->arr1=malloc(m->n1*sizeof(double));\\
+         m->arr2=malloc(m->n2*sizeof(int));\\
+       }\\
+       pup\_doubles(p,m->arr1,m->n1);\\
+       pup\_ints(p,m->arr2,m->n2);\\
+       if (pup\_isDeleting(p)) {\\
+         free(m->arr1);\\
+         free(m->arr2);\\
+         free(m);\\
+       }\\
+       return m;\\
+     }\\
+\end{alltt}
+
+This single PUP function can be used to copy the my\_block data into a
+message buffer and free the old heap storage (deleting pupper); allocate
+storage on the new processor and copy the message data back (unpacking
+pupper); or save the heap data for debugging or checkpointing.
+
+A Fortran block TYPE and corresponding PUP routine is as follows:
+
+\begin{alltt}
+     MODULE my\_block\_mod\\
+       TYPE my\_block\\
+         INTEGER :: n1,n2x,n2y\\
+         REAL*8, POINTER, DIMENSION(:) :: arr1\\
+         INTEGER, POINTER, DIMENSION(:,:) :: arr2\\
+       END TYPE\\
+     END MODULE\\
+ \\
+     SUBROUTINE pup\_my\_block(p,m)\\
+       IMPLICIT NONE\\
+       USE my\_block\_mod\\
+       USE pupmod\\
+       INTEGER :: p\\
+       TYPE(my\_block) :: m\\
+       call pup\_int(p,m%n1)\\
+       call pup\_int(p,m%n2x)\\
+       call pup\_int(p,m%n2y)\\
+       IF (pup\_isUnpacking(p)) THEN\\
+         ALLOCATE(m%arr1(m%n1))\\
+         ALLOCATE(m%arr2(m%n2x,m%n2y))\\
+       END IF\\
+       call pup\_doubles(p,m%arr1,m%n1)\\
+       call pup\_ints(p,m%arr2,m%n2x*m%n2y)\\
+       IF (pup\_isDeleting(p)) THEN\\
+         DEALLOCATE(m%arr1)\\
+         DEALLOCATE(m%arr2)\\
+       END IF\\
+     END SUBROUTINE\\
+\end{alltt}
+
+\function{int FEM\_Register(void *block, FEM\_PupFn pup\_ud)}
+\function{function integer :: FEM\_Register(block,pup\_ud)}
+    \args{TYPE(varies), POINTER :: block}
+    \args{SUBROUTINE :: pup\_ud}
+\desc{
+     Associates the given data block and PUP function.  Returns a block
+     ID, which can be passed to FEM\_Get\_Userdata later.  Can only be
+     called from driver.  For the declarations above, you call
+     FEM\_Register as:
+
+\begin{alltt}
+          /*C/C++ driver() function*/\\
+          my\_block *m=malloc(sizeof(my\_block));\\
+          int myId=FEM\_Register(m,(FEM\_PupFn)pup\_my\_block);\\
+ \\
+          !- Fortran driver subroutine\\
+          use my\_block\_mod\\
+          interface\\
+            subroutine pup\_my\_block(p,m)\\
+              use my\_block\_mod\\
+              INTEGER :: p\\
+              TYPE(my\_block) :: m\\
+            end subroutine\\
+          end interface\\
+          TYPE(my\_block) :: m\\
+          INTEGER :: myId\\
+          myId=FEM\_Register(m,pup\_my\_block)\\
+\end{alltt}
+
+     Note that Fortran blocks must be allocated on the stack in driver;
+     while C/C++ blocks may be allocated on the heap.
+}
+
+\function{void FEM\_Migrate()}
+\function{subroutine FEM\_Migrate()}
+\desc{
+     Informs the load balancing system that you are ready to be
+     migrated, if needed.  If the system decides to migrate you, the
+     PUP function passed to FEM\_Register will be called with a sizing
+     pupper, then a packing, deleting pupper.  Your stack (and pupped
+     data) will then be sent to the destination machine, where your PUP
+     function will be called with an unpacking pupper.  FEM\_Migrate
+     will then return, whereupon you should call FEM\_Get\_Userdata to
+     get your unpacked data block.  Can only be called from driver.
+}
+
+\function{void *FEM\_Get\_Userdata(int n)}
+\desc{
+     Return your unpacked userdata after migration-- that is, the
+     return value of the unpacking call to your PUP function.  Takes
+     the userdata ID returned by FEM\_Register.  Can be called from
+     driver at any time.
+
+     Since Fortran blocks are always allocated on the stack, the system
+     migrates them to the same location on the new processor, so no
+     Get\_Userdata call is needed from Fortran.
+}
+\input{index}
+\end{document}
diff --git a/doc/fem/partitioned_mesh.eps b/doc/fem/partitioned_mesh.eps
new file mode 100644 (file)
index 0000000..624db9a
--- /dev/null
@@ -0,0 +1,757 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: (ImageMagick)
+%%Title: (partitioned_mesh.epsf)
+%%CreationDate: (Mon Dec  4 23:38:07 2000)
+%%BoundingBox: 0 0 481.4 346
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 1
+%%Pages: 0
+%%EndComments
+
+%%BeginDefaults
+%%PageOrientation: Portrait
+%%EndDefaults
+
+%%BeginProlog
+%
+% Display a color image.  The image is displayed in color on
+% Postscript viewers or printers that support color, otherwise
+% it is displayed as grayscale.
+%
+/buffer 512 string def
+/byte 1 string def
+/color_packet 3 string def
+/pixels 768 string def
+
+/DirectClassPacket
+{
+  %
+  % Get a DirectClass packet.
+  %
+  % Parameters:
+  %   red.
+  %   green.
+  %   blue.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/DirectClassImage
+{
+  %
+  % Display a DirectClass image.
+  %
+  systemdict /colorimage known
+  {
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { DirectClassPacket } false 3 colorimage
+  }
+  {
+    %
+    % No colorimage operator;  convert to grayscale.
+    %
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { GrayDirectClassPacket } image
+  } ifelse
+} bind def
+
+/GrayDirectClassPacket
+{
+  %
+  % Get a DirectClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   red
+  %   green
+  %   blue
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/GrayPseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassImage
+{
+  %
+  % Display a PseudoClass image.
+  %
+  % Parameters:
+  %   class: 0-PseudoClass or 1-Grayscale.
+  %
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  class 0 gt
+  {
+    currentfile buffer readline pop
+    token pop /depth exch def pop
+    /grays columns 8 add depth sub depth mul 8 idiv string def
+    columns rows depth
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { currentfile grays readhexstring pop } image
+  }
+  {
+    %
+    % Parameters:
+    %   colors: number of colors in the colormap.
+    %   colormap: red, green, blue color packets.
+    %
+    currentfile buffer readline pop
+    token pop /colors exch def pop
+    /colors colors 3 mul def
+    /colormap colors string def
+    currentfile colormap readhexstring pop pop
+    systemdict /colorimage known
+    {
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { PseudoClassPacket } false 3 colorimage
+    }
+    {
+      %
+      % No colorimage operator;  convert to grayscale.
+      %
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { GrayPseudoClassPacket } image
+    } ifelse
+  } ifelse
+} bind def
+
+/DisplayImage
+{
+  %
+  % Display a DirectClass or PseudoClass image.
+  %
+  % Parameters:
+  %   x & y translation.
+  %   x & y scale.
+  %   label pointsize.
+  %   image label.
+  %   image columns & rows.
+  %   class: 0-DirectClass or 1-PseudoClass.
+  %   compression: 0-RunlengthEncodedCompression or 1-NoCompression.
+  %   hex color packets.
+  %
+  gsave
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  x y translate
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  currentfile buffer readline pop
+  token pop /pointsize exch def pop
+  /Helvetica findfont pointsize scalefont setfont
+  x y scale
+  currentfile buffer readline pop
+  token pop /columns exch def
+  token pop /rows exch def pop
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  currentfile buffer readline pop
+  token pop /compression exch def pop
+  class 0 gt { PseudoClassImage } { DirectClassImage } ifelse
+  grestore
+} bind def
+%%EndProlog
+%%Page:  1 1
+%%PageBoundingBox: 0 0 482 347
+userdict begin
+%%BeginData:
+DisplayImage
+0 0
+482.4 347.04
+12
+335 241
+1
+0
+0
+256
+000000
+1c1c1c
+2a2a2a
+383838
+3f3f3f
+555555
+717171
+7f7f7f
+8d8d8d
+aaaaaa
+bfbfbf
+c6c6c6
+d4d4d4
+e2e2e2
+ffffff
+000008
+007c3e
+000d1a
+000c03
+004040
+00f847
+004e00
+001b00
+000800
+00f864
+9a6844
+83ef00
+04ff00
+40bf00
+46dc20
+56c056
+1bb21b
+080008
+de949c
+7eefee
+0dffff
+08bfbf
+00147b
+00f083
+00ff07
+00bf08
+1404f8
+f0004e
+ff001b
+bf0008
+23a086
+01ef00
+00ff80
+00bf03
+e12068
+7ef08d
+0dff1b
+08bf08
+68ae47
+8d0d00
+1b0300
+084000
+308c10
+015700
+7ca045
+0def00
+0cff00
+540412
+690000
+060000
+400000
+030420
+00002d
+000017
+18bcac
+55efee
+1bffff
+4c3c00
+02f08a
+7c0420
+0d007c
+0c001a
+400008
+bcc801
+f0ef00
+ffff00
+bfbf00
+54480a
+75f000
+06ff00
+a8ae01
+540d2d
+1b0317
+084008
+18e0c4
+5555ee
+1b1bff
+0808bf
+4cc8c9
+02ef7d
+7ceaa0
+0d2379
+0c131a
+404008
+187471
+551900
+1b1c80
+084003
+e8ff34
+f0fff4
+bf03bf
+7ee8c5
+b1ef72
+04ff05
+40bf08
+a852f0
+542ef1
+1b13ff
+0840bf
+182c67
+55f075
+1bff05
+4c0064
+02ac00
+001600
+7cff00
+0dab00
+0c1600
+400c00
+f80034
+4e00f4
+1b00ff
+0800bf
+007434
+0019f4
+001cff
+0040bf
+24cc7c
+f1f00d
+ffff0c
+bfbf40
+ffab24
+65f269
+081206
+084040
+ed2c03
+91f000
+0dff00
+08bf00
+0012b4
+0080ef
+000dff
+0008bf
+acfc04
+f1f000
+082c18
+50f0ef
+21ffff
+40bfbf
+ac0098
+f1acef
+ff16ff
+bf08bf
+08ff04
+50ff00
+21ff00
+40ff00
+540024
+612ca4
+a7f0ef
+07ffff
+0174a4
+001957
+001c1b
+004008
+4f2000
+012d00
+001700
+f13500
+002d00
+00b400
+00f000
+00ff00
+00bf00
+010000
+a8bf34
+f1f0f4
+ac4000
+54c000
+f10200
+ff0000
+bf0000
+9b0301
+a70000
+070000
+080000
+080164
+500000
+21ad00
+40fb00
+4f0004
+01ac00
+f1005c
+00acef
+0016ff
+0000dc
+340004
+f4ac00
+ff1600
+bf0800
+002d68
+01ffe8
+00abef
+000cbf
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+0eff0eff0eff0eff0eff0eff0eff0e8e07000eff0e49090008000e010c000eff0e490a00
+09000eff0e490b000eff0e4c0a0000000eff0eff0e980c000eff0e4d060009000eff0eff
+0e980c000eff0e4d000007000eff0e4c0c000d000eff0eff0e980b0005000e1d0d000eff
+0e2d0c0007000eff0eff0eff0ee805000c000eff0e4c09000eff0eff0eff0ecd05000e0f
+0d00050106000e0605000e000b000501070009000700060009000e0e07000b000eff0e16
+090000000c000e0e050007000c00020004000e0509000e01070000000e02070000000900
+0e0b0a000200000009000eff0e160600000006000e0d09010e01080000000e0807000000
+0e020d00000005000e0d000009000eff0e16070105000e0d0a000e02090000000e080700
+00000e020c00000005000e0d000009000e6c0b000e120b000e930c0008000e0000000c00
+0e050b00020006000900030002000d000e03080005000e0308000c000e02070000000e01
+0c00050000000b000e030900010009000800020005000e03000009000e6c02000e100900
+040005000e9307000c000e00050007000e06000009000e01000009000e0305000e040700
+0e03070000000702020007000e0500000e0200000e03000009000e6b0c00000005000e0f
+0900070005000e920b00000009010500000008000e05000009000e01000009000e020901
+0e09070000000e020d00000003000e0400000e0200000e03000009000e6b070002000000
+0e10070005000e9202000a000e010c00000005000e05000009000e01000009000e010701
+0e0a070000000e0400000e0400000e0200000e03000009000e6b05000d0000000b000e05
+0c00080009000b00050006000e03070005000e910c0003000e03000001000e0500000900
+0e01000009000e00090005000d000e000c000b000e000d0009000e04070000000e030500
+01000e0400000e0200000e03000009000e6a090007000e00040005000e06050004000c00
+0e00020007000e02070005000e91040009000e030700000007000e04000009000e010000
+09000a00000304000e010c0000000e04040000000a000e010500000007000e0400000e02
+00000e020c00000007000e6a06000e010900010009000e05050007000e01050007000e02
+070005000e900d0009010c000e010d0009020d000e020b0009010c000b0009060c000e07
+0b0009050e0509020d0009020e000c0009020c000e6807000200070200010e0505000700
+0e01050007000e02070005000ea90900000104000c000e87000009000e02050000000d00
+0e04050007000e01050007000e02070005000ea80900000301000c000e85090007000e03
+0700000007000e04050007000e01050007000e02070005000ea80200000404000e850600
+07000b000e020800050006000c000e020c00060007000b000c00060007000d000e000900
+050109000e9b090b00060eff0e27070900130500070000060eff0e080909070005080200
+0009050909090e0b0600000409000ef407090013040007080a000e290c0000040e920b00
+050107000d000e3e0b0009080800050803000009050909090c000e3d010009020c000500
+02000d000e8f0a00000302000e2a09000708020000120200070809000e5b040002000e04
+040002000e8e0d00000505000e0b09090509000903000508080009080b000e6e09000000
+0b000e05030005000e8d0900000607000400001307090e8d020007000e060c0000000700
+0e8c090000060500070009090ea0050003000e080c00010007000e8c000507000eab0900
+00000c000e09090000000c000e8b0c00010000030c000eab010007000e0b070001000c00
+0e8c000005000a00050004000eaa040005000e0d070000000c000e8b000009000e000d00
+020006000ea8080000000d000e0e020003000e8a090000000e020a0000000a000ea70000
+0a000e10020004000e89090000000e03080000000d000ea5020005000e110d0002000500
+0e88050007000e04040002000ea4070000000c000e120a0000000a000e87050007000e05
+030005000ea20c00010009000e140900000009000e8600000e060c00000007000ea10400
+07000e160a0000000a000e8500000e07090001000c000e9f060002000d000e1705000200
+0d000e83070005000e08070000000e9e0a0000000a000e19040002000e83070005000e08
+0d00020005000e9c0d00020006000e1b030002000e82000009000e0a00000a000e9b0700
+00000e1c0c00000007000e81000009000e0a090000000b000e990c0000000c000e1d0c00
+010007000e7f090000000e0c040002000e99000007000e1f0900000009000e7e09000000
+0e0d030005000e97050002000e21070001000c000e7d050007000e0d0c00000007000e95
+0a0000000e23070000000c000e7c050007000e0e090001000c000e930d00000008000e24
+020003000e7c00000e10070000000e93050004000e26020004000e7b00000e100d000200
+05000e91090001000c000e260d00020005000e79070005000e1200000a000e8f0c000000
+07000e280a0000000a000e78070005000e120900000009000e8e05010e2a090000000900
+0e77000009000e13040002000e8d070002000e2c0a0000000a000e76000009000e140500
+02000e8b0b00000009000e2d050002000d000e74090000000e150c00000007000e8a0200
+04000e2f040002000e74090000000e160c0000000c000e88070001000e31030002000e73
+050007000e17070000000c000e860c00000009000e310c00000007000e72050007000e18
+020005000e86030007000e330c00010007000e7100000e1a020007000e84040002000e35
+0900000009000e7000000e1a0900000009000e82090000000b000e36070001000c000e6e
+070005000e1b070002000e82020007000e38070000000c000e6d070005000e1c05000200
+0e80050003000e3a020003000e6d000009000e1c0c00000007000e7e090000000c000e3b
+020004000e6c000009000e1d0c0000000c000e7d010007000e3c0d00020005000e6a0900
+00000e1f070000000c000e7b040005000e3e0a0000000a000e69090000000e2002000500
+0e3408000e0f0c00050106000e30080000000d000e3f0900000009000e68050007000e21
+020007000e3300000a000e0d0c00040009000a00020004000e2f00000a000e410a000000
+0a000e67050007000e210900000009000e310900000002000e0d06000e02080000000e2e
+020005000e43060002000d000e6600000e230a0000000e31070100000e0d0c000e020900
+00000e2d070000000c000e44040002000e6600000e24050002000d000e2e0d0005000e00
+000008000e06090007000800020009000e04080005000e2c0c00010009000e4605000200
+0e64070005000e25000007000e2e09000a000e00070005000e0605000e0200000e040500
+0e2d040007000e470c00000007000e63070005000e250c00010009000e2c0c0003000901
+0700000005000e05030009030e03070009000e2c060002000d000e480c00010007000e62
+000009000e26070000000c000e2b040007000e02020000000e0502000e0605000a000e2c
+0a0000000a000e4a0c00000009000e61000009000e27050003000e2a0d0002000b000e02
+050000000b000e0401000c000e0109000e01070006000e010c000b000e280d0002000600
+0e4c070001000c000e5f090000000e29020004000e2907010e030900000005000e040700
+0000020007010e000700000304000e29070000000e4e070000000c000e5e090000000e29
+0b00000009000e2809010b000e0209020c000e040c0009000c000e0109040c000e280c00
+00000c000e4f050003000e5e050007000e2a0a0000000e6b000007000e51020004000e5d
+050007000e2b050002000d000e68050002000e520d00020005000e5c00000e2d00000700
+0e670a0000000e5500000a000e5b00000e2d0c00010009000e650d00000008000e550900
+000009000e59070005000e2e070000000c000e64050004000e570a0000000a000e580700
+05000e2f050003000e63090001000c000e58060002000d000e57000009000e3002000400
+0e610c00000007000e5a040002000e57000009000e300d00000008000e60050002000e5c
+050002000d000e54090000000e320a0000000a000e5e070002000e5d0c00000007000e54
+090000000e33060002000d000e5c0b00000009000e5e0c00010007000e53050007000e34
+040005000e5c020004000e600c00000007000e52050007000e340c00010007000e5a0700
+01000e62070001000c000e5100000e36090000000c000e580c00000009000e6307000000
+0c000e5000000e37070001000e58030005000e65050001000e4f070005000e3802000400
+0e56040002000e67020004000e4e070005000e380d00000008000e54090000000b000e27
+090001000000080009000500030007000e0c0900050007000e270d00020005000e4d0000
+09000e390a0000000a000e53020007000e29050000000e02050000000c000e0a0c000700
+050007000e29000007000e4c000009000e3a060002000d000e51050003000e2a05000000
+0e020900000009000e0c050007000e290900000009000e4a090000000e3c040005000e50
+090000000c000e2a050000000e02050000000c000e040c0007010e04050007000e2a0a00
+00000a000e49090000000e3c0c00010007000e4f010007000e2b05000000090105000300
+07000e04090006000c00090002000d000e02050007000e2b060000000d000e4805000700
+0e3d090000000c000e4d040002000e2c050000000e010a00020004000c000e0300000702
+000009000e02050007000e2c040002000e48050007000e3e070001000e4c090000000d00
+0e2c050000000e020b00020006000e0300000e07050007000e2d050002000d000e460000
+0e40020004000e4b00000a000e2d050000000e03070005000e03000009000e0605000700
+0e2d0c00000007000e4600000e400d00020006000e49020005000e2e050000000e020800
+000008000e03050109000e0007000b000e02050007000e2e0c00010007000e4407000500
+0e410a0000000a000e47070000000c000e2d07000001050007000400020007000e050500
+000002000a000e010c000700000109000e2e0c00000007000e43070005000e4208000000
+0d000e450c00010009000e77070001000c000e42000009000e43040002000e4504000500
+0e79070000000c000e41000009000e44010007000e43080002000d000e7a050001000e40
+090000000e450c00000009000e410a0000000a000e7c020004000e3f090000000e460700
+01000c000e3f0d00020006000e7d0d00020005000e3e050007000e47050004000e3f0700
+00000e80000007000e3d050007000e470d00020006000e3d0c0000000c000e8009000000
+09000e3c00000e490a0000000a000e3c000007000e820a0000000a000e3b00000e4a0800
+00000d000e3a060002000d000e83060000000d000e39070005000e4b040002000e390a00
+00000e86040002000e39070005000e4c010007000e370d00000008000e87050002000d00
+0e37000009000e4c0c00000009000e36050004000e880c00000007000e37000009000e4d
+070001000c000e34090001000c000e890c00010007000e35090000000e4f070000000e33
+0c00000007000e8b0c00000007000e34090000000e4f0d00020005000e32050002000e8d
+070001000c000e33050007000e5100000a000e300a0002000e8f070000000c000e320500
+07000e1b0b0009000e100c0008000e20090000000b000e2e0b00000009000e9007000100
+0e3200000e1c050004000e0f0200040005000e21040002000e2e020004000e9202000400
+0e3100000e1c010000000b000e0f070005000e22030005000e2c070001000e930d000200
+05000e2f070005000e1c0700000009000e0f070005000e220c00000007000e2a0c000000
+09000e95020007000e2e070005000e1b05000d00070003000e060d000700060007000500
+0e03070005000e23090001000c000e29030005000e960900000009000e2d000009000e1b
+04000e0100000e0607000a000e01050007000e02070005000e24070000000e2807000200
+0e980a0000000a000e2c000009000e1a060005000901010000000d000e04050009030c00
+0e02070005000e240d00020005000e26090000000b000e990800000203000c000e270900
+00000e1a0a0002000e020700000009000e0405000a000e06070005000e2600000a000e25
+020007000e9a020000040c000e26090000000e1a050008000e020900000006000e040600
+05000e010d0009000e02070005000e26090000000b000e23050003000e9a090000050600
+0e26050007000e190c0000000e0400010e040c000001070005000e03040002000e270400
+02000e22090000000c000e970c0007010400000505000e26050007000e190b0009010e02
+0b0009020e0509010e0309030e27030005000e21010007000e900b000901050200010100
+0502000506000e2600000e5c0c00000007000e1f040002000e8c07020004040007010e05
+020000040c000e2600000e5d090000000c000e1d090000000d000e830d00090107000501
+01000001050209010b000e0a0d000500000103000c000e26070005000e5e070000000c00
+0e1c00000a000e7f07020004040007010c000e3f070005000e5f020005000e1b02000500
+0e7809010700050101000001050209010b000e45000009000e60020007000e1907000000
+0c000e720a00070102000004070109000e4d000009000e600900000009000e170c000100
+09000e6b090205010300000102000501080009010e1b0c00050000000500090008000200
+05000c000e0b090000000300000009000e1c090000000e62070002000e17040005000e66
+0a00070102000004070109000e240900000009000e02000004000e0b07000e0107000000
+0e1c090000000e63050002000e15080002000d000e5e0c00090106000500030000020501
+080009010e2a0900000009000e02050000000e0a07000b000e0200000e1c050007000e63
+0c00000007000e130a0000000a000e5a070105000004050007010e320900000009000e02
+000004000e040a000c000e0007000a000e0500000e1c050007000e640c0000000c000e11
+0d00020006000e520c0009010600050100020501060009010c000e370900000006000900
+0800020005000c000e030b00000006000900080000000b000e03090006000e1c00000e66
+070000000c000e10070000000e4e070105000004050007010e400900000009000e010700
+000007000e04000009000e01000009000e0300000e1d00000e67020005000e0f0c000000
+0c000e4609020501010000010300050109010c000e450900000009000e02080000000b00
+0e03000009000e01000009000e0206000c000e1c070005000e68020007000e0e00000700
+0e410a00070102000004070109000e4d0900000009000e03000009000e03000009000e01
+000009000e01000009000e1d070005000e680900000009000e0c060002000d000e390902
+05010300000102000501080009010e530900000009000e02030000000d000e0300000900
+0e01000009000e0005010901080009000e1a000009000e69070002000e0b0a0000000e35
+0a00070102000004070109000e5a0a000200000002000701000005000a000e0309000000
+05000a000900000005000400000305000e1b000009000e6a050002000e090d0000000800
+0e2d0c0009010600050100020501060009010e95090000000e6b0c00000007000e080500
+04000e29070105000004050007010e9d090000000e6c0c00010009000e06090001000c00
+0e200c0009010600050100020501060009010c000ea2050007000e6d070000000c000e04
+0c00000007000e1c0900070005000004050007010eab050007000e6e050003000e040500
+02000e15090108000501020000010300050109020eb000000e70050002000d0009010700
+01000e0d0c0009010600050100020501060009010c000eb800000e700c00000409000e08
+070105000004050007010ec0070005000e700b00000401000e0009010800050102000001
+0300050109010c000ec5070005000e7005000008020007010a000ecd000009000e6f0c00
+0300000505000ed3000009000e6d0a00050000070a000ed2090000000e6b090005000100
+0200060009000d000200000305000ed3090000000e690500000104000c000e0405000001
+07000ed4050007000e650b00070003000000050009000d000e0605000c000ed605000700
+0e6307000001040009000ee300000e600d00090005000000030007000b000ee500000e58
+09000e0409000400000107000e080c000a000e070c0007050e0f07010ebc070005000e58
+01000c000e00090006000000010005000b000e0a030007000e03080005000e020c000000
+05000e010800000006000e0b070008000900050002000ebb070005000e570a0000000400
+000105000a000e0c0a00050007000e09000007000e02040000000e0b0a000e0109000000
+0ebb000009000e550c0006000200000109000e0f0500080007000e09000007000e020500
+00000e0e090005000ebb000009000e53070002000000020004000e00000009000e050a00
+050007000900000002000e0202000a00090007000e09000007000e010c00000005000e03
+0a00050007000900000002000e0405000ebb090000000e500c0008000500000005000800
+0c0009010e0005010e0605010d000e00030007000e0007000b000e00090007000e010d00
+05000b000e04000005000901010005000b000e0405010d000e00030007000e010b000700
+010002000d000eb9090000000e4e0a000500000107000c000e0205000e010a0000000700
+0e05050007000e01050007000c00040007010500040009000e010a000e05000007000e02
+040000000e04050007000e01050007000e04000009000eb9050007000e4b090005000100
+0200060009000e0405010902010000000e05050007000e01050007000b00050203000200
+08000e08000007000e020c00030007000e03050007000e01050007000e04070009000eb9
+050007000e490500000104000c000e07000009000e02050000000c000e04050007000e01
+050007000e03090007000e09000007000e020a00020007000e03050007000e0105000700
+0e04040009000eb900000e460b00070003000000050009000d000e08080007000e030800
+000006000e04050007000e01050007000e03090007000e0007000b000e050c0000000500
+0e010b00020001000e04050007000e01050007000e00050008000e00080007000eba0000
+0e4407000001040009000e0c070109000e0207020a000e020a00070109000a0007010c00
+0e020c000a000e00070009000e040c0007050a000e040a00070109000a0007010c000a00
+070109000eba070005000e400d00090005000000030007000b000eff0e04070005000e3e
+09000400000107000eff0e08000009000e3b090006000000010005000b000e2e0d000eda
+000009000e380c000700000105000a000e3100000ed9090000000e360c00060002000000
+050008000e340d000ed9090000000e34070002000000020007000eff0e12050007000e31
+080005000000020008000c000eff0e14050007000e2e0a000500000107000c000e3a0700
+0a000eda00000e2c0900050001000200060009000e3d0b0009000eda00000e2a07000001
+040009000eff0e1c070005000e260b00070003000000050009000d000eff0e1e07000500
+0e240900000209000eff0e22000009000e200d00090005000000030007000b000e470200
+09000eda000009000e1e09000400000107000eff0e27090000000e1c0900060002000100
+050009000eff0e29090000000e190c000700000105000a000eff0e2c050007000e160c00
+080002000000050008000e5205000edb050007000e14070002000000020007000e550700
+0edb00000e12080005000000020008000c000eff0e3400000e0f0a000500000107000c00
+0eff0e36070005000e0c0900050001000200060009000e5b0d000c000edb070005000e0a
+07000001040009000e5e070004000ed90901000009000e060b0007000300000005000900
+0d000eff0e3b0200000207000e040900000209000eff0e3e0200000409000d0009000500
+0000030007000b000e650c000d000ed70900000807000e690a0005000ed7090000060900
+0eff0e450c00000504000eff0e470700000301000c000e6b0b0009000eda090000010400
+0c000e6c0c0000000eff0eff0eff0e730c000d000e100b0009000d000e600d000ed60400
+09000e0e0c0004000700040002000e60020007000ed40d00000003000e0e09000e020000
+0e600d000ed50900040000000e1202000eff0e3708000e00030009000e050d0009000800
+0c00060005000d000e03070009000eff0e3705000e00070000000e06070002000a000e00
+040005000e010a000500000002000e6005000ed409010e000b00000008000e0507000500
+0e01070005000e030c00030007000e5f06000ed309000000070200010e05070005000e01
+070005000e04090007000eff0e34050007000e02070000000c000e04070005000e010700
+05000e04080007000eff0e3405000e030a00000004000e04070005000e01070005000e00
+09000a000e0105000e610a000ed10700060009000e02090005010b000e020d0007000600
+09000d00070006000c0009000500080005000d000e60090005000eff0eff0eff0eff0eff
+0e3a0c0003000eff0eff0eff0eff0eff0e3c01000eff0eff0e18
+%%EndData
+end
+%%PageTrailer
+%%Trailer
+%%BoundingBox: 0 0 481.4 346
+%%EOF
diff --git a/doc/fem/partitioned_mesh.png b/doc/fem/partitioned_mesh.png
new file mode 100644 (file)
index 0000000..82ea0ac
Binary files /dev/null and b/doc/fem/partitioned_mesh.png differ
diff --git a/doc/fem/simple_mesh.eps b/doc/fem/simple_mesh.eps
new file mode 100644 (file)
index 0000000..6f96a75
--- /dev/null
@@ -0,0 +1,709 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: (ImageMagick)
+%%Title: (simple_mesh.epsf)
+%%CreationDate: (Mon Dec  4 23:38:54 2000)
+%%BoundingBox: 0 0 474.2 336
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 1
+%%Pages: 0
+%%EndComments
+
+%%BeginDefaults
+%%PageOrientation: Portrait
+%%EndDefaults
+
+%%BeginProlog
+%
+% Display a color image.  The image is displayed in color on
+% Postscript viewers or printers that support color, otherwise
+% it is displayed as grayscale.
+%
+/buffer 512 string def
+/byte 1 string def
+/color_packet 3 string def
+/pixels 768 string def
+
+/DirectClassPacket
+{
+  %
+  % Get a DirectClass packet.
+  %
+  % Parameters:
+  %   red.
+  %   green.
+  %   blue.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/DirectClassImage
+{
+  %
+  % Display a DirectClass image.
+  %
+  systemdict /colorimage known
+  {
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { DirectClassPacket } false 3 colorimage
+  }
+  {
+    %
+    % No colorimage operator;  convert to grayscale.
+    %
+    columns rows 8
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { GrayDirectClassPacket } image
+  } ifelse
+} bind def
+
+/GrayDirectClassPacket
+{
+  %
+  % Get a DirectClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   red
+  %   green
+  %   blue
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile color_packet readhexstring pop pop
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/GrayPseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet;  convert to grayscale.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  color_packet 0 get 0.299 mul
+  color_packet 1 get 0.587 mul add
+  color_packet 2 get 0.114 mul add
+  cvi
+  /gray_packet exch def
+  compression 0 gt
+  {
+    /number_pixels 1 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add def
+  } ifelse
+  0 1 number_pixels 1 sub
+  {
+    pixels exch gray_packet put
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassPacket
+{
+  %
+  % Get a PseudoClass packet.
+  %
+  % Parameters:
+  %   index: index into the colormap.
+  %   length: number of pixels minus one of this color (optional).
+  %
+  currentfile byte readhexstring pop 0 get
+  /offset exch 3 mul def
+  /color_packet colormap offset 3 getinterval def
+  compression 0 gt
+  {
+    /number_pixels 3 def
+  }
+  {
+    currentfile byte readhexstring pop 0 get
+    /number_pixels exch 1 add 3 mul def
+  } ifelse
+  0 3 number_pixels 1 sub
+  {
+    pixels exch color_packet putinterval
+  } for
+  pixels 0 number_pixels getinterval
+} bind def
+
+/PseudoClassImage
+{
+  %
+  % Display a PseudoClass image.
+  %
+  % Parameters:
+  %   class: 0-PseudoClass or 1-Grayscale.
+  %
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  class 0 gt
+  {
+    currentfile buffer readline pop
+    token pop /depth exch def pop
+    /grays columns 8 add depth sub depth mul 8 idiv string def
+    columns rows depth
+    [
+      columns 0 0
+      rows neg 0 rows
+    ]
+    { currentfile grays readhexstring pop } image
+  }
+  {
+    %
+    % Parameters:
+    %   colors: number of colors in the colormap.
+    %   colormap: red, green, blue color packets.
+    %
+    currentfile buffer readline pop
+    token pop /colors exch def pop
+    /colors colors 3 mul def
+    /colormap colors string def
+    currentfile colormap readhexstring pop pop
+    systemdict /colorimage known
+    {
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { PseudoClassPacket } false 3 colorimage
+    }
+    {
+      %
+      % No colorimage operator;  convert to grayscale.
+      %
+      columns rows 8
+      [
+        columns 0 0
+        rows neg 0 rows
+      ]
+      { GrayPseudoClassPacket } image
+    } ifelse
+  } ifelse
+} bind def
+
+/DisplayImage
+{
+  %
+  % Display a DirectClass or PseudoClass image.
+  %
+  % Parameters:
+  %   x & y translation.
+  %   x & y scale.
+  %   label pointsize.
+  %   image label.
+  %   image columns & rows.
+  %   class: 0-DirectClass or 1-PseudoClass.
+  %   compression: 0-RunlengthEncodedCompression or 1-NoCompression.
+  %   hex color packets.
+  %
+  gsave
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  x y translate
+  currentfile buffer readline pop
+  token pop /x exch def
+  token pop /y exch def pop
+  currentfile buffer readline pop
+  token pop /pointsize exch def pop
+  /Helvetica findfont pointsize scalefont setfont
+  x y scale
+  currentfile buffer readline pop
+  token pop /columns exch def
+  token pop /rows exch def pop
+  currentfile buffer readline pop
+  token pop /class exch def pop
+  currentfile buffer readline pop
+  token pop /compression exch def pop
+  class 0 gt { PseudoClassImage } { DirectClassImage } ifelse
+  grestore
+} bind def
+%%EndProlog
+%%Page:  1 1
+%%PageBoundingBox: 0 0 475 337
+userdict begin
+%%BeginData:
+DisplayImage
+0 0
+475.2 336.96
+12
+330 234
+1
+0
+0
+256
+000000
+1c1c1c
+2a2a2a
+383838
+3f3f3f
+555555
+717171
+7f7f7f
+8d8d8d
+aaaaaa
+bfbfbf
+c6c6c6
+d4d4d4
+e2e2e2
+ffffff
+000008
+007c3e
+000d1a
+000c03
+004040
+00f868
+004e00
+001b00
+000800
+00f866
+9a6865
+83ef00
+04ff00
+40bf00
+46dc1c
+56c056
+1bb21b
+080008
+de949c
+7eefee
+0dffff
+08bfbf
+00147b
+00f083
+00ff07
+00bf08
+1404f8
+f0004e
+ff001b
+bf0008
+23a086
+01ef00
+00ff80
+00bf03
+e12068
+7ef08d
+0dff1b
+08bf08
+68ae68
+8d0d00
+1b0300
+084000
+30d010
+015700
+7ca066
+0def00
+0cff00
+540412
+690000
+060000
+400000
+030420
+00002d
+000017
+18bcac
+55efee
+1bffff
+4c3c00
+02f08a
+7c0420
+0d007c
+0c001a
+400008
+bcc801
+f0ef00
+ffff00
+bfbf00
+54480e
+75f000
+06ff00
+a8ae01
+540d2d
+1b0317
+084008
+18e0c4
+5555ee
+1b1bff
+0808bf
+4cc8c9
+02ef7d
+7ceaa0
+0d2379
+0c131a
+404008
+187471
+551900
+1b1c80
+084003
+e8ff34
+f0fff4
+bf03bf
+7ee8c5
+b1ef72
+04ff05
+40bf08
+a852f0
+542ef1
+1b13ff
+0840bf
+182c67
+55f075
+1bff05
+4c0066
+02ac00
+001600
+7cff00
+0dab00
+0c1600
+400c00
+f80034
+4e00f4
+1b00ff
+0800bf
+007434
+0019f4
+001cff
+0040bf
+24cc7c
+f1f00d
+ffff0c
+bfbf40
+ffab24
+65f269
+081206
+084040
+ed2c03
+91f000
+0dff00
+08bf00
+0012b4
+0080ef
+000dff
+0008bf
+acfc04
+f1f000
+082c18
+20f0ef
+21ffff
+40bfbf
+ac0098
+f1acef
+ff16ff
+bf08bf
+08ff04
+20ff00
+21ff00
+40ff00
+540024
+612ca4
+a7f0ef
+07ffff
+0174a4
+001957
+001c1b
+004008
+4a2000
+012d00
+001700
+ea3000
+002d00
+00b400
+00f000
+00ff00
+00bf00
+010000
+a8bf34
+f1f0f4
+ac4000
+540400
+f10300
+ff0000
+bf0000
+9b0301
+a70000
+070000
+080000
+080166
+200000
+21ad00
+40fb00
+4a0004
+01ac00
+ea005c
+00acef
+0016ff
+0000dc
+340004
+f4ac00
+ff1600
+bf0800
+002868
+01ffe8
+00abef
+000cbf
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+000000
+0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff0eff
+0eff0eff0eff0e860900050107000eff0e440a0005000a000900000007000eff0e430200
+0e0205010eff0e430a000e02070005000eff0e3c0800000009000700010007000e040500
+08000eff0e3c090000000e01090000000e030c0004000e900b000eab090000000e010900
+00000e0306000c000e8e0c00070000000eab090000000e01090000000e010c0004000c00
+0e8f0b000c0000000eab090000000e01090000000e01060007000e0109000e8f00000eab
+090000000e01090000000e000400000307000e85090005000d00070005000c000e030000
+0eab09020e0009070d000e850900000009000e00070000000e0300000eff0e3e09000000
+0e01090000000e0300000eff0e3e090000000e01090000000e0300000eb0070000010500
+0e89090000000e01090000000e0300000eaf0500000302000d000e87090000000e010900
+00000e0300000eae0a00000507000e870800050009000e00080005000b000e000b000700
+050007000d000ea00c00090905000200000505000eff0e210a0007080400001307000400
+000505000eff0e020d0009090509000902000508070009080c000e0b010000040b000eee
+0c0007080500001307090e2a070000040e8d0900050108000e3f09090600050801000008
+01000508060009090e3d090001000c0009010b00020005000e8b0700000304000e2a0709
+0013050007080c000e5a0c00000007000e04020004000e890c00000508000e0a0d000908
+0800050803000009050909090c000e6e050002000e050d00000008000e88070000050200
+0700020000120200070809000e8c0a0000000e070a0000000a000e870700000501000500
+080009080b000e9f0d00000008000e080900000009000e87010000040b000eab03000500
+0e0a090001000c000e860c0000040c000eaa070002000e0c070000000c000e8700000900
+0d00020005000ea9090000000b000e0d070001000c000e8600000e02020007000ea80200
+07000e0f020004000e85070005000e020900000009000ea6050003000e100d0002000500
+0e84070005000e03070002000ea5090000000c000e12020004000e83000009000e040500
+02000d000ea3010007000e130900000009000e82000009000e05000007000ea204000200
+0e150a0000000a000e80090000000e060c00010009000ea0090000000d000e1608000000
+0b000e7f090000000e07070000000c000e9f00000a000e18040002000e7f050007000e08
+050003000e9e020005000e1a050002000d000e7d050007000e09020004000e9c07000000
+0c000e1b000005000e7d00000e0a0b00000009000e9a0c00010009000e1c0c0001000700
+0e7c00000e0b0a0000000e9a040005000e1e0c00000007000e7a070005000e0c05000200
+0d000e97080002000d000e1f090000000c000e79070005000e0d000007000e960a000000
+0a000e21070000000c000e78000009000e0d0c00010009000e940d00020006000e230700
+01000c000e77000009000e0e070000000c000e93070000000e25020004000e7609000000
+0e10050003000e920c0000000c000e250d00020005000e75090000000e11020004000e91
+000007000e28020004000e74050007000e110b00000009000e8f060002000d000e280900
+000009000e73050007000e120a0000000a000e8d0a0000000e2b0a0000000a000e720000
+0e14050002000d000e8b0d00000008000e2c080000000b000e7100000e15040005000e8b
+050004000e2e040002000e70070005000e150c00010007000e89090001000c000e2f0500
+02000d000e6e070005000e16090000000c000e870c00000007000e31000005000e6e0000
+09000e17070001000e87050002000e320c00010007000e6d000009000e18020004000e85
+0a0002000e340c00000007000e6b090000000e190d00000008000e830b00000009000e35
+090000000c000e6a090000000e1a0a0000000a000e82020004000e37070000000c000e69
+050007000e1b060002000d000e80070001000e39070001000c000e68050007000e1c0400
+05000e7f0c00000009000e3a020004000e6800000e1d0c00010007000e7e030005000e3b
+0d00020005000e6700000e1e090000000c000e7c070002000e3e020004000e6507000500
+0e1f070001000e7b090000000b000e3e0900000009000e64070005000e20020004000e7a
+020007000e400a0000000a000e63000009000e200d00000008000e390d0009010c000e3a
+050003000e42090000000b000e62000009000e210a0000000a000e380200040002000000
+0c000e38090000000c000e43040002000e61090000000e23080000000d000e3605000d00
+0e01020005000e38010007000e45050002000d000e5f090000000e24040002000e360400
+0e02070005000e37040002000e47040005000e5f050007000e25010007000e2f0c000600
+090006000e05070006000e36090000000d000e470c00010007000e5e050007000e250c00
+000009000e2e00000e01070004000e0400000c000e3600000a000e490c00000007000e5d
+00000e27070001000c000e2c090005000901080005000e03080009000e36020005000e4b
+0c0000000c000e5c00000e28050004000e2c090007000e060a0007000e36070000000c00
+0e4c070000000c000e5a070005000e280d00020006000e2b090000000e020c000e010800
+02000e010d000e330c00010009000e4e070001000c000e59070005000e290a0000000a00
+0e2b000005000a000c0004000e000a000200070205000e33040005000e50050004000e59
+000009000e2a080000000d000e2a0c000600050008000e000d0005040b000e3208000200
+0d000e500d00020005000e58000009000e2b040002000e680a0000000a000e5302000400
+0e56090000000e2d010007000e660d00020006000e540b00000009000e55090000000e2d
+0c00000009000e65070000000e560a0000000c000e54050007000e2e070001000c000e63
+0c0000000c000e57090001000e54050007000e2f050004000e63000007000e5902000400
+0e5300000e300d00020005000e61060002000d000e590d00020005000e5200000e320000
+0a000e5f0a0000000a000e5c020004000e50070005000e32090000000b000e5d0d000000
+08000e5d0900000009000e4f070005000e33040002000e5d050004000e5f0a0000000a00
+0e4e000009000e34030005000e5b090001000c000e60080000000b000e4d000009000e34
+0c00000007000e590c00000007000e62040002000e4c090000000e36090001000c000e58
+050002000e64050002000d000e4a080002000e37080000000d000e56070001000e660200
+03000e4a050007000e38040002000e55090000000c000e2f0a0007000a000e3402000400
+0e49030009000e39010007000e54010007000e2e0c0006000900080000000b000e330d00
+020005000e4800000e3a0c00000009000e52040002000e2f0a000e02000009000e340a00
+00000a000e460c0001000e3b070001000c000e50090000000b000e3300000d000e350900
+000009000e45070005000e3c050004000e50020007000e2a0a000200070002000e040700
+0a000e370a0000000a000e44050006000e3c0d00020006000e4e050003000e2a0d000200
+0e01080002000e010d0009000300000009000e37050002000d000e43000009000e3d0a00
+00000a000e4c090000000c000e2a0900040007030e04070005000e38040002000e420d00
+00000b000e3e080000000d000e4a0c00010009000e2b090005000e0905000e3903000200
+0e41090000000e40040002000e4a040005000e2c090000000e020a000e040a0005000e39
+0c00000007000e40080002000e41030005000e48080000000d000e2d0200030007000800
+07000e00090006000c000b0005000d000e3a0c00010007000e3f050007000e410c000000
+07000e4700000a000e2f090007000c000e0207020e3d0900000009000e3e030009000e42
+090001000c000e45020005000e78070001000c000e3d00000e44070000000e4407000000
+0c000e79070000000c000e3b0c0001000e440d00020005000e420c0001000c000e7b0200
+03000e3b070005000e4600000a000e41000007000e7d020004000e3a050006000e460900
+00000b000e3f060002000d000e7d0d00020005000e39000009000e47040002000e3e0a00
+00000a000e7f0a0000000a000e370d0000000b000e48030005000e3c0d00020006000e81
+0900000009000e36090000000e490c00000007000e3b070000000e830a0000000a000e35
+080002000e4a090001000c000e390c0001000c000e84050002000d000e34050007000e4b
+070000000e380c00000007000e86040002000e34030009000e4b0d00020005000e370500
+02000e88030002000e3300000e4e00000a000e350a0000000e890c00000007000e310c00
+01000e4e0900000009000e330d00000008000e8a0c00010007000e30070005000e4f0700
+02000e33050004000e8c0900000009000e2f050006000e50050002000e31090001000c00
+0e8d070001000c000e2e000009000e500c00000007000e2f0c00000009000e8f07000000
+0c000e2c0d0000000b000e510c0000000d000e2e030005000e91050003000e2c09000000
+0e53070002000e2d070002000e93020004000e2b080002000e54010007000e2b0b000000
+09000e930d00020005000e2a050007000e280a000c000e290c00000009000e2a02000400
+0e9600000a000e29030009000e260c000600000009000e2a070001000c000e2807000100
+0e970900000009000e2800000e29000009000e2b050004000e270c0000000c000e980a00
+000007020e240c0001000e29000009000e2b0d00020006000e26010007000e9a03000002
+01000c000e22070005000e200c000400050000000c000e03000009000e2c0a0000000a00
+0e24040002000e9a070000050e22050006000e2005000e010c0001000e03000009000e2d
+080000000d000e22090000000b000e9a000609000e21000009000e20020007030e030000
+09000e2e040002000e22020007000e950a0007010200000809000e200d0000000b000e20
+03000e07000009000e2f010007000e20050003000e8e0c00090105010300000102000501
+08000901050000050d000e20090000000e2100000e020c000e03000009000e2f0c000000
+07000e1e090000000c000e89070105000004050007010e08020000030a000e2108000200
+0e21060002000600090006000e020d00000008000e30070001000c000e1c0c0001000900
+0e810c0009010600050100020501060009010c000e0d0d00070005010b000e2205000700
+0e220a0007000a000e020a0007020a000e30070000000e1c040005000e7d070105000004
+050007010e3e030009000e5e0d00020005000e1a080000000d000e750902050101000001
+03000500060009010c000e4300000e6100000a000e1900000a000e700a00070102000004
+070109000e270c00070209000e1d0c0001000e61090000000b000e17020005000e690902
+05010300000102000501080009010e2d060005020d000e1d070005000e62040002000e16
+070000000c000e630a00070102000004070109000e3507000e21050006000e6303000500
+0e140c0001000c000e5c0c0009010600050100020501060009010e3a0900030005000800
+0e1f000009000e630c00000007000e13000007000e58070105000004050007010e3b0700
+00000c00040000000a000e000a0007000400000004000e1d0d0000000b000e6409000100
+0c000e11060002000d000e4f0c0009010600050100020501060009010c000e4009000000
+0b000e00080000000e03090000000b000e1c090000000e66070000000e100a0000000a00
+0e4b070105000004050007010e49090000000e01090000000e04040009000e1c08000200
+0e660d00020005000e0e0d00020006000e44090108000501020000010300050109020e4e
+090000000e01090000000e04070009000e1c050007000e6800000a000e0d070000000e3f
+090007010004020007010a000e56090000000e01090000000e0404000c000e1c03000900
+0e68090000000b000e0b0c0001000c000e37090108000501020000010300050109020e5c
+090000000e01090000000e00050009000e00080007000e1d00000e6a040002000e0a0c00
+000007000e320c0007010004020007010a000e6407020e00070109000a0007010c000e1d
+0c0001000e6b030005000e09050002000e2b0b0009010502000101000501070009010d00
+0e92070005000e6b0c00000007000e070a0000000e260c0007010400000407020e9b0500
+06000e6c0c0000000c000e050d00000008000e1e0b000901050200010100050107000901
+0d000ea0000009000e6d070000000c000e04050004000e1a07020004040007010ea80d00
+00000b000e6e020005000e03090001000c000e110d000901070005010100000105020901
+0b000ead090000000e700300050006000501000009000e0a0b0009010502000101000501
+070009010d000eb5070004000e70090000040c000e0507010400000407020ebe05000700
+0e700300000403000700050101000001050209010b000ec302000a000e70000604000701
+0c000ecb00000e6f0b00050000060ece0a0002000e6d0700000104000200000405000ece
+070005000e690b00070003000000050009000d000e000d000200000202000d000ece0400
+07000e6709000400000107000e060900070009000ed0000009000e630d00090005000000
+030007000b000edb0c0000000c000e610c000400000105000edf090000000e5f09000600
+02000100050009000ee1070004000e5c0c000700000105000a000e1702000ecb05000700
+0e590d00090005000000050008000c000e18090001000ecb02000a000e57090004000001
+07000e1c000005000ecb00000e55090006000000010005000b000e150b000e000d000900
+0d000e0206000c0005000eca0a0002000e520c000700000105000a000e17070000000701
+040002000e01070009000e0005000eca070005000e4f0c00060002000000050009000e1b
+00000e0200000e000b0007000e0105000eca040007000e4d070002000000020007000e1e
+00000e0200000e000500000409000ec8000009000e490c00080005000000050008000c00
+0e2000000e0200000e000b000902030009000d000ec70c0000000c000e470a0005000001
+07000c000e2300000e0200000e0405000ec9090000000e45090005000100020006000900
+0e250900000009000d000900000009000e0305000ec9070004000e430500000104000c00
+0efe050007000e3f0b00070003000000050009000d000eff0e0002000a000e3d07000001
+040009000eff0e0400000e3a0d00090005000000030007000b000eff0e050a0002000e38
+09000400000107000eff0e09070005000e350900060000000100050009000eff0e0b0400
+07000e320c000700000105000a000eff0e0e000009000e2f0c0008000200000005000800
+0eff0e100c0000000c000e2d070002000000020007000eff0e13090000000e2b08000500
+0000020008000c000eff0e15070004000e280a000500000107000c000eff0e1805000700
+0e250900050001000200060009000eff0e1b02000a000e2307000001040009000eff0e1e
+00000e200b00070003000000050009000d000eff0e1f0a0002000e1e0900000209000eff
+0e23070005000e1a0d00090005000000030007000b000eff0e25040007000e1809000400
+000107000eff0e29000009000e150900060002000100050009000eff0e2a0c0000000c00
+0e120c000700000105000a000eff0e2d090000000e100c00080002000000050008000eff
+0e30070004000e0e070002000000020007000eff0e33050007000e0b0800050000000200
+08000c000eff0e3502000a000e080a000500000107000c000eff0e350900050100000e06
+0900050001000200060009000eff0e370700000304000e0307000001040009000eff0e39
+0c0000050600070003000000050009000d000eff0e3b0700000709000eff0e3f07000005
+05000eff0e42000509000eff0e420900000307000eff0e4507010c000eff0eff0eff0edd
+0c000800050006000eff0e440c0004000e01020007000eff0e430d000e02050007000eff
+0e3d0b000e000d0009000d000e0405000eff0e3d070000000701040002000e0304000500
+0eff0e3e00000e0200000e020901030002000eff0e3d00000e0200000e040c0000000eff
+0e3d00000e0200000e0500000eff0e3d00000e0200000e04090004000eff0e3c09000000
+09000d000900000009000b0000000600070006000eff0eff0eff0eff0eff0eff0eff0eff
+0eff0eff0eff0eff0eff0eff0eff0e64
+%%EndData
+end
+%%PageTrailer
+%%Trailer
+%%BoundingBox: 0 0 474.2 336
+%%EOF
diff --git a/doc/fem/simple_mesh.png b/doc/fem/simple_mesh.png
new file mode 100644 (file)
index 0000000..fe463c2
Binary files /dev/null and b/doc/fem/simple_mesh.png differ