1.5. Input file, data part, introduction

Data items in the data part are used to control the calculation, select required output, give dof’s initial values, etc.. Note that an end_data record is needed.

data_item index data_values
...
data_item index data_values
end_data

Consider the following example

element 0 -tria3 0 1 2
element 1 -tria3 1 2 3
node 0 0. 0.
node 1 1. 0.
node 2 0. 1.
node 3 1. 1.
...
end_data

Note that the data items element and node are indexed. In fact most data items need to be indexed. Indexing starts at 0 (all numbering in Tochnog starts at 0). Indices need not strictly be sequential (e.g. only the indices 1,2 and 5 of a data item may be specified).

The following sections first treat some extras that can be used in the data part. After that, all possible data items are specified.

1.5.1. Arithmetic blocks

You also can use the arithmetic expressions plus, minus, multiply and divide. We show some examples:

(make A equal to 4.1)
start_arithmetic
A 1.1 plus 3
end_arithmetic
...
(make B equal to 3.2)
start_arithmetic
B 3.2
end_arithmetic
...
(make C equal to 7.3)
start_arithmetic
C A plus B
end_arithmetic
...
(make D equal to 14.6)
start_arithmetic
D A plus B multiply 2.
end_arithmetic

Expressions will be evaluated from left to right. Words from define blocks will not be recognized in arithmetic blocks.

1.5.2. Automatic counting: the counters

The words counter_a, counter_b, counter_c and counter_d are reserved words in the data part. If they are found, they will be substituted by their integer value. After its value is substituted, the counter will be incremented by 1. Initially the value for counters is 0. The example below shows a typical application.

start_define
left_edge geometry_line counter_a
end_define
start_define
right_edge geometry_line counter_a
end_define
...
left_edge 0. 0. 0. 10. 1.e-4
right_edge 2. 0. 2. 10. 1.e-4
...
bounda_dof 1 -left_edge -velx
bounda_time 1 0.
bounda_dof 2 -right_edge -velx
bounda_time 2 1.3
...

Notice that we automatically give the geometry lines a unique number in this way; the unique number is not really of interest in the remainder of the input file, so the application of a counter is convenient.

Finally, also the words counter_a_apply, counter_b_apply, counter_c_apply and counter_d_apply are available. They will be substituted by the current value of the counters, without that the counters are incremented.

1.5.3. Conditional blocks

Parts of the input file can be processed conditionally within start_ifend_if blocks. This is illustrated below with an example:

start_define
do_complete_calculation true
end_define
...
start_if do_complete_calculation
...
end_if
...

The part in the start_ifend_if block is only done if do_complete_calculation is set to true, like in the example. If do_complete_calculation is set to false that part will be skipped. You also can use start_if_notend_if_not blocks, so that actions are NOT taken if the defined variable is set to true.

1.5.4. Control indices

All possible data items are defined in the following sections. It only makes sense to specify some of the data items before the calculation; the other data items are only meant to be printed after the calculation. The example below specifies a 1D temperature calculation.

echo -no
number_of_space_dimensions 1
condif_temperature
end_initia

node 1 0
node 2 1
node 3 2

element 1 -bar2 1 2
element 2 -bar2 2 3

bounda_dof 0 1 -temp
bounda_time 0 0.0 0. 1. 1. 100. 1.
bounda_dof 1 3 -temp
bounda_time 1 0.0 0.0 100.0 0.

group_type 0 -condif
group_condif_density 0 1.0
group_condif_capacity 0 0.1
group_condif_conductivity 0 0.1
group_condif_flow 0 0.

control_timestep 0 0.1 10.0
control_print 0 -time_current -node_dof
control_print_database 1 -separate_index
control_timestep 2 0.2 10.0
control_print 2 -time_current -node_dof

end_data

Note how the indices of control items like control_timestep and control_print are used to control the sequence of events. First, (index=0) time steps of size 0.1 are taken and for each time step results are printed. Then (index=1) the database is printed which can serve as a point of restart. Finally (index=2) time steps of size 0.2 are taken and for each time step results are printed.

1.5.5. Define blocks

You can define a word to represent a set of strings. For each word defined, you need to specify a start_defineend_define block. Within the block, you first specify the word, and then you specify the set of strings. Later in the data part, you can use the defined words as the replacement of the set of strings. Example:

start_define
velocity 1.34
end_define
start_define
left_edge geometry_line 1
end_define
...
left_edge 0. 0. 0. 10. 1.e-4
...
bounda_dof 1 -left_edge -velx
bounda_time 1 0. 0. 100. velocity
...

The words plus, minus, multiply and divide as used in arithmetic blocks are prohibited in define blocks.

1.5.6. Include files

You can use include filename in the data part, to request that the file with name filename is included. This is handy to include often used data parts, or include a mesh generated by a pre-processor, etc.

The included file itself is not allowed to have an include in the data part.

The included file should not contain comments ( … ). The included file needs to be ended with an end_data. On some MS windows computers two end_data records are needed, so try that in case of trouble. On MS windows 32 bit computers include is not available.

1.5.7. Numbering of values in records

The numbering of values in records in illustrated by node_dof records. Look at the following piece of input file

...
number_of_space_dimensions 2
materi_velocity
materi_stress
end_initia
...
node_dof 1 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 -1.0
node_dof 2 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 -1.0
...
end_data

Here node_dof records 1 and 2 are initialized. The initial velocities are 0, and for the initial stresses we use \(\sigma _xx = −1\), σ_yy = −1 and σ_zz = −1. The total list of dof’s in the node_dof record is -velx, -vely, -sigxx, -sigxy, -sigxz, -sigyy, -sigyz and -sigzz.

We refer to -velx as the 0’th value in the node_dof record, -vely as the 1’th value, etc. So printing the history of the -sigxx stress of node_dof record 1 is obtained by this:

...
control_timestep 10 . . .
control_print_history 10 -node_dof 1 2
...
end_data

where the number 2 refers to the -sigxx stress. See also the definition of the control_print_history record for this. As an alternative, sometimes you can use names instead of numbers, for example here:

...
control_timestep 10 . . .
control_print_history 10 -node_dof 1 -sigxx
...
end_data

1.5.8. Ranges

Ranges are general input formats used for indices and data values. Possible ranges are illustrated by the following examples:

-all
-ra 12 32 44 -ra
-ra -from 5 -to 16 -ra
-ra -from 5 -to 25 -step 2 -ra

The -all range is not available for indices.

The data values for a data item can be specified as a range if this is allowed for in the description of the data item. All words in the data part (or part of an index) need to be preceeded with a ’tic’ (-). In the example the node_dof records 1 to 100 are initialized

node_dof -ra -from 1 -to 100 -ra 1. 0. 0.

1.5.9. Types of dof’s

Some of the dof’s are principal dof’s: these are materi_velocity, condif_temperature, groundflow_pressure, wave_fscalar. These are the dof’s which are solved by the equilibrium equations (conservation laws).

The other dof’s, like materi_stress and so, follow from these principal dof’s (strains follow from displacement derivatives, stresses follow from strains by material laws, etc.).

Furthermore, for all the dof’s we have primary values, which are the dof’s themselves, and derived dof’s, which are the space and time derivatives of the primary dof’s.