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: ndarray, v2: ndarray) ndarray[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: ndarray, csysi: ndarray) ndarray[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, debug: 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_eid_to_theta_rad(bdf: BDF, debug: bool) dict[int, float][source]
pyNastran.op2.data_in_material_coord.get_eid_to_theta_rad2(model: BDF, debug: bool) dict[int, float][source]
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.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.theta_deg_to_principal(Sxx: ndarray, Syy: ndarray, Sxy: ndarray) ndarray[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: ndarray, Syy: ndarray, Sxy: ndarray, theta_rad: ndarray) tuple[ndarray, ndarray, ndarray][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.