Skip to content
Snippets Groups Projects
Closed Need means of distinguishing between openfoam versions for user-coding
  • View options
  • Need means of distinguishing between openfoam versions for user-coding

  • View options
  • Closed Issue created

    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.

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading