[Gmsh] Load structured field: problem with file format

Florian Wellmann flohorovicic at gmail.com
Thu Nov 4 11:24:32 CET 2010


Hi there,

I am trying to load data into a "Structured Field", both in a script

Field[4] = Structured;
Field[4].FileName = "field_test.fld";
Field[4].TextFormat = 1;

and with the GUI. I am getting the error message:

Error   : Field 4 : error reading file field_test.fld

I couldn't find any example on the web (and only an older, unanswered
post) about the correct format. The description is (help file):

***** begin help *******

Structured
Linearly interpolate between data provided on a 3D rectangular
structured grid. The format of the input file is :
Ox Oy Oz
Dx Dy Dz
nx ny nz
v(0,0,0) v(0,0,1) v(0,0,2) ...
v(0,1,0) v(0,1,1) v(0,1,2) ...
v(0,2,0) v(0,2,1) v(0,2,2) ...
... ... ...
v(1,0,0) ... ...
where O are the coordinates of the first node, D are the distances
between nodes in each direction, n are the numbers of nodes in each
directions, and v are the values on each nodes.
Options:
FileName
Name of the input file
type: path
default value: ""

TextFormat
True for ASCII input files, false for binary files (4 bite signed
integers for n, double precision floating points for v, D and O)
type: boolean
default value: 0

******* end help *****

My input file looks like:

******* begin input file ******

0 0 0
10 10 1
3 3 2
1 1
1 1
1 1
4 1
5 1
2 2
2 3
3 4
4 3
5 2
1 1
4 1
5 1
2 2
2 3
3 4
4 3
5 2

******* end input file ******

I am thankful for any ideas or, even better, a working example.

Cheers,

      --- Florian ---