ogf_gridPointForces Package

ogf_objects Module

digraph inheritance16f6b1c6c4 { bgcolor=transparent; rankdir=LR; size=""; "pyNastran.op2.op2_interface.op2_codes.Op2Codes" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "pyNastran.op2.result_objects.op2_objects.BaseElement" [URL="../result_objects/pyNastran.op2.result_objects.html#pyNastran.op2.result_objects.op2_objects.BaseElement",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "pyNastran.op2.result_objects.op2_objects.ScalarObject" -> "pyNastran.op2.result_objects.op2_objects.BaseElement" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.op2.result_objects.op2_objects.BaseScalarObject" [URL="../result_objects/pyNastran.op2.result_objects.html#pyNastran.op2.result_objects.op2_objects.BaseScalarObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The base scalar class is used by:"]; "pyNastran.op2.op2_interface.op2_codes.Op2Codes" -> "pyNastran.op2.result_objects.op2_objects.BaseScalarObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.op2.result_objects.op2_objects.ScalarObject" [URL="../result_objects/pyNastran.op2.result_objects.html#pyNastran.op2.result_objects.op2_objects.ScalarObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Used by all vectorized objects including:"]; "pyNastran.op2.result_objects.op2_objects.BaseScalarObject" -> "pyNastran.op2.result_objects.op2_objects.ScalarObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.ComplexGridPointForcesArray" [URL="#pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.ComplexGridPointForcesArray",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces" -> "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.ComplexGridPointForcesArray" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces" [URL="#pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "pyNastran.op2.result_objects.op2_objects.BaseElement" -> "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.RealGridPointForcesArray" [URL="#pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.RealGridPointForcesArray",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="G R I D P O I N T F O R C E B A L A N C E"]; "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces" -> "pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.RealGridPointForcesArray" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.ComplexGridPointForcesArray(data_code, is_sort1, isubcase, dt)[source]

Bases: GridPointForces

build()[source]

sizes the vectorized attributes of the ComplexGridPointForcesArray

build_dataframe()[source]

major-axis - the axis

mode 1 2 3 freq 1.0 2.0 3.0 nodeID ElementID Item 1 2 T1

major_axis / top = [

[1, 2, 3], [1.0, 2.0, 3.0]

] minor_axis / headers = [T1, T2, T3, R1, R2, R3] name = mode

property element_name
get_headers() list[str][source]
get_stats(short: bool = False) list[str][source]
property is_complex: bool
property is_real: bool
write_f06(f06_file, header=None, page_stamp='PAGE %s', page_num: int = 1, is_mag_phase: bool = False, is_sort1: bool = True)[source]
write_op2(op2_file, op2_ascii, itable, new_result, date, is_mag_phase=False, endian='>')[source]

writes an OP2

class pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.GridPointForces(data_code, is_sort1, isubcase)[source]

Bases: BaseElement

class pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.RealGridPointForcesArray(data_code, is_sort1, isubcase, dt)[source]

Bases: GridPointForces

G R I D P O I N T F O R C E B A L A N C E

POINT-ID ELEMENT-ID SOURCE T1 T2 T3 R1 R2 R3

0 13683 3736 TRIAX6 4.996584E+00 0.0 1.203093E+02 0.0 0.0 0.0

13683 3737 TRIAX6 -4.996584E+00 0.0 -1.203093E+02 0.0 0.0 0.0 13683 TOTALS 6.366463E-12 0.0 -1.364242E-12 0.0 0.0 0.0

assert_equal(table, rtol=1e-05, atol=1e-08)[source]
build() None[source]

sizes the vectorized attributes of the RealGridPointForcesArray

build_dataframe() None[source]

major-axis - the axis

mode 1 2 3 freq 1.0 2.0 3.0 nodeID ElementID Item 1 2 T1

major_axis / top = [

[1, 2, 3], [1.0, 2.0, 3.0]

] minor_axis / headers = [T1, T2, T3, R1, R2, R3] name = mode

property element_name: str
extract_freebody_loads(eids: NDArrayNint, coord_out: CORD, coords: dict[int, CORD], nid_cd: NDArrayN2int, icd_transform: dict[int, NDArrayNint], itime: int = 0, debug: bool = False, log: SimpleLogger | None = None)[source]

Extracts Patran-style freebody loads. Freebody loads are the external loads.

Parameters:
eids(Nelements, ) int ndarray

all the elements to consider

coord_outCORD2R()

the output coordinate system

coordsdict[int] = CORDx

all the coordinate systems key : int value : CORDx

nid_cd(Nnodes, 2) int ndarray

the (BDF.point_ids, cd) array

icd_transformdict[cd] = (Nnodesi, ) int ndarray

the mapping for nid_cd

itimeint; default=0

the time to extract loads for

debugbool; default=False

debugging flag

loglog; default=None

a log object that gets used when debug=True

Returns:
force_out(Nnodes, 3) float ndarray

the ith float components in the coord_out coordinate frame

moment_out(Nnodes, 3) float ndarray

the ith moment components about the summation point in the coord_out coordinate frame

Todo

doesn’t seem to handle cylindrical/spherical systems ..

Warning

not done ..

extract_interface_loads(nids: NDArrayNint, eids: NDArrayNint, coord_out: CORD, coords: dict[int, CORD], nid_cd: NDArrayN2int, icd_transform: dict[int, CORD], xyz_cid0: NDArrayN3float, summation_point: NDArray3float | None = None, consider_rxf: bool = True, itime: int = 0, assume_sorted: bool = False, stop_on_nan: bool = False, debug: bool = False, log: SimpleLogger | None = None, idtype: str = 'int32') tuple[NDArray3float, NDArray3float][source]

Extracts Patran-style interface loads. Interface loads are the internal loads at a cut.

Parameters:
nids(Nnodes, ) int ndarray

all the nodes to consider; must be sorted

eids(Nelements, ) int ndarray

all the elements to consider; must be sorted

coord_outCORD2R()

the output coordinate system

coordsdict[int] = CORDx

all the coordinate systems key : int value : CORDx

nid_cd(Nnodes, 2) int ndarray

the (BDF.point_ids, cd) array

icd_transformdict[cd] = (Nnodesi, ) int ndarray

the mapping for nid_cd

xyz_cid0(nnodes + nspoints + nepoints, 3) ndarray

the grid locations in coordinate system 0

summation_point0(3, ) float ndarray; default=None

None : no load summation array : the summation point in the global frame

consider_rxfbool; default=True

considers the r x F term

itimeint; default=0

the time to extract loads for

debugbool; default=False

debugging flag

loggerlogger; default=None

a logger object that gets used when debug=True

assume_sortedbool; default=False

sorts the nodes/elements if they’re not is sorting required?

Returns:
force_out_sum(3, ) float ndarray

the sum of forces in the coord_out coordinate frame

moment_out_sum(3, ) float ndarray

the sum of moments about the summation point in the coord_out coordinate frame

Todo

doesn’t seem to handle cylindrical/spherical systems ..

Todo

Add support for: 2D output style:

  • This would allow for shell problems to have loads applied in the plane of the shells

  • This would require normals

1D output style:
  • Make loads in the direction of the element

This process can’t be done for 0D or 3D elements

finalize() None[source]

required so the OP2 writer works…

find_centroid_of_load(f, m)[source]

Mx = ry*Fz - rz*Fy My = rz*Fx - rx*Fz Mz = rx*Fy - ry*Fx

{M} = [F]{r} [F] = [

[ 0, -Fy, Fz], [-Fz, 0, Fx], [ Fy, -Fx, 0],

] {r} = [F]^-1 {M}

When the determinant of [F] is nonzero (2D):

Life is easy

When the determinant of [F] is zero: When Fx != Fy != Fz and they don’t equal 0 there are 3 solutions:

where M=[0, 0, 0]

det([F]) = 0:

[F]{x} = [lambda]{x}

where one of the eigenvalues is 0? (the trivial case) and

However, [F] is singular, so let rx=0: Mx = ry*Fz - rz*Fy My = rz*Fx Mz = -ry*Fx let Fx=0, so ry, rz != 0, but My=Mz=0 -> ry = rz*Fy/Fz let rz = 1 -> ry = Fy/Fz <0, Fy/Fz, 1>

get_headers() list[str][source]
get_stats(short: bool = False) list[str][source]
property is_complex: bool
property is_real: bool
shear_moment_diagram(nids: np.ndarray, xyz_cid0: np.ndarray, nid_cd: NDArrayN2int, icd_transform: dict[int, NDArrayNint], eids: np.ndarray, element_centroids_cid0: NDArrayN3float, stations: NDArrayNfloat, coords: dict[int, CORD], coord_out: CORD, iaxis_march: NDArray3float | None = None, itime: int = 0, icoord: int = None, idir: int = 0, nodes_tol: float | None = None, stop_on_nan: bool = False, debug: bool = False, log: SimpleLogger | None = None) tuple[NDArray3float, NDArray3float, dict[int, CORD], NDArrayNint, NDArrayNint][source]

Computes a series of forces/moments at various stations along a structure.

Parameters:
xyz_cid0(Nnodes, 3) float ndarray

all the nodes in the model xyz position in the global frame

eids(Nelements, ) int ndarray

an array of element ids to consider

nids(Nnodes, ) int ndarray

an array of node ids corresponding to xyz_cid0

icd_transformdict[cd] = (Nnodesi, ) int ndarray

the mapping for nid_cd

element_centroids_cid0(Nelements, 3) float ndarray

an array of element centroids corresponding to eids

coordsdict[int] = CORDx

all the coordinate systems key : int value : CORDx

nid_cd(Nnodes, 2) int ndarray

the (BDF.point_ids, cd) array

stations(nstations, ) float ndarray

The station to sum forces/moments about, where a station is the value of coord_out in the idir (e.g., for station=1, cid=0, idir=0, then x=1). It is necessary that the spacing is constant. Stations should be sorted (negative to positive), but it not necessary (it makes it easier to see a monotonic change in the number of nodes/elements). Try to avoid picking exactly on symmetry planes/boundaries of elements or nodes.

coord_outCORD2R()

the output coordinate system

iaxis_march(3,) float narray; default=None -> coord_out.i

the normalized x-axis that defines the direction to march

icoordint; default=None -> coord_out+1

the starting index for the coordinate systems that will be created and placed in new_coords; useful for debugging

nodes_tolfloat; default=None -> dstation

the tolerance bending the plane to pull nodes from

Returns:
force_sum / moment_sum(nstations, 3) float ndarray

the forces/moments at the station

new_coords: dict[int, CORD2R]

the station march coords starting from icoord

nelems, nnodes: (nstations,) int ndarray

the number of elements/nodes included in the summation

Notes

  1. Clip elements based on centroid. Elements that are less than the ith station are kept.

  2. Get the nodes on the opposite side of the clip plane and the ones within nodes_tol of the plane.

  3. Extract the interface loads and sum them about the summation point.

Examples

Imagine a swept aircraft wing. Define a coordinate system in the primary direction of the sweep. Note that station 0 doesn’t have to be perfectly at the root of the wing.

Create stations from this point.

Todo

Not Tested…Does 3b work? Can 3a give the right answer?

write_csv(csv_file: TextIO, is_exponent_format: bool = False, is_mag_phase: bool = False, is_sort1: bool = True, write_header: bool = True)[source]
write_f06(f06_file: TextIO, header=None, page_stamp='PAGE %s', page_num: int = 1, is_mag_phase: bool = False, is_sort1: bool = True)[source]
write_f06_time(f06_file, itime=0, i=None, header=None, page_num=1, page_stamp='')[source]
write_op2(op2_file, op2_ascii, itable, new_result, date, is_mag_phase=False, endian='>')[source]

writes an OP2

pyNastran.op2.tables.ogf_gridPointForces.ogf_objects.set_3d_data(data: ndarray, itime: int, itotal: int, values: list[float], size: int)[source]

annoying way to handle underflow

ogpf Module

digraph inheritance96d2d47e4f { bgcolor=transparent; rankdir=LR; size=""; "pyNastran.op2.tables.ogf_gridPointForces.ogpf.OGPF" [URL="#pyNastran.op2.tables.ogf_gridPointForces.ogpf.OGPF",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }
Defines the Real/Complex Forces created by:

GPFORCE = ALL

class pyNastran.op2.tables.ogf_gridPointForces.ogpf.OGPF(op2: OP2)[source]

Bases: object

property factor: int
read_grid_point_forces1(data: bytes, ndata: int, prefix: str = '') int[source]

table_code = 19

read_grid_point_forces2(data: bytes, ndata: int, prefix: str = '') int[source]

table_code = 19

property size: int