#!/bin/bash # 14-08-19 20:02:41 # this script launches a batch of gencase runs that draw floating objects # and reads out the moments of inertia out of the inertia tensor # (diagonal elements); it does not inspect inertia products off the diagonal # Usage note: before starting select the paths, ids and data sets in the section user-defined parts # 1 USER-DEFINED PARTS ## functions fail () { echo Execution aborted. # read -n1 -r -p "Press any key to continue..." key exit 1 } ## functions to extract a single diagonal element of inertia tensor from xml file Ixx() { cat ${dirout2}/${name}.xml | grep "&1 | tee -a $0-${mkbound}.out echo #### second object mkbound=${mkbound2} a2=$(Ixx) b2=$(Iyy) c2=$(Izz) # Ixx && Iyy && Izz echo $dx $a2 $b2 $c2 2>&1 | tee -a $0-${mkbound}.out echo #### third object mkbound=${mkbound3} a3=$(Ixx) b3=$(Iyy) c3=$(Izz) # Ixx && Iyy && Izz echo $dx $a3 $b3 $c3 2>&1 | tee -a $0-${mkbound}.out echo sleep 0.5 done ## shows GenCase version and close echo echo version: $( ${gencase} -h | grep GenCase | grep v ) echo "End of script $0"