There are two ways to customize the dataset options via command line arguments:
It is possible to customize all types of Arcane options listed here: Option Types
This type of customization requires modifying the dataset to include symbols. This dataset can therefore become unusable without the correct command line arguments.
A symbol is a string of characters enclosed in at-signs.
Example: @UneValeur@
If we put this symbol in a dataset, we could have, for example:
Whether the option deltat-cp is a simple option, an enumerated option, or an extended option, the functionality is the same, even if these options are in complex options or service options.
For service options, symbol replacement also works in the name and mesh-name attributes. Example:
Three symbols can be replaced: @NamePostProcessor@, @MeshPostProcessor@, and @NbTimeInOneFile@.
Symbol replacement can also be used in simple options that have an array type.
Let's take the following option:
In the dataset, let's add a symbol:
We can replace the symbol @DeuxiemeElement@ with 3.1, or with multiple values: 3.1 3.11.
When the dataset contains the desired symbols, we can assign their values during execution.
This assignment uses the syntax of Arcane arguments (-A,).
Let's assume that we have the symbols @NamePostProcessor@, @MeshPostProcessor@, and @NbTimeInOneFile@ in the dataset.
To assign a value to these symbols, we can run the application like this:
It is also possible to enclose the values in quotes "". This is particularly useful for array types:
When a symbol is present in the dataset but absent from the command line, the symbol is simply replaced by an empty string.
Compared to symbol replacement, this method allows you to keep a valid dataset without mandatory arguments (but is a bit more verbose).
Both methods also act in the same internal locations, so the possibilities are the same: it is possible to modify the value of a simple option, an enumerated option, or an extended option, even if these options are in complex options or service options.
For service options, as before, we can act on the name and mesh-name attributes.
Let's take the first example again:
If we want to modify the value of the deltat-cp option, we simply run the application like this:
It is necessary to have the option's address (XPath). To find it, you must parse the XML elements. Here, the deltat-cp option is at the address: //case/simple-hydro/deltat-cp. Then, we remove the case/ at the beginning (or cas/ for datasets in French). Finally, we can construct the argument to add:
-A,``//simple-hydro/deltat-cp``=3.1
As with symbol replacement, we can add quotes:
-A,//simple-hydro/simple-real-array="3.1 3.11 3.12"
In the case of attributes, they are designated by an @ (for the name attribute, we must put @name in the address). If we want to modify the name attribute of a service, we can do it like this:
-A,//simple-hydro/post-processor/@name=VtkHdfV2PostProcessor
But a problem quickly appears: what if we have multiple options?
In XML, in this kind of case, we use indices. Thus, for the three values of deltat-cp, we address them like this:
//simple-hydro/deltat-cp[1]
//simple-hydro/deltat-cp[2]
//simple-hydro/deltat-cp[3]
We can also write them like this:
//simple-hydro[1]/deltat-cp[1]
//simple-hydro[1]/deltat-cp[2]
//simple-hydro[1]/deltat-cp[3]
These syntaxes are handled by Arcane. Thus, to modify the second option, we can write:
Or:
Another thing you can do is add options.
If you want to add a fourth deltat-cp option, you can add the argument:
-A,//simple-hydro/deltat-cp[4]=9.0
It is also possible to add options that are not present in the dataset (but are present in the AXL):
You could add the options via command line arguments:
This also works for service options. In this case, it is necessary to add at least the name attribute:
Then, for example, you can modify the simple options of this service or the mesh-name attribute:
If, instead of running our application with these arguments:
we ran this:
In this case, the option //simple-hydro/deltat-cp[1], which is neither present in the dataset nor present in the command line arguments, will be added with the default value.
The ANY index allows you to process multiple options with different indices at once. It is represented by empty brackets: [].
If we take the example above and want to modify all deltat-cp values, we can use the address:
//simple-hydro/deltat-cp[]
Launch example:
In this case, all three simple-hydro/deltat-cp options would have the value 2.0.
The ANY tag allows you to change the value of an option present in multiple locations. It is represented by an empty address part (two / with nothing between them) (so //module1/option1/option11, if you want to replace option1 with ANY, you do //module1//option11).
Taking the example above, if you want to modify all deltat-cp[2] options, regardless of the module in which this option appears, you can use the address:
///deltat-cp[2]
Launch example:
Let's assume we have the dataset:
We could start by wanting to modify the deltat-cp option of the second checkpoint in the pas-simple-hydro module. To do this, we can use the argument:
-A,//pas-simple-hydro/checkpoint[2]/delta-cp=4.0.
Then, we could modify the first deltat-cp of both modules:
-A,///checkpoint[1]/delta-cp=2.0.
Next, we might not want any writing between checkpoints:
-A,///checkpoint[]/print-details-before-cp=false.
Finally, the services in the simple-hydro module must act on Mesh0 and the pas-simple-hydro services on Mesh1:
-A,//simple-hydro//@mesh-name=Mesh0
-A,//pas-simple-hydro//@mesh-name=Mesh1
Finally, we end up with the command:
For this section, some usage constraints have been implemented: