.. _d7.01.01-catalog: Order catalog ======================== Here is the skeleton to be completed from the ``code_aster/cata/commands/modi_mail.py`` catalog: .. code-block:: python from.commons import* from.. language.DataStructure import* from.. language.Syntax import* MODI_MAIL = OPER ( name=" MODI_MAIL ", op=190, sd_prod=mesh_sdaster, fr=tr ("Modifying a mesh by translation"), reentrant="o: MAILLAGE ", use= SIMP (status="c", typ=CO), MAILLAGE = ... , TRANSLATION = ... , INFO = SIMP (status="f", typ="I", default=1, into =( 1, 2)), ) .. _d7.01.01-catalog-descr: Catalog description ------------------------ Imports of other modules throughout the*package* code_aster must be facts in relation (``from.. Commons`` and not ``from code_aster.cata.commons``). ``import*`` is forbidden except in order catalogs. ``name`` must be the same as what is on the left of the equal sign, among others, to automate the import of orders. Note that this catalog will automatically be imported with no other addition. The file name is also consistent (in lower case). ``op`` indicates the number of the Fortran routine that is being called. For a new order, choose a free number in ``Ex0000.F90``. ``sd_pro`` defines the type of the output object. The catalog is also used by asterStudy, which cannot import all aster_codes. So it is a lightweight *DataStructure*, defined in ``code_aster/cata/datastructure.py``, and not of the object that will be produced in the command file. Here, ``mesh_sdaster`` vs ``Mesh``. asterStudy manipulates a ``mesh_sdaster`` object which does not contain much more than its type and the command file manipulates real ``Mesh`` objects. The correspondence is as follows: .. code-block:: python mesh_sdaster.getType () == Mesh () .getType () == "MAILLAGE_SDASTER" ``reentrant`` indicates that the command must be ('o') "reentrant", i.e. that it changes the object provided to the "MAILLAGE" keyword. If it was reentrant according to the keywords provided, we would indicate 'f' (optional) or 'n' if it never is. If it can be reentrant, you should add the hidden keyword ``reuse``, which is always defined that way. The INFO keyword is present in the majority of orders. It is worth 1 (normal verbosity) or 2 (additional detailed prints). .. _d7.01.01-cata-todo: Keywords to add ~~~~~~~~~~~~~~~~~~~~~ MAILLAGE is a simple keyword. Its optional or mandatory nature must be defined, the expected type. For this exercise, we want TRANSLATION to be a keyword factor that contains only one simple VECTEUR keyword. These keywords are mandatory. It is more natural for the user to provide 2 real values to define the translation vector in 2D and 3 in 3D.