utils
Module¶
- defines:
- 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
Parameters: - aspect_ratio : float
AR = height/width a = radius (theta=90) b = AR*radius (theta=0)
- https://en.wikipedia.org/wiki/Ellipse#Polar_form_relative_to_center
- .. 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, nids, cids, cid_to_inids, delete_unused_coords=True)[source]¶ Creates MONPNT1s, AECOMPs, and SET1s by a series of coordinate systems
Parameters: - model :: BDF()
the model object
- nids : (nnodes, ) int ndarray
all the nodes in the model
- cid_to_inids : Dict[cid]=inids
- cid : int
coord id
- inids : (nnodes_in_cid, ) int ndarray
the indicies in nids in sorted order
- cids : List[int]
cids to create
- delete_unused_coords : bool; default=True
delete coordinate systems from the model that aren’t used
Notes
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.
Parameters: - 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
- dtype : str; default=’int32’
the type of elements
Returns: - points (nchord, nspan) float ndarray; might be backwards???
the points
- elements (nquads, 4) int ndarray
series of quad elements nquads = (nchord-1) * (nspan-1)