Mixins
Mixins serve to add (or to overwrite existing) simulation parameters of a case, i.e. parameters used by the driver for simulating. This allows to quickly vary a number of things like fitting variables, catalyst structure, or reaction mechanisms by just clicking on them in CaRMeN's user interface. Mixins follow the same data structure as cases. That means that a minimally valid mixin requires the presence of a package.json file (and optionally a carmen.yml file) in the Project Directory.
Cases are defined in YAML by writing mixins: and hitting enter. Mixins are then given as an array, each one starting with one level of indentation (i.e. two blank spaces) followed by a - hyphen and enter. Mixins require a title key and a configuration key. The first key is written by convention on the line below the hyphen with one additional level of indentation (i.e. two additional blank spaces) with respect to the hyphen. The name of each key is followed by a colon :, a blank space, and the value of the key.
The following example is an excerpt from a mixin definition in YAML format:
mixins:
-
title: My first mixin
configuration:
-
driver: detchem_stagnation
parameters:
#...
The title: field defines the name of the mixin shown in CaRMeN's user interface. It is therefore important to give it a name which which is quickly and unequivocally identifiable.
The configuration: field contains the parameters to be added to (or overwritten in) the case. Since the simulation parameters depend on the driver used, the driver at hand must first be defined. All parameters are then given as an array, each entry corresponding to a driver and starting with an additional level of indentation (i.e. two additional blank spaces) followed by a - hyphen and enter.
NOTE: Mixins can only add or overwrite parameters corresponding to the drivers used, which means that a mixin can neither modify the name of a case nor the experimental data.
The configuration: field requires a driver key and a parameters key. The first key is written by convention on the line below the hyphen with one additional level of indentation (i.e. two additional blank spaces) with respect to the hyphen.
The driver: field defines the driver used.
The parameters: field contains then all driver parameters to be added to (or to be overwritten in) the case. This occurs first when both a case and a mixin have been selected in CaRMeN's Combiner View window. The original definition of the case (i.e. the written text under cases:) will not be modified.
The example shown above can be understood as follows:
Here a single mixin with the title My first mixin is defined. This mixin definition tells carmen to take the configuration written under the parameters: field and add it to (or overwrite any existing configuration with the same name in) the case definition.