|
[Sponsors] |
November 30, 2010, 03:41 |
How to read vtk format using fortran code?
|
#1 |
Member
yu
Join Date: Nov 2010
Posts: 39
Rep Power: 16 |
Hello all,
I am trying to write a fortran code to read a vtk file. When I am trying to read the following part 0 0 0 1 0 0 2 0 0 0 1 0 1 1 0 2 1 0 0 0 1 1 0 1 2 0 1 0 1 1 1 1 1 2 1 1 0 1 2 1 1 2 2 1 2 0 1 3 1 1 3 2 1 3 0 1 4 1 1 4 2 1 4 0 1 5 1 1 5 2 1 5 0 1 6 1 1 6 2 1 6 I run into some trouble. Those numbers are x, y, z's, in this order. (0,0,0) (1,0,0) .... and so on. I know how many points that I have 27 this case. What kind of read statement should I have? I had Do i = 1 , nodes Read(11,*) x(i),y(i),z(i) End do I know this is not right since it only read the first three numbers of each row. Any ideas? |
|
December 2, 2010, 07:15 |
|
#2 |
Senior Member
Rami Ben-Zvi
Join Date: Mar 2009
Posts: 155
Rep Power: 17 |
Try
Read(11,*) ( x(i),y(i),z(i), i = 1 , nodes ) |
|
December 11, 2010, 21:18 |
|
#3 |
New Member
Igor
Join Date: Dec 2010
Posts: 3
Rep Power: 16 |
can be:
program ... type xyz real :: x, y, z end type xyz integer, parameter :: N=27 !numbers of point type (xyz), dimansion(N) :: data_num read (....) data_num end program .... You can to use dynamic array. Last edited by raggar; December 11, 2010 at 22:30. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
use GAMBIT then read the coord by fortran solver | A. Chehhat | FLUENT | 1 | June 12, 2008 14:59 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |
what is the format of.txt file for scanf to read | lamlash | FLUENT | 0 | July 17, 2006 19:04 |
grid data to be read by Fortran code | seckin | FLUENT | 0 | April 19, 2003 15:03 |
seeking fortran code for LEE | ahmed m.abdulla | Main CFD Forum | 0 | January 14, 1999 12:16 |