pyNastran  0.5.0
pyNastran BDF Reader/Writer, OP2 Parser, and GUI
pyNastran.op2.fortranFile.FortranFile Class Reference
Inheritance diagram for pyNastran.op2.fortranFile.FortranFile:
pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader pyNastran.op2.op2.OP2

List of all members.

Public Member Functions

def __init__
def setEndian
 sets the endian
def readHollerith
 doesnt really read a hollerith, it's an integer of value=528 which corresponds to the length of iTable=3
def readHeader
 a header is defined as (4,i,4), where i is an integer
def readString
 reads nCharacters that are assumed to be a string
def readInts
 reads a list of nIntegers
def readDoubles
 reads a list of nDoubles
def readFloats
 reads nFloats
def getStrings
 unpacks a data set into a series of characters
def getStrings2
 unpacks a data set into a series of characters
def getInts
 unpacks a data set into a series of ints
def getInts2
 unpacks a data set into a series of ints
def getLongs
 unpacks a data set into a series of longs
def getFloats
 unpacks a data set into a series of floats
def getFloats2
 unpacks a data set into a series of floats
def getDoubles
 unpacks a data set into a series of doubles
def printBlock
 prints a data set in int/float/double/string format to determine table info.
def printBlock2
 prints a data set in int/float/double/string format to determine table info.
def getData
 gets a data set of length N
def readData
def getBlockIntEntry
 given a data set, grabs the nth word and casts it as an integer
def printSection
 prints data, but doesn't move the cursor
def printSection2
 prints data, but doesn't move the cursor
def skip
 skips nBits
def scan
 same as skip, but actually reads the data instead of using seek
def getTableCode
def getMarker
def readMarker
def readMarkers
 Reads a set of predefined markers e.g.
def getNMarkers
 gets the next N markers, verifies they're correct
def isTableDone
def goto
 jumps to position n in the file
def readBlock
 reads a fortran formatted data block nWords data1 data2 data3 nWords
def readFullBlock
 reads a fortran formatted data block nWords data1 data2 data3 nWords includes nWords in the output
def readFullIntBlock
 reads a fortran formatted block assumes that the data is made up of integers only
def readStringBlock
 reads a fortran formatted block assumes that the data is made up of characters only
def readIntBlock
 reads a fortran formatted block assumes that the data is made up of integers only
def readFloatBlock
 reads a fortran formatted block assumes that the data is made up of floats only
def readDoubleBlock
 reads a fortran formatted block assumes that the data is made up of doubles only
def rewind
 rewinds the file nBytes
def readTableName
 peeks into a table to check it's name
def skipNextTable
 skips a table
def hasMoreTables

Public Attributes

 endian
 the endian of the processor (typically '<' for Windows/Linux/Mac, '>' for old HPCs) currently does nothing
 bufferSize
 currently does nothing
 hasBuffer
 flag to help know if a buffer was found
 n

Detailed Description

Definition at line 33 of file fortranFile.py.


Constructor & Destructor Documentation

Definition at line 34 of file fortranFile.py.


Member Function Documentation

doesnt really read a hollerith, it's an integer of value=528 which corresponds to the length of iTable=3

Definition at line 56 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.readHeader().

Referenced by pyNastran.op2.op2.OP2.readTitle(), and pyNastran.op2.fortranFile.FortranFile.setEndian().

def pyNastran.op2.fortranFile.FortranFile.getStrings2 (   self,
  data,
  endian 
)

unpacks a data set into a series of characters

Definition at line 181 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.getInts2().

Referenced by pyNastran.op2.fortranFile.FortranFile.printBlock(), and pyNastran.op2.fortranFile.FortranFile.readFloats().

def pyNastran.op2.fortranFile.FortranFile.getInts (   self,
  data,
  debug = True 
)
def pyNastran.op2.fortranFile.FortranFile.getInts2 (   self,
  data,
  endian,
  debug = True 
)

unpacks a data set into a series of ints

Definition at line 205 of file fortranFile.py.

Referenced by pyNastran.op2.fortranFile.FortranFile.getStrings2(), and pyNastran.op2.fortranFile.FortranFile.printBlock().

def pyNastran.op2.fortranFile.FortranFile.getFloats2 (   self,
  data,
  endian 
)
def pyNastran.op2.fortranFile.FortranFile.printSection2 (   self,
  nBytes,
  endian 
)

prints data, but doesn't move the cursor

Parameters:
selfthe object pointer
nBytesthe number of bytes to print the data specs on
Return values:
msgints/floats/strings of the next nBytes (handles poorly sized nBytes; uncrashable :) )
Note:
this the BEST function when adding new cards/tables/debugging

Definition at line 366 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.getMarker(), pyNastran.op2.fortranFile.FortranFile.readHeader(), pyNastran.converters.cart3d.cart3d_reader.Cart3DAsciiReader.readHeader(), pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader.readHeader(), pyNastran.op2.fortranFile.FortranFile.readMarker(), and pyNastran.op2.fortranFile.FortranFile.readMarkers().

Referenced by pyNastran.op2.fortranFile.FortranFile.getBlockIntEntry().

same as skip, but actually reads the data instead of using seek

Definition at line 380 of file fortranFile.py.

Referenced by pyNastran.op2.fortranFile.FortranFile.printSection().

def pyNastran.op2.fortranFile.FortranFile.getTableCode (   self,
  expected = None,
  debug = True 
)

Definition at line 384 of file fortranFile.py.

Referenced by pyNastran.op2.fortranFile.FortranFile.printSection().

def pyNastran.op2.fortranFile.FortranFile.readMarkers (   self,
  markers,
  tableName = None,
  debug = False,
  printErrorOnFailure = True 
)

Reads a set of predefined markers e.g.

[-3,1,0] and makes sure it is correct.

A marker (e.g. a -3) is a series of 3 integers [4,-3,4]. Typically 3 markers are put together (e.g. [-3,1,0]) such that the integers are [4,-3,4, 4,1,4, 4,0,4] to mark important parts of the table.

Markers will "increment" during table reading, such that the first marker is [-1,1,0], then [-2,1,0], etc. Tables will end (or really the next table starts) when a [-1,1,0] or a [0,1,0] marker is found.

# Verify the following statement... Occassionally, buffer markers will be embedded inside the marker [-3,1,0], (e.g. [4,2^16,4] <- the default BUFFSIZE), which make reading the marker more difficult.

Definition at line 413 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.getNMarkers(), pyNastran.op2.fortranFile.FortranFile.goto(), pyNastran.op2.fortranFile.FortranFile.isTableDone(), pyNastran.op2.op2.OP2.makeOp2Debug, pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader.makeOp2Debug, pyNastran.op2.fortranFile.FortranFile.n, pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader.n, pyNastran.op2.fortranFile.FortranFile.readHeader(), pyNastran.converters.cart3d.cart3d_reader.Cart3DAsciiReader.readHeader(), and pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader.readHeader().

Referenced by pyNastran.op2.tables.geom.geometryTables.GeometryTables.checkForNextSubTable(), pyNastran.op2.fortranFile.FortranFile.printSection2(), pyNastran.op2.fortranFile.FortranFile.readFloatBlock(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readGeomSubTable(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readRecordTable(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readTable_CASECC(), pyNastran.op2.tables.lama_eigenvalues.lama.LAMA.readTable_LAMA(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readTable_OMM2(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readTable_PCOMPTS(), pyNastran.op2.tables.r1tab.R1TAB.readTable_R1TAB(), pyNastran.op2.tables.geom.geometryTables.GeometryTables.readTable_SDF(), pyNastran.op2.fortranFile.FortranFile.readTableName(), and pyNastran.op2.op2.OP2.readTapeCode().

reads a fortran formatted block assumes that the data is made up of doubles only

Definition at line 596 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.n, and pyNastran.converters.cart3d.cart3d_reader.Cart3DBinaryReader.n.

Referenced by pyNastran.op2.fortranFile.FortranFile.readStringBlock().

rewinds the file nBytes

Warning:
doesnt support a full rewind, only a partial

Definition at line 610 of file fortranFile.py.

References pyNastran.op2.fortranFile.FortranFile.skipNextTable().

Referenced by pyNastran.op2.fortranFile.FortranFile.readIntBlock().


Member Data Documentation

the endian of the processor (typically '<' for Windows/Linux/Mac, '>' for old HPCs) currently does nothing

Definition at line 37 of file fortranFile.py.

Referenced by pyNastran.op2.fortranFile.FortranFile::setEndian().

currently does nothing

Definition at line 38 of file fortranFile.py.

flag to help know if a buffer was found

Definition at line 64 of file fortranFile.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables