nastran Package

displacements Module

Inheritance diagram of pyNastran.converters.nastran.displacements
class pyNastran.converters.nastran.displacements.DisplacementResults(subcase_id, titles, headers, xyz, dxyz, unused_scalar, scales, data_formats=None, nlabels=None, labelsize=None, ncolors=None, colormap='jet', set_max_min=False, uname='NastranGeometry')[source]

Bases: pyNastran.converters.nastran.displacements.NastranTable

Defines a Displacement/Eigenvector result

Parameters:
subcase_id : int

the flag that points to self.subcases for a message

headers : List[str]

the sidebar word

titles : List[str]

the legend title

xyz : (nnodes, 3)

the nominal xyz locations

dxyz : (nnodes, 3)

the delta xyz values

scalars : (nnodes,n) float ndarray

#the data to make a contour plot with does nothing

scales : List[float]

the deflection scale factors nominally, this starts as an empty list and is filled later

data_formats : List[str]

the type of data result (e.g. ‘%i’, ‘%.2f’, ‘%.3f’)

ncolors : int; default=None

sets the default for reverting the legend ncolors

set_max_min : bool; default=False

set default_mins and default_maxs

deflects(self, unused_i, unused_res_name)[source]
get_location(self, unused_i, unused_name)[source]

the result type

get_methods(self, i)[source]
get_vector_result_by_scale_phase(self, i, unused_name, scale, phase=0.0)[source]

Gets the real/complex deflection result

Parameters:
i : int

mode/time/loadstep number

name : str

unused; useful for debugging

scale : float

deflection scale factor; true scale

phase : float; default=0.0

phase angle (degrees); unused for real results

Returns:
xyz : (nnodes, 3) float ndarray

the nominal state

deflected_xyz : (nnodes, 3) float ndarray

the deflected state

class pyNastran.converters.nastran.displacements.ElementalTableResults(subcase_id, titles, headers, dxyz, unused_scalar, scales, data_formats=None, nlabels=None, labelsize=None, ncolors=None, colormap='jet', set_max_min=False, uname='NastranGeometry')[source]

Bases: pyNastran.converters.nastran.displacements.NastranTable

this is a centroidal result

deflects(self, unused_i, unused_res_name)[source]
get_methods(self, i)[source]
get_vector_result_by_scale_phase(self, i, unused_name, unused_scale, phase=0.0)[source]
class pyNastran.converters.nastran.displacements.ForceTableResults(subcase_id, titles, headers, dxyz, unused_scalar, scales, data_formats=None, nlabels=None, labelsize=None, ncolors=None, colormap='jet', set_max_min=False, uname='NastranGeometry')[source]

Bases: pyNastran.converters.nastran.displacements.NastranTable

this is a nodal force result

deflects(self, unused_i, unused_res_name)[source]
get_methods(self, i)[source]
get_vector_result_by_scale_phase(self, i, unused_name, unused_scale, phase=0.0)[source]

Gets the real/complex deflection result

Parameters:
i : int

mode/time/loadstep number

name : str

unused; useful for debugging

scale : float

deflection scale factor; true scale unused because it’s a force

phase : float; default=0.0

phase angle (degrees); unused for real results

Returns:
xyz : (nnodes, 3) float ndarray

the nominal state

deflected_xyz : (nnodes, 3) float ndarray

the deflected state

class pyNastran.converters.nastran.displacements.NastranTable(subcase_id, location, titles, headers, dxyz, linked_scale_factor, scales, data_formats=None, nlabels=None, labelsize=None, ncolors=None, colormap='jet', set_max_min=False, uname='NastranGeometry')[source]

Bases: pyNastran.gui.gui_objects.gui_result.GuiResultCommon

Defines a Displacement/Eigenvector result

Parameters:
subcase_id : int

the flag that points to self.subcases for a message

headers : List[str]

the sidebar word

titles : List[str]

the legend title

#xyz : (nnodes, 3)

#the nominal xyz locations

#scalars : (nnodes,n) float ndarray

##the data to make a contour plot with #does nothing

dxyz : (nnodes, 3)

the delta xyz values

linked_scale_factor : bool

is the displacement scale factor linked displacements/loads steps should be force/eigenvectors should not be

scales : List[float]

the table (e.g., deflection, SPC Forces) scale factors nominally, this starts as an empty list and is filled later

data_formats : List[str]

the type of data result (e.g. ‘%i’, ‘%.2f’, ‘%.3f’)

ncolors : int; default=None

sets the default for reverting the legend ncolors

set_max_min : bool; default=False

set default_mins and default_maxs

_get_complex_displacements(self, i)[source]

see _get_complex_displacements_by_phase

_get_complex_displacements_by_phase(self, i, phase=0.0)[source]

Get displacements for a complex eigenvector result.

get_data_format(self, i, name)[source]
get_data_type(self, unused_i, unused_name)[source]

the precision of the data

