util
Class PanairRunnerShevell

java.lang.Object
  extended by iterator.AbstractIterator
      extended by util.CommandLineRunner
          extended by util.PanairRunnerShevell
All Implemented Interfaces:
Iterable
Direct Known Subclasses:
PanairRunnerLinux

public class PanairRunnerShevell
extends CommandLineRunner

Extends PanairRunnerLinux to run on shevell, which runs ROCKS Linux and the job scheduler PBS, using the command qsub.

Author:
dgorur

Field Summary
protected  java.lang.String statusString
           
 
Fields inherited from class util.CommandLineRunner
commandLine, DEFAULT_POLL_INTERVAL, DEFAULT_RUN_COMMAND, DEFAULT_SCRATCH_DIR, DEFAULT_STATUS_COMMAND, DEFAULT_TIMEOUT_INTERVAL, statArgument, timeElapsed
 
Fields inherited from class iterator.AbstractIterator
diagnosticString, iter
 
Constructor Summary
PanairRunnerShevell()
           
 
Method Summary
 boolean isTerminated()
          Returns true after a timeout.
static void main(java.lang.String[] args)
          Runs PANAIR interpreting the first argument as an input filename.
static double readDrag(java.lang.String fileName)
          Reads the drag value from the given PANAIR output file.
static double[] readForces(java.lang.String fileName)
           
static void removePanairInputFile(java.lang.String panairInputFilename)
          Deletes the specified PANAIR input file.
 void run(java.lang.String arg)
          Runs PANAIR on the specified input file.
 void singleIteration()
          Sleeps for a designated sleep interval.
 
Methods inherited from class util.CommandLineRunner
getArgList, getPollInterval, getRunCommand, getScratchDir, getStatusCommand, getTimeoutInterval, init, isInline, iterate, run, run, setArgList, setInline, setPollInterval, setRunCommand, setScratchDir, setStatusCommand, setTimeoutInterval, updateDiagnostics
 
Methods inherited from class iterator.AbstractIterator
isVerbose, printDiagnostics, setVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statusString

protected java.lang.String statusString
Constructor Detail

PanairRunnerShevell

public PanairRunnerShevell()
Method Detail

main

public static void main(java.lang.String[] args)
Runs PANAIR interpreting the first argument as an input filename.

Parameters:
args - the list of arguments.

readDrag

public static double readDrag(java.lang.String fileName)
                       throws java.io.IOException,
                              java.io.FileNotFoundException,
                              Exceptions.ComputationException
Reads the drag value from the given PANAIR output file.

Parameters:
fileName - the given PANAIR output file.
Returns:
the drag value in the file.
Throws:
java.io.IOException - if IO error in file read.
java.io.FileNotFoundException - if the given output file does not exist.
Exceptions.ComputationException - if PANAIR did not compute a drag value for some reason, or if there was a negative drag value.

readForces

public static double[] readForces(java.lang.String fileName)
                           throws java.io.IOException,
                                  java.io.FileNotFoundException,
                                  Exceptions.ComputationException
Throws:
java.io.IOException
java.io.FileNotFoundException
Exceptions.ComputationException

removePanairInputFile

public static void removePanairInputFile(java.lang.String panairInputFilename)
Deletes the specified PANAIR input file.

Parameters:
panairInputFilename - the given input file.

singleIteration

public void singleIteration()
Description copied from class: CommandLineRunner
Sleeps for a designated sleep interval.

Specified by:
singleIteration in interface Iterable
Overrides:
singleIteration in class CommandLineRunner
See Also:
Iterable.singleIteration()

isTerminated

public boolean isTerminated()
Description copied from class: CommandLineRunner
Returns true after a timeout.

Specified by:
isTerminated in interface Iterable
Overrides:
isTerminated in class CommandLineRunner
Returns:
true when done.
See Also:
Iterable.isTerminated()

run

public void run(java.lang.String arg)
Runs PANAIR on the specified input file. First runs the command cleanpan, which must be in the PATH. Then calls panair and writes the input filename to the output stream of the process. Finally, calls cleanpan again.

Overrides:
run in class CommandLineRunner
Parameters:
arg - the name of the given input file.