op2_interface Package

op2_codes Module

Inheritance diagram of pyNastran.op2.op2_interface.op2_codes
pyNastran.op2.op2_interface.op2_codes.determine_sort_bits_meaning(table_code: int, sort_code: int, sort_bits: Tuple[int, int, int]) → Tuple[int, bool, bool][source]

Value Sort type Data format Random ===== ========= =========== ====== 0 SORT1 Real No 1 SORT1 Complex No 2 SORT2 Real No 3 SORT2 Complex No 4 SORT1 Real Yes 5 SORT2 ??? Yes 6 SORT2 Real Yes

table_code%1000 = function3()

SPCForce = table_code % 1000 (function 3)

pyNastran.op2.op2_interface.op2_codes.get_format_word(format_code: int) → str[source]
pyNastran.op2.op2_interface.op2_codes.get_scode_word(s_code: int, stress_bits: List[int]) → str[source]
pyNastran.op2.op2_interface.op2_codes.get_scode_word_assert(s_code: int, stress_bits: List[int]) → str[source]
pyNastran.op2.op2_interface.op2_codes.get_sort_method_from_table_name(table_name: bytes) → int[source]

helper method

pyNastran.op2.op2_interface.op2_codes.get_table_from_table_code(table_code: int, table_name: str, is_msc: bool = True) → str[source]

translates that a key of say 1 is the ‘OUG - Displacement vector’ table

op2_f06_common Module

Inheritance diagram of pyNastran.op2.op2_interface.op2_f06_common
class pyNastran.op2.op2_interface.op2_f06_common.OP2_F06_Common[source]

Bases: object

property cbar_force
property cbar_force_10nodes
property cbar_strain_energy
property cbeam_force
property cbeam_force_vu
property cbeam_strain_energy
property cbear_force
property cbend_force
property cbend_strain_energy
property cbush_force
property cbush_strain_energy
property cconeax_force
property cdamp1_force
property cdamp1_strain_energy
property cdamp2_force
property cdamp2_strain_energy
property cdamp3_force
property cdamp3_strain_energy
property cdamp4_force
property cdamp4_strain_energy
property cdum8_strain_energy
property celas1_force
property celas1_strain
property celas1_strain_energy
property celas1_stress
property celas2_force
property celas2_strain
property celas2_strain_energy
property celas2_stress
property celas3_force
property celas3_strain
property celas3_strain_energy
property celas3_stress
property celas4_force
property celas4_strain
property celas4_strain_energy
property celas4_stress
property cfast_force
property cgap_force
property cgap_strain_energy
property chexa_pressure_force
property chexa_strain
property chexa_strain_energy
property chexa_stress
property conm2_strain_energy
property conrod_force
property conrod_strain_energy
property cpenta_pressure_force
property cpenta_strain
property cpenta_strain_energy
property cpenta_stress
property cpyram_pressure_force
property cpyram_strain
property cpyram_strain_energy
property cpyram_stress
property cquad4_force
property cquad4_strain_energy
property cquad8_force
property cquad8_strain_energy
property cquadr_force
property cquadr_strain_energy
property cquadx_strain_energy
property crod_force
property crod_strain_energy
property cshear_force
property cshear_strain_energy
property ctetra_pressure_force
property ctetra_strain
property ctetra_strain_energy
property ctetra_stress
property ctria3_force
property ctria3_strain_energy
property ctria6_force
property ctria6_strain_energy
property ctriar_force
property ctriar_strain_energy
property ctriax6_strain_energy
property ctriax_strain_energy
property ctube_force
property ctube_strain_energy
property cvisc_force
property cweld_force
del_result(result_name)[source]

delattr, but considers sub-objects

property dmig_strain_energy
property genel_strain_energy
get_op2_stats(short=False)[source]

Gets info about the contents of the different attributes of the OP2 class.

Examples

*Detailed OP2 Stats* >>> self.get_op2_stats()

displacements[1]

isubcase = 1 type=RealDisplacementArray nnodes=72 data: [t1, t2, t3, r1, r2, r3] shape=[1, 72, 6] dtype=float32 gridTypes sort1 lsdvmns = [1]

