3. Operands#
3.1. What is a table?#
A table is a computer data structure that stores a set of integer, real, complex, or character string values.
A table is comparable to a spreadsheet in a spreadsheet, in other words, it can be seen as a list of columns facing each other. Each column has a field name, which we call parameter, and contains similar data like: I, R, C, K8, K16, K16, K24, or K32.
Example:
You can also think of the table as a series of records (which we’ll call rows). All the lines do not necessarily have the same structure (i.e. the same parameters). For example:
ACTION |
NUME_ORDRE |
INST |
NOEUD |
DX |
DY |
MAILLE |
SIXX |
||||
INTITULE 1 |
1 |
N1 |
|||||||||
INTITULE 1 |
1 |
N2 |
|||||||||
INTITULE 1 |
1 |
N3 |
|||||||||
INTITULE 1 |
2 |
N1 |
|||||||||
INTITULE 1 |
2 |
N2 |
|||||||||
INTITULE 1 |
2 |
N3 |
|||||||||
INTITULE 2 |
2 |
MA1 |
-12. |
||||||||
INTITULE 2 |
2 |
MA2 |
-14. |
To print the contents of a table, the user will be able to:
select the columns and rows he wants to print [§3.6]
choose a criterion for the order in which the lines are printed [§3.7]
choose the print « format »: in rows, in tables,… [§3.8]
3.2. Operand TABLE#
♦ TABLE = my table
Name of the table you want to print
3.3. Operand TITRE#
◊ TITRE = title
Character string that will be printed before the table (and before the title that may be attached to the table). This chain can make it possible to better distinguish table printings placed end to end in the same file.
3.4. Select what you want to print: the keywords FILTRE and NOM_PARA, TOUT_PARA#
The user chooses which columns to print using the keywords NOM_PARA and TOUT_PARA. He chooses the lines to be printed using the keyword factor (repeatable at will) FILTRE.
3.4.1. Keyword FILTRE#
The keyword factor FILTRE allows you to remember in the table only rows that meet certain criteria imposed by the user. The occurences of the keyword are added to each other like successive filters (« AND » filters). For each occurrence of this keyword, we specify the name of the parameter for which a condition is imposed, the type of condition (equality, non-equality, smaller,…) as well as the value associated with the condition.
3.4.1.1. Operand NOM_PARA#
◊ NOM_PARA = para
para is the name of the parameter to which the filtering constraint relates.
3.4.1.2. Operand CRIT_COMP#
◊ CRIT_COMP = write
crit is the type of the filter constraint.
EQ |
“equality” for integers, texts, real or complex integers. For floating numbers (real or complex), this equality is evaluated with a certain tolerance given by the keywords PRECISIONet CRITERE. |
NE |
“non-equality” (confer EQ) |
LT |
“smaller than” Order relationships: - natural for integers and reals - alphabetical for texts - invalid for complexes |
GT |
“bigger than” (confer LT) |
LE |
“less than or equal to” (confer LT) |
GE |
“greater than or equal to” (confer LT) |
VIDE |
empty cell |
NON_VIDE |
cell not empty |
MAXI |
the selected line will be the one with the maximum value |
MAXI_ABS |
the line selected will be the one with the maximum absolute value |
MINI |
the selected line will be the one with the minimum value |
MINI_ABS |
the line selected will be the one that has the minimum absolute value |
REGEXP |
check the regular expression provided by VALE_K |
Attention
In extraction commands EXTR_TABLE/RECU_FONCTION , the criteria MINI/MAXI (and MINI_ABS/MAXI_ABS ) select a single line that meets the criterion, the last one.
Whereas in commands that manipulate the table CALC_TABLE/IMPR_TABLE , all rows that meet these criteria are retained.
The regular expression filter is only available in CALC_TABLE .
3.4.1.3. Operands VALE/VALE_I/VALE_C/VALE_K#
These various keywords are used depending on the type of column associated with the parameter to which the constraint relates: integer, real, complex or text.
As an argument, we give the value associated with the constraint; for example 12 if we are only interested in the order number 12. You can provide several values (valid for equality or inequality tests) to apply an « OR » filter (see example below).
This operand is useless when using constraint types: “VIDE”, “NON_VIDE”, “MAXI”, “MINI”,…
VALE_K is also used to provide the regular expression to be checked (CRIT_COMP =” REGEXP “). Example: VALE_K =”^N [MP] “to keep only the lines where, for the chosen parameter, the cell contains a character string that starts with an N (uppercase) followed by an M or P, then possibly other characters (See the Python re module for more details on regular expressions).
3.4.1.4. Operands CRITERE/PRECISION#
When the constrained parameter is of a floating type (real or complex) and the constraint type is equality (or non-equality), this equality is evaluated with a certain tolerance.
PRECISION = eps, eps is tolerance
CRITERIA= /'RELATIVE', |x-xref| < eps*|xref|
/'absolute', |x-xref| < eps
3.4.1.5. Example of using the keyword FILTRE#
If we specify:
FILTRE = (_F (NOM_PARA = 'NOEUD', VALE_K = ('N7', 'N12'),),
_F (NOM_PARA = 'INST', CRIT_COMP = 'GT', VALE = 3.0,),
_F (NOM_PARA = 'INST', CRIT_COMP = 'LT', VALE = 13.0,),
),
The rows of the table are thus selected such that the parameter NOEUD is equal to “N7” or “N12” and such that the parameter INST is between 3. and 13.
3.4.2. Operand NOM_PARA#
If the NOM_PARA keyword is not present, all columns in the table will be printed.
If the user uses the keyword NOM_PARA = lpara, only the parameters specified in the lpara list and in the order of the list will be printed.
3.5. Ordering the rows of a table: the keyword factor TRI#
Only one occurrence is accepted for the keyword factor TRI.
3.5.1. Operand NOM_PARA = lpara#
This keyword is used to specify the list of parameters that will be used to order the rows in the table (several parameters may be needed). In case of equality on the first parameter, the next parameter is used…
Note:
Parameters that cannot be printed can be used to sort.
3.5.2. Operand ORDRE#
This keyword is used to specify whether to use ascending or descending order. By default, we sort in ascending order.
The order relationships used are:
the natural order for integers and real numbers,
alphabetical order for texts and concept names.
Notes:
A complex parameter cannot be used to classify rows in a table.
For parameters NOEUD (or MAILLE), the order is alphabetical because these parameters contain the names of the nodes (or meshes) .
3.5.3. Example of using the keyword TRI#
If we specify:
TRI =_F (NOM_PARA = ('NOEUD', 'INST'), ORDRE = 'CROISSANT'),
The rows of the table will be printed in the alphabetical order of the nodes. If there are multiple rows corresponding to a given node, the second sorting criterion (INST) will be used to classify these rows.
3.6. Choice of print format: keywords FORMAT, PAGINATION,…#
By default the print format is the “TABLEAU” format, i.e. presentation in columns of the various selected parameters (as for the examples in this document). The EXCELTM software offers a set of tools to use this type of file: sorting, filtering, dynamic tables,…
3.6.1. FORMAT = “TABLEAU” or “AGRAF”#
An example of a table printed in the “TABLEAU” format:
The only difference between the “TABLEAU” format and the “AGRAF” format is that for the latter, the « text » columns (for example NOEUD above) are preceded by a « ".
Note:
In the format AGRAF, no directive (file .digr) is produced, only values (file .dogr) are produced.
3.6.2. Layout in TABLEAU format#
Here we can define the appearance of the printed table: from a classic table in columns to a compatible CSV or HTML format…
◊ DEBUT_TABLE = text
Define the text printed before each table (by default, we print a line of dashes).
◊ FIN_TABLE = text
Define the text printed after each table (nothing by default).
◊ SEPARATEUR = separ
Defines the separator used between two columns (one space by default).
◊ COMMENTAIRE = com
Character inserted at the beginning of the line to indicate a line as a comment (or title, # by default).
COMM_PARA = comp
Character inserted to comment on the labels line (by default, no characters are inserted).
◊ DEBUT_LIGNE = deb
String inserted at the start of each line (empty by default).
◊ FIN_LIGNE = end
String inserted at the end of the line (”n” by default).
3.6.3. FORMAT = “ASTER”#
The difference between the “ASTER” format and the “TABLEAU” format is the table header and its last row. This difference is justified by the fact that a table printed in the “ASTER” format can be re-read by*Code_Aster* (command LIRE_TABLE [U7.02.03]).
Example:
# DEBUT_TABLE
# TITRE ASTER 6.03.11 CONCEPT TAB_REAC CALCULE ON 12/07/2002
# TITRE TABL_POST_RELE
INTITULE RESU NOM_CHAM NUME_ORD INST DY
K8 K8 K16 I R R
MESSAGE RESU REAC_NODA 1 2.50000E-01 -2.25146E+00
MESSAGE RESU REAC_NODA 2 5.00000E-01 -4.44089E+00
MESSAGE RESU REAC_NODA 3 7.50000E-01 -6.59515E+00
MESSAGE RESU REAC_NODA 4 1.00000E+00 -8.65972E+00
MESSAGE RESU REAC_NODA 5 1.25000E+00 -1.06742E+01
MESSAGE RESU REAC_NODA 6 1.50000E+00 -1.26438E+01
MESSAGE RESU REAC_NODA 7 1.75000E+00 -1.45569E+01
# FIN_TABLE
3.6.4. FORMAT =” NUMPY “#
Numpy is a Python module for manipulating arrays.
Printing in this format produces a file that can be read again by the numpy.load () function.
Only real and integer parameters (columns) (automatically converted to real ones) are printed. Other settings are ignored.
Finally, the topology of the table is maintained: we find a numpy array that has as many rows as the table and as many columns as there are real or integer parameters.
Note
In the case of a parametric calculation, only one row is expected in the printed table. Use CALC_TABLE to filter rows where appropriate.
3.6.5. FORMAT = “TABLEAU_CROISE”#
The “TABLEAU_CROISE” format is reserved for double entry tables. The printing is done in the form of a table whose column names and row names have been documented. This impression concerns tables with 3 parameters. The values of one of the 3 parameters are represented as a function of the 2 others.
Example: DX based on NOEUD and INST:
DX FONCTION FROM NOEUD AND INST |
|||||
NOEUD/INST |
N7 |
3.4 |
3.4 |
3.4 |
3.4 |
N4 |
2.4 |
2.4 |
2.4 |
||
N2 |
1.4 |
1.4 |
1.4 |
NOM_PARA = ('INST', 'NOEUD', 'DX')
The parameter « filling » the table is the 3rd in the list indicated by the simple keyword NOM_PARA.
The « abscissa » parameter is the 2nd in the list indicated by the simple keyword NOM_PARA.
The « ordered » parameter is the first in the list indicated by the simple keyword NOM_PARA.
Note:
If the table contains more than 3 parameters, you can use the keyword PAGINATIONpour « list » the values taken by the other parameters (see example 3) .
3.6.6. FORMAT = “XMGRACE”#
This format makes it possible to produce a file that can be directly visualized in xmgrace in the form of a curve.
We have the same formatting features as in IMPR_FONCTION.
If PILOTE is not specified, we produce a data file for xmgrace; if PILOTE is entered and if the driver chosen is actually available on the machine, we can directly produce a postscript file, png,…
Chart formatting keywords: see IMPR_FONCTION [U4.33.01].
3.6.7. Operand PAGINATION#
This keyword is used to print a table piecewise (like a set of smaller tables). A list of parameters (lpagi) is given that will be listed and printed as titles for small tables.
The list of pagination parameters (lpagi) must be included in the complete list of parameters you want to print (lpara).
If you want to use pagination and the “TABLEAU_CROISE” format, the lpara list must, once you have removed the lpagi parameters, consist of 3 residual parameters. These 3 parameters will be used for table presentation [§3.4.3].
Example: FORMAT =” TABLEAU “, PAGINATION =” NOEUD “
NOEUD: N7 road
NUME_ORDRE |
|
DX |
DY |
1 |
3.4 |
3.8 |
|
4 |
3.4 |
3.8 |
|
7 |
3.4 |
3.8 |
NOEUD: N4
NUME_ORDRE |
|
DX |
DY |
1 |
2.4 |
2.8 |
|
4 |
2.4 |
2.8 |
|
7 |
2.4 |
2.8 |
NOEUD: N2
NUME_ORDRE |
|
DX |
DY |
1 |
1.4 |
1.8 |
|
4 |
8 |
1.4 |
1.8 |
7 |
1.4 |
1.8 |
3.6.8. Operand FORMAT_C#
For complexes, two print formats are available (module/phase by default or real part/imaginary part).
3.6.9. Operand FORMAT_R#
This keyword allows you to choose the number of decimals printed for each floating number: (real or complex).
To do this, we use the syntax of FORTRAN.
For example, for the default value: “E12.5”, we will print each floating number over 12 characters, with 5 decimals and in scientific notation (with an exponent).
3.6.10. Operand IMPR_FONCTION#
For tables containing function names in their cells, this keyword indicates that you also want to print the content of the functions referenced in the table.
We first print the table (as seen above) then we « loop » over all the functions contained in the printed part of the table and we print these functions (as does command IMPR_FONCTION).
3.7. Operand INFO#
◊ INFO = under
Print additional information in the « message » file if inf=2. Nothing happens if inf=1.