|
waLBerla 7.3
|
Welcome to the contributors guide to the waLBerla v8 core library. Here you will find instructions and guidance on how to contribute code to the v8 core modules. Please read this guide carefully before beginning development.
The V8 core library is part of the waLBerla project's ongoing efforts at modernization. It is designed as a platform for the reimplementation of waLBerla's core framework features, and will replace the legacy framework modules over time.
In developing the V8 core, we follow these guiding principles:
The library's public header files are located in the directory include/walberla/v8, placed in subfolders according to module affiliation. We employ the file extension .hpp and #pragma once include guards for headers.
Translation units are located at the src/v8 directory.
Each source file must have a license header, including authorship information. Source files must be formatted using clang-format according to the style laid down in the waLBerla project's .clang-format file.
The outermost namespace is walberla::v8. Each module ModuleX has its own namespace walberla::v8::module_x. Module namespace names are written in lower snake-case. A module's components and submodules should be further distributed into child namespaces, as is appropriate. Modules are allowed to export their most important APIs to the parent namespace walberla::v8 via using-declarations.
The header files and translation units of module ModuleX are located in the v8/module_x subfolders of the include/walberla and src directories, respectively. Each module has a primary header file walberla/v8/ModuleX.hpp that #includes and re-exports the module's public APIs. The primary header files are in turn included the bulk-header walberla/V8.hpp.
Public APIs must be sufficiently documented. We use Doxygen documentation comments in Javadoc-style for API documentation. We use the @ syntax for special commands, and prefer Markdown over Doxygen-commands and raw HTML (see Markdown in the Doxygen documentation).
Classes and free functions must be grouped according to their owning modules and submodules, in order to be easily locatable in the documentation pages. See Grouping in the Doxygen documentation.
When done correctly, API documentation will appear cleanly structured in the API Reference > Modules section.
Code in the V8 core modules must be rigorously tested. In waLBerla, unit and integration testing is orchestrated using CTest. For writing tests, we have developed a toolkit of test utilities, including functions for registering tests with CMake; a tests runner, an extensive family of assertions and helper functions, and verbose error reporting. Refer to the test toolkit's documentation for instructions on how to create and register tests.
Tests are placed in the tests/v8 directory, grouped by modules. Tests should also be topically grouped into test executables to reduce compilation times. Each unit test function should test a single, or a small set of, API features, using the toolkit's assertion functions. Particular attention should be given to edge cases and error conditions.