cart3d Package

cart3d Module

Inheritance diagram of pyNastran.converters.cart3d.cart3d
Defines:
  • Cart3D(log=None, debug=False)
    • read_cart3d(self, infilename, result_names=None)
    • write_cart3d(self, outfilename, is_binary=False, float_fmt=’%6.7f’)
    • flip_model()
    • make_mirror_model(self, nodes, elements, regions, loads, axis=’y’, tol=0.000001)
    • make_half_model(self, axis=’y’, remap_nodes=True)
    • get_free_edges(self, elements)
    • get_area(self)
    • get_normals(self)
    • get_normals_at_nodes(self, cnormals)
  • comp2tri(in_filenames, out_filename,
    is_binary=False, float_fmt=’%6.7f’)
class pyNastran.converters.cart3d.cart3d.Cart3D(log=None, debug=False)[source]

Bases: pyNastran.converters.cart3d.cart3d.Cart3dIO

Cart3d interface class

flip_model(self)[source]

flip the model about the y-axis

get_area(self)[source]

Gets the element area

Returns:
area : (n, 3) ndarray

the element areas

get_free_edges(self, elements)[source]

Cart3d must be a closed model with each edge shared by 2 elements The free edges indicate the problematic areas.

Returns:
free edges : (nedges, 2) int ndarray

the free edge node ids

get_max(self, points, i)[source]
get_min(self, points, i)[source]
get_normals(self)[source]

Gets the centroidal normals

Returns:
cnormals : (n, 3) ndarray

normalized centroidal normal vectors

get_normals_at_nodes(self, cnormals)[source]

Gets the nodal normals

Parameters:
cnormals : (n, 3) ndarray

normalized centroidal normal vectors

Returns:
nnormals : (n, 3) ndarray

normalized nodal normal vectors

is_outward_normals = True
is_structured = False
make_half_model(self, axis='y', remap_nodes=True)[source]

Makes a half model from a full model

Notes

Cp is really loads[‘Cp’] and was meant for loads analysis only

make_mirror_model(self, nodes, elements, regions, loads, axis='y', tol=1e-06)[source]

Makes a full cart3d model about the given axis.

Parameters:
nodes : (nnodes, 3) ndarray

the nodes

elements : (nelements, 3) ndarray

the elmements

regions : (nelements) ndarray

the regions

loads : dict[str] = (nnodes) ndarray

not supported

axis : str; {“x”, “y”, “z”, “-x”, “-y”, “-z”}

a string of the axis

tol : float; default=0.000001

the tolerance for the centerline points

model_type = 'cart3d'
read_cart3d(self, infilename, result_names=None)[source]

extracts the points, elements, and Cp

write_cart3d(self, outfilename, is_binary=False, float_fmt='%6.7f')[source]

writes a cart3d file

class pyNastran.converters.cart3d.cart3d.Cart3dIO(log=None, debug=False)[source]

Bases: object

Cart3d IO class

nelements

get the number of elements

nnodes

alternate way to access number of points

nodes

alternate way to access the points

npoints

get the number of points

nresults

get the number of results

show(self, n, types='ifs', endian=None)[source]
show_data(self, data, types='ifs', endian=None)[source]
show_ndata(self, n, types='ifs')[source]
pyNastran.converters.cart3d.cart3d.comp2tri(in_filenames, out_filename, is_binary=False, float_fmt='%6.7f', log=None, debug=False)[source]

Combines multiple Cart3d files (binary or ascii) into a single file.

Parameters:
in_filenames : List[str]

list of filenames

out_filename : str

output filename

is_binary : bool; default=False

is the output file binary

float_fmt : str; default=’%6.7f’

the format string to use for ascii writing

Notes

assumes loads is None

pyNastran.converters.cart3d.cart3d.convert_to_float(svalues)[source]

Takes a list of strings and converts them to floats.

pyNastran.converters.cart3d.cart3d.read_cart3d(cart3d_filename, log=None, debug=False, result_names=None)[source]

loads a Cart3D file

cart3d_result Module

Inheritance diagram of pyNastran.converters.cart3d.cart3d_result
defines:
  • Cart3dGeometry
class pyNastran.converters.cart3d.cart3d_result.Cart3dGeometry(subcase_id, labels, nodes, elements, regions, area, cnormals, colormap='jet', uname='Cart3dGeometry')[source]

Bases: pyNastran.gui.gui_objects.gui_result.GuiResultCommon

Stores the cart3d results.

