Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • ExaHyPE-Engine ExaHyPE-Engine
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 68
    • Issues 68
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.

  • ExaHyPEExaHyPE
  • ExaHyPE-EngineExaHyPE-Engine
  • Issues
  • #61
Closed
Open
Issue created Sep 14, 2016 by Ghost User@ghostContributor

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__ */
Assignee
Assign to
Time tracking

LRZ Homepage | Datenschutz | Dokumentation und Betriebsbedingungen | Impressum