Home | Forum Index | Log in | Register | Profile
 
Forum
  Search  
  Watched Topics  
  Memberlist  
  Usergroups  
  RSS feed  
  Digests  
  FAQ  
  Tecplot Data Format       (TecIO Library)
  Add-ons  
  Python  
User
 Log in 
 Register 
 Profile 

 
 

Tecplot Add-on: Plot3D <--> Tecplot converter

This user-contributed add-on is unsupported. Please use forums for questions and comments.

(Please let jim know if you have an add-on you'd like to share or link to.)

This program converts Plot3D and Tecplot file formats in either direction (subject to limitations). Structured multiblock grids in 3-space with optional function files are assumed. File names are prompted for and standard file extensions (e.g., .g and .f for Plot3D, .dat and .plt for Tecplot) are assumed.

Blocks are processed one at a time.

As this may be useful for those interested in writing a Tecplot format reader/writer, information on the utilities provided for applications is listed below.
  • Written by: David Saunders, ELORET Corp./NASA Ames Research Ctr
  • Compatible with: Tecplot 360
  • Macros added: none
  • Known limitations:
    • Limited to 2- and 3-D structured multizone data. Support for reading unformatted data is not implemented.
    • This version looks for an optional p3d2tec.inp.2 file if Tecplot output is implied. This should contain the desired variable names, delimited by double quotes ("). For example:
      "x, m"
      "y, m"
      "z, m"
      "Cp"
      "qw, W/cm^2"
      If the ancillary file is not present, function names default to "function 1" "function 2" etc.
Instructions
  1. Download the source and compile on your system.
  2. run p3d2tec
Downloads
PlatformGet thisAnd do this...
N/A p3d2tec.zipUnpack and compile. If you'd like to supply us with the compiled binary, I'll post it here.


The two I/O packages employed by p3d2tec might benefit other applications reading or writing Tecplot and/or Plot3D data. Here are the utilities provided for applications:

   public :: Tecplot_read       ! Reads  an entire structured Tecplot file
   public :: Tecplot_write      ! Writes an entire structured Tecplot file
   public :: Tec_header_read    ! Reads  Tecplot file header records
   public :: Tec_header_write   ! Writes Tecplot file header records
   public :: Tec_block_allocate ! Allocates the array fields for one block or zone of a Tecplot file
   public :: Tec_block_read     ! Reads  one block of a structured Tecplot file
   public :: Tec_block_write    ! Writes one block of a structured Tecplot file
   public :: clone_header       ! Derives one dataset header from another
   public :: clone_zone         ! Derives one zone (block) from another and allocates array fields
   public :: deallocate_header  ! Deallocates any dataset auxiliaries in the given grid header
   public :: deallocate_blocks  ! Deallocates all array fields of the indicated blocks of a grid
To help understand these utilities, you should know it uses two derived data types as follows (at the top of the Tecplot_io.f90 file).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!  Module prompted by Tecplot 360 dataset auxiliaries.  Storing them with block 1 (only) was attempted !
!  but is not a good idea.  The dataset file name, title, and variable names, etc., belong here too.   !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   module grid_header_structure
     type grid_header
        character          :: filename * 80           ! Name of file if the dataset is to be read or written
        logical            :: formatted               ! T | F for ASCII | binary
        integer            :: ndim                    ! 2 | 3 for 2D | 3D data (x and y only, or x, y, and z)
        integer            :: numq                    ! # additional variables beyond ndim; numq >= 0
        integer            :: nblocks                 ! # blocks in dataset (not always known?)
        integer            :: datapacking             ! Same for all zones;  0 => POINT; 1 => BLOCK (efficient)
        character          :: title * 80              ! Dataset title
        character, pointer :: varname (:) * 32        ! Variable names; embedded blanks are permitted; same length as in 
                                                      !    Tecplot_io
        integer            :: ndatasetaux             ! # auxiliary data strings associated with dataset; ndatasetaux >= 0
        character, pointer :: datasetauxname (:) * 32 ! Names of dataset auxiliary items, if any (no embedded blanks)
        character, pointer :: datasetauxvalue(:) * 32 ! Corresponding values (excluding leading and trailing double quotes)
     end type grid_header

   end module grid_header_structure

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!  Module for a structured grid block or zone with associated flow field variables and a zone name   !
!  (Tecplot_io_module version).  This version is a superset of that originally used with the xyzq_io !
!  package, and is intended to be compatible with that package.  If both packages are used by an     !
!  application, this version of the module is the one that should be compiled.                       !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   module grid_block_structure

     type grid_type
        integer            :: nzoneheaderlines        ! # lines in zone header, to facilitate reading zones after 
                                                      !    counting them
        character          :: zone_title * 32         ! Zone/block title; embedded blanks are permitted; same 
                                                      !    length as in Tecplot_io
        integer            :: nzoneaux                ! # auxiliary data strings associated with zone; nzoneaux >= 0
        character, pointer :: zoneauxname (:) * 32    ! Names of zone auxiliary items, if any (no embedded blanks)
        character, pointer :: zoneauxvalue(:) * 32    ! Corresponding values (excluding leading and trailing double quotes)
        real               :: solutiontime            ! Time (or some other useful real number) associated with zone
        integer            :: ni                      ! # points in i direction
        integer            :: nj                      ! # points in j direction
        integer            :: nk                      ! # points in k direction
        integer            :: mi                      ! # dependent variables in i direction
        integer            :: mj                      ! # dependent variables in j direction
        integer            :: mk                      ! # dependent variables in k direction
        real               :: xmin, xmax              ! Data range for the grid block in the x direction
        real               :: ymin, ymax              !     ... and the y direction ...
        real               :: zmin, zmax              !     ... and the z direction
        real, dimension(:,:,:),   pointer :: x,y,z    ! Grid coordinates
        real, dimension(:,:,:,:), pointer :: q        ! Dependent variables
     end type grid_type

   end module grid_block_structure
If you haven't already, take a minute to REGISTER for the Tecplot Talk forum. click here to register
The complete archives of the original Tecplot Talk email discussion group are available online. click here to view the archives
Most Recent Posts
EPS (vector) export and dashed...
original difference by rotatio...
Re: contour problem...
Re: contour problem...
Re: saving layouts containing ...


Powered by phpBB © 2001, 2005 phpBB Group
 
CONTOURS online newsletter   
   ©2006-2007 Tecplot, Inc. All rights reserved.  Privacy Policy turndown