This document will be updated throughout the course
einstein, linux1, etc.), then type einstein you should see a "toolchest"
     labelled Desk 1 in the upper left of the screen, as well as 
     an xterm window. 
     At this point you can 
     start additional X-applications (xmaple, more
     xterms etc.) from the xterm window, or from the 
     toolchest.
DISPLAY
     environment variable appropriately, e.g.
einstein % setenv DISPLAY pmcl-pc8.ph.utexas.edu:0.0and start X-applications from there. Note that the Internet address of each machine should be taped to the system's monitor.
einstein,
    choose Log out from the Desktop menu of the toolchest.
    A notifier asking you to confirm the log out should appear---click
   Yes to log out.  A less graceful way to exit is to choose
    Close from the eXodus menu.
On the SGIs type
% xmaplefor the GUI version (in which case make sure your DISPLAY environment variable is set correctly if running on a remote machine), or
% maplefor a terminal-based (text) session. In the latter instance you should see something like this.
% maple
    |\^/|     Maple V Release 5 (University of Texas at Austin)
._|\|   |/|_. Copyright (c) 1981-1997 by Waterloo Maple Inc. All rights
 \  MAPLE  /  reserved. Maple and Maple V are registered trademarks of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> 
If there is any sequence of Maple commands that 
you find yourself typing at the beginning of each session (maple
or xmaple) you can put them in a file .mapleinit
in your home directory, whereafter they will automatically be executed 
each time you use Maple.
Typical usage (on the SGIs):
% f77 -n32 -g mypgm.f mysubs.f -o mypgmSee the on-line notes describing the use of Fortran and C in the Unix environment for additional information.
% cc -n32 -g mypgm.c myfcns.c -o mypgmSee the on-line notes describing the use of Fortran and C in the Unix environment for additional information.
p329fsa.f.
     See 
     source 
        code 
     and course notes for further information.% f77 pgm.f -L/usr/localn32/lib -lp329 -o pgm
einstein% set DISPLAY linux1.ph.utexas.edu:0 einstein% ghostview somefile.psNote: Not all Postscript files will have .ps extensions, but many do by convention.
   einstein% gnuplot
             .
             .
             .
   Terminal type set to 'x11'
   gnuplot> help
             .
             .
             .
   gnuplot> quit
   einstein% sm
   Can't find entry for iris-ansi-net in /usr/local/lib/sm/termcap
   Hello Matt, please give me a command
   : device x11
   : help
             .
             .
             .
   : quit
Use of this routine in Fortran is illustrated by the code vswave.f which generates a time-series of waveforms, and, at each time step, outputs the data using vsxynt. Note that this program is essentially identical to the gpwave.f example discussed in class, we're just changing the "output interface".
Depending on which library is linked-to, data which is output via vsxynt will be sent to special-purpose files, or sometimes directly to a visualization server such as scivis. I strongly recommend that you use the following libraries when using the vsxynt interface:
    -lsvs -lrnpl -lmfhdf -ldf -ljpeg -lz -lsv -lm
I further recommend that you communicate these libraries to make
using the following setenv command which should be placed 
in your .cshrc: 
    setenv LIBVS '-lsvs -lrnpl -lmfhdf -ldf -ljpeg -lz -lsv -lm'
If you do this, then Makefiles such as 
this one will work properly.
Assuming that your executable has linked to the libraries given above, calls to vsxynt will direct data to files with the extension .sdf. Thus, in the vswave.f example, the call
     call vsxynt('wave',t,x,y,nx)
will send data to 
     wave.sdf
 
.sdf files can then be sent to 
scivis
using the 
sdftosv
command, as discussed in more detail below. 
Important: Note that .sdf files are not ``human-readable'', so please don't try to edit them or, worse, to print them!
PLEASE SEND ME E-MAIL IMMEDAITELY IF YOU HAGE PROBLEMS WITH THIS SOFTWARE.
Assuming that you have established an X session to einstein, you should be able to start the scivis visualization server (also known as jser) by selecting jser from the Tools sub-menu of the toolchest in the upper left corner of the screen.
Alternatively, you can start jser from the command-line:
einstein% jser &Note, that we start jser in the background so that we can continue to type commands at the shell prompt. Note that jser is an X-application, so be sure that the DISPLAY environment variable points to your local screen.
Whichever way you start jser, the following window should pop up on your screen in a few seconds (but be patient, it may be 15 seconds, or so):

Note that, with the exception of the Exit button---which shuts the server down---you will probably find little use for the various selections on the server panel. Rather, you will primarily interact with the server through additional windows which display data sets which are sent to the server after it is started. For example, assume that we have previously generated an .sdf file using, for example, a Fortran program which calls vsxynt:
   einstein% pwd
   /usr2/people/phy329/fd/new_wave
   einstein% ls
   Makefile   gpwave.f   vswave.f
   einstein% make vswave
      f77 -g -n32 -c vswave.f
      f77 -g -n32 -L/usr/localn32/lib vswave.o -lp329f \
          -lsvs -lrnpl -lmfhdf -ldf -ljpeg -lz -lsv -lm -o vswave
   ld32: WARNING 84: /usr/localn32/lib/libjpeg.a is not used for ...
   einstein% vswave
    usage: vswave 
   einstein% vswave 101 
   einstein% ls *.sdf
   wave.sdf
 
Then, once we have started the scivis server, we can send 
the data in this .sdf file to the server using the
sdftosv command:
einstein% sdftosv waveIn a few seconds you should see a window such as the following pop-up:

Observe that the new window displays one time step (dataset) of the data at a time. Using the pull down menus and/or keyboard accelerators, you can step through the data, zoom-in or or, play (animate) the data, and perform many other functions, many of which are fairly self-explanatory.
Here is a guide to the annotations on the above scivis data window:

Note that the server's main function (in the context of this course) is to provide you with a useful tool to develop and analyze programs which solve time-dependent partial differential equations in one spatial dimension (or time dependent particle motion in 2 dimensions). In particular, you should not expect to use it to produce ``quality'' hardcopy output.
scivis (jser) keyboard-accelerators
Important Note: Due to a bug in SGI's implementation of Java, you must first RESIZE any window that scivis creates in order for the following keyboard accelerators to work. All accelerators are Ctrl-key based; for example, C-a means depress the ctrl key and then the a key (without releasing the ctrl key).
| Keystroke | Mnemonic | Function | 
|---|---|---|
| C-q | Quit | Closes window | 
| C-a | Animate | Starts animation | 
| C-s | Stop | Stops animation | 
| C-n | Next | Displays next dataset | 
| C-p | Previous | Displays previous dataset | 
| C-g | Goto | Goto specific dataset | 
   % sdftosv
sdftosv version: 1.0
  Copyright (c) 1997 by Robert L. Marsa
  sends .sdf files to the scivis visualization server
Usage: 
  sdftosv [ -i ivec ]
          [ -n oname ]
          [ -s ]
          input_file [ input_file [ ... ] ]
  -i ivec  -- use ivec (0 based) for output control
  -n oname -- name all data sets oname
  -s       -- send data sets one at a time
              useful for large or nonuniform data
  input_file is an .sdf file
Beware that there is a command sdftovs which sends 
an .sdf file to a different server---if you get an 
error message such as
assign_Server: Could not communicate with einstein assign_Server: Ensure that server is running on einstein and/or assign_Server: check/reset value of environment variable VSHOST.you have typed sdftovs instead of sdftosv.
A typical invocation will be:
% ls wave.sdf % sdftosv waveNote that you do not have to specify the .sdf extension explicitly, but you can if you so wish.
% sdftosv -i '0-*/2' waveIn this example, the construct
0-*/2is an example of an index-vector (or ivec), which is just a shorthand for a regular sequence of integers:
min-max/step ===> min, min + step, min + 2 step, ... min + n stepwhere n is the largest integer such that
min + n step <= maxIndex 0 refers to the first time level of data stored in the file, and an asterisk (*) can be used in place of min and/or max to denote "first time-level" or "last time-level" respectively. When using * in an index-vector specfication, such as in the above example, be sure to enclose the index-vector in single quotes to keep the shell from interpreting * in its own special way.
% jv1 < data_fileor
% jv1 name < data_filewhere data_file is a two column file containing the data to plot. In the first instance, the data will be visualized in a jser window named Standard input, in the second the jser window will be labelled name.
      gft_out_bbox
should suffice.   Here is a usage example:
      integer      nx,        ny
      parameter  ( nx = 65,   ny = 33 )
      real*8       gfcn(nx,ny)
      real*8       xmin,      xmax,     ymin,     ymax, 
     &             time
      integer      shape(2),  rank
      real*8       bbox(4)
               .
               .
               .
c------------------------------------------------------
c     'bbox' defines 'bounding box' of coords.
c     associated with the data:
c
c     bbox := ( xmin, xmax, ymin, ymax )
c------------------------------------------------------
      bbox(1) = xmin
      bbox(2) = xmax
      bbox(3) = ymin
      bbox(4) = ymax
      rank = 2
      shape(1) = nx
      shape(2) = ny
 
      do it = 1 , nt
              .
              .
              .
c------------------------------------------------------
c     The first (string) arg. to 'gft_out_bbox'
c     is stripped of non alphanumeric/underscore 
c     characters (including punctuation) if necessary,
c     and then used as the 'stem' for a filename of 
c     the form 'stem.sdf'.  All calls to 'gft_out_bbox'
c     with the same string result in output to the 
c     same file.
c------------------------------------------------------
         time = it * 1.0d0
         call gft_out_bbox('gfcn',time,shape,rank,
     &                      bbox,gfcn)
      end do
              .
              .
              .
The gft_ routines use a machine-independent binary format; thus data output using gft_out_bbox on a Cray, for example, can be processed on an SGI. On the SGIs, 2- and 3-D data is best visualized using IRIS Explorer. A locally developed module, called ReadSDF_GFT0, is available for Explorer input of data written using the gft_ routines. Here's an image of an Explorer map which uses this module.
      % explorer
Here are links to the 
IRIS Explorer Center and
Postscript versions of the User's Guide
with graphics
and 
without graphics.
   % ls 
   document.tex
   % latex document.tex
   This is TeX, Version 3.14159 (C version 6.1)
   (document.tex
   LaTeX2e <1996/06/01>
   Hyphenation patterns for english, german, loaded.
             .
             .
             .
   No file document.aux.
   [1] (document.aux) )
   Output written on document.dvi (1 page, 696 bytes).
   Transcript written on document.log.
   % ls
   document.aux   document.dvi   document.log   document.tex
You can easily include Encapsulated Postscript files in a TeX/LaTeX
document, using the epsf package.  Here is a sample 
tex source file,
here is the 
figure file 
which is included, and 
here is the final 
postscript file.
% ls document.aux document.dvi document.log document.tex % xdvi document
% ls document.aux document.dvi document.log document.tex % dvips document Got a new papersize This is dvips 5.58 Copyright 1986, 1994 Radical Eye Software ' TeX output 1997.01.22:1442' -> document.ps. [1] % ls document.aux document.dvi document.log document.ps document.tex 
   % cc -n32 -I/usr/local/include pp2d.c -L/usr/localn32/lib -lglut \
         -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lXmu -lXi -lXext -lX11 \
         -lm -o pp2d
% nbody 2.0 0.01 < nbody_input | pp2d % nbody 2.0 0.01 < nbody_input | pp2d -mHelp is available via
% pp2d -hThe source code, pp2d.c and pp2d.h, may be of interest to those of you interested in using OpenGL for graphics programming. Makefile for pp2d.
      real*8    positions(3,max_ncharge),   radius
      integer   ncharge
c---------------------------------------------------------
c     Set the radius for *all* displayed spheres.
c---------------------------------------------------------
      radius = 0.03d0 
c---------------------------------------------------------
c     Call with ncharge > 0 for normal display.  A graphics 
c     window will be opened interactively the first time 
c     this routine is called in a program (the outline of
c     a small window will appear on the screen; you will 
c     have to position and size the window).
c---------------------------------------------------------
      call sphplot(positions,ncharge,radius)
c---------------------------------------------------------
c     Call with ncharge < 0 (presumably at the end of the 
c     simulation) for "tumbling" display.  Depress the escape 
c     key in the graphics window to return from the routine.
c---------------------------------------------------------
      call sphplot(positions,-ncharge,radius)
Sample linking and loading with a Fortran main 
program pgm.f:
% f77 -g -n32 -c pgm.f % f77 -g -n32 -L/usr/localn32/lib pgm.o -lp329util -lsphere -lgl -o pgmNote that sphplot is part of the p329util library, and that the sphere and gl libraries must also be linked in.
 Here is the source code, 
sphplot.c,
and header file,
sphplot.h,
for the routine.