Separate grid and solution files -> zone dimension mismat

Creating Tecplot binary data files

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

Posts: 2
Joined: Thu Jan 03, 2013 1:26 am
Location: Germany

Separate grid and solution files -> zone dimension mismat

Postby eciman » Fri Jan 04, 2013 5:04 am

Hi everybody,

when trying to load the grid and solution file, generated with the appended Fortran code, into Tecplot, i receive the following error message:

"The zone dimensions for zone 1 in the solution file .../Solution.plt do not match the dimensions of that zone in the grid file ...Gridfile.plt"

Can it give problems if i want the grid data to be node-centered while the solution data are cell-centered? Any help would be kindly appreciated.

With best regards,

Code: Select all

program test

  implicit none
  include 'tecio.f90'
  integer            :: i, j, k, nodes, centers
  integer,parameter         :: ni=100, nj=100, nk=60
  real*4, dimension(0:ni,0:nj,0:nk)   :: x, y, z
  real*4, dimension(ni,nj,nk)      :: p
  integer,parameter         :: Debug=1            ! 1=debugger messages will be prompted by default writing unit
  integer,dimension(3),parameter   :: ValueLocation_grid = (/ 1, 1, 1 /)    ! 0=cell-centered, 1=nodal
  integer,dimension(1),parameter   :: ValueLocation_solution = (/ 0 /)    ! 0=cell-centered, 1=nodal
  integer            :: FileType_grid = 1          ! 0=Full, 1=Grid, 2=Solution
  integer            :: FileType_solution = 1       ! 0=Full, 1=Grid, 2=Solution
  real*8, parameter         :: SolTime = 1d0
! Create grid
  do i=0,ni
    do j=0,nj
      do k=0,nk
   x(i,j,k) = i
   y(i,j,k) = j
   z(i,j,k) = k

! Create data
  do i=1,ni
    do j=1,nj
      do k=1,nk
   p(i,j,k) = i+j+k
! Calculate number of nodes and centers
  nodes = (ni+1)*(nj+1)*(nk+1)
  centers = ni*nj*nk
! Open the gridfile
  i = TecIni112('Project 1'//char(0),'x y z'//char(0),'Grid.plt'//char(0),'.'//char(0),FileType_grid,Debug,0)

! Write grid information
  i = TecZne112('Zone 1'//char(0),0,ni+1,nj+1,nk+1,0,0,0,SolTime,0,0,1,0,0,0,0,0,%val(0),ValueLocation_grid,%val(0),0)
  i   = TecDat112(nodes,x,0)
  i   = TecDat112(nodes,y,0)
  i   = TecDat112(nodes,z,0)
! Close gridfile
  i = TecEnd112()

! Open solution file
  i = TecIni112('Project 1'//char(0),'p'//char(0),'Solution.plt'//char(0),'.'//char(0),FileType_solution,Debug,0)

! Write first dataset
  i = TecZne112('Zone 1'//char(0),0,ni+1,nj+1,nk+1,0,0,0,SolTime,0,0,1,0,0,0,0,0,%val(0),ValueLocation_solution,%val(0),0)
  i = TecDat112(centers,p,0)
! Close solution file
  i = TecEnd112()
end program test

Chris Idso
Jedi Master
Posts: 249
Joined: Mon Jan 15, 2007 10:07 am
Location: Bellevue, WA

Re: Separate grid and solution files -> zone dimension mi

Postby Chris Idso » Tue Jan 08, 2013 10:44 am

Hi Eric,

Thank you for providing your code. It looks like there is a problem in yoru second call to TECINI. Your FileType_Solution variable is set to 1 at the top of your program, but 1 is for Grid files which is not what you need when opening/creating the Solution file. Perhaps setting it to 2 (for Solution Files) would help.

Christopher Idso

Tech Support Lead
Tecplot, Inc

Posts: 2
Joined: Thu Jan 03, 2013 1:26 am
Location: Germany

Re: Separate grid and solution files -> zone dimension mi

Postby eciman » Wed Jan 09, 2013 12:42 am

That helped. Sometimes the solution can be so simple.

Thank you!

Return to “TecIO Library”

Who is online

Users browsing this forum: No registered users and 2 guests