Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
1/10

Organization (S): EDF-R & D/AMA

Handbook of Utilization
U4.3- booklet: Function
Document: U4.33.01

Operator IMPR_FONCTION

1 Goal

To print the contents of objects of the function type or list of realities in a file intended for a tracer of
curves.

Replace, with IMPR_TABLE, old procedure IMPR_COURBE.

Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
2/10

2 Syntax

IMPR_FONCTION
(
FORMAT =

/“TABLEAU”,

/
“XMGRACE”,


/
“AGRAF”,

# Definition of the logical unit to format AGRAF



UNITE
=/
links,
[I]
/
25,
[DEFAUT]



UNITE_DIGR
=
/
unit_digr, [I]
/
26,
[DEFAUT]

# Definition of the logical unit to format XMGRACE and the pilot of impression


UNITE
=/
links,
[I]
/
29,
[DEFAUT]


PILOTE
=/“,
[DEFAUT]
/
“POSTSCRIPT”,
[KN]
/
“EPS”,
/
“MIF”,
/
“SVG”,
/
“PNM”,
/
“Png”,
/
“JPEG”,
/
“Pdf”,
/
“INTERACTIF”,

# Definition of the logical unit to format TABLEAU



UNITE
=/
links,
[I]
/
8,
[DEFAUT]

# Put on graphic page common to XMGRACE and AGRAF









BORNE_X = (xmin, xmax), [l_R]









BORNE_Y = (ymin, ymax), [l_R]









ECHELLE_X
=
/
“LIN”,
[DEFAUT]













/“LOG”,









ECHELLE_Y
=
/
“LIN”,
[DEFAUT]













/“LOG”,









GRILL_X

=
/
0,
[DEFAUT]













/
nx, [R]









GRILL_Y

=
/
0,
[DEFAUT]













/
ny,




[R]









LEGENDE_X
=
xlegen
,
[KN]









LEGENDE_Y
=
ylegen
,
[KN]

# Put on page of the table


SEPARATEUR
=
/
separ,
[DEFAUT]
/
'

',
[KN]


COMMENTAIRE
=
/
COM, [kN]
/
“#”, [DEFAUT]


DEBUT_LIGNE
=
/
deb., [kN]








/“,
[DEFAUT]


FIN_LIGNE
=
/
end, [kN]
/
“\,
[DEFAUT]
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
3/10


# Definition of the function to be traced






COURBE = _F (

# Formatted of the function at formats XMGRACE and AGRAF









LEGENDE = legend,



[KN]









STYLE
= sty, [I]









COULEUR
=
coul,
[I]









MARQUEUR
= marq,
[I]









FREQ_MARQUEUR
=
freqmarq,
[I]

# Recovery of the function to be traced








/
FONCTION =
Fr, [function]











LIST_PARA = will lpara,

[listr8]









/
FONCTION =
FC, [fonction_C]











PART =/“REAL”,





/
“IMAG”,











LIST_PARA = will lpara,

[listr8]









/
FONC_X = fx, [function]










FONC_Y = fy, [function]











LIST_PARA
=
will lpara,
[listr8]









/
LIST_PARA
=
will lpara,
[listr8]










LIST_RESU
=
lresu,
[listr8]









/
ABSCISSE = labs,

[l_R]










ORDONNEE = lordo,

[l_R]

# Tri possible









SORTING =/“,
[DEFAUT]










/
“X”,










/
“Y”,










/
“XY”,










/
“YX”,

# Commun runs with all the formats


TITER
=
titrate,
[KN]
SOUS_TITER =
sous_titer,
[KN]
INFO =
/
1,







/2,









),




)


Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
4/10

3 Operands

3.1
Presentation of the curves

A whole of operands optional makes it possible to define the presentation of the curve. All have one
default value.

3.1.1 Operand
FORMAT


FORMAT =

Format of impression of the function

“AGRAF”
impression intended for the software agraf, which also makes it possible to adapt them

parameters of presentation in interactive,
“TABLEAU”
the impression in columns makes it possible to import the data in one easily

spreadsheet, if several curves are given, it is the list of the X-coordinates of
first function which is used to interpolate the values of the others
functions,
“XMGRACE”
impression intended for the software xmgrace. One can also adapt them
parameters of presentation in interactive. The use of key word PILOTE
allows to directly produce a file image or postscript.

3.1.2 Operand
UNITE


UNITE = links

UNITE_DIGR = unit_digr if FORMAT = “AGRAF”

Allow to choose on which logical unit one prints the functions. The value of links
must be the same one as in the interface astk.

If many curves are plotted, it is more flexible to use the repe type combined with
order DEFI_FICHIER, the files will be in the repertory./REPE_OUT.

