data_in_material_coord Package

data_in_material_coord Module

Defines:
  • data_in_material_coord(bdf, op2, in_place=False)

pyNastran.op2.data_in_material_coord.angle2vec(v1, v2)[source]

Using the definition of the dot product to get the angle

v1 o v2 = |v1| * |v2| * cos(theta) theta = np.arccos( (v1 o v2) / (|v1|*|v2|))

pyNastran.op2.data_in_material_coord.calc_imat(normals, csysi)[source]

Calculates the i vector in the material coordinate system.

j = k x ihat jhat = j / |j| i = jhat x k

Notes

i is not a unit vector because k (the element normal) is not a unit vector.

pyNastran.op2.data_in_material_coord.check_theta(elem) → float[source]
pyNastran.op2.data_in_material_coord.data_in_material_coord(bdf: BDF, op2: OP2, in_place: bool = False) → OP2[source]

Convert OP2 2D element outputs to material coordinates

Nastran allows the use of ‘PARAM,OMID,YES’ to print 2D element forces, stresses and strains based on the material direction. However, the conversion only takes place in the F06 output file, whereas the OP2 output file remains in the element coordinate system.

This function converts the 2D element vectors to the material OP2 similarly to most of the post-processing tools (Patran, Femap, HyperView, etc). It handles both 2D elements with MCID or THETA.

Parameters
bdfBDF object

A BDF object that corresponds to the ‘op2’.

op2OP2 object

A OP2 object that corresponds to the ‘bdf’.

in_placebool; default=False

If true the original op2 object is modified, otherwise a new one is created.

Returns
op2_newOP2 object

A OP2 object with the abovementioned changes.

Warning

doesn’t handle composite stresses/strains/forces ..

Warning

doesn’t handle solid stresses/strains/forces (e.g. MAT11) ..

Warning

zeros out data for CQUAD8s ..

pyNastran.op2.data_in_material_coord.get_eids_from_op2_vector(vector)[source]

Obtain the element ids for a given op2 vector

Parameters
vectorop2 vector

An op2 vector obtained, for example, doing:

vector = op2.cquad4_force[1]
vector = op2.cquad8_stress[1]
vector = op2.ctriar_force[1]
vector = op2.ctria3_stress[1]
pyNastran.op2.data_in_material_coord.get_transform(T1, Te)[source]

[T_el] = [T1]^T [T] [T_element_in_local] = [T_local_in_basic]^T [T_elemental_in_basic] [T_element_in_local] = [T_basic_in_local] [T_elemental_in_basic]

pyNastran.op2.data_in_material_coord.is_mcid(elem)[source]

Determines if the element uses theta or the mcid (projected material coordinate system)

Parameters
elemvaries

an element object CQUAD4, CQUAD8, CQUADR CTRIA3, CTRIA6, CTRIAR

Returns
is_mcidbool

the projected material coordinate system is used

pyNastran.op2.data_in_material_coord.main()[source]
pyNastran.op2.data_in_material_coord.thetadeg_to_principal(Sxx, Syy, Sxy)[source]

Calculate the angle to the principal plane stress state

Parameters
Sxx, Syy, Sxyarray-like

Sigma_xx, Sigma_yy, Sigma_xy stresses.

Returns
thetadegnp.ndarray

Array with angles for which the given stresses are transformed to the principal stress state.

pyNastran.op2.data_in_material_coord.transf_Mohr(Sxx, Syy, Sxy, thetarad)[source]

Mohr’s Circle-based Plane Stress Transformation

Parameters
Sxx, Syy, Sxyarray-like

Sigma_xx, Sigma_yy, Sigma_xy stresses.

thetaradarray-like

Array with angles for which the stresses should be transformed.

Returns
Sxx_theta, Syy_theta, Sxy_thetanp.ndarray

Transformed stresses.

pyNastran.op2.data_in_material_coord.transform_solids(bdf_model: BDF, op2_model: OP2, cid: int)[source]

http://web.mit.edu/course/3/3.11/www/modules/trans.pdf

[stress_out] = [T_out] [stress_0] [T_out]^T [T_out]^T [stress_0] [T_out] = [stress_0] [T_out] [stress_out] = [T_out] [T_in]^T [stress_in] [T_in] [T_out]^T [stress_out] = [T] [stress_in] [T]^T [T] = [T_out] [T_in]^T