-
Notifications
You must be signed in to change notification settings - Fork 2
How to develop and test
My Linh Würzburger edited this page Dec 17, 2020
·
2 revisions
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.
- If necessary, add a new field
(in the classes
FieldController, Visual, Solution) - Implement the solver itself (according to the interface
DoStep()) in a new source file and add source files inCMakeLists.txt - Add the solver in if-statements
(in class
SolverSelection)
- Implement the method itself in a new source file (according to the solver interface)
and add the source files in
CMakeLists.txt - Add the method in if-statements in all solvers using the method
- If necessary add the initialisation to
Functions - Build an XML file with the new initialisation function
- Where applicable, add the function
(in classes
SolverControllerandSolution)
- Build an XML file for the new test (e.g., by using the script
xml-builder.sh) and save it in new foldertests/<name of solver>/<name of case> - If an analytical solution is available, add the solution to
Functionsas well asSolutionto calculate the error between the numerical and the analytical solution (inAnalysis) - 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 - Add consistency testing via the Python script
verify.pyin thetests/<name of solver>/<name of case>folder, which simply compares the output files.datwith the reference files_ref.datvia element-wise comparison using the L2-norm. - Optional for use of ctest:
⋅⋅* Add the
run.shscript to test the case for consistency ⋅⋅* Add the test inCMakeLists.txtwith
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>)
- Test for consistency automatically via
ctest .., which uses the providedrun.shandverify.pyscripts or manually start the simulation and then test for consistency with the scriptverify.py - If an analytical solution is available, check the absolute and root mean square errors in the terminal output
In case you find bugs or request new features, use templates introduced in Issues.
Back to Wiki home