util
Class Cart3DRunner

java.lang.Object
  extended by iterator.AbstractIterator
      extended by util.CommandLineRunner
          extended by util.Cart3DRunner
All Implemented Interfaces:
Iterable

public class Cart3DRunner
extends CommandLineRunner

Runs CART3D with or without using a job-queueing system.

First, it needs access to a directory in which CART3D-related files are made and modified. By default, it looks for one called cart3dScratch. Provide a symlink of this name in $JAMPOTHOME. Next, it needs a CART3D command that will do the following: 1. Setup and run CART3D using the geometry described in the PLOT3D files cart3dScratch/model.plot3d and cart3dScratch/model.plot3d.component.list from start to finish, and 2. Return a job id JOB_ID for this process. By default, tries the command cart3d. Create a script (bash, or PBS, or what have you) and make sure a symlink to this exists on the PATH.

Finally, it needs a command to check for completion. By default, tries qstat $JOB_ID. This command should return a null output when done, but some non-empty output while still running. Note that this is default behavior for the PBS command qstat.

Author:
dgorur

Field Summary
 
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
Cart3DRunner()
          Default constructor.
Cart3DRunner(boolean inline)
           
 
Method Summary
 boolean isTerminated()
          Returns true after a timeout.
static void main(java.lang.String[] args)
          Test run of whatever PASS-style XML file is in the scratch directory.
 double readDrag(java.lang.String fileName)
          Reads the drag value from the CLiC output file.
 double[] readForces(java.lang.String fileName)
          Reads lift and drag forces from the CLiC output file.
 void setClic(double alfa, double sref, double lref)
          Modifies the default CLiC input control file clic.cntl.
 void setClic(double alfa, double sref, double lref, java.lang.String clicCntl)
          Modifies the given clic control file to set angle of attack, reference area and reference length for CliC.
 void setInput(double alfa, double M)
          Modifies the default CART3D input control file input.cntl.
 void setInput(double alfa, double M, java.lang.String inputCntl)
          Modifies a given input control file to set angle of attack and Mach number for CART3D.
 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, 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
 

Constructor Detail

Cart3DRunner

public Cart3DRunner()
Default constructor.


Cart3DRunner

public Cart3DRunner(boolean inline)
Method Detail

main

public static void main(java.lang.String[] args)
Test run of whatever PASS-style XML file is in the scratch directory.

Parameters:
args - None used.

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()

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()

readDrag

public double readDrag(java.lang.String fileName)
Reads the drag value from the CLiC output file.

Parameters:
fileName - name of the output file.
Returns:
the drag value contained in that file.

readForces

public double[] readForces(java.lang.String fileName)
Reads lift and drag forces from the CLiC output file. Written by A. Haas.

Parameters:
fileName - name of the output file.
Returns:
lift and drag values

setInput

public void setInput(double alfa,
                     double M,
                     java.lang.String inputCntl)
Modifies a given input control file to set angle of attack and Mach number for CART3D.

Parameters:
alfa - angle of attack in degrees.
M - Mach number.
Throws:
java.lang.Exception

setClic

public void setClic(double alfa,
                    double sref,
                    double lref,
                    java.lang.String clicCntl)
Modifies the given clic control file to set angle of attack, reference area and reference length for CliC.

Parameters:
alfa - angle of attack in degrees.
sref - reference area in consistent units.
lref - reference length in consistent units.
clicCntl - name of the clic control file

setClic

public void setClic(double alfa,
                    double sref,
                    double lref)
Modifies the default CLiC input control file clic.cntl.

Parameters:
alfa - angle of attack in degrees.
sref - reference area.
lref - reference length.

setInput

public void setInput(double alfa,
                     double M)
Modifies the default CART3D input control file input.cntl.

Parameters:
alfa - angle of attack in degrees.
M - mach number.