spc_forces[1]

isubcase = 1 type=RealSPCForcesArray nnodes=72 data: [t1, t2, t3, r1, r2, r3] shape=[1, 72, 6] dtype=float32 gridTypes sort1 lsdvmns = [1]

ctetra_stress[1]

type=RealSolidStressArray nelements=186 nnodes=930 nodes_per_element=5 (including centroid) eType, cid data: [1, nnodes, 10] where 10=[oxx, oyy, ozz, txy, tyz, txz, o1, o2, o3, von_mises] data.shape = (1, 930, 10) element name: CTETRA sort1 lsdvmns = [1]

*Appreviated OP2 Stats* >>> self.get_op2_stats(short=True) displacements[1]; RealDisplacementArray; [1, 72, 6]; [t1, t2, t3, r1, r2, r3]

get_result(result_name)[source]

Getattr, but considers sub-objects

Examples

Example 1 >>> self.eigenvectors = get_result(‘eigenvectors’)

Example 2 >>> self.ato.displacements = get_result(‘ato.displacements’)

get_table_types()[source]

Gets the names of the results.

has_result(result_name: str) → bool[source]

checks to see if a result exists

isubcase_name_map = None

a dictionary that maps an integer of the subcaseName to the subcase_id

property rbe1_strain_energy
property rbe3_strain_energy
remove_empty_results()[source]
title = None

BDF Title

property vu_quad_force
property vu_tria_force
property weldc_strain_energy
class pyNastran.op2.op2_interface.op2_f06_common.Op2F06Attributes[source]

Bases: pyNastran.op2.op2_interface.op2_f06_common.OP2_F06_Common

result_set Module

Inheritance diagram of pyNastran.op2.op2_interface.result_set
Defines:
  • ResultSet(allowed_results)

    • allowed

    • found

    • saved

    • is_saved(result)

    • is_not_saved(result)

    • clear()

    • add(result)

    • remove(results)

    • _found_result(result)

    • update(self, results)

class pyNastran.op2.op2_interface.result_set.ResultSet(allowed_results: List[int], results_map, unused_log)[source]

Bases: object

This class is private storage interface class.

It’s an interface tool between the code and the results the user requests.

add(results: Union[str, List[str]]) → List[str][source]

adds a list/str of results

clear() → None[source]

clears all the results

is_not_saved(result: str) → bool[source]

checks to see if a result is saved

is_saved(result: str) → bool[source]

checks to see if a result is saved

remove(results: Union[str, List[str]]) → List[str][source]

removes a list/str of results

update(results: List[str]) → None[source]

write_utils Module

Defines methods for the op2 & hdf5 writer

pyNastran.op2.op2_interface.write_utils.export_to_hdf5(self, group, log)[source]

exports the object to HDF5 format

pyNastran.op2.op2_interface.write_utils.get_complex_fdtype(dtype)[source]

complex64 -> float32; complex128 -> float64

pyNastran.op2.op2_interface.write_utils.set_table3_field(str_fields, ifield, value)[source]

ifield is 1 based

pyNastran.op2.op2_interface.write_utils.to_column_bytes(data_list: List[numpy.ndarray], dtype_out: str, debug: bool = False) → numpy.ndarray[source]

Takes an stackable numpy array of mixed types (e.g., ints/strings) and casts them to the appropriate output datatype (typically float32/float64).

An array is stackable if it’s the same shape (e.g., ints/floats). This requirement is a bit looser for strings (4 characters per 32-bit float)

pyNastran.op2.op2_interface.write_utils.view_dtype(array_obj, dtype)[source]

handles downcasting data

pyNastran.op2.op2_interface.write_utils.view_idtype_as_fdtype(int_array, fdtype)[source]

If we’re downcasting from int64 to float32, we can’t directly go to float32. We need to first go to int32, then to float32.

pyNastran.op2.op2_interface.write_utils.write_table_header(op2_file, fascii, table_name)[source]

Writes the beginning of an op2 table

Parameters
op2_filefile

the op2 file object

table_namestr

the table name to write