#! /bin/sh ############################################################ # This shell script is a "front-end" to twobody 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 the # scivis/jser interactive graphics server. ############################################################ P=`basename $0` ############################################################ # Set defaults ############################################################ tmax=5.0 dt=0.05 tol=1.0d-6 ############################################################ # Usage ############################################################ Usage() { cat< [} Default tol: $tol y0 = 1.0 will produce circular orbit. END exit 1 } ############################################################ # Argument handling ############################################################ case $# in 1|2) y0=$1; tol=${2-$tol};; *) Usage;; esac ############################################################ # Build application, run it, and process the results. ############################################################ make -f Makefile twobody tag="$y0"_"$tol" ofile=out_"$tag" twobody 0.0 $y0 1.0 0.0 $tmax $dt $tol > $ofile nth 2 3 < $ofile | jv1 xcyc_$tag nth 1 2 < $ofile | jv1 xc_$tag nth 1 3 < $ofile | jv1 yc_$tag nth 1 4 < $ofile | jv1 dEtot_$tag nth 1 5 < $ofile | jv1 dJtot_$tag exit 0