#! /bin/sh ############################################################ # This shell script is a "front-end" to 2body which # expedites the analysis of the results from that code, # including the plotting of particle position, d(energy), # d(angular momentum) as a function of time using an # interactive graphics server. # # History: Doit_sm ############################################################ ############################################################ # Set defaults ############################################################ tmax=5.0 dt=0.05 tol=1.0d-6 ############################################################ # Set name of client program which sends data to # visualization server. # # Should be set to 'jv1' if you are using 'jser'. 'v1' # will only work on SGI consoles in conjunction with # 'ser/vs' ############################################################ client=v1 ############################################################ # Usage ############################################################ Usage() { cat< [ ] Default tol: $tol Default client: $client y0 = 1.0 will produce circular orbit. END exit 1 } ############################################################ # Argument handling ############################################################ case $# in 1|2|3) y0=$1; tol=${2-$tol}; client=${3-$client};; *) Usage;; esac ############################################################ # Build application, run it, and process the results. ############################################################ make -f Makefile 2body tag="$y0"_"$tol" ofile=oute_"$tag" 2body 0.0 $y0 1.0 0.0 $tmax $dt $tol > $ofile nth 2 3 < $ofile | $client xcyc_$tag nth 1 2 < $ofile | $client xc_$tag nth 1 3 < $ofile | $client yc_$tag nth 1 4 < $ofile | $client dEtot_$tag nth 1 5 < $ofile | $client dJtot_$tag exit 0