get_default_data_format(self, i, name)[source]
get_default_min_max(self, i, name)[source]
get_default_nlabels_labelsize_ncolors_colormap(self, i, name)[source]
get_default_phase(self, i, name)[source]
get_default_scale(self, i, name)[source]
get_default_title(self, i, name)[source]
get_header(self, i, unused_name)[source]
get_location(self, i, unused_name)[source]
get_min_max(self, i, name)[source]
get_nlabels_labelsize_ncolors_colormap(self, i, name)[source]
get_phase(self, i, name)[source]
get_plot_value(self, i, unused_name)[source]
get_result(self, i, name)[source]
get_scale(self, i, name)[source]
get_title(self, i, name)[source]
get_vector_result(self, i, name)[source]
get_vector_size(self, i, unused_name)[source]

the result size

phases = None

stored in degrees

save_defaults(self)[source]
set_data_format(self, i, name, data_format)[source]
set_min_max(self, i, name, min_value, max_value)[source]
set_nlabels_labelsize_ncolors_colormap(self, i, name, nlabels, labelsize, ncolors, colormap)[source]
set_phase(self, i, name, phase)[source]
set_scale(self, i, name, scale)[source]
set_title(self, i, name, title)[source]

geometry_helper Module

nastran_to_cart3d Module

defines:
  • cart3d = nastran_to_cart3d(bdf, log=None, debug=False)
  • nastran_to_cart3d_filename(bdf_filename, cart3d_filename,
    log=None, debug=False)
pyNastran.converters.nastran.nastran_to_cart3d.nastran_to_cart3d(bdf, log=None, debug=False)[source]

Converts a Nastran BDF() object to a Cart3D() object.

Parameters:
bdf : BDF()

a BDF object

log : log; default=None -> dummyLogger

a logger object

debug : bool; default=False

True/False (used if log is not defined)

Returns:
cart3d : Cart3D()

a Cart3D object

pyNastran.converters.nastran.nastran_to_cart3d.nastran_to_cart3d_filename(bdf_filename, cart3d_filename, log=None, debug=False)[source]

Creates a Nastran BDF from a Cart3D file.

Parameters:
bdf_filename : str

the path to the bdf file

cart3d_filename : str

the path to the cart3d output file

log : log; default=None -> dummyLogger

a logger object

debug : bool; default=False

True/False (used if log is not defined)

nastran_to_stl Module

defines:
  • stl = nastran_to_stl_filename(bdf_filename, stl_filename, is_binary=False,
    log=None)
  • stl = nastran_to_stl(bdf_filename, stl_filename, is_binary=False,
    log=None, stop_on_failure=False)
pyNastran.converters.nastran.nastran_to_stl.nastran_to_stl(bdf_filename, stl_filename, is_binary=False, log=None, stop_on_failure=False)[source]

Converts a Nastran model to an STL

Parameters:
bdf_filename : varies

str : the path to a BDF input file BDF() : a BDF() model object

stl_filename : str

the output STL path

is_binary : bool; default=False

should the output file be binary

log : Logger()

a Python logging object

stop_on_failure : bool; default=False

should the code stop if an error is encountered

pyNastran.converters.nastran.nastran_to_stl.nastran_to_stl_filename(bdf_filename, stl_filename, is_binary=False, log=None)[source]

Converts a Nastran model to an STL

nastran_to_tecplot Module

defines:
  • tecplot = nastran_to_tecplot(model)
  • tecplot = nastran_to_tecplot_filename(bdf_filename, tecplot_filename, z
    log=None, debug=False)
pyNastran.converters.nastran.nastran_to_tecplot.nastran_to_tecplot(model)[source]

assumes sequential nodes

pyNastran.converters.nastran.nastran_to_tecplot.nastran_to_tecplot_filename(bdf_filename, tecplot_filename, log=None, debug=False)[source]

converts a BDF file to Tecplot format; supports solid elements

nastran_to_ugrid Module

defines:
  • ugrid = nastran_to_ugrid(bdf_filename, ugrid_filename_out=None, properties=None,
    check_shells=True, check_solids=True, log=None)
pyNastran.converters.nastran.nastran_to_ugrid.main()[source]

Converts a Nastran model to UGRID model and renumbers the properties. Also creates a fun3d.mapbc file.

pyNastran.converters.nastran.nastran_to_ugrid.nastran_to_ugrid(bdf_filename, ugrid_filename_out=None, properties=None, check_shells=True, check_solids=True, log=None)[source]

set xref=False

Parameters:
bdf_filename : varies

str : a bdf filename BDF() : a BDF object

ugrid_filename_out : str (default=None -> ???)

the path to the ugrid_filename

properties : Dict[pid_old]=pid_new???

???

check_shells : bool (default=True)

verify that there is at least one shell element

check_solids : bool (default=True)

verify that there is at least one solid element

log : Logger()

a Python logging object

results_helper Module