User Tools

Site Tools


battery:addtestgitlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
battery:addtestgitlab [2025/10/29 10:56]
arthur [Creating your test]
battery:addtestgitlab [2026/01/26 10:26] (current)
arthur
Line 12: Line 12:
   - 1. A build phase that generates, in Unix, the Prepro.exe, Lagamine.exe and Select.exe. This gives a first information on the state of the code.   - 1. A build phase that generates, in Unix, the Prepro.exe, Lagamine.exe and Select.exe. This gives a first information on the state of the code.
   - 2. A test phase that launches as many tests as implemented. It uses three .sh files:   - 2. A test phase that launches as many tests as implemented. It uses three .sh files:
-       * run_tests.sh:​ this file cycles through the $CI_PROJECT/​Tests/​ folders in order to run each test. The prepro and lagamine is run for each test, then the .ipe, .ipn and .ipr are compared with the original results that may be found in a folder ExpectedResults. For the moment, the tolerance is set to 3% and any value below 1E-7 is rounded to 0.0. +       * run_tests.sh:​ this file cycles through the $CI_PROJECT/​Tests/​ folders in order to run each test. The prepro and lagamine is run for each test, then the .ipe, .ipn and .ipr are compared with the original results that may be found in a folder ExpectedResults. For the moment, the tolerance is set to 3% and any value below 1E-7 is rounded to 0.0. The differences are calculated as such:\\ \\ if(absx < abs_tol && absy < abs_tol) {diff = 0} \\ else if(absx < abs_tol) {diff = absy / abs_tol} \\ else if(absy < abs_tol) {diff = absx / abs_tol} \\ else {diff = (y - x)/x} \\ 
 +       
        * run_prepro.sh:​ this file calls the newly generated prepro.exe for the test case.        * run_prepro.sh:​ this file calls the newly generated prepro.exe for the test case.
        * run_lagamine.sh:​ this file calls the newly generated lagamine.exe for the test case. The .ipe, .ipn, .ipr, .log and .out are generated and exported in the artifacts of Gitlab, for further referencing. The simulations are run in sequential as all routines do not allow the use of parallelisation at the moment.        * run_lagamine.sh:​ this file calls the newly generated lagamine.exe for the test case. The .ipe, .ipn, .ipr, .log and .out are generated and exported in the artifacts of Gitlab, for further referencing. The simulations are run in sequential as all routines do not allow the use of parallelisation at the moment.
Line 37: Line 38:
  
 Once you have designed your test and created the necessary simulation files, you must identify the important variables that indicate whether your law/element is behaving as it should. \\ Once you have designed your test and created the necessary simulation files, you must identify the important variables that indicate whether your law/element is behaving as it should. \\
-These values can be obtained via the [[appendices:​a9|*.ipe result file]].// \\ \\ **Be sure to print out the values you want to check at the time step(s) you see fit**. \\ To define the time steps at which you want a printing, you can use [[lagamex:​auto#​rd_line_14i5_-_strategy_control_data|ILSAV = 1 or 2]] in the ex.dat file. \\ Check [[appendices:​a1|Appendix 1: Printing options]] and [[appendices:​a9|Appendix 9: Printing files]] for more info about printing files.+These values can be obtained via the [[appendices:​a9|*.ipe result file]].
  
-==== Comparator code ==== +**Be sure to print out the values ​you want to check at the time step(s) you see fit**. \\ To define the time steps at which you want printing, you can use [[lagamex:auto#​rd_line_14i5_-_strategy_control_data|ILSAV = 1 or 2]] in the ex.dat file. \\ Check [[appendices:a1|Appendix 1: Printing options]] and [[appendices:a9|Appendix 9: Printing files]] for more info about printing ​files.
-After you have created your test and identified ​the variables that need to be checked, ​you need to write the comparator code. \\ \\ This code should be written in Python script. If Python is not already installed on your computer, you can download it from the official Python website: ​[[https://​www.python.org/​downloads/​|https://www.python.org/​downloads/​]] ​\\ Several editors exist to facilitate coding and debugging with Python. You can use [[https://​www.spyder-ide.org/​|Spyder]] or [[https://​code.visualstudio.com/​|Visual Studio Code]] for instance.\\ +
- +
-For the comparator code, it is recommanded to use one of the existing comparators as an example. You can search in the Dokuwiki tests that use the same type of result ​files as you to find a code similar to what you should write\\+
  
 ==== Adding your test to the battery ==== ==== Adding your test to the battery ====
Line 48: Line 46:
 To add a new test to the battery, you should: To add a new test to the battery, you should:
   * Add the new test to "​http://​www.lagamine.uliege.be/​dokuwiki/​doku.php/​battery/​listtests" ​   * Add the new test to "​http://​www.lagamine.uliege.be/​dokuwiki/​doku.php/​battery/​listtests" ​
-  ​* Modify the file **Test_battery.txt** on Obelix: add the name of the new test +  * Add the folder containing your test to the test battery directory.
-  ​* Add the folder containing your test to the test battery directory. ​This folder should contain: +
-                    * The files of simulation (with the same name as the test) +
-                    * The reference simulation folder (with the same name as the test + "​_ref"​) +
-                    * The comparator python script (with the same name as the test)+
  
  
battery/addtestgitlab.1761731776.txt.gz · Last modified: 2025/10/29 10:56 by arthur