Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 1/6
Organization (S): EDF-R & D/AMA
Handbook of Utilization
U4.3- booklet: Function
Document: U4.32.02
Operator LIRE_FONCTION
1 Goal
To see actual values in a data file representing a function and to create a concept of
type function [U4.31.02] or tablecloth [U4.31.03].
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 2/6
2 Syntax
F [function] = LIRE_FONCTION
(
UNITE = U
,
[I]
FORMAT
=
“LIBRE”
,
[DEFAUT]
NOM_PARA = cf key word are equivalent of DEFI_FONCTION [U4.31.02],
NOM_RESU = idem
Interpol
= idem
PROL_DROITE =
idem
PROL_GAUCHE =
idem
VERIF
=
idem
TITER =
idem
INFO =
idem
SEPAR
=
/
“Nun”
,
[DEFAUT]
/“,”
,
/“;”
,
/“/”
,
INDIC_PARA
=
/
[1,1]
, [DEFAUT]
TYPE
=
/
“FONCTION”
,
[DEFAUT]
/“FONCTION_C'
,
/“NAPPE”
,
if TYPE=' FONCTION':
INDIC_RESU
=
/
[1,2]
, [DEFAUT]
if TYPE=' FONCTION_C':
FORMAT_C
=
/
“REEL_IMAG”
[DEFAUT]
/“MODULE_PHASE”
,
if FORMAT_C=' REEL_IMAG':
INDIC_REEL
=
/
[1,2]
, [DEFAUT]
INDIC_IMAG
=
/
[1,3]
, [DEFAUT]
if FORMAT_C=' MODULE_PHASE':
INDIC_MODU
=
/
[1,2]
, [DEFAUT]
INDIC_PHAS
=
/
[1,3]
, [DEFAUT]
if TYPE=' NAPPE':
NOM_PARA_FONC
= cf key word NOM_PARA
INDIC_ABSCISSE =
[indice1, indice2],
[l_I]
INTERPOL_FONC
= cf key word ITERPOL
PROL_DROITE_FONC = cf key word PROL_DROITE
PROL_GAUCHE_FONC = cf key word PROL_GAUCHE
DEFI_FONCTION
=
_F (
INDIC_RESU
=
[indice1, indice2],
[l_I]))
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 3/6
3 Operands
3.1 Operand
UNITE
UNITE = U
Entirety, logical number of the unit of reading.
3.2 Operand
FORMAT
FORMAT = “FREE”,
This key word is for the moment useless. It will be able to make it possible in the future to define a format of reading
specific, more constraining than the current format.
3.3 Operands PROL_DROITE/PROL_GAUCHE/NOM_PARA/
NOM_RESU/INTERPOL/VERIF/TITLE/INFORMATION
LIRE_FONCTION is a macro-command: the numerical values are read in the file indicated
by PYTHON then the function is actually created by DEFI_FONCTION [U4.03.01].
Thus, these key words are taken again with identical DEFI_FONCTION and make it possible to specify them
characteristics of the produced function: interpolation, prolongations, names of the parameters of access.
3.4 Operand
SEPAR
SEPAR
=/“Nun”/“,”/“;”/“/”
Separating character of the columns of figures in the file with reading.
The default value “None” means one or more white characters. For the others
separators, of the white characters can also fit between the figures and the separator
itself.
3.5 Operand
INDIC_PARA
INDIC_PARA =
/[indice1, indice2]
This key word is identical in its principle to other key words INDIC_ * of the command. It
allows to choose the column of figures in the file read which will define the X-coordinates of the function,
are the values of the parameter.
One awaits obligatorily a list of two entireties: the first indicating the number of “block”
in the file (cf paragraph [§4] Exemples), the second indicating the number of the column. For
to identify the blocks of the file, one regards as separator of blocks any line which
would not exclusively contain figures and separators of columns. The columns are
defined by the presence of separators of columns delimiting them (key word SEPAR).
The default value is [1,1]: the first column of the first block is read. That makes it possible to define
very easily, by informing less possible key words, the reading of a function in one
file containing two simple columns of figures.
3.6 Operand
TYPE
TYPE
=
/
“FONCTION”
,
[DEFAUT]
/“FONCTION_C'
,
/“NAPPE”
,
Specify the type of function read and created: “FONCTION”, “FONCTION_C' (call in
macro-command with DEFI_FONCTION) or “NAPPE” (call to DEFI_NAPPE).
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 4/6
3.7
Case of a real function: TYPE=' FONCTION'
INDIC_RESU =
/[indice1, indice2]
Of operation identical to INDIC_PARA, this key word allows to choose the column of figure
in the file read defining the ordinates of the function, are the values of the result.
The default value is [1,2]: the second column of the first block is read.
3.8
Case of a complex function: TYPE=' FONCTION_C'
FORMAT_C =
“REEL_IMAG”
INDIC_REEL =
/[indice1, indice2]
INDIC_IMAG =
/[indice1, indice2]
FORMAT_C =
“MODULE_PHASE”
INDIC_MODU =
/[indice1, indice2]
INDIC_PHAS =
/[indice1, indice2]
In the case of a complex function, two columns of figures (actual values) are to be identified
in the file read to define the list of the complex values of the result. One can thus read with the choice
real/left part imaginary or modulates/phase.
The default values are respectively [1,2] and [1,3]: one reads the second and third columns
first block. The first column read by defect having been the value of the parameter
(INDIC_PARA).
3.9
Case of a tablecloth: TYPE=' NAPPE'
NOM_PARA_FONC
= cf key word NOM_PARA
INDIC_ABSCISSE =
[indice1, indice2],
INTERPOL_FONC
= cf key word ITERPOL
PROL_DROITE_FONC = cf key word PROL_DROITE
PROL_GAUCHE_FONC = cf key word PROL_GAUCHE
DEFI_FONCTION
=
_F (
INDIC_RESU
=
[indice1, indice2],))
The principle is the same one as that of DEFI_NAPPE [U4.31.03]: the list of possible values of
parameter (second variable) having been defined by INDIC_PARA, it remains to identify the functions
in the file read by the key word factor DEFI_FONCTION (similar to the key word factor FONCTION
DEFI_NAPPE). Attention, the number of identified functions (occurrences of the key word factor)
will have to be identical to the cardinal of the values read by INDIC_PARA.
Contrary to the tablecloths in general, one imposes that the functions share the same list of
values of X-coordinates INDIC_ABSCISSE, this is why only INDIC_RESU is present under the word
key factor DEFI_FONCTION.
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 5/6
4 Examples
of use
That is to say the textual file following containing information to reading. It is composed of columns of figures, here
separated by white characters, defining blocks, themselves delimited by free text.
Any line understanding of other characters that figures and the preset separator is considered
like free text delimiting.
aaa bbb ccc
ddd
eee FF
0. 0. 0.
0.1 1. 10.
0.2 2. 20.
0.3 3. 30.
xxx yyy
www zzz
0.4 4. 40. 400.
0.5 5. 50. 500.
0.6 6. 60. 600.
xxx
70. 700.
80. 800.
90. 900.
PPP qqq
8.8
9.9
Or, with a separator:
….
0.1 ; 1. ; 10. ; 100.
0.2 ; 2. ; 20. ; 200.
….
4.1
Reading of a simple function
By exploiting the default values for the choice of the columns:
F=LIRE_FONCTION (UNIT = 38,
NOM_PARA = “INST”,)
The function thus created is:
X-coordinates =
[0., 0.1, 0.2, 0.3]
Ordinates = [0., 1. , 2. , 3. ]
While associating for X-coordinates and ordinates of the columns taken in different blocks:
F=LIRE_FONCTION (UNIT = 38,
NOM_PARA = “INST”,
INDIC_PARA = [2,4],
INDIC_RESU = [3,1],
The function thus created is:
X-coordinates =
[400., 500., 600.]
Ordinates = [70., 80., 90.]
Attention, the command checks whereas the cardinals of the columns defined by INDIC_PARA and
INDIC_RESU are quite identical. What would not have been the case here with for example INDIC_PARA =
[1,4].
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Code_Aster ®
Version
7.4
Titrate:
Operator LIRE_FONCTION
Date:
19/01/05
Author (S):
C. Key DURAND
:
U4.32.02-G Page
: 6/6
4.2
Reading of a complex function
By exploiting the default values for the choice of the columns:
F=LIRE_FONCTION (UNIT
= 38,
NOM_PARA =
“INST”,
TYPE =
“FONCTION_C',
FORMAT_C = “REEL_IMAG”,)
The function thus created is:
X-coordinates =
[0., 0.1, 0.2, 0.3]
Ordinates = [(0., 0.) , (1., 10.) , (2., 20.) , (3., 30.)]
One could of course have specified other columns for INDIC_REEL and INDIC_IMAG that those by
defect. Attention however to point on columns in the same way cardinal.
4.3
Reading of a tablecloth
By exploiting the default values for the choice of the columns:
F=LIRE_FONCTION (UNIT
=
38,
NOM_PARA
=
“INST”,
INDIC_PARA =
[4,1],
NOM_PARA_FONC
=
“FREQ”,
INDIC_ABSCISSE =
[2,2],
DEFI_FONCTION
=
(
F (INDIC_RESU = [3,1],),
F (INDIC_RESU = [2,3],),))
The tablecloth thus created is:
For the value of parameter INST=8.8, the function:
X-coordinates =
[4. , 5. , 6.]
Ordinates = [70. , 80. , 90.]
For the value of parameter INST=9.9, the function:
X-coordinates =
[4. , 5. , 6.]
Ordinates = [40. , 50. , 60.]
The checks of coherence of the cardinals of columns of X-coordinates and ordinates are made by
the macro-command.
Handbook of Utilization
U4.3- booklet: Function
HT-66/05/004/A
Outline document