op2 Package¶
fortranFile Module¶
-
class
pyNastran.op2.fortranFile.FortranFile[source]¶ Bases:
object-
goto(n)[source]¶ jumps to position n in the file
Parameters: - self – the object pointer
- n – the position to goto
Note
n>0
-
printBlock(data, nMax=200)[source]¶ prints a data set in int/float/double/string format to determine table info. doesn’t move cursor.
Note
this is a great function for debugging
-
printBlock2(data, endian)[source]¶ prints a data set in int/float/double/string format to determine table info. doesn’t move cursor.
Note
this is a great function for debugging
-
printSection(nBytes)[source]¶ prints data, but doesn’t move the cursor
Parameters: - self – the object pointer
- nBytes – the number of bytes to print the data specs on
Returns: msg ints/floats/strings of the next nBytes (handles poorly sized nBytes; uncrashable :) )
Note
this the BEST function when adding new cards/tables/debugging
-
printSection2(nBytes, endian)[source]¶ prints data, but doesn’t move the cursor
Parameters: - self – the object pointer
- nBytes – the number of bytes to print the data specs on
Returns: msg ints/floats/strings of the next nBytes (handles poorly sized nBytes; uncrashable :) )
Note
this the BEST function when adding new cards/tables/debugging
-
readDoubleBlock()[source]¶ reads a fortran formatted block assumes that the data is made up of doubles only
-
readDoubles(nData, debug=True)[source]¶ reads a list of nDoubles
Parameters: - self – the object pointer
- nData – the number of doubles to read
- debug – for developer: debug combined with makeOp2Debug
-
readFloatBlock()[source]¶ reads a fortran formatted block assumes that the data is made up of floats only
-
readFullBlock()[source]¶ reads a fortran formatted data block nWords data1 data2 data3 nWords includes nWords in the output
-
readFullIntBlock()[source]¶ reads a fortran formatted block assumes that the data is made up of integers only
-
readHeader(expected=None, debug=True)[source]¶ a header is defined as (4,i,4), where i is an integer
-
readHollerith()[source]¶ doesnt really read a hollerith, it’s an integer of value=528 which corresponds to the length of iTable=3
-
readIntBlock()[source]¶ reads a fortran formatted block assumes that the data is made up of integers only
-
readInts(nInts, debug=True)[source]¶ reads a list of nIntegers
Parameters: - self – the object pointer
- nInts – the number of ints to read
- debug – for developer: debug combined with makeOp2Debug
-
readMarkers(markers, tableName=None, debug=False, printErrorOnFailure=True)[source]¶ 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.
-
readStringBlock(debug=True)[source]¶ reads a fortran formatted block assumes that the data is made up of characters only
-
op2 Module¶
op2_helper Module¶
Subpackages¶
- resultObjects Package
- tables Package
destabModuleeptModulemptModuler1tabModuleresultTableModule- Subpackages
- writer Package