Loading Other Data Formats

Tecplot Chorus uses Tecplot 360 for examining solution data from selected cases. This visualization tool seamlessly opens native Tecplot-format data files, including .plt (binary data), .szplt (subzone data), .dat (ASCII data), .lay (layout) and .lpk (layout package) files. It also recognizes the nonstandard filename extensions .bin and .tec, used by some solvers, as synonyms for .plt files.

Tecplot 360 also includes a suite of data loader add-ons that can open data files in many other popular CFD formats, including CGNS, EnSight, FEA, FLOW-3D, Fluent, Kiva, and PLOT3D.

Loading these files from inside Tecplot Chorus requires a loader description file that identifies the filename extensions to which it applies and specifies the options required for the loader to successfully load your data files. Loader descriptions are stored in a special directory in your Tecplot Chorus installation folder, namely interop/360/loaderdescriptions.

Some data formats, such as Fluent and PLOT3D, use two physical files per data set, one for the coordinates and one for the rest of the variables. In this case, you must give both files the same tag when adding them to the project so that Tecplot Chorus will know they should be opened together when you view the case’s data.

Loader description files for the following formats are included with Tecplot Chorus.. If necessary, you may modify these description files to set the options you usually use to load your data files.

  • CGNS (.cgns, .adf)

  • PLOT3D g.*, *.g, x.*, *.x, xyz.*, *.xyz, in.*, *.in, q.*, *.q, f.*, *.f, fun.*, *.fun, *.nam)

  • EnSight (.case)

  • TRIX (.trix)

  • OpenFOAM (controldict)

  • Fluent (.cas, .dat as well as gzipped versions of these)

If you need to load another format, one of these files can be used as a template for creating your own loader description. See the Loading Data section of the Tecplot 360 User’s Manual for more information on these formats.

Editing a Loader Description

The CGNS loader description file, cgns.xml, is shown here. This file may be viewed and edited in any text editor, such as Notepad on Windows.

<!DOCTYPE ChorusForeignLoaderDescription>
<ChorusForeignLoaderDescription version="1">
  <TecplotLoader Name="CGNS Loader">
    <StandardSyntaxIdentifier Name="FILELIST_CGNSFILES" DefaultExtension=".cgns" />
    <InstructionTemplate Name="CGNS">
      "STANDARDSYNTAX" "1.0"
      "FILELIST_CGNSFILES" %FILELIST_CGNSFILES%
      "AverageToNodes" "No"
      "AveragingMethod" "Arithmetic"
      "SectionLoad" "SeparateZones"
      "LoadBCs" "Yes"
      "AssignStrandIDs" "Yes"
      "LOADCONVERGENCEHISTORY" "No"
    </InstructionTemplate>
  </TecplotLoader>
</ChorusForeignLoaderDescription>

The section between <InstructionTemplate Name="CGNSstd"> and </InstructionTemplate> defines a macro instruction that invokes the CGNS loader for the specified file (indicated using the placeholder %FILELIST_CGNSFILES%). The easiest way to change this is to record a macro file in Tecplot 360, use the Tecplot 360 dialogs to specify loader options, and extract the READDATASET instruction from the macro using a text editor:

  1. Start Tecplot 360, either by choosing to view a case’s data in a Tecplot Chorus project or directly. To start Tecplot 360 without Tecplot Chorus:

    • In Windows, click the Tecplot 360 shortcut on the Start menu.

    • In Linux, cd /path/to/tecplot360/bin ; ./tec360

  2. In Tecplot 360, choose Scripting → Record Macro to begin recording the macro and specify a name for it and a directory to save it in.

  3. Choose File → Load Data File(s) and load a data file from one of your cases. Be sure to specify any loader options necessary to load the file correctly. This action is recorded to the macro file.

  4. Click the Stop Recording button in the Macro Recorder dialog.

Open the recorded macro file in a text editor and find the $!READDATASET instruction. Beginning with the text "STANDARDSYNTAX", but excluding the text $!READDATASET, copy the entire instruction into the loader description file between the tags <InstructionTemplate Name="CGNSstd"> and </InstructionTemplate>. Do not include the single quotes around the instruction. Also do not include the DATASETREADER line.

Replace the path of the file that appears in the macro instruction with the placeholder text %FILELIST_CGNSFILES%. Tecplot Chorus will replace this with the path of the actual file being loaded when you choose to view or extract a case’s data.

Creating Other Loader Descriptions

A loader description can be used as a template for loading other data formats supported by Tecplot 360. Copy the file and give it a new name. You will need the set of options, specific to each loader, necessary to load one of your typical files in that format.

The easiest way to get this information is to record a macro that loads a single data file as described in the previous section. The body of the $!READDATASET instruction (excluding the single quotes, the $!READDATASET instruction and the DATASETREADER line) should be placed between the <InstructionTemplate Name="…​"> and </InstructionTemplate> tags.

References to the loader name and any filename extensions should be changed as appropriate for the new loader, and the <TecplotLoader Name="…​"> tag should be edited to include the name of the loader as found in the DATASETREADER line of the recorded macro file. Save the new file in the folder interop/360/loaderdescriptions as a plain text file with an .xml extension.

We are interested to hear about what kinds of data files you are using so that we can improve the loader descriptions included with Tecplot Chorus. Please do not hesitate to contact Technical Support if you need help creating your own loader description.

Multiple Instruction Templates

If you frequently load data files of a single type but with varying sets of options, it is possible to include multiple instruction templates in a loader description file. Simply copy the text beginning with <InstructionTemplate> and ending with </InstructionTemplate> and paste it above or below any existing instruction template definition, then change the loader options as desired, either manually or by recording a macro as already described. Change the Name attribute in the <InstructionTemplate> tag to change how this set of options appears in Tecplot Chorus dialogs.

