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()[source]

flip the model about the y-axis

get_area()[source]

Gets the element area

Returns
area(n, 3) ndarray

the element areas

get_free_edges(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_normals()[source]

Gets the centroidal normals

Returns
cnormals(n, 3) ndarray

normalized centroidal normal vectors

get_normals_at_nodes(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(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(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

loadsdict[str] = (nnodes) ndarray

not supported

axisstr; {“x”, “y”, “z”, “-x”, “-y”, “-z”}

a string of the axis

tolfloat; default=0.000001

the tolerance for the centerline points

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

extracts the points, elements, and Cp

write_cart3d(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

property nelements

get the number of elements

property nnodes

alternate way to access number of points

property nodes

alternate way to access the points

property npoints

get the number of points

property nresults

get the number of results

show(n, types='ifs', endian=None)[source]
show_data(data, types='ifs', endian=None)[source]
show_ndata(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_filenamesList[str]

list of filenames

out_filenamestr

output filename

is_binarybool; default=False

is the output file binary

float_fmtstr; 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(i, name)[source]
get_default_data_format(i, name)[source]
get_default_min_max(i, name)[source]
get_default_nlabels_labelsize_ncolors_colormap(i, name)[source]
get_default_title(i, name)[source]
get_header(i, name)[source]
headerstr

the sidebar word

get_location(i, name)[source]
get_methods(i)[source]
get_min_max(i, name)[source]
get_nlabels_labelsize_ncolors_colormap(i, name)[source]
get_result(i, name)[source]
get_scalar(i, name)[source]
get_title(i, name)[source]
get_vector_size(i, name)[source]
set_data_format(i, name, data_format)[source]
set_min_max(i, name, min_value, max_value)[source]
set_nlabels_labelsize_ncolors_colormap(i, name, nlabels, labelsize, ncolors, colormap)[source]
set_title(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_filenamestr

path to the input Cart3D file

bdf_filenamestr

path to the output BDF file

loglog / None

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

debugbool

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_filenamestr

path to the input Cart3D file

loglog / None

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

debugbool

True/False (used if log is not defined)

Returns
bdf_modelBDF

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
cart3dCart3D()

a Cart3D object

stl_filenamestr; default=None

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

loglog

a logger object (or None)

debugbool; default=False

True/False (used if log is not defined)

Returns
stlSTL()

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_filenamestr

path to the input Cart3D file

stl_filenamestr; default=None

path to the output STL file (or None to skip

is_binarybool; default=False

writes the stl in binary

loglog

a logger object (or None)

debugbool; default=False

True/False (used if log is not defined)

Returns
stlSTL()

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(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()[source]
get_flow_conditions()[source]
get_post_processing()[source]
read_input_cntl(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]