Contents Previous Next Subchapters

Transferring Volume Data from Tecplot to O-Matrix
Syntax X = tpget3D(variablezoneplaneplaneNumber)
See Also tpget , tpput3D , tpdims , tpplottype , tpxyzaxes , tpdataset

Description
Transfers planes of a Tecplot 3D ordered data set to O-Matrix. The current frame must contain a data set with data of type Double or Float. The argument variable must be an integer scalar that specifies the variable number to retrieve. The argument zone must be an integer scalar that specifies the zone number to retrieve. The argument plane must equal "I", "J", or "K" and specifies the desired plane to retrieve. The argument planeNumber is the desired plane number for the specified plane. The returned value X is a double or float precision valued matrix.

Examples

Retrieving Volume Data
If you enter,
   clear
   tpopen([OM_INSTALL,"\example\tecplot\astrojet.lpk"])
Tecplot will open the astrojet.lpk sample file from the distribution which contains a 3D volume with IMax = 40, JMax = 40, and KMax = 9. Your display will now look like
If you continue by entering
   I20 = tpget3D(tpvarnum("/dset"), 1, "I", 20)
   tpframe("IPlane = 20 Contour")
   tpcontour(I20)
   tpxaxis(1, 9)
   tpyaxis(0, 40)
O-Matrix will retrieve the data for I plane number 20 for variable /dset. This result is then plotted as a contour in a new frame and your display will now look like
This result may also be obtained by explicitly retrieving and contouring with the spatial variables from the original volume. If you enter,
   tpopen([OM_INSTALL,"\example\tecplot\astrojet.lpk"])
   I20 = tpget3D(tpvarnum("/dset"), 1, "I", 20)
   ZI20 = tpget3D(tpvarnum("Z"), 1, "I", 20)
   YI20 = tpget3D(tpvarnum("Y"), 1, "I", 20)
   tpframe("With Variables")
   tpcontour(I20, ZI20, YI20)
Tecplot will create the contour presented above.

Modifying Volume Data
Use of the tpput3D function with tpget3D enables various data altering and numerical analysis of Tecplot data sets. If you enter,
   clear
   tpopen([OM_INSTALL,"\example\tecplot\FluidVolume.lpk"])
Tecplot will open the FluidVolume.lpk sample file from the distribution and create the following display
If you continue by entering the following, O-Matrix will retrieve each J plane of the variable RHO-V from the sample data and replace each plane that contains any values less than the threshold value of -45 with a constant valued plane of -45.
   [I,J,K] = tpdims(1)
   for j = 1 to J begin
      P = tpget3D(4,1,"J", j)
      if( any(P < -45) ) then begin
         P = fill(-45,I,K)
         tpput3D(P,4,1,"J",j)
      end
   end
Organizing Volume Data
The tpget3D and tpput3D functions provide flexible and automated techniques for re-arranging, or changing the form of Tecplot data sets. If you enter,
   clear
   tpopen([OM_INSTALL,"\example\tecplot\FluidVolume.lpk"])
Tecplot will load the FluidVolume.lpk sample file which contains 1 zone and 5 variables with IMax = 9, JMax = 12, and KMax = 11. The following sample will create 11 new zones with IMax = 9, JMax = 12 and KMax = 1 with the same 5 variables, each containing a single K plane from the original zone.
   [nZones,nVars] = tpdims()
   [I,J,K] = tpdims(1)
   for k = 1 to K begin
      zNum = tpaddzone(I,J,1,["KPlane:",ntoa(k)])
      for v = 1 to nVars begin
         P = tpget3D(v,1,"K", k)
         tpput(P,v,zNum)
      end
   end
The revised data set structure can be reviewed in the Tecplot Zone Style dialog