op2_reader_helper¶
This is the pyNastran.op2_interface.op2_reader.rst file.
op2_reader
Module¶
- Defines various tables that don’t fit in other sections:
OP2Reader - read_cmodeext(self) - read_cmodeext_helper(self) - read_aemonpt(self) - read_monitor(self) - read_r1tabrg(self) - read_hisadd(self)
read_cstm(self)
read_dit(self)
read_extdb(self)
read_fol(self)
read_frl(self)
read_gpl(self)
read_ibulk(self)
read_intmod(self)
read_meff(self)
read_omm2(self)
read_sdf(self)
read_tol(self)
_skip_pcompts(self)
_read_pcompts(self)
Matrix - _get_matrix_row_fmt_nterms_nfloats(self, nvalues, tout) - _skip_matrix_mat(self) - read_matrix(self, table_name) - _read_matpool_matrix(self) - _read_matrix_mat(self) - grids_comp_array_to_index(grids1, comps1, grids2, comps2,
make_matrix_symmetric)
Others - _get_marker_n(self, nmarkers) - read_markers(self) - _skip_subtables(self) - _skip_table_helper(self) - _print_month(self, month, day, year, zero, one) - read_results_table(self)
-
class
pyNastran.op2.op2_interface.op2_reader.
OP2Reader
(op2: OP2)[source]¶ Stores methods that aren’t useful to an end user
-
property
binary_debug
¶ interface to the op2 object
-
property
debug_file
¶ interface to the op2 object
-
get_marker1_4
(rewind: bool = True, macro_rewind: bool = False) → int[source]¶ Gets 1 marker See get_n_markers(…)
- Parameters
- rewindbool
should the file be returned to the starting point
- macro_rewindbool
???
- Returns
- markersint
a single marker
-
get_marker1_8
(rewind=True, macro_rewind=False) → int[source]¶ Gets 1 marker See get_n_markers(…)
- Parameters
- rewindbool
should the file be returned to the starting point
- macro_rewindbool
???
- Returns
- markersint
a single marker
-
get_nmarkers4
(n: int, rewind=True, macro_rewind=False)[source]¶ Gets n markers, so if n=2, it will get 2 markers.
- Parameters
- nint
number of markers to get
- rewindbool
should the file be returned to the starting point
- Returns
- markersList[int]
list of [1, 2, 3, …] markers
-
get_nmarkers8
(n: int, rewind=True, macro_rewind=False)[source]¶ Gets n markers, so if n=2, it will get 2 markers.
- Parameters
- nint
number of markers to get
- rewindbool
should the file be returned to the starting point
- Returns
- markersList[int]
list of [1, 2, 3, …] markers
-
h5_file
= None¶ the h5 file object used to reduce memory usage
-
property
is_debug_file
¶ interface to the op2 object
-
is_valid_subcase
() → bool[source]¶ Lets the code check whether or not to read a subcase
- Returns
- is_validbool
should this subcase defined by self.isubcase be read?
-
load_as_h5
= None¶ should an h5_file be created
-
property
log
¶ interface to the op2 object
-
read_3_blocks4
() → bytes[source]¶ - Reads a block following a pattern of:
[nbytes, data, nbytes] [nbytes, data, nbytes] [nbytes, data, nbytes]
This is intended to be used for reading marker triples
- Returns
- databytes
the data in binary
-
read_3_markers
(markers, macro_rewind=True) → None[source]¶ Micro-optimizes
read_markers
for 3 markers.
-
read_3_markers4
(markers, macro_rewind=True) → None[source]¶ Micro-optimizes
read_markers
for 3 markers.- Parameters
- markersList[int, int, int]
markers to get; markers = [-10, 1, 0]
- Raises
- FortranMarkerError
if the expected table number is not found
-
read_block4
() → bytes[source]¶ - Reads a block following a pattern of:
[nbytes, data, nbytes]
- Returns
- databytes
the data in binary
Notes
see read_3_blocks
-
read_block8
() → bytes[source]¶ - Reads a block following a pattern of:
[nbytes, data, nbytes]
- Returns
- databytes
the data in binary
Notes
see read_3_blocks
-
read_cstm
()[source]¶ Reads the CSTM table, which defines the transform from global to basic.
Returns 14-column matrix 2-d array of the CSTM data:
[ [ id1 type xo yo zo T(1,1:3) T(2,1:3) T(3,1:3) ] [ id2 type xo yo zo T(1,1:3) T(2,1:3) T(3,1:3) ] ... ]
T is transformation from local to basic for the coordinate system.
-
read_fol
()[source]¶ Reads the FOL table Frequency response frequency output list
tested by TestOP2.test_monpnt3
Word
Name
Type
Description
1
NAME(2)
CHAR4
Data block name
3
FREQ
RS
Frequency
Word 3 repeats until End of Record
Word
Name
Type
Description
1
WORD1
I
Number of frequencies
2
WORD2
I
Frequency set record number
3
WORD3
I
Number of loads
4
UNDEF(3)
None
Not used
-
read_frl
()[source]¶ reads the FRL (Frequency Response List) table
tested by TestOP2.test_op2_good_sine_01
-
read_ibulk
()[source]¶ tested by TestOP2.test_ibulk
read_mode = 1 (array sizing) read_mode = 1 (reading)
-
read_markers4
(markers: List[int], macro_rewind: bool = True) → None[source]¶ Gets specified markers, where a marker has the form of [4, value, 4]. The “marker” corresponds to the value, so 3 markers takes up 9 integers. These are used to indicate position in the file as well as the number of bytes to read.
Because we’re checking the markers vs. what we expect, we just throw the data away.
- Parameters
- markersList[int]
markers to get; markers = [-10, 1]
- Raises
- FortranMarkerError
if the expected table number is not found
-
read_markers8
(markers: List[int], macro_rewind: int = True) → None[source]¶ Gets specified markers, where a marker has the form of [4, value, 4]. The “marker” corresponds to the value, so 3 markers takes up 9 integers. These are used to indicate position in the file as well as the number of bytes to read.
Because we’re checking the markers vs. what we expect, we just throw the data away.
- Parameters
- markersList[int]
markers to get; markers = [-10, 1]
- Raises
- FortranMarkerError
if the expected table number is not found
-
property
read_mode
¶ interface to the op2 object
-
read_monitor
()[source]¶ reads the MONITOR table; new version D:NASAgitexamplesbackupaeroelasticityloadf.op2
-
read_nastran_version
(mode: str)[source]¶ - reads the version header
ints = (3, 4, 12, 1, 28, 12, 12, 4, 7, 4, 28, 1414742350, 541999442, 1414680390, 1346458656, 1145643077, 1146045216, 539828293, 28, 4, 2, 4, 8, 1482184792, 1482184792, 8, 4, -1, 4, 4, 0, 4, 4, 2, 4, 8, 1297040711, 538976305, 8, 4, -1
-
read_qualinfo
()[source]¶ Reads the QUALINFO table
-100001 (AUXMID=0;AFPMID=0;DESITER=0;HIGHQUAL=0;PVALID=0;DESINC=0;DISCRETE=FALSE;MASSID=0;ARBMID=0;PARTNAME=’ ‘;TRIMID=0;MODULE=0) -100000 (AUXMID=0;AFPMID=0;DESITER=0;HIGHQUAL=0;PVALID=0;DESINC=0;ARBMID=0;PARTNAME=’ ‘;DISCRETE=FALSE;TRIMID=0)
-99999 (AUXMID=0;AFPMID=0;HIGHQUAL=0;PVALID=0;DESINC=0;PRESEQP=TRUE;ARBMID=0;PARTNAME=’ ‘;TRIMID=0;FLXBDYID=0;DFPHASE=’ ‘) -99998 (AUXMID=0;AFPMID=0;DESITER=0;HIGHQUAL=0;DESINC=0;DISCRETE=FALSE;ARBMID=0;MASSID=0;PARTNAME=’ ‘;TRIMID=0)
1431 (HIGHQUAL=0;AUXMID=0;AFPMID=0;DESINC=0;ARBMID=0;PARTNAME=’ ‘;TRIMID=0;FLXBDYID=0) 1459 (PEID=0;DESITER=0;PVALID=0;NL99=0;APRCH=’ ‘;QCPLD=’ ‘;HIGHQUAL=0;AUXMID=0;DESINC=0;DISCRETE=FALSE;MASSID=0;PARTNAME=’ ‘;MODULE=0) 1461 (PEID=0;APRCH=’ ‘;QCPLD=’ ‘;HIGHQUAL=0;AUXMID=0;DESINC=0;PARTNAME=’ ‘;MODULE=0) 1541 (SEID=0;PEID=0;MTEMP=0;DESITER=0;PVALID=0;APRCH=’ ‘;QCPLD=’ ‘;HIGHQUAL=0;P2G=’ ‘;K2GG=’ ‘;M2GG=’ ‘;DELTA=FALSE;AUXMID=0;BNDSHP=FALSE;ADJOINT=FALSE;DESINC=0;DISCRETE=FALSE;CASEF06=’ ‘;ISOLAPP=1;SUBCID=0;OSUBID=1;STEPID=0;RGYRO=0;PARTNAME=’ ‘;SSTEPID=0;MODULE=0)
Word Name Type Description 1 NAME(2) CHAR4 Datablock Name
Word Name Type Description 1 DBKEY I database KEY associated with qualifiers 2 QLEN(C) I length in words of qualifiers string 3 QUALSTR CHAR4 Qualifier information string Word 3 repeats QLEN times
Word Name Type Description 1 FUNIT I Fortran unit op2 file was written to 2 NUMKEYS I Number of keys 3 BIT(5) I ,{
-
read_xsop2dir
()[source]¶ Matrix datablocks are named with the matrix name, and they contain only the matrices with no row and column DOF information.
External superelements are written to the OP2 in the XSOP2DIR datablock which contains the directory of matrices, and multiple EXTDB datablocks that contain these matrices. The information in XSOP2DIR can be used to rename the EXTDB datablocks to their corresponding matrix name.
The MATPOOL datablock contains matrices of several different formats. MATPOOL matrices are DMIG-formatted matrices. Matrices from all of these sources can be stored as structured array.
-
show
(n: int, types: str = 'ifs', endian: Optional[str] = None, force: bool = False)[source]¶ shows the next N bytes
- Parameters
- nint
the number of bytes to show
- typesstr; default=’ifs’
the data types to show
- endianstr; default=None -> active endian
the data endian
- forcebool; default=False
overwrite the n=2000 limiter
-
show_data
(data: bytes, types: str = 'ifs', endian: Optional[str] = None, force: bool = False)[source]¶ Shows a data block as various types
- Parameters
- databytes
the binary string bytes
- typesstr; default=’ifs’
i - int f - float s - string d - double (float64; 8 bytes) q - long long (int64; 8 bytes)
l - long (int; 4 bytes) I - unsigned int (int; 4 bytes) L - unsigned long (int; 4 bytes) Q - unsigned long long (int; 8 bytes)
- endianstr; default=None -> auto determined somewhere else in the code
the big/little endian {>, <}
- forcebool; default=False
overwrite the n=2000 limiter
- .. warning:: ‘s’ is apparently not Python 3 friendly
-
property
-
pyNastran.op2.op2_interface.op2_reader.
dscmcol_dresp1
(responses: Dict[int, Dict[str, Any]], nresponses_dresp1: int, ints, floats) → None[source]¶ helper for DSCMCOL
-
pyNastran.op2.op2_interface.op2_reader.
dscmcol_dresp2
(responses: Dict[int, Dict[str, Any]], nresponses_dresp2: int, ints, floats) → None[source]¶ helper for DSCMCOL
-
pyNastran.op2.op2_interface.op2_reader.
eqexin_to_nid_dof_doftype
(eqexin1, eqexin2) → Tuple[Any, Any, Any][source]¶ assemble dof table
-
pyNastran.op2.op2_interface.op2_reader.
get_table_size_from_ncolumns
(table_name: str, nvalues: int, ncolumns: int) → int[source]¶
-
pyNastran.op2.op2_interface.op2_reader.
grids_comp_array_to_index
(grids1, comps1, grids2, comps2, make_matrix_symmetric: bool) → Tuple[Any, Any, int, int, int][source]¶ Maps the dofs
- Returns
- ja???
???
- jb???
???
- nja???
???
- njb???
???
- nj???
???
-
pyNastran.op2.op2_interface.op2_reader.
reshape_bytes_block_size
(name_bytes: bytes, size: int = 4) → bytes[source]¶