![]() |
![]() |
![]() |
![]() |
Reading In All Data and Writing Out Time-Dependent Fields
Previous versions of the Read_Field and Read_UCD modules treated data in all input files as single-step data; that is, they read in and then wrote out the data one step at a time. The enhanced versions of these modules, available in the current release of AVS/Express, can read in files containing either standard (single-step) data or time-dependent (multistep) data.
When either of these modules reads in a file that contains time-dependent data, it can optionally read in all of the data at one time and store it in memory. (A toggle button called Store All Steps enables this mode of reading data.) In store-all-steps mode, Read_Field and Read_UCD do not access the input file for each step and can, therefore, write the step data to their output ports in a fast and continuous manner.
As a further enhancement, the Read_Field and Read_UCD modules output step data that was read in in store-all-steps mode as a time-dependent field. Each module now contains an output port that can handle time-dependent fields, resulting in two field output ports for each module:
The field output port handles the standard (single-step) field.
The time_field output port handles the time-dependent (multistep) field.
Note that Read_Field and Read_UCD output a time-dependent field only if the Store All Steps button has been turned on and the step data has, therefore, been read in all at once.
Note that while processing time-dependent data in store-all-steps mode saves time, it uses more memory. This may be a problem when you process files that contain large quantities of time-dependent data and/or many steps. To determine whether you should use store-all-steps mode, proceed as described in the following process:
1. Input to Read_xxx the file that contains time-dependent data. The module adds to its user interface a set of objects that include the Store All Steps button and a Total Steps field, with the Store All Steps button turned off. The module now reads in the data corresponding to the first step and outputs it to the field port as the appropriate Fld structure.
2. Check the number of steps (displayed in Total Steps) and determine whether there is enough memory to store all of them. If there is, turn on Store All Steps, otherwise leave it turned off.
If you turn on Store All Steps, all of the data (including the first step) is read in and stored in memory, then written to the time_field port as a time-dependent Fld structure, otherwise it is processed one step at a time and written to the field port as the appropriate Fld structure.
3. If the amount of memory used to store the data read in with Store All Steps is so large that it affects other operations, turn it off.
If you turn off Store All Steps:
The module frees the memory used to store all of the step data and deletes the time-dependent data from the time_field output port.
The data corresponding to the first step is output to the field port.
NOTE: If you turn off the Store All Steps button, the button becomes invisible. You cannot turn it on again except by specifying the file to the Read_xxx module again.
Additional considerations in the use of this module are as follows:
Each step in a field or UCD file can store time and comments. When step data is output to the time_field port, the time values are output in its time subobject.
If the time values are input as numbers, they are set as is in the time subobject.
If the time values are not input as numbers, they are specified in the time subobject as consecutive integers starting with 0.
In field data of the rectilinear type, the coordinates change from step to step. You cannot process data of this type in store-all-steps mode.
In the UCD data, the number and type of the cells may differ from step to step. If this is the case, you cannot process the data in store-all-steps mode.
Renderable object data is output to the out_obj and title_obj ports only in the following cases:
You input a file containing standard data (out_obj port only).
You input a file containing time-dependent data but do not process it in store-all-steps mode (out_obj and title_obj ports).
Renderable object data is not output to these ports if you input a file containing time-dependent data and process it in store-all-steps mode.
The Current step, Step Forward, Step Backward, One-time, Continuous, and Bounce parameters are relevant only when you input a file containing time-dependent data and do not process it in store-all-steps mode. These parameters control how the step data is written to the field, out_obj, and title_obj ports.
When you input a file that contains time-dependent data, the module also adds these objects to its user interface: Current Step, Step Forward, Step Backward, One-time, Continuous, and Bounce. These objects, which are relevant only if you do not process the time-dependent data in store-all-steps mode, control how the step data is written to the field, out_obj, and title_obj ports.
The following example illustrates a network that outputs time-dependent data to the time_field output port.
![]()
Formatting Changes in Time-Dependent Files
In previous AVS/Express releases, when you used the time-dependent (multistep) format for field files, you were required to include in the ASCII file header a file keyword that specified the name of the file containing the data. As of the current release, you can opt to omit this keyword, to indicate that the ASCII file header and data are in the same field file. In this case, you must press Ctrl-L (^L) twice after the ASCII file header and start the data portion of the file on the next line.
The following example of a field file that contains time-dependent data uses this new feature. Please note the absence of the file keyword, and please also observe the specification of the skip keyword.
# AVS field file
#
nstep=3
ndim=2
dim1=4
dim2=2
nspace=3
veclen=1
data=float
field=irregular
time_filetype=ascii_skip=1_close=0
variable 1 filetype=ascii skip=2 offset=0 stride=4 close=0
coord___ 1 filetype=ascii skip=2 offset=1 stride=4 close=0
coord___ 2 filetype=ascii skip=2 offset=2 stride=4 close=0
coord___ 3 filetype=ascii skip=2 offset=3 stride=4 close=0
EOT
DO
time filetype=ascii skip=8 close=0
variable 1 filetype=ascii skip=1 offset=0 stride=4 close=0
coord___ 1 filetype=ascii skip=1 offset=1 stride=4 close=0
coord___ 2 filetype=ascii skip=1 offset=2 stride=4 close=0
coord___ 3 filetype=ascii skip=1 offset=3 stride=4 close=0
EOT
ENDDO
^L^L
data___ X__ Y__ Z
1
5.0__ -2.0 -1.0 0.0
10.0_ -1.0 -1.0 0.0
20.0_ _0.0 -1.0 0.0
25.0_ _1.0 -1.0 0.0
30.0_ -2.0 0.0 0.0
40.0_ -1.0 _0.0 0.0
50.0_ _0.0 _0.0 0.0
60.0_ _2.0 _0.0 0.0
2
5.0__ -2.0 -1.0 0.0
10.0_ -1.0 -1.0 0.0
20.0_ _0.0 -1.0 0.0
25.0_ _1.0 -1.0 0.0
30.0_ -2.0 0.0 0.0
40.0_ -1.0 0.0 0.0
50.0_ _0.0 0.0 0.0
60.0_ _2.0 0.0 0.0
3
5.0__ -2.0 -1.0 0.0
10.0_ -1.0 -1.0 0.0
20.0_ _0.0 -1.0 0.0
50.0_ _2.0 -1.0 0.0
35.0_ -2.0 0.0 0.0
45.0_ -1.0 0.0 0.0
55.0_ _0.0 0.0 0.0
95.0_ _3.0 0.0 0.0
![]() |
![]() |
![]() |
![]() |