Skip to content

How to develop and test

My Linh Würzburger edited this page Dec 17, 2020 · 2 revisions

Code Development and Testing

For code development, fork the git repository. After successful implementation and testing, file a pull request on git. Developments and testing thereof can be easily added to the existing code as described as follows.

Steps to include a new solver

  1. If necessary, add a new field (in the classes FieldController, Visual, Solution)
  2. Implement the solver itself (according to the interface DoStep()) in a new source file and add source files in CMakeLists.txt
  3. Add the solver in if-statements (in class SolverSelection)

Inclusion of further methods

  1. Implement the method itself in a new source file (according to the solver interface) and add the source files in CMakeLists.txt
  2. Add the method in if-statements in all solvers using the method

Steps to include more functions for initialisation

  1. If necessary add the initialisation to Functions
  2. Build an XML file with the new initialisation function
  3. Where applicable, add the function (in classes SolverController and Solution)

Adding new tests in tests folder

  1. Build an XML file for the new test (e.g., by using the script xml-builder.sh) and save it in new folder tests/<name of solver>/<name of case>
  2. If an analytical solution is available, add the solution to Functions as well as Solution to calculate the error between the numerical and the analytical solution (in Analysis)
  3. Run and save the output in ref.dat files in the tests/<name of solver>/<name of case> folder to test the consistency in cases of changing the underlying code
  4. Add consistency testing via the Python script verify.py in the tests/<name of solver>/<name of case> folder, which simply compares the output files .dat with the reference files _ref.dat via element-wise comparison using the L2-norm.
  5. Optional for use of ctest: ⋅⋅* Add the run.sh script to test the case for consistency ⋅⋅* Add the test in CMakeLists.txt with
add test( NAME <...> COMMAND sh ./run.sh $CMAKE_BINARY_DIR/$EXECUTABLE_OUTPUT_PATH/artss_<version> WORKING_DIRECTORY $CMAKE_BINARY_DIR/tests/<name of solver>/<name of case>)

Testing

  1. Test for consistency automatically via ctest .., which uses the provided run.sh and verify.py scripts or manually start the simulation and then test for consistency with the script verify.py
  2. If an analytical solution is available, check the absolute and root mean square errors in the terminal output

Filing new Issues

In case you find bugs or request new features, use templates introduced in Issues.


Back to Wiki home

Clone this wiki locally