Skip to content

Write Tecplot routines should only write real parts of the data #54

@anilyil

Description

@anilyil

Description

If a curve coef array is complex valued, the writeTecplot (e.g. https://github.com/mdolab/pyspline/blob/main/pyspline/pyCurve.py#L822-L846) method will write the data as is in complex form. I am not 100% sure if this is the case but at some point I may have run into this issue and I don't have time to check now. It's not a critical issue at all, so just leaving the issue here to keep track. Ultimately, we should only use the real parts of the data when writing to Tecplot here:

def writeTecplot1D(handle, name, data, solutionTime=None):
"""A Generic function to write a 1D data zone to a tecplot file.
Parameters
----------
handle : file handle
Open file handle
name : str
Name of the zone to use
data : array of size (N, ndim)
1D array of data to write to file
SolutionTime : float
Solution time to write to the file. This could be a fictitious time to
make visualization easier in tecplot.
"""
nx = data.shape[0]
ndim = data.shape[1]
handle.write('Zone T="%s" I=%d\n' % (name, nx))
if solutionTime is not None:
handle.write("SOLUTIONTIME=%f\n" % (solutionTime))
handle.write("DATAPACKING=POINT\n")
for i in range(nx):
for idim in range(ndim):
handle.write("%f " % (data[i, idim]))
handle.write("\n")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions