public class GTCGeomReader extends AbstractGeomReader
GeomReader
for reading geometry from a GridTool restart file. GridTool is a
NASA developed grid/geometry program that is a part of the NASA TetrUSS CFD system.
More information can be found here:
http://geolab.larc.nasa.gov/GridTool/
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTENSION |
MAYBE, NO, YES
Constructor and Description |
---|
GTCGeomReader() |
Modifier and Type | Method and Description |
---|---|
int |
canReadData(java.io.File inputFile)
Method that determines if this reader can read geometry from the specified input
file.
|
boolean |
canWriteData()
Returns
true . |
java.lang.String |
getExtension()
Returns the preferred file extension (not including the ".") for files of this
GeomReader's type.
|
boolean |
isUnitAware()
This method always returns
false as GTC restart files do not encode
the units that are being used. |
GeometryList |
read(java.io.File inputFile)
Reads in a GridTool restart file from the specified input file and returns a
GeometryList object that contains the geometry from the file. |
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
write(java.io.File outputFile,
GeometryList geometry)
Writes out a geometry file for the geometry contained in the supplied
GeometryList object. |
compareTo, getWarnings, setFileUnits
public static final java.lang.String EXTENSION
public GTCGeomReader()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getExtension()
public boolean isUnitAware()
false
as GTC restart files do not encode
the units that are being used. You must call setFileUnits
to set the
units being used before reading from a file of this format, otherwise
default system units will be assumed.AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
public int canReadData(java.io.File inputFile) throws java.io.IOException
canReadData
in interface GeomReader
canReadData
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in. May not be
null.java.io.IOException
- If there is a problem reading from the specified file.public GeometryList read(java.io.File inputFile) throws java.io.IOException
Reads in a GridTool restart file from the specified input file and returns a
GeometryList
object that contains the geometry from the file. The output
list contains 4 sub-lists: SURFACES, CURVES, PATCHES and SOURCES. Empty lists are
included if any of these entities is not included in the file.
WARNING: This file format is not unit aware. You must set the units to be used by calling "setFileUnits()" before calling this method!
read
in interface GeomReader
read
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in. May not be
null.GeometryList
object containing the geometry read in from the
file. If the file has no geometry in it, then this list will have no
components in it (will have a size() of zero).java.io.IOException
- If there is a problem reading the specified file.AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
public boolean canWriteData()
true
. This reader can write some entity types to a GTC file.canWriteData
in interface GeomReader
canWriteData
in class AbstractGeomReader
public void write(java.io.File outputFile, GeometryList geometry) throws java.io.IOException
GeometryList
object. If the input geometry is not 3D, it will be forced to
be 3D (by padding if there are too few or by truncating additional dimensions).
WARNING: This format is not unit aware. The geometry will be written out in whatever its current units are! Make sure to convert to the desired units for the file before calling this method.
write
in interface GeomReader
write
in class AbstractGeomReader
outputFile
- The output File to which the geometry is to be written. May not
be null.geometry
- The GeometryList
object containing the geometry to be
written out. May not be null.java.io.IOException
- If there is a problem writing to the specified file.