nastran Package¶
cart3dIO Module¶
cart3d_reader Module¶
- class pyNastran.converters.cart3d.cart3d_reader.Cart3DReader(log=None, debug=False)[source]¶
Bases: object
- get_normals(nodes, elements, shift_nodes=True)[source]¶
Gets the centroidal normals
Parameters: - self – The reader object
- nodes – the ndarray of nodes
- elements – the ndarray of triangles
- shift_nodes – boolean to shift element IDs such that the node IDs start at 0 instead of 1 True : nodes start at 1 False : nodes start at 0
Retval cnormals: the ndarray of normalized centroidal normal vectors
- get_normals_at_nodes(nodes, elements, cnormals, shift_nodes=True)[source]¶
Gets the nodal normals
Parameters: - self – The reader object
- nodes – the ndarray of nodes
- elements – the ndarray of triangles
- cnormals – the ndarray of normalized centroidal normal vectors
- shift_nodes – boolean to shift element IDs such that the node IDs start at 0 instead of 1 True : nodes start at 1 False : nodes start at 0
Retval nnormals: the ndarray of normalized nodal normal vectors
- isOutwardNormals = True¶
- isStructured = False¶
- make_half_model(nodes, elements, regions, loads=None, axis='y', remap_nodes=True)[source]¶
Makes a half model from a full model
... note:: Cp is really loads[‘Cp’] and was meant for loads analysis only
- make_mirror_model(nodes, elements, regions, loads, axis='y', tol=1e-06)[source]¶
Makes a full cart3d model about the given axis.
Parameters: - nodes – the nodes; (nnodes, 3) ndarray
- elements – the elmements; (nelements, 3) ndarray
- regions – the regions; (nelements) ndarray
- loads – not supported; dictionary of (nnodes) ndarray
- axis – a string of “x”, “y”, “z”, “-x”, “-y”, “-z”
- tol – the tolerance for the centerline points (default=0.000001)
- modelType = 'cart3d'¶
- read_elements_ascii(bypass=False)[source]¶
An element is defined by n1,n2,n3 and the ID is the location in elements.
- read_results_ascii(i, infile, result_names=None)[source]¶
Reads the Cp results. Results are read on a nodal basis from the following table:
Cp rho,rhoU,rhoV,rhoW,rhoE- With the following definitions:
- Cp = (p - 1/gamma) / (0.5*M_inf*M_inf) rhoVel^2 = rhoU^2+rhoV^2+rhoW^2 M^2 = rhoVel^2/rho^2
- Thus:
- p = (gamma-1)*(e- (rhoU**2+rhoV**2+rhoW**2)/(2.*rho)) p_dimensional = qInf * Cp + pInf
# ??? rho,rhoU,rhoV,rhoW,rhoE
Parameters: result_names – the results to read; default=None -> All result_names = [‘Cp’, ‘rho’, ‘rhoU’, ‘rhoV’, ‘rhoW’, ‘rhoE’,
‘Mach’, ‘U’, ‘V’, ‘W’, ‘E’]
- pyNastran.converters.cart3d.cart3d_reader._get_list(sline)[source]¶
Takes a list of strings and converts them to floats.
- pyNastran.converters.cart3d.cart3d_reader.comp2tri(self, in_filenames, out_filename, is_binary=False, float_fmt='%6.7f')[source]¶
Combines multiple Cart3d files (binary or ascii) into a single file.
Parameters: - in_filenames – list of filenames
- out_filename – output filename
- is_binary – is the output filename binary (default=False)
- float_fmt – the format string to use for ascii writing (default=’%6.7f’)
Note
assumes loads is None
cart3d_to_stl Module¶
cart3d_to_nastran Module¶
- pyNastran.converters.cart3d.cart3d_to_nastran.cart3d_to_nastran_filename(cart3d_filename, bdf_filename, log=None, debug=False)[source]¶
Converts a Cart3D file to STL format.
Parameters: - cart3d_filename – path to the input Cart3D file
- bdf_filename – path to the output BDF file
- log – a logger object (or None)
- debug – True/False (used if log is not defined)
test_cart3d Module¶