3. cata_ce.py file: catalogs#

The meidee_cata.py file was defined at the time when Python methods for manipulating Aster concepts weren’t as developed. However, they are still quite useful, as they are particularly adapted to the needs of CALC_ESSAI calculations.

This file contains:

  • the CalcessaiObjects class: class containing all the Aster concepts that may be useful in calculations,

  • the Results class: the Aster sd_result concepts are instances of it,

  • the ModeMeca class: subclass of the previous one: instantiate the Aster mode_meca concepts

  • the DynaHarmo class: Results subclass: instantiates the dyna_harmo Aster concepts

  • the classes caraeLem, fieldMaterial: instantiate the concepts Aster cara_elem and cham_mater

  • the InterSpectre class: instantiates Aster table_sdaster concepts of the table_function type containing frequency functions,

  • the Tempo class: instantiate Aster table_sdaster concepts of the table-type function containing temporal functions (for signal processing),

  • the Model class: instantiates the Aster modele_sdaster concepts.

Only the classes that are most used in calculations are described here.

3.1. CalcessAIObjects Class Description#

This class is called when the macro command is called, and after each calculation creating a new Aster concept in order to update the dictionary of available concepts, using the recup_objects method.

Description of the main methods:

3.1.1. Recup_objects#

This method retrieves all the available concepts and stores them in a dictionary indexed by their names, for each type of concept:

self.mode_meca = {“NOM_1 “:mode_meca_1,” NOM_2 “:mode_meca_2}

If a particular class has been created for the concept in question, then the Mode_MECA_X object will be an instance of that concept. The ModeMECA and InterSpectre classes are the most used in current operations. In particular, the InterSpectrum class has a very useful method for transforming the inter-spectrum Aster concept into a Python matrix indexed by the discretization frequencies and the order numbers i and j (or, instead, the names of nodes and components i and j).

Several methods relating to the classes in question are called to link concepts to nume_ddls, models, matrices, ascending meshes…

3.1.2. Update#

Allows you to add a concept to the MeideeObjects instance without having to recreate it entirely (which can be long given the number of initializations).

3.1.3. Debug#

Routine for displaying concepts associated with a concept.

3.1.4. Get_xxx and get_xxx_name routines#

The get_xxx_name routines are used to retrieve the list of names of existing xxx concepts. The get_xxx routine allows you to retrieve the concept based on its name.

3.2. ModeMECA Class Description#

The concept of mode_meca includes both dynamic modes, from CALC_MODES, and static modes. The former are indexed by their order number and their natural frequency, the latter by their order number and the variable NOM_CMP, which is the degree of freedom associated with static deformation.

3.2.1. get_xxx classes#

These classes are used to link the mode_meca concept with the ascending concepts:

  • get_matrices retrieves the mass, stiffness, and damping matrices associated with the concept. The associated attributes are.mass, .kass, and.cass.

  • get_nume gets the nume_ddl in the same way (.nume extension),

  • get_meshes retrieves the associated mesh, either through the nume_ddl, or directly from the information in the. REFE of each order number of the result.

  • get_model retrieves the associated model, either through the Aster Tell Me routine, or through the associated mesh

Warning: some routines are inter-dependent; during updates, it is appropriate (as in the update routine of CalcessAIObjects) to execute them in a certain order.

  • get_mode_data: get all the generalized data in the form of a dictionary; for static modes, only fields NUME_MODE, NUME_ORDRE, and NOEUD_CMP are filled in, the others are set to None; for dynamic modes, fields FREQ, AMOR_REDUIT,,,, AMOR_GENE, RIGI_GENE and MASS_GENE are filled in, the field NOEUD_CMP is equal to None. The show_cara_mod routine allows you to display all the extracted modal characteristics.

3.2.2. Extr_matr routine#

Routine for extracting modal deformations in the form of a numpy matrix. Extraction is done with the CREA_CHAMP operator and the EXTR_COMP routine. These two commands are encapsulated in the crea_champ routine at the end of the ce_cata.py file.

The nume_ddl_phy routine allows you to create a numbering of active degrees of freedom. These DDL come from the filter that the user was able to apply using the OBSERVATION operator to create the mode base, or by using the DDL filter in the graphical interface.

3.3. DynaHarmo class#

