6. A few questions#

6.1. How do I know which catalog file is used by a calculation?#

The situation is as follows:

  1. a calculation has been run with*Code_Aster*;

  2. several order catalog files are present in the environment;

  3. The user — or the developer — wants to know which one is actually being used.

A solution may be as follows:

  1. import the catalog into the command file, for example in ahlv100a.comm;

  2. insert the following sequence into the command file which:

  • import the catalog,

  • write the catalog reference to the standard output,

  • stops treatment.

import data, sys Print “ahlv100a.comm:cata= “, cata sys.exit (0)

With this sequence, we obtain a result in the following style:

cata=<module “cata” from “/home/salome/yessayan/Devel/Asterv7/bibpyt/Cata/cata.pyc”>

From which we deduce that the catalog used can be found in the file:

/home/salome/yessayan/Devel/Asterv7/bibpyt/Cata/cata.py

6.2. How is DEBUG mode managed?#

In Eficas and in the supervisor - in fact, in any Python script - mode DEBUG is managed via a standard variable defined in the global __builtin__: __debug__ namespace. In normal interpretation mode (python main.py), __debug__ is set to 1 (in main.pyc) but in optimized mode (python —o main.py) __debug__ is set to 0 (in main.pyo)

At any time, in all modules, the __debug__ variable can be used to condition the processing.

6.3. Where is the order catalog loaded into memory#

Whether in the supervisor or in the Eficas, JdC graphical interface, the Python object containing the catalog is created in the cata module of the Cata package. More exactly, JdC is created when the cata module is imported: the import is done in the imports method of the SUPERV module Execution/E_ SUPERV class. After the import, the JdC object contains — in its commands attribute, of the list type — the definition of all available commands as well as that of all the keywords associated with each command.

6.3.1. Creating the JdC object#

At the start of the cata.py script, the JdC is declared by the statement:

JdC = JDC_CATA (code=” ASTER “, execModul=none, rules = (AU_MOINS_UN (“DEBUT”, “POURSUITE”), AU_MOINS_UN (“FIN”), A_ CLASSER ((“DEBUT”, “POURSUITE”), “FIN”))))

This statement primarily uses the __init__ method of the N_ JDC_CATA class. JDC_CATA (Kernel package). In this method, the created JdC object is saved in the global __builtins__ space, using the _cata variable in module CONTEXT: __builtins__ [« CONTEXT »]. _cat.

A reference to the current catalog is always available in the global namespace __builtins__ .

6.3.2. Loading catalog entities into the JdC object#

After creation, the load is always done when the catalog is imported in the imports method, by creating objects of the following types:

  1. OPER:

  2. PROC:

  3. MACRO:

6.4. Where is the command set executed by the supervisor?#

The command set j (Accas.A_ JDC object). JDC) is executed in the Execute method of class SUPERV in the E_ SUPERV module of the Execution package.

Two cases are possible:

  1. In mode PAR_LOT =” OUI “(in the script the j.par_lot attribute of the command set is set to” OUI “in the script), the processing is done by the call

j.exec_compile ();

  1. In mode PAR_LOT =” NON “(in the script the j.par_lot attribute of the command set is set to” NON “in the script), the processing is done by the call

ier = self.by mixed batch (j).

6.5. What is the _F keyword used for in the command file?#

In the command file, a factor keyword is introduced by the character string _F. In fact, this character string is a class name that takes care of creating in memory the dictionary corresponding to the factor keyword from a description using the equal sign “=” and brackets rather than the colon “:” and the curly braces that would be used with a standard Python dictionary.

For example:

ELAS = _F ( E = 2.1E11, NU = 0.3, ALPHA = 1.E-5, RHO = 8000. )

is equivalent to:

ELAS = {E: 2.1E11, NU: 0.3, ALPHA: 1.E-5, RHO: 8000.}

This layout is better suited to the wishes of end users and to the tradition of the Code_Aster command language.

6.6. Where is the getvxx command set interface located?#

The getvxx methods belong to class ETAPE defined in the B_ ETAPE module of the Build package.