function
Class WaveDragAxisymmetric.Panair

java.lang.Object
  extended by function.BasicScalarFunction
      extended by function.WaveDragAxisymmetric.Panair
All Implemented Interfaces:
Computable, ScalarFunction, VariableBounds
Direct Known Subclasses:
WaveDragAxisymmetric.PanairShevell
Enclosing class:
WaveDragAxisymmetric

public static class WaveDragAxisymmetric.Panair
extends BasicScalarFunction
implements VariableBounds

Runs PANAIR to compute the wave drag of these axisymmetric bodies.

Author:
dgorur

Field Summary
protected  java.lang.String filenamePrefix
           
protected static int INSTANCE_COUNT
           
protected static PanairRunnerShevell panairRunner
           
 
Fields inherited from class function.BasicScalarFunction
DEFAULT_BOUNDS, DEFAULT_DIM, VALUE_OUTSIDE_BOUNDS
 
Constructor Summary
WaveDragAxisymmetric.Panair()
           
 
Method Summary
 Hypercube getBounds()
          Returns a Hypercube specifying the domain of this Computable.
 WaveDragAxisymmetric getParent()
          Returns the parent container.
 void init()
          Initialization method.
static void main(java.lang.String[] args)
          Tests the Sears-Haack and quadratic bodies.
 double quickCompute(double[] x)
          Compute method without dimension checking.
static double readPanairOutput(java.lang.String filename)
          Processes PANAIR output in output file of the given file name.
protected  java.lang.String renameInputFile(java.lang.Integer index)
          Renames the input file.
 void setBounds(Hypercube bounds)
          Sets the bounds for this ScalarFunction.
 void setParent(WaveDragAxisymmetric parent)
          Sets the parent.
protected  int writePanairInput(double[] r, int n, double[] x, double L, double M)
          Write PANAIR input file by calling C and then Fortran
 
Methods inherited from class function.BasicScalarFunction
checkDimensions, compute, compute, compute, compute, compute, compute, getInputDimension, getOutputDimension, isWithinBounds, makeBounds, quickCompute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE_COUNT

protected static int INSTANCE_COUNT

panairRunner

protected static PanairRunnerShevell panairRunner

filenamePrefix

protected java.lang.String filenamePrefix
Constructor Detail

WaveDragAxisymmetric.Panair

public WaveDragAxisymmetric.Panair()
Method Detail

main

public static void main(java.lang.String[] args)
Tests the Sears-Haack and quadratic bodies.

Parameters:
args - Mach number, body length, and nominal radius.

readPanairOutput

public static double readPanairOutput(java.lang.String filename)
Processes PANAIR output in output file of the given file name. If the computation failed, or a negative drag value was computed, if an IO exception found, or if the specified file was not found, the method assigns VALUE_OUTSIDE_BOUNDS.

Parameters:
filename - the given file name.
Returns:
the computed drag value.

getBounds

public Hypercube getBounds()
Description copied from interface: Computable
Returns a Hypercube specifying the domain of this Computable.

Specified by:
getBounds in interface Computable
Overrides:
getBounds in class BasicScalarFunction
Returns:
the domain of this ScalarFunction.

getParent

public WaveDragAxisymmetric getParent()
Returns the parent container.

Returns:
the parent.

init

public void init()
Description copied from class: BasicScalarFunction
Initialization method.

Specified by:
init in interface ScalarFunction
Overrides:
init in class BasicScalarFunction

quickCompute

public double quickCompute(double[] x)
Description copied from class: BasicScalarFunction
Compute method without dimension checking. All subclasses must implement this method: it is the core method that defines the function.

Specified by:
quickCompute in interface ScalarFunction
Specified by:
quickCompute in class BasicScalarFunction
Parameters:
x - the given input.
Returns:
the output corresponding to the given input.

setBounds

public void setBounds(Hypercube bounds)
Description copied from interface: VariableBounds
Sets the bounds for this ScalarFunction.

Specified by:
setBounds in interface VariableBounds
Parameters:
bounds - the given bounds.

setParent

public void setParent(WaveDragAxisymmetric parent)
Sets the parent.

Parameters:
parent - the given parent.

renameInputFile

protected java.lang.String renameInputFile(java.lang.Integer index)
Renames the input file. This sometimes facilitates analyzing multiple configurations. Adds a numeric suffix to the main filename.

Parameters:
index - the numeric suffix to add.
Returns:
the modified file name.

writePanairInput

protected int writePanairInput(double[] r,
                               int n,
                               double[] x,
                               double L,
                               double M)
Write PANAIR input file by calling C and then Fortran

Parameters:
r - radii
n - number of radii specified
x - x-locations (note: first and last points not included in r)
L - body length
M - Mach number
Returns:
-1 if superinclined flag was set.