Structured Cell Data Format

Structured Cell Data Format


Overview

Structured cell data denotes data that can be represented using a 1-dimensional , 2-dimensional or 3-dimensional array. Except in the case of an 1-dimensional array, this data type is used in the case of data that can be clearly divided into lattice cells.
With MicroAVS 3.0, functionality was enhanced and now time dependent data and multi-step data can be described.

File Extension

The data file extension is .fld.

Format


Outline

The structured cell data format is consist of Header portion,Data portion, and Coordinates portion as given bellow.
The number of dimensions for the data, size in the direction of each axis, data type etc. are described in the header portion. The source of the data values to be read in would appear in the Data portion, and the source of the coordinates values to be read in would appear in the Coordinates portion.
  
       # AVS field file
       ndim = 3
       dim1 = 40
       dim2 = 20
       dim3 = 30
       nspace = 3
       veclen = 2
       data = float
       field = irregular
       label = temperature  pressure

       variable 1 file=./sample.dat filetype=ascii skip=1 offset=0 stride=2
       variable 2 file=./sample.dat filetype=ascii skip=1 offset=1 stride=2

       coord 1 file=./sample.cod filetype=ascii skip=1 offset=0 stride=3
       coord 2 file=./sample.cod filetype=ascii skip=1 offset=1 stride=3
       coord 3 file=./sample.cod filetype=ascii skip=1 offset=2 stride=3

Header Portion

Different types of information required to define structured cell data is descr\ ibed using the ASCII notation in this header portion. Keywords are used to defi\ ne this information.

# AVS field file
This line is a must at the beginning of the structured cell data file. Further, small letters, capitals and spaces must be defined precisely. Any line beginning with # after the first line will be assumed to be a comment.

ndim = <number>
defines the dimension of the calculation space. This denotes the number of dimensions of the data array itself. Set this value as 1 in the case of scatter data. Note that this value has nothing to do with the coordinate information.

     Example: ndim=2             #this is 2D data

dim1 = <number>
dim2 = <number>
dim3 = <number>

Defines the data size in the direction of each axis. Depending on the value of ndim, this is specified as given below.

     For ndim=1    Set only dim1
     For ndim=2    Set dim1 and dim2
     For ndim=3    Set dim1, dim2 and dim3

nspace = <number>
Sets the dimension of the physical space in which data exists. Consequently, this defines the space in which the data exists and the kind of coordinates it has.

     If X and Y coordinates are defined              nspace = 2
     If X, Y and Z coordinates are defined           nspace = 3

veclen = <number>
Defines the number of data components.

Example: For temperature data only              veclen = 1
         For temperature  and pressure data     veclen = 2
         for temperature, pressure and density  veclen = 3

data = <text>
Specifies the data type of the data components. One of the types given below is set in the <text> portion.

short byte integer float double

Note: If there are multiple data components, it is not possible to set each of these components to be of a different type. The type of all the data components have to be the same.

field = <text>
Specifies the information about the coordinates. Depending on how the coordinate values are to specified, one of the three types given below is selected.

uniform
Refers to a orthogonal uniformly spaced lattice. In this case, there is no need of coordinate information. The coordinate portion of the structured data format becomes redundant and the cell spacing is automatically set to 1.

rectilinear
efers to a orthogonal non-uniformly spaced lattice. In this case, the coordinates are specified in each of the representative axis directions.

irregular
Any kind of structured cell data can be specified. Coordinate values are specified for each point. In the cases of the orthogonal uniformly spaced lattice as well as the orthogonal non-uniformly spaced lattice, if the coordinate values are specified for each point, then this can be considered to be of irregular type.

label = <text> <text> .... (option)
A label is attached to every component. In the case of multiple components, the text strings are separated using spaces. This keyword is an option and is not a must.

Example: For temperature data only             label = temperature
         For temperature and pressure data     label = temperature   pressure

max_ext = x-value [y-value] [z-value].....(option)
min_ext = x-value [y-value] [z-value].....(option)
Specify minimum or maximun values of each coordinates. If you define these keywords in the file header, display advanced 3D axis in the object window. You can see these value is enterd in each modules.

max_val = value [value] [value].....(option)
min_val = value [value] [value].....(option)
Specify minimum or maximun values of each data components. However these value reflect modules, you need to check in the Enabled check box of All data Dialog Box.


Data Portion

The information about the data file is described using the following keywords.

variable n file=<text> filetype=<text> skip=<number> offset=<number> stride=<number> close=<0/1>

variable
A line that starts with this keyword indicates that this information about data .

n
This is a number that distinguishes between the different data components. This is an integer that begins from 1.When the number of data components are 3, the example is as given below:

variable 1 file=C:/tmp/sample filetype=ascii
variable 2 file=C:/tmp/sample filetype=ascii
variable 3 file=C:/tmp/sample filetype=ascii

file
Specifies the name of the file to read.
The filename can be specified in terms of absolute or relative paths. Further, the directory separator / (slash) can also be replaced by the \(backslash).

filetype
The type of the file to be read in is specified as ASCII or binary.

For ASCII: filetype=ascii
For Binary: filetype=binary

skip
Specifies the amount to skipped in the beginning of the file. The meaning of this differs based on whether the file is ASCII or binary.

For ASCII : Defines the number of lines to be skipped in the beginning.
For Binary: Defines the number of bytes to be skipped in the beginning.

If this keyword is not specified, then skip is automatically set to 0.

offset
This can be used only when the file to be read in is ASCII. This keyword is ignored in the case of a binary file. This value specifies the column number from where data is to be read in the row from which the data is read. For example, to read data from the fourth column, offset is specified as 3.
If this keyword is not specified, it is automatically set to 0.

stride
Specifies how much to skip between the data. The meaning of this is different based on whether the file is ASCII or binary.

For ASCII:
specifies the number of variables to be skipped between data. If there is more than one space between data, this is seen as a separator.

For Binary:
stride means stride forward "stride" * the size of the data type (byte,float,double,integer). When there are 3 data components of 1 byte each, then stride is set as 3.

When this keyword is not set, it is automatically assumed that stride = 1.

close
After reading one step, it defines whether or not the current file should be closed before reading in the next step.

If the value is 1, the next step would be read in after closing the file.
If the value is 2, the next step would be read in without closing the file.
In case of close=1;
Since the file will be closed after reading the step, skip, stride descriptions in the next step should be defined from the start.

In case of close=0;
After reading the step, the file will not be closed and the file pointer will be kept. Therefore, if the next step is stored within the same data file, you can designate it from that point relatively.

NOTE 1
In case of reading time, variable, coord from the same data file within the same step, file pointers will be controlled separately, therefore close keyword will take effect individually and will not affect the others.
For example. if time and variable 1 are designating the same data file in all the steps and it's close=0 for all of them, variable 1 always starts reading at the end of variable 1 of three steps back.

NOTE 2
if it's filetype=ascii, close=0 will make the file pointer go to the end of the last line and save, rather than going to the last item of step data. This is to simplify the description of the next step.

Addendum

When setting values in skip, offset and stride, instead of directly specifying numbers, it is possible to specify keywords or simple arithmetical formulae. The keywords that can be used are given below.

ndim nspace veclen dim1 dim2 dim3 byte short int float double

Example: offset=28+(dim1*dim2*dim3*4)


Coordinate Portion

The following keywords are defined for each axis direction.

coord n file=<text> filetype=<text> skip=<number> offset=<number> stride=<number>

coord
A line starting with this keyword is taken as representing information related to coordinates.

n
Is a number used to distinguish different axis directions and is an integer starting with 1. The example given below indicates a case where three coordinate values X, Y and Z are to be defined.

Coord 1 represents the X coordinate, coord 2 the Y coordinate and coord 3 the Z coordinate respectively.

coord 1 file=C:/tmp/sample filetype=ascii
coord 2 file=C:/tmp/sample filetype=ascii
coord 3 file=C:/tmp/sample filetype=ascii

file
This has the same meaning as that in the data portion.

filetype
This has the same meaning as that in the data portion.

skip
This has the same meaning as that in the data portion.

offset
This has the same meaning as that in the data portion.

stride
This has the same meaning as that in the data portion.


Examples of Structured Cell Data Creation

Sample files are located in <directory in which MicroAVS is installed>/ DATA/FIELD/SAMPLES and can be referred to if necessary.

UP © 1999-2008 KGT Inc. All rights reserved.