Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Dataset

Our HelloWorld application needs a dataset to function. Here is the dataset generated by arcane_template, enhanced with an option.

Note
The .arc files are not compiled with the application. They can therefore be modified afterwards. Furthermore, we can have several of them to vary the simulation (which is somewhat the goal, by the way).

HelloWorld.arc

<?xml version="1.0"?>
<case codename="HelloWorld" xml:lang="en" codeversion="1.0">
<arcane>
<title>3steps</title>
<timeloop>HelloWorldLoop</timeloop>
</arcane>
<meshes>
<mesh>
<generator name="Cartesian2D" >
<nb-part-x>1</nb-part-x>
<nb-part-y>1</nb-part-y>
<origin>0.0 0.0</origin>
<x><n>20</n><length>2.0</length></x>
<y><n>20</n><length>2.0</length></y>
</generator>
</mesh>
</meshes>
<say-hello>
<nSteps>3</nSteps>
</say-hello>
</case>

Several things should be noted here. First, we find the name of our application on the second line.

Next:

<arcane>
<title>3steps</title>
<timeloop>HelloWorldLoop</timeloop>
</arcane>

We have the title of our dataset. It must describe the dataset. This dataset allows for 3 loop iterations, hence 3steps.

Then, we have <timeloop>HelloWorldLoop</timeloop>. This is the name of the time loop in our program. This name must be identical to the one given in the .config file (see the next section Configuration File).


<meshes>
<mesh>
<generator name="Cartesian2D" >
<x><n>20</n><length>2.0</length></x>
<y><n>20</n><length>2.0</length></y>
<origin>0.0 0.0</origin>
<nb-part-x>1</nb-part-x>
<nb-part-y>1</nb-part-y>
</generator>
</mesh>
</meshes>

This part allows calling the Cartesian2DMeshGenerator service (developer documentation only), which allows creating a 2D Cartesian mesh. In this example, we generate a mesh of 20x20 cells, with a total size of 2.0x2.0 (so each cell is (0.1, 0.1)) with an origin at (0.0, 0.0) and a subdivision into 1x1 subdomains (so there is 1x1=1 subdomain).

It is possible to specify a mesh file whose format is recognized by Arcane. In this case, you must replace the <generator> tag with <filename>filename_name</filename>:


<meshes>
<mesh>
<filename>sod.msh</filename>
</mesh>
</meshes>

For more information on possible mesh values, refer to the page Service 'ArcaneCaseMeshMasterService'


<say-hello>
<nSteps>3</nSteps>
</say-hello>

This part concerns only the SayHello module. Indeed, each module can have options recorded in the dataset. The module name is converted to low-case and capital letters are preceded by a hyphen.

Remarks
Several examples to understand:
SayHello -> say-hello
SAYHello -> s-a-y-hello
sayhello -> sayhello

In the middle, we find our option <nSteps>3</nSteps> which we saw in the previous section. We give it the value 3, which means that the instruction options()->getNStep() will return the value 3.

Remarks
As a reminder, in the .axl of the SayHello module, we had this:
<options>
<simple name="nSteps" type="integer" default="10">
<description>Nombre de boucle à effectuer.</description>
</simple>
</options>
We can clearly see the link between .axl and .arc.