1. Extract data using Aster commands#

It is assumed that the user has a calculation result obtained from, for example, the command CALC_MODES for an eigenmode calculation, STAT_NON_LINE for a nonlinear static calculation, or DYNA_NON_LINE for a non-linear dynamic calculation…

In all cases, we have a result concept which will for example be of the type mode_meca, mode_flamb, dyna_trans, tran_gene, evol_elas, evol_noli, evol_ther, etc. depending on the command used and which contains value fields that we want to represent in the form of curves.

1.1. Produce a function or a table#

Reminder

A function is composed of two lists of values, abscissa and ordinate; abscissa values are necessarily monotonic.

A table is an agglomeration of values that are not necessarily of the same type that are accessed via a parameter, « column name ». In the use of the tables we are interested in here, columns of real numbers will generally be produced; their variation is arbitrary.

For more details on what a table is, you can consult the documentation of IMPR_TABLE [U4.91.03].

Values can be extracted using the following commands:

  • RECU_FONCTION [U4.32.03]: produces a function from a result, a field, a table… Example: time evolution of a component of a field at a particular point.

  • POST_RELEVE_T [U4.81.21]: produces a table from a result or a field. We can extract a quantity associated with the components of a field (a component, an invariant…) at certain particular points or along a path that is not necessarily rectilinear.

  • MACR_LIGN_COUPE [U4.81.13]: produces a table from a result or a field along a cut line (a straight line composed of regular segments).

  • RECU_TABLE [U4.71.02]: produces a table based on the values of one or more parameters of a result. For example: the evolution of the control parameter during a calculation. You can also extract a table from a few specific data structures.

  • CREA_CHAMP [U4.72.04]: allows you to extract a field from a result data structure. This can be useful when a command does not know how to process certain results. For example, you can then retrieve a function via RECU_FONCTION/CHAM_GD.

1.2. Dealing with data blocks#

A data block is simply an array of values with N rows, P columns.

In some cases, one or more files are available, each composed of one or more data blocks, separated by lines of text. To build functions from such files, you can use LIRE_FONCTION [U4.32.02].

For example, a parametric study is carried out, each calculation produces a table that enriches a result file; the file may also have been built by a single calculation or manually, regardless. Such a file could look something like this:

AVEC PARA =1.23

INST COOR_X DY

1.00000E+00 1.00000E+01 -3.02717E-2

1.20000E+00 1.00000E+01 -8.14498E-2

1.40000E+00 1.00000E+01 -7.97278E-2

1.60000E+00 1.00000E+01 -3.86827E-2

1.80000E+00 1.00000E+01 -8.48309E-2

2.00000E+00 1.00000E+01 -9.37561E-2

2.20000E+00 1.00000E+01 7.18293E-2

2.40000E+00 1.00000E+01 6.05322E-2

AVEC PARA =1.98

INST COOR_X COOR_Y DX DY

1.00000E+00 1.00000E+01 0.00000E+00 -3.02717E-2 2.07127E-01

1.10000E+00 1.00000E+01 0.00000E+00 -8.14498E-2 4.14928E-01

1.20000E+00 1.00000E+01 0.00000E+00 -7.97278E-2 7.92728E-01

1.80000E+00 1.00000E+01 0.00000E+00 -7.86827E-2 6.88227E-01

2.45000E+00 1.00000E+01 0.00000E+00 8.48309E-2 3.43029E-01

We have several blocks that do not necessarily have the same number of columns.

Suppose we want to compare the displacement DY obtained with the two values of PARA, we will use for example:

f DY1 = LIRE_FONCTION (

TYPE =” FONCTION “,

INDIC_PARA =( 1,1,), # the abscissas are taken from block 1, column 1

INDIC_RESU =( 1,3,), # the ordinates are taken from block 1, column 3

UNITE =38,

NOM_PARA =” INST “,

NOM_RESU =”DY”,)

f DY2 = LIRE_FONCTION (

TYPE =” FONCTION “,

INDIC_PARA =( 2,1,), # the abscissas are taken from block 2, column 1

INDIC_RESU =( 2.5,), # the abscissas are taken from block 2, column 5

UNITE =38,

NOM_PARA =” INST “,

NOM_RESU =”DY”,)

# classic plot of two functions with IMPR_FONCTION:

IMPR_FONCTION (FORMAT =” XMGRACE “,

UNITE =29,

COURBE =( _F (FONCTION =f DY1,

LEGENDE =” PARA =1.23”,),

_F (FONCTION =f DY2,

LEGENDE =” PARA =1.98”,),),

TITRE =”dy=F (t) “,)