The routines for accessing the dyna_harmo bottom-up concepts are relatively similar to those in the ModeMECA class.

DynaHarmo are only used for model expansion, a calculation class that only performs Aster calculation. It is therefore not necessary to extract the data in Python format.

3.4. CaraElem classes, Material field#

No Python treatment of these concepts has been done. So these classes are almost empty. They just allow you to encapsulate the corresponding Aster concept and to be able to point to this one with its name.

3.5. InterSpectre class#

Class for dealing with inter-spectrum concepts. Interspectra are tables containing frequency variable functions indexed by:

  • order numbers (indices NUME_ORDRE_I and NUME_ORDRE_J),

  • or nodes and components (NOEUD_I, NOEUD_J,, NOM_CMP_I, NOM_CMP_J).

When the instance of the class is initialized, the discretization frequencies of the functions are extracted, which makes it possible to differentiate inter-spectrum tables from other types of tables (tables containing temporal functions, for example, which will be processed by the Tempo class).

3.5.1. make_inte_spec routine#

Like operator LIRE_INTE_SPEC, this routine makes an Aster inter-spectrum from functions defined in list form.

If the concept is linked to a model (with set_model), through a result concept (DynaHarmo or ModeMECA), then it is associated with a numbering of the physical degrees of freedom. The inter-spectrum created is therefore indexed by its nodes and components. Otherwise, the inter-spectrum is associated with a generalized concept. It is therefore indexed by its order numbers.

3.5.2. Routine set_model#

Allows you to associate a mode_meca concept to the defined inter-spectrum. The coherence in size of the inter-spectrum and the associated result concept must be respected (but not necessarily the coherence in DDL), because the inter-spectra are not always defined by physical numbering.

3.5.3. extr_inte_spec and extr_freq routines#

Inverse operation of the make_inte_spec routine. The inter-spectrum created is a 3-dimensional numpy matrix. Routine steps:

  • extraction of pairs of order numbers or nodes and components i and j, depending on whether the inter-spectrum is physical or modal, with extr_nume_order,

      • coupl_ddl = [(“N1_DX”,”N1_DY”)… (“N10_DZ”,”N10_DZ”)],

  • or coupl_ddl = [(1,2)…(10,10)],

  • extraction of the number of discretization frequencies (nb_freq),

  • the set function allows you to retrieve the order numbers in a list containing only one occurrence of each; it can be useful for sizing non-square inter-spectra, for example, the FRF and coherence functions created in CALC_SPEC; this feature is however not currently used by the signal processing tab; in this one, the inter-spectrum functions are extracted by RECU_FONCTION, and no operations are performed matrices on the matrices; we therefore temporarily add a check on the equality between the number of rows and columns,

  • association with a result concept and extraction of active DDL (self.nume_phy),

  • checking the consistency between the size of the nume_phy and the size of the inter-spectrum,

  • production of a list of string pairs to index the functions of the inter-spectrum in Python: NOEUDS_CMP_X or NUME_ORDRE_X, depending on how the inter-spectrum was manufactured in Aster (coupl_ddl),

  • extraction of functions in python format; depending on how the inter-spectrum was defined, the functions may not be directly accessible in the database from the data of its name; the alternative solution is to use RECU_FONCTION,

  • for the inter-spectrum indexed by the names of the nodes and the associated components, the coherence is checked with the self.nume_phy; if the inter-spectrum is only defined by its order numbers, the user must ensure this coherence himself.

The extr_freq routine works in an identical manner to recover only the discretization frequencies.

3.6. Tempo class#

The purpose of this class is to encapsulate concepts that contain tables of time variable functions. The methods in this class are quite similar to those in the InterSpectre class. The time functions are intended to be used by the CALC_SPEC operator. It is therefore not necessary to extract the functions in Python format.

3.6.1. Extr_tempo method#

The time samples are indexed by the order numbers, and the measurement number, so as to be able to gather the samples that have been measured simultaneously. The extraction is therefore done by the values method, by looking for the keywords NUME_ORDRE_I, NUME_MES and by making the associated FONCTION names.

3.7. Model class#

This class allows you to encapsulate Aster models. The associated methods make it possible to extract the ascending mesh and all the nume_ddl descendants that depend on this model (there may be several). This class is of little interest in itself.