|
[Sponsors] |
April 4, 2018, 06:53 |
Supporting multiple OF versions in library
|
#1 |
Senior Member
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14 |
Dear all,
I am developing a library for wall-modelled LES in OpenFOAM https://bitbucket.org/lesituu/libwallmodelledles Unfortunately, the OF community is split and there are several forks, all with different APIs. Moreover, breaking API changes are continuously introduced within a single fork as well. I work with OpenFOAM 3.0.1 but I would like the code to support multiple versions of OF, to enlarge the user-base. I intended to have separate git branches corresponding to different versions. But I see already now that this is not going to work: propagating changes to several branches will take too long and it will be hard to keep them in sync. Therefore, I would like the code to determine the OF fork that is installed and have appropriate pieces of code compiled. If I understand correctly, swak4foam manages to do that, using complicated makefiles and #ifdef macros in the code, like this, for example Code:
#ifdef FOAM_NO_DIMENSIONEDINTERNAL_IN_GEOMETRIC << this->internalField().name() #else << this->dimensionedInternalField().name() #endif Best, Timofey |
|
Tags |
version-specific code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[Other] Bashrc problem on multiple OpenFOAM versions | Rolanzo | OpenFOAM Installation | 4 | March 4, 2018 16:42 |
[OpenFOAM.org] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs | Pier84 | OpenFOAM Installation | 4 | June 18, 2016 17:22 |
decomposePar is missing a library | whk1992 | OpenFOAM Pre-Processing | 8 | March 7, 2015 08:53 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |