utils Module

  • elements = elements_from_quad(nx, ny, dtype=’int32’)

  • points, elements = points_elements_from_quad_points(p1, p2, p3, p4, x, y, dtype=’int32’)

pyNastran.bdf.cards.aero.utils.create_axisymmetric_body(xstation, ystation, zstation, radii, aspect_ratio, p1)[source]

creates a CAERO2-type body by defining cone properties at various stations

pyNastran.bdf.cards.aero.utils.create_ellipse(aspect_ratio, radius, thetas=None)[source]

a : major radius b : minor radius


AR = height/width a = radius (theta=90) b = AR*radius (theta=0)

.. math::

r(theta )={frac {ab}{sqrt {(bcos theta )^{2}+(asin theta )^{2}}}}

R(theta) = a*b / ((b*cos(theta))**2 + (a*sin(theta))**2)
TODO: doesn’t support the aero coordinate system
pyNastran.bdf.cards.aero.utils.elements_from_quad(nx, ny, dtype='int32')[source]

Creates an array of rectilinear mesh of nodes and then grabs indexs it to get the elements

pyNastran.bdf.cards.aero.utils.make_monpnt1s_from_cids(model: BDF, nids, cids, cid_to_inids, delete_unused_coords=True)[source]

Creates MONPNT1s, AECOMPs, and SET1s by a series of coordinate systems

model :: BDF()

the model object

nids(nnodes, ) int ndarray

all the nodes in the model


coord id

inids(nnodes_in_cid, ) int ndarray

the indicies in nids in sorted order


cids to create

delete_unused_coordsbool; default=True

delete coordinate systems from the model that aren’t used


Doesn’t write duplicate sets

pyNastran.bdf.cards.aero.utils.points_elements_from_quad_points(p1, p2, p3, p4, x, y, dtype='int32')[source]

Creates nodes and elements in a structured grid given 4 points. Used to make an CAERO1 panel.

p1(3, ) float ndarray

leading edge root

p2(3, ) float ndarray

trailing edge root

p3(3, ) float ndarray

trailing edge tip

p4(3, ) float ndarray

leading edge tip

x(nchord, ) float ndarray

points in the chordwise direction in percentage of the chord

y(nspan, ) float ndarray

points in the spanwise direction in percentage of the span

dtypestr; default=’int32’

the type of elements

points (nchord, nspan) float ndarray; might be backwards???

the points

elements (nquads, 4) int ndarray

series of quad elements nquads = (nchord-1) * (nspan-1)


The tri_cap buils triangles that fan out from the first node

*    *2
|   /      *3
|  /     /
| /   /
0  /---------*4

create a matrix with the point counter