With format AGRAF, the data are written in UNITE whereas the directives are written
in UNITE_DIGR (is worth 26 per defect).

The default value of links is worth:

· 8 with format TABLEAU (corresponds to the file result),
· 25 with format AGRAF,
· 29 with format XMGRACE (optional if PILOTE = “INTERACTIF”)

3.1.3 Operand
PILOTE

While choosing FORMAT = “XMGRACE”, one has the pilots of output used by xmgrace in
using key word PILOTE. This amounts using the functions of export of xmgrace via its menu
“File/Print Setup…”.
The exact list of the pilots available on your server is provided by the option “- version” of xmgrace.

Possible values of PILOTE:

· “
: in this case, no pilot is used, the file obtained is
the .agr or .dat of xmgrace (file containing them
data and directives of the graph),
· “POSTSCRITP”, “EPS”
: file postscript full-page or encapsulated,
· “PNG”, “JPEG”, “PNM”
: file of the image type,
· “PDF”, “MIF”, “SVG”
: formats
private individuals,
· “INTERACTIF”
: no file is turned over if one can open xmgrace with
the screen.

NB: “JPEG” and “pdf” are not available on the server of calculation EDF (clayastr).
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
5/10

3.1.4 Page-setting of the graph common to XMGRACE and AGRAF

3.1.4.1 Operands
BORNE_X/BORNE_Y


BORNE_X =

Layout of the function in an interval of the X-coordinates given.


BORNE_Y =

Layout of the function in an interval of the ordinates given.

3.1.4.2 Operands
ECHELLE_X/ECHELLE_Y


ECHELLE_X =

Type of scale desired for the X-coordinates, LINéaire or LOGarithmique.


ECHELLE_Y =

Type of scale desired for the ordinates, LINéaire or LOGarithmique.

3.1.4.3 Operands

LEGENDE_X/LEGENDE_Y


LEGENDE_X =

Caption associated with the X-axis.


LEGENDE_Y =

Caption associated with the Y-axis.

3.1.4.4 Operands

GRILL_X/GRILL_Y


GRILL_X = nx

For xmgrace, NOC is the distance between two vertical successive lines of the grid.
For agraf, nx is the entirety defining the frequency of layout of these lines.


GRILL_Y = ny

Even thing for the horizontal lines of the grid.

3.1.5 Page-setting with format TABLEAU

One can define here the membership of the printed table: of a traditional table in columns with a format
compatible csv or HTML…

Note:

The labels of the columns are suffixées by “_ + n° of column” (while starting to 0) so
to avoid the repetition because the names all of columns must be different.


SEPARATEUR = separ

The separator used between two columns (a space by defect) defines.


COMMENTAIRE = COM

