[Paraview] Plot3D

Evgeniy Shapiro shellinux at gmail.com
Wed May 2 04:25:17 EDT 2007


Example of code which writes plot3d file in question (blocks commented - 
i tried both multi-block and single-block):

      program write_examples

      real x(121,121,21),y(121,121,21),z(121,121,21)
      real u(121,121,21),v(121,121,21),w(121,121,21)
      real vars(121,121,21,5)
      real r,alpha
c
c   create gridpoints for simple example:
      ni=121
      nj=121
      nk=21
      do k=1,nk
        do j=1,nj
          do i=1,ni
            x(i,j,k)=float((i-ni/2))/ni*2.
            y(i,j,k)=float((j-nj/2))/nj*2.
            z(i,j,k)=float((k-1))/nk*10.
            r=exp(-sqrt(x(i,j,k)**2+y(i,j,k)**2))*z(i,j,k)/10.
            alpha=atan(y(i,j,k)/(x(i,j,k)+1.e-6))
            u(i,j,k)=r*sin(alpha)
            v(i,j,k)=-r*cos(alpha)
            w(i,j,k)=0.01
            vars(i,j,k,1)=1.
            vars(i,j,k,2)=u(i,j,k)
            vars(i,j,k,3)=v(i,j,k)
            vars(i,j,k,4)=w(i,j,k)
            vars(i,j,k,5)=1.
          enddo
        enddo
      enddo
      write(*,'('' created simple 3-D grid points/flow'')')
C***********************************************************
C WRITE Plot3D
C open grid file
      OPEN(1,FILE="grid.xyz", form="unformatted", action="write")
      rewind (1)
! write blocks
!      write(1) 1
! write size
      write(1) ni,nj,nk
! write coordinates
      write(1)  (((x(I,J,K),I=1,ni),J=1,nj),K=1,nk),
     &          (((y(I,J,K),I=1,ni),J=1,nj),K=1,nk),
     &          (((z(I,J,K),I=1,ni),J=1,nj),K=1,nk)
      close(1)
      OPEN(1,FILE="grid.q", form="unformatted", action="write")
      rewind (1)
! write blocks
!      write(1) 1
! write size
      write(1) ni,nj,nk
! mach, alpha, re, time
      write(1) r,r,r,r
! write coordinates
      write(1) (((( vars(i,j,k,l), i = 1, ni),
     &   j = 1, nj), k = 1, nk), l = 1, 5 )
      close(1)
      stop
      end program









Berk Geveci wrote:
> Hi,
>
> Can you send me a small file to experiment with?
>
> -berk
>
>
> On 5/1/07, Evgeniy Shapiro <shellinux at gmail.com> wrote:
>> Hello
>>
>> Help me pleeeeeease! I'm using paraview 2.6.0. I am trying to read a
>> plot3D dataset generated by (as per
>> http://www.grc.nasa.gov/WWW/wind/valid/plot3d.html):
>>
>> C open grid file
>>       OPEN(1,FILE="grid.xyz", form="unformatted", action="write")
>>       rewind (1)
>> ! write blocks
>>       write(1) 1
>> ! write size
>>       write(1) ni,nj,nk
>> ! write coordinates
>>       write(1)  (((x(I,J,K),I=1,ni),J=1,nj),K=1,nk),
>>      &          (((y(I,J,K),I=1,ni),J=1,nj),K=1,nk),
>>      &          (((z(I,J,K),I=1,ni),J=1,nj),K=1,nk)
>>       close(1)
>>       OPEN(1,FILE="grid.q", form="unformatted", action="write")
>>       rewind (1)
>> ! write size
>>       write(1) 1
>>       write(1) ni,nj,nk
>>       write(1) r,r,r,r
>> ! write coordinates
>>       write(1) (((( vars(i,j,k,l), i = 1, ni),
>>      &   j = 1, nj), k = 1, nk), l = 1, 5 )
>>       close(1)
>>
>> Which fails. The error message I get is
>>
>>
>> ErrorMessage
>> # Error or warning: There was a VTK Error in file:
>> /home/amy/ParaViewReleaseRoot/ParaView-2.6.0/GUI/Client/vtkPVPLOT3DReaderModule.cxx 
>>
>> (81)
>>  vtkPVPLOT3DReaderModule (0x90c1cf8): Can not read input file. Try
>> changing parameters.
>> ErrorMessage end
>>
>>
>> I have tried reading with "binary on" and "fortran byte count" on/off,
>> multiblock on/off to no avail. Tecplot imports the same dataset without
>> complaints. I ran out of ideas.
>>
>> What am I doing wrong????
>>
>> Evgeniy
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
>



More information about the ParaView mailing list