3. Addition of a new law of behavior#
We list the different actions to be performed on the code to add a new law of behavior. Some actions are detailed in dedicated paragraphs when necessary.
3.1. Order catalog#
Add the name of the new behavior in the c_behavior.capyfile in part COMMAND == “CALC_EUROPLEXUS”.
3.2. Behavioral dictionary#
In the translation catalog (calc_epx_cata.py), duplicate a key/value pair from the cata_compor dictionary.
For example for behavior VMIS_ISOT_TRAC this couple is as follows:
“VMIS_ISOT_TRAC”: {
“LOI”: [“ELAS”, “TRACTION”],
“BESOIN”: [“o”, “o”,],
“REPEAT”: [“n”, “n”],
“NOM_EPX”: “VMIS ISOT”,
“NOM_EPX_CH_MED”: “ISOT”,
“NB_VAR_ASTER”: 2,
“NB_VAR_EPX”: 5,
“TRANSFO”: True,
},
3.2.1. Stages#
Replace the existing key with the new behavior.
Enter the keywords materials necessary for the operation of the law in the key “LOI”.
All you have to do is copy the mc_master list from the python behavior module (. /bibpyt/behavior/ my_behavior.py).
Tell for each of them in “BESOIN” whether their presence is mandatory or optional (“o”/”f”) and in “REPEAT “whether they can be repeated or not (” y “,” n “). In the vast majority of cases the presence of these keywords in the material is mandatory and they cannot be repeated (layout for the specificities of GLRC_DAMAGE).
In “NOM_EPX” give the name of the corresponding material in EPX (keyword for directive MATE). In some cases, the string of four characters allowing to know the material EPX associated with a given field in the file MED is not the one formed by the first four characters of “NOM_EPX”. In this case you have to add the key “NOM_EPX_CH_MED” with the right value.
Indicate respectively in “NB_VAR_ASTER” and “NB_VAR_EPX” the number of internal variables of the law in*Code_Aster* and EPX (field ECROdans EPX).
Indicate in the “TRANSFO” keyword whether a routine for transforming internal variables from EPX to Code_Aster is necessary and therefore needs to be developed (True/False).
If necessary, develop the transformation of internal variables from Code_Aster to EPX to send a field of internal variables (non-zero) in the initial state.
3.2.2. Details on transformations of internal variables.#
3.2.2.1. Passage EPX to Code_Aster#
If “TRANSFO” is False and there are more components on the Code_Aster side than on the EPX side, reading the internal variables will fail. You must at least activate “TRANSFO” and program the addition of the number of missing components by assigning them the value 0.
If “TRANSFO” is False and there are at least as many components on the EPX side as on the side as on the Code_Aster side, the \(i\) component of EPX is copied onto the \(i\) component of Code_Aster if \(i\le \mathit{NbVarAster}\). The other components are forgotten.
If “TRANSFO” is True, then you have to program the transformation. To do this, you must add a new routine (by duplicating one already present) in the /bibpyt/calc_epx/trans_var_int.py module. The name of this routine should be tr_e2a_my_behavior. This routine must then be plugged into the rest of the code in the transfo_var_int method of the Read EPX () class in lire_europlexus_ops.py.
3.2.2.2. Move Code_Aster to EPX#
When the VARI_INTde ETAT_INIT keyword is set to “OUI”, then an internal variables field is added to the initial state sent to EPX. When adding a new behavior law, if nothing is done, the initial field of internal variables will be zero on the meshes on which the new behavior is affected.
For the values of the internal variables to be transferred it is necessary to develop the transformation from Code_Aster to EPX of the law. To do this it is necessary:
Create a new transformation routine based on the model of tr_a2e_vmis_john_cook in the module. /bibpyt/calc_epx/trans_var_int.py. It will be called tr_e2a_*my_behaviour.
Add the call to the new routine in var_int_a2edu same module.
3.3. Dictionary of laws or materials#
In the translation catalog (calc_epx_cata.py), duplicate a key/value pair from the cata_lois dictionary. The keys in this dictionary are formed by the name of the behavior and the material keyword (from DEFI_MATERIAU) that we want to define separated by a “/”.
Here are the first three pairs in this dictionary:
“ELAS/ELAS”: {
“PARA”: [“E”, “NU”, “RHO”, “”, “AMOR_ALPHA”, “AMOR_BETA”],
“PARA_EPX”: [“YOUNG”, “NU”, “NU”, “RO”, “KRAY”, “MRAY”],
“BESOIN”: [“o”, “o”, “o”, “o”, “f”, “f”],
“TYPE”: [“real”, “real”, “real”, “real”, “real”, “real”],
},
“VMIS_ISOT_TRAC/ELAS”: {
“PARA”: [“E”, “NUDE”, “RHO”,],
“PARA_EPX”: [“YOUNG”, “NU”, “RO”,],
“BESOIN”: [“o”, “o”, “o”,],
“TYPE”: [“real”, “real”, “real”,],
},
“VMIS_ISOT_TRAC/TRACTION”: {
“PARA”: [“SIGM”,],
“PARA_EPX”: [[“ELAS”, “TRAC”],],
“BESOIN”: [“o”,],
“TYPE”: [“background”,],
},
3.3.1. Stages#
Replace the existing key with the key to be added.
In “PARA”, enter the material parameter names in*Code_Aster*.
In “PARA_EPX”, enter the names of the corresponding parameters in EPX. In some cases, there is no perfect correspondence between the parameters and special treatment must be carried out. We must then make sure that the list “PARA_EPX” contains another list for the index in question in order to be able to detect that special treatment is to be done. This processing is to be programmed in a routine to be added in the calc_epx_mate.py module and to be plugged into the get_para_all routine of the same module after the line:
if type (para_epx) is list:
Tell for each of them in “BESOIN” whether their presence is mandatory or optional (“o”/”f”).
Give the type of each of them in “TYPE”, real or function (“reel”/”fonc”).
3.4. Synthesis#
In the case of a perfectly identical law of behavior between*Code_Aster* and EPX, the addition is reduced to catalog/dictionary changes.
For other cases, specific targeted treatments are to be programmed. At the moment there are two. The transformation of the components of internal variables and the correspondence of the parameters of the laws. For these two treatments, all you have to do is duplicate the existing one and adapt it to the case in question.