Character inserted at the beginning of line to indicate a line in comment (or titrates, # by defect).


DEBUT_LIGNE = deb.

Chain inserted into the beginning of each line (vacuum by defect).


FIN_LIGNE = fine

Chain inserted at the end of the line (“\ by defect).
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
6/10

3.1.6 Key words common to all the formats


TITER

SOUS_TITER

Allow to define the principal and secondary titles graph or table.

3.2 Word
key
COURBE

COURBE

Key word factor allowing to print the definite functions or to trace one or more
functions in the same graph (a function by occurrence of the key word factor).

3.2.1 Complementary attributes for the layout of each function by the software
xmgrace or agraf



STYLE = sty

This key word defines the style of feature of the curve.

For xmgrace, the correspondence is as follows:
0 step of line 1 continuous feature 2 dotted lines
3 short dashes 4 long dashes
5, 6, 7, 8 alternate dashes dotted lines

For agraf, the styles are:
0 line
1 dotted lines
2 point



MARQUEUR = marq

This key word defines the type of marker or symbol of the points of the curve.

For xmgrace:
0 step of marker
1 circle
2 square
3 rhombus
4 high triangle
5 left triangle
6 low triangle 7 right triangle 8 more
9 crosses
10
star


For agraf, the markers are:
0 circle
1 square
2 more
3 rhombus
4 full circle
5 full square
6 full rhombus 7 cercle+croix 8 losange+croix



COULEUR = coul

This key word defines the color of the curve.

For xmgrace, the colors are:
0 white
1 black
2 red
3 green
4 blue
5 yellow
6 brown
7 gray
8 purple
9 cyan
10 magenta
11 orange
12 chestnut
13 indigo
14 turquoise
15
green
dark


For agraf, the colors are:
0 black
1 red
2 dark green
3 blue
4 magenta
5 cyan
6 green
7 chestnut
8 orange
9 mauve
10 yellow
11 clear chestnut





LEGENDE = legend

Caption given to the function (by defect one recovers the name of the function).



FREQ_MARQUEUR = freqmarq

Entirety indicating the frequency of impression of the marker associated with a function. All the im
points of discretization of the function, a marker is printed (by defect all points).
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
7/10

3.2.2 Attributes
additional
for the layout by the software agraf



TRI = tr

This key word makes it possible to sort by order ascending the parameters defining the function:

·
tr = “, not of sorting,
·
tr = “X”, sorting of the points of the function according to the order ascending of X-coordinates X,
·
tr = “Y”, sorting of the points of the function according to the order ascending of the ordinates y,
·
tr = “XY”, sorting of the points of the function according to the order ascending of X-coordinates X and in
case of equality according to the order ascending of the ordinates,
·
tr = “YX”, sorting of the points of the function according to the order ascending of the ordinates y and in
case of equality according to the order ascending of the X-coordinates,

3.2.3 Impression or layout of a real function

/
FONCTION = Fr

Name of the real function to print or trace.



LIST_PARA = Lr

Impression or layout of the function according to the list of the parameters given.

3.2.4 Impression or layout of a complex function

One trace either the real part, or the imaginary part. If one wants to trace the real part and the part
imaginary in the same graph, it is necessary to repeat the key word factor COURBE.

/
FONCTION = FC

Name of the function complexes to print or trace.



PARTIE =

Impression or layout of the part REELle or IMAGinaire.



LIST_PARA = Lr

Impression or layout of the function according to the list of the parameters given.
Without effect during an impression in column (format “EXCEL”).

3.2.5 Impression or layout of a function defined by 2 lists of realities

/
LIST_PARA = will lpara

Name of the list of the X-coordinates.


LIST_RESU = lresu

Name of the list of the ordinates.

Or:

/
ABSCISSE = labs

List python of the X-coordinates.


ORDONNEE = lordo

List python of the ordinates.
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
8/10

3.2.6 Impression or layout of a parametric function

/
FONC_X = fx

Name of the parametric function X = F (T) to print or trace.


FONC_Y = fy

Name of the parametric function y = G (T) to print or trace.



LIST_PARA = Lr

Impression or layout of the function according to the list of the parameters given.

3.2.7 Functionalities which existed in IMPR_COURBE

Working of the graphs starting from table from now on is ensured by IMPR_TABLE.

The layout of a resu_gene in a node of shock must be made in two times: to recover a function
with RECU_FONCTION, key word RESU_GENE, then to print the graph with IMPR_FONCTION.
Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A


Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
9/10

4 Examples

4.1
Curve representing a complex function

FC = DEFI_FONCTION (NOM_PARA=' INST', NOM_RESU=' DX',
VALE_C= (0., 0., 0., 1., 2., 3.,
2., 3., 4., 3., 4., 5.,
4., 5., 6., 5., 6., 7. ),)

IMPR_FONCTION (
UNITE = 24,
FORMAT = “XMGRACE”,
PILOT = “POSTSCRIPT”,
LEGENDE_X = “Temps (S)”,
LEGENDE_Y = “DX (mm)”,
COURBE = (
_F (FONCTION = FC,
PART = “REAL”,
COULEUR = 4,
STYLE = 2,
MARQUEUR = 5,
LEGENDE = “left real”,),
_F (FONCTION = FC,
PART = “IMAG”,
COULEUR = 2,
STYLE = 5,
MARQUEUR = 8,
LEGENDE = “left imaginary”,),
),
TITER = “Tracé of a complex function”,
)



Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Operator IMPR_FONCTION


Date:
22/02/06
Author (S):
Key COURTEOUS Mr.
:
U4.33.01-G1 Page:
10/10

4.2 Curve
parametric

lt = DEFI_LIST_REEL (DEBUT = 0., INTERVALLE=_F (JUSQU_A=10., PAS=0.01),)

fx = FORMULE (NOM_PARA=' you,
VALE= """ 2.* cos (T) - cos (2.* T) """,)
cardioX=CALC_FONC_INTERP (
FONCTION = fx,
LIST_PARA = lt,)

fy = FORMULE (NOM_PARA=' you,
VALE= """ 2.* sin (T) - sin (2.* T) """,)
cardioY=CALC_FONC_INTERP (
FONCTION = fy,
LIST_PARA = lt,)

IMPR_FONCTION (
UNITE = 27,
FORMAT = “XMGRACE”,
TITRATE = “Ardioid”,
COURBE = (
_F (FONC_X = cardioX,
FONC_Y = cardioY,),
),
)

A file thus is obtained that one can visualize in xmgrace:

Additional working in xmgrace: small Plot/Graph appearance, fixed type (grid
square), and to remove the legend by stripping the box Display legend.

Handbook of Utilization
U4.3- booklet: Function HT-62/06/004/A

Outline document