12. Define your own material#
This paragraph is halfway between use and development. We use an unqualified overload that is the responsibility of the user/developer.
Here we discuss the definition of a catalog for a material given by a user.
The catalog thus developed will be able to integrate the managed catalog in configuration after the required qualification, but in the meantime, it can be used in excess.
To do this, simply define a particular directory where the new catalog will be stored, and use the -rep_mat [directory name] argument when starting the study (cf. [u1.04.00]).
12.1. Managing the mesh length unit#
To manage the change of unit, we have the coef_unit function.
coef_unit (n) is 1. if UNITE_LONGUEUR is” M “, and is \({10}^{n}\) if UNITE_LONGUEUR is “MM”.
For example, for a quantity in MPa, we would write:
E = 2.1e11 * coef_unit (-6)
12.2. Extraction and evaluation according to temperature#
When writing the catalog, you need to determine which keywords are returned in the presence of EXTRACTION and which are not.
Example: If you do not require extraction at a given temperature, you want to obtain temperature-dependent elastic properties, keyword ELAS_FO. Whereas if we ask for these properties at 20°C, we want to obtain the keyword factor ELAS.
We will write extraction=True (in the catalog) to indicate that the keyword factor should be retained if EXTRACTION is present (in the command set), extraction=False to indicate that it should be kept if EXTRACTION is absent. If extraction is not filled in, the keyword is retained in both cases.
We indicate which function should be evaluated according to the temperature (the only control variable currently supported) using the temp_eval function:
E = temp_eval (_A2) where _A2 is a previously defined function.
12.2.1. Syntax, reserved words#
The catalog doesn’t call DEFI_MATERIAU itself, it just defines the list of keywords.
To do this, you must use the defi_motscles function and name the result of this function as keywords:
words = defi_keywords (…)
A material catalog is not a macro order. However, it obeys the same rules concerning the naming of intermediate concepts (functions of temperature-dependent properties in particular). In order not to cause conflicts with the concepts in the user command set, care should be taken to prefix intermediate catalog concepts with a “_” (cf. [d5.01.02]) and to destroy concepts that may be prefixed.
Finally, a limited number of commands can be used in a catalog: those that mainly manipulate functions (consult the bibpyt/Macro/include_materiau_ops.py file for the exhaustive list).