Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 423
    • Issues 423
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #195
Closed
Open
Issue created Jul 26, 2016 by Mark OLESEN@markMaintainer

Need means of distinguishing between openfoam versions for user-coding

When migrating user code between versions, there are some changes in OpenFOAM that may require alteration in the user code. If this code exists in a codeStream, for example, it may not be possible to run the same case with slightly different OpenFOAM versions. It is proposed to supply a pre-processor define to reflect the current base-level compatibility. This type of define could also be used to distinguish between OpenFOAM+ and other variants. This type of definition would also greatly simplify other third-party applications that may be built for various OpenFOAM versions. For example,

#ifdef OPENFOAM_PLUS
...
#endif

The OPENFOAM_PLUS define would have a numerical value corresponding to the newly introduced version numbers (eg, 1606) since these provide a simple, consistent, linear numbering without any additional effort.

#ifdef OPENFOAM_PLUS
    #if (OPENFOAM_PLUS >= 1612)
    ...
    #endif
#endif

This type of code naturally becomes quite cluttered and thus should only be used when strictly necessary.

It remains at the discretion of the developers to bump the number between release cycles, to indicate a newer functionality. Finer granularity than one month is not intended.

Assignee
Assign to
Time tracking