get_data_format(self, i, name)[source]
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_title(self, i, name)[source]
get_header(self, i, name)[source]
header : str
the sidebar word
get_location(self, i, name)[source]
get_methods(self, i)[source]
get_min_max(self, i, name)[source]
get_nlabels_labelsize_ncolors_colormap(self, i, name)[source]
get_result(self, i, name)[source]
get_scalar(self, i, name)[source]
get_title(self, i, name)[source]
get_vector_size(self, i, name)[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_title(self, i, name, title)[source]
class pyNastran.converters.cart3d.cart3d_result.Cart3dResult(subcase_id, labels, loads, colormap='jet', uname='Cart3dResult')[source]

Bases: pyNastran.gui.gui_objects.gui_result.GuiResultCommon

is this used???

get_data_format(self, i, name)[source]
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_title(self, i, name)[source]
get_location(self, i, name)[source]
get_methods(self, i)[source]
get_min_max(self, i, name)[source]
get_nlabels_labelsize_ncolors_colormap(self, i, name)[source]
get_result(self, i, method)[source]
get_scalar(self, i, method)[source]
get_title(self, i, name)[source]
get_vector_size(self, i, name)[source]
set_data_format(self, i, name, data_format)[source]
set_min_max(self, i, name, min_value, max_value)[source]
set_title(self, i, name, title)[source]

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 Nastran format.

Parameters:
cart3d_filename : str

path to the input Cart3D file

bdf_filename : str

path to the output BDF file

log : log / None

log : a logger object None : a log will be defined

debug : bool

True/False (used if log is not defined)

Examples

>>> cart3d_filename = 'threePlugs.tri'
>>> bdf_filename = 'threePlugs.bdf'
>>> cart3d_to_nastran_filename(cart3d_filename, bdf_filename)
pyNastran.converters.cart3d.cart3d_to_nastran.cart3d_to_nastran_model(cart3d_filename, log=None, debug=False)[source]

Converts a Cart3D file to Nastran format and returns a BDF() object.

Parameters:
cart3d_filename : str

path to the input Cart3D file

log : log / None

log : a logger object None : a log will be defined

debug : bool

True/False (used if log is not defined)

Returns:
bdf_model : BDF

BDF() model object

cart3d_to_stl Module

defines:
  • stl = cart3d_to_stl(cart3d, stl_filename=None, is_binary=False, log=None, debug=False)
  • stl = cart3d_to_stl_filename(cart3d_filename, stl_filename=None, is_binary=False, log=None, debug=False)
pyNastran.converters.cart3d.cart3d_to_stl.cart3d_to_stl(cart3d, stl_filename=None, is_binary=False, log=None, debug=False)[source]

Converts a Cart3D object to STL format.

Parameters:
cart3d : Cart3D()

a Cart3D object

stl_filename : str; default=None

path to the output STL file (or None to skip)

log : log

a logger object (or None)

debug : bool; default=False

True/False (used if log is not defined)

Returns:
stl : STL()

an STL object

Todo

this seems to be broken… ..

pyNastran.converters.cart3d.cart3d_to_stl.cart3d_to_stl_filename(cart3d_filename, stl_filename=None, is_binary=False, log=None, debug=False)[source]

Converts a Cart3D file to STL format.

Parameters:
cart3d_filename : str

path to the input Cart3D file

stl_filename : str; default=None

path to the output STL file (or None to skip

is_binary : bool; default=False

writes the stl in binary

log : log

a logger object (or None)

debug : bool; default=False

True/False (used if log is not defined)

Returns:
stl : STL()

an STL object

cart3d_to_tecplot Module

pyNastran.converters.cart3d.cart3d_to_tecplot.cart3d_to_tecplot(cart3d_filename, tecplot_filename, log=None, debug=False)[source]

Converts Cart3d to Tecplot

input_c3d_reader Module

Inheritance diagram of pyNastran.converters.cart3d.input_c3d_reader
class pyNastran.converters.cart3d.input_c3d_reader.InputC3dReader(log=None, debug=False)[source]

Bases: object

read_input_c3d(self, input_c3d_filename, stack=True)[source]

reads the input.c3d file

pyNastran.converters.cart3d.input_c3d_reader.read_input_c3d(input_c3d_filename, log=None, debug=False, stack=True)[source]

reads the input.c3d file

>>> input_c3d_filename = 'bJet/input.c3d'
>>> nodes, elements = read_input_c3d(input_c3d_filename)

input_cntl_reader Module

Inheritance diagram of pyNastran.converters.cart3d.input_cntl_reader
class pyNastran.converters.cart3d.input_cntl_reader.InputCntlReader(log=None, debug=False)[source]

Bases: object

get_boundary_conditions(self)[source]
get_flow_conditions(self)[source]
get_post_processing(self)[source]
read_input_cntl(self, input_cntl_filename)[source]
pyNastran.converters.cart3d.input_cntl_reader.main()[source]
pyNastran.converters.cart3d.input_cntl_reader.read_input_cntl(input_cntl_filename, log=None, debug=False)[source]