Compile time constants should be available as static const
Currently, we do have
int exahype::solvers::Solver::getNumberOfVariables() const {
return _numberOfVariables;
}
as a method in the Solvers. However, this is not accessible at user kernels as the Solver object is no more accessible. As these are compile time constants, they should be generated by the code, ie. in a file like GeneratedConstants.h:
#ifndef __MY_GENERATED_CONSTANTS__
#define __MY_GENERATED_CONSTANTS__
/**
* These constants should be created by the toolkit instead
* of scattering numbers around in the code. The practice to
* write naked numbers somewhere, as in
* ADERDGSolver("SRHDSolver", 3, 2, ...)
* is called "magic numbers" and they are accepted as bad
* coding practice.
*
* As we currently cannot run the toolkit for SRHD,
* these constants have to be always kept equal to the
* toolkit.
*
**/
static const int MY_POLYNOMIAL_DEGREE = 1;
static const int MY_NUMBER_OF_VARIABLES = 5;
static const int MY_NUMBER_OF_PARAMETERS = 0;
#endif /* __MY_GENERATED_CONSTANTS__ */