Ejemplo n.º 1
0
def cart3d_to_tecplot(cart3d_filename,
                      tecplot_filename,
                      log=None,
                      debug=False):
    """
    Converts Cart3d to Tecplot
    """
    if isinstance(cart3d_filename, Cart3D):
        model = cart3d_filename
    else:
        model = read_cart3d(cart3d_filename, log=log, debug=debug)

    tecplot = Tecplot()
    tecplot.log = model.log
    tecplot.xyz = model.points
    tecplot.tri_elements = model.elements + 1
    tecplot.write_tecplot(tecplot_filename, adjust_nids=False)
    return tecplot
Ejemplo n.º 2
0
def cart3d_to_tecplot(cart3d_filename,
                      tecplot_filename,
                      log=None,
                      debug=False):
    """
    Converts Cart3d to Tecplot
    """
    if isinstance(cart3d_filename, Cart3D):
        model = cart3d_filename
    else:
        model = read_cart3d(cart3d_filename, log=log, debug=debug)

    tecplot = Tecplot()
    tecplot.log = model.log
    zone = Zone(model.log)
    zone.headers_dict['VARIABLES'] = ['X', 'Y', 'Z']
    zone.xyz = model.points
    zone.tri_elements = model.elements + 1
    tecplot.zones = [zone]

    tecplot.write_tecplot(tecplot_filename, adjust_nids=False)
    return tecplot