XML Schema

The following are the tags supported in loader description files.

Tag Notes Required

ChorusForeignLoaderDescription

Encloses one or more TecplotLoaders.

Yes

Version=

File version.

No

TecplotLoader

Block containing loader descriptions for a given Tecplot Loader.

Yes

Name=

Official "ADDONID" loader name.

Yes

StandardSyntaxIdentifier

Name of File or Dir list identifier found in the STANDARDSYNTAX string along with the associated default file extension.

Yes

Name=

Name of the standard syntax identifier.

Yes

DefaultExtension=

Default extension for the identifier.

Yes

InstructionTemplate

Custom loader instruction.

Yes

Name=

Name of custom loader instruction.

Yes

(body)

STANDARDSYNTAX instruction string with placeholders for actual files to deliver.

Yes

Alternative Method

Loader description files work only for the CGNS, EnSight, FEA, FLOW-3D, Fluent, Kiva, and PLOT3D loaders. These loaders all use a standard macro syntax that Tecplot Chorus knows about and can generate as needed to load data files. However, an alternative method is available that will work with all loaders, including the loaders just listed as well as all others included with Tecplot 360.

In this method, you create a macro file that contains the instructions necessary to read a single data file. A copy of this macro file is then placed in each folder that contains a non-Tecplot data file. The same macro file can be used for all cases; a copy can be inserted into the appropriate folder as a post-processing step in your solver workflow. This macro file, rather than the actual data file, is then tagged as part of your Tecplot Chorus project. When you view data for a case, instead of loading the data file directly, Tecplot 360 loads and executes the macro, which loads the data file.

For this technique to work, the raw data files must have the same file name in every case. If you have more than one non-Tecplot format data file you wish to load, or if the names vary, you will need to prepare a separate macro file for each.

For example, suppose you have the following folder structure:

./
├── a1/
│   ├── sample_nozzle.g
│   └── sample_nozzle.q
└── a2/
    ├── sample_nozzle.g
    └── sample_nozzle.q

In other words, two case folders, a1 and a2, each containing a pair of PLOT3D files (the .g and .q files). You will create a sample_nozzle.mcr file, a Tecplot macro that loads the PLOT3D files, and deposit a copy in each case folder. The resulting structure will look like this:

./
├── a1/
│   ├── sample_nozzle.g
│   ├── sample_nozzle.mcr
│   └── sample_nozzle.q
└── a2/
    ├── sample_nozzle.g
    ├── sample_nozzle.mcr
    └── sample_nozzle.q

The sample_nozzle.mcr file would be the file tagged in Tecplot Chorus as an auxiliary data file for the case.

Creating the Macro File

Step 1: Record the Macro

  1. Start Tecplot 360, either by choosing to view a case’s data in a Tecplot Chorus project or directly. To start Tecplot 360 without Tecplot Chorus:

    • In Windows, click the Tecplot 360 shortcut on the Start menu.

    • In Linux, cd /path/to/tecplot360/bin ; ./tec360

  2. In Tecplot 360, choose Scripting → Record Macro to begin recording the macro and specify a name for it and a directory to save it in.

  3. Choose File → Load Data File(s) and load a data file from one of your cases. Be sure to specify any loader options necessary to load the file correctly. This action is recorded to the macro file.

  4. Click the Stop Recording button in the Macro Recorder dialog.

If you make a mistake, simply stop recording and start over with a fresh macro file.

Step 2: Edit the Macro

The next step is to edit the macro so that it does not mention specific directory names in any $!READDATASET command(s) it contains. This may be done with any standard text editor, such as Notepad on Windows. Any directory names found in the macro must be replaced with the variable |MACROFILEPATH|. This way, the macro loads the data file from the directory it is placed in, rather than from the location of the data file you opened when recording the macro.

For example, your recorded macro file might contain the following line:

$!READDATASET '"STANDARDSYNTAX" "1.0" "FILELIST_GRIDFILES" "1"
    "/users/joe/myproject/a1/sample_nozzle.g" ...'

(The actual command will likely be much longer, as it will contain specifications of every loader option.)

The text /users/joe/myproject/a1/sample_nozzle.g is the path to the file you loaded. This must be edited so that it looks like this (note the slash after the vertical bar):

$!READDATASET '"STANDARDSYNTAX" "1.0" "FILELIST_GRIDFILES" "1"
    "|MACROFILEPATH|/sample_nozzle.g" ...'

The macro file may contain other references to files, since many data formats use multiple files. Each of these must be edited in a similar fashion so that the macro loads the files from whatever directory the .mcr file is placed in.

Save the .mcr file after making these edits.

Step 3: Copy the Macro File to Each Case Folder

This can be done as a post-processing step after your solver has created a data file, if desired. If you do only a few cases at a time, you may find it easier to just make the copies manually.

Step 4: Tag the Macro File

Now you must tag the macro file in Tecplot Chorus to make it available as a data file. This can be done when the project is initially created (see Creating Projects), or it can be done afterward (see Appending To a Project).

  • If you are using the Delimited Text Reader, add a column to the file that names the .mcr file (the same file name for each case, sample_nozzle.mcr in our example). There is no need to include columns for the actual data files (for example, .g and .q files).

  • If you are using the File Crawler, on the Files to Link page you should specify a pattern that matches only the .mcr file (for example, sample_nozzle.mcr). Do not use any patterns that match the actual data files (.g and .q files in our example).

In either case, specify a tag that represents the file’s contents (such as "Sample Nozzle") so you can easily find it in Tecplot Chorus.

Viewing The Data Files

Once you have set up the macro files properly and tagged them in Tecplot Chorus, you can view these data files in the same way you view any other data file. Tecplot Chorus will tell Tecplot 360 to open the macro file, which will load the data. See Viewing Data for instructions.