How to make an animated Gif via gd1.pp -3darrowplot

Arndt-E-0.3-animated.gif

The Movie is created via these four Commands, with the proper Inputfiles:

 mkdir -p /tmp/UserName/garbage
    gd1 < arndt-movie.gdf
    gd1.pp -ignore-profile < E-pp-in
    convert -loop 0 /tmp/UserName/garbage/Arndt-E*.gif Arndt-E-0.3-animated.gif

The Solver gd1 is used to compute the Fields. At selected Times the Fields are stored.

     gd1 < arndt-movie.gdf
The Postprocessor gd1.pp reads these stored Fields and writes Plotfiles. The Plot-Program gd1.3dplot reads these Plotfiles and writes xwd Bit-Map Files. ImageMagicks convert converts these xwd Bit-Map Files to GIF-Files which are moved to some other Directory. These three Steps are all performed with the Command:
     gd1.pp < E-pp-in
ImageMagicks convert converts these GIF-Files to an animated GIF.
     convert -loop 0 /tmp/UserName/garbage/Arndt-E*.gif Arndt-E-0.3-animated.gif

The Inputfile for the Solver gd1 is: arndt-movie.gdf

 define(CU, 3) # Materialindex for Copper
 define( FREQ, 13.1e9 ) # Center-Frequency of the Excitation.

 define(WGH, 15.8e-3) define(WGW0, 7.9e-3) define(T0, 6.6e-3)

 define(CSW1, 4.2e-3) define(T1, 6.2e-3)

 define(STPSZE, 0.2e-3 )
 define(XHIGH, 30e-3) define(XLOW, -XHIGH )
 define(ZHIGH, 12e-3) define(ZLOW, -ZHIGH )

 ########
 ########
 ########
 -general
   outfile= /tmp/UserName/arndt-movie
   scratch= /tmp/UserName/scratch-arndt

 -mesh
   spacing= STPSZE
   graded= on, qfgraded= 1.2, dmaxgraded= 3e8/FREQ/80
   pxlow= XLOW, pxhigh= XHIGH        # pxlow: Position of xLow
   pylow= -WGH/2-STPSZE, pyhigh= 0
   pzlow= ZLOW, pzhigh= ZHIGH

   cxlow= electric, cxhigh= electric # cxlow: Condition at xLow
   cylow= electric, cyhigh= magnetic
   czlow= electric, czhigh= magnetic

 -material
   material= CU,  type= impedance, kappa= 56e6

 ###################
 ###################
 ###################
 ###################
 ###################
 #
 # Fill the Universe with Material CU.
 #
 -brick
    material= CU,
        volume= ( -INF, INF, \
                  -INF, INF, \
                  -INF, INF)
    doit

    #
    # Carve out the upper Waveguide.
    #
    material= 0,
       volume= ( -INF, INF,\
                 -WGH/2, WGH/2,\
                 T0/2, T0/2+WGW0 )
       doit

    #
    # Carve out the lower Waveguide.
    #
       volume= (-INF, INF,\
                -WGH/2, WGH/2,\
                -(T0/2+WGW0), -T0/2 )
       doit

    #
    # Carve out the coupling Slits.
    #
       volume= ( -CSW1/2, CSW1/2,\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), T0/2+WGW0 )
       doit

       volume= ( -(4.2e-3/2+3.0e-3), (4.2e-3/2+3.0e-3),\
                 -WGH/2, WGH/2,\
                 T0/2, T0/2+WGW0 ),
       doit

       volume= ( -(4.2e-3/2+3.0e-3), (4.2e-3/2+3.0e-3),\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), -T0/2 ),
       doit

       #
       #
       #
define(XDUM, 4.2e-3/2+3.0e-3 )
       volume= ( -(XDUM+3.2e-3), -XDUM,\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), T0/2+WGW0 ),
       doit

       volume= ( XDUM, (XDUM+3.2e-3),\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), T0/2+WGW0 ),
       doit

       #
       #
       #
define(XDUM, 4.2e-3/2+3.0e-3+3.2e-3+4.2e-3 )
       volume= ( -(XDUM+1.6e-3), -XDUM,\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), T0/2+WGW0 ),
       doit

       volume= ( XDUM, XDUM+1.6e-3,\
                 -WGH/2, WGH/2,\
                 -(T0/2+WGW0), T0/2+WGW0 ),
       doit

 ########
 ########
 ########
 ########
 #

 -volumeplot,
   eyeposition= ( 1.0, 2.0, 0.5) 
# doit # volumeplot

 -fdtd
   -ports
      name= xlow1,  plane= xlow,  pzlow= 0,  modes= 2, doit
      name= xlow2,  plane= xlow,  pzhigh= 0, modes= 2, doit
      name= xhigh1, plane= xhigh, pzlow= 0,  modes= 2, doit
      name= xhigh2, plane= xhigh, pzhigh= 0, modes= 2, doit

     list

  -pexcitation
     port= xlow1
     mode= 1, amplitude= 1, frequency= FREQ
 define( BANDWIDTH, FREQ / 3 )
       bandwidth= BANDWIDTH

  -time

 define( DISTANCE, 0.1 / FREQ )
 define( FIRSTSAVED,  2 / BANDWIDTH )
 define( LASTSAVED, FIRSTSAVED + 202 * DISTANCE )
     tmin= LASTSAVED + DISTANCE
     tmax= LASTSAVED + DISTANCE
     firstsaved= FIRSTSAVED
     lastsaved= LASTSAVED
     distancesaved= DISTANCE

  -fdtd, doit

The Inputfile for the Postprocessor gd1.pp is: E-pp-in

 -general
     infile= /tmp/UserName/arndt-movie
     scratchbase= ./Arndt-E-

 -3darrowplot
     lenarrows= 1
     scale= 4, fcolour= 7, arrows= 5000, fonmat= yes
     eyeposition= ( 1.0, 2.3, 0.5 )
     onlyplotfile= yes

     quantity= e

     #
     # A first Pass through the Results.
     # We want to know what the max-Values of the Fields are,
     # to not use autoscaling of the Arrow-Lengths and fonmat Patches.
     #

 define( FARROWMAX, 0 )
 define( FMAXONMAT, 0 )
     do ii= 1, 200
        solution= ii

 # Just to not occupy too much FileSpace.
 system( rm -f ./*-3D-Arrowplot.*.gld )

        doit
 define( FARROWMAX, max( FARROWMAX, @farrowmax ) )
 define( FMAXONMAT, max( FMAXONMAT, @absfmax ) )
     end do

 echo fArrowMax: FARROWMAX
 echo fonMatMax: FMAXONMAT

     #
     # The second pass through the Results.
     # We now know the Max Values, and scale every Frame for the same
     # Max Values that will occur in all the Frames.
     #

     fmaxonmat= FMAXONMAT / 2  # Slightly cheating.
     fscale= 1.5 /  FARROWMAX
     do ii= 1, 200
        solution= ii

 # Delete all *.gld Files in the current Directory,
 # so that the now to be created gld-File will be the only one.
 system( rm -f ./*.gld )
        doit   # Create the gld-File.

 # Convert the gld-File to a xwd-BitMap File.
 system( gd1.3dplot -xwd -geometry 650x530+1+1 ./*.gld )

 # Convert the xwd-BitMap File ./dumped.window to GIF-File.
 # The Name of the GIF-File is constructed from the Name
 # of the just written gld-File.
 system( convert -verbose ./dumped.window `basename ./*-3D-Arrowplot.*.gld gld`gif )

 # Move the created GIF-File to some other Directory.
 system( mv *.gif /tmp/UserName/garbage )
     end do

 echo fArrowMax: FARROWMAX
 echo fonMatMax: FMAXONMAT