jvencels / EOF-Library

Efficient two-way coupling between Elmer FEM and OpenFOAM
https://eof-library.com/
GNU General Public License v3.0
70 stars 25 forks source link

Added OpenFOAM-11 compatibility #12

Closed didzis-berenis closed 5 months ago

didzis-berenis commented 5 months ago

1) Header fvCFD.H is no longer defined in OF11. The bare minimum to compile EOF-Library is to include fvMesh.H instead. 2) OF11 uses c++14 standard, so the flag -std=gnu++0x cannot be used. I did not specify here that c++14 standard is required though. Should I add -std=gnu++1y in the if statement for OF11?

jvencels commented 5 months ago

Hi Didzis,

I am not sure about the flag. Please explain in more detail what would be the right solution.

Juris

On Wed, Apr 3, 2024, 08:48 didzis-berenis @.***> wrote:

  1. Header fvCFD.H is no longer defined in OF11. The bare minimum to compile EOF-Library is to include fvMesh.H instead.
  2. OF11 uses c++14 standard, so the flag -std=gnu++0x cannot be used. I did not specify here that c++14 standard is required though. Should I add -std=gnu++1y in the if statement for OF11?

You can view, comment on, or merge this pull request online at:

https://github.com/jvencels/EOF-Library/pull/12 Commit Summary

File Changes

(2 files https://github.com/jvencels/EOF-Library/pull/12/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/jvencels/EOF-Library/pull/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHP7QILS4J3UDRCJ6PGOTDY3OJ2RAVCNFSM6AAAAABFUTV5JSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDCOJVGM4DGMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

didzis-berenis commented 5 months ago

It's just that OF11 doesn't compile with the flag -std=gnu++0x that is currently in the compile options. The current option corresponds to c++11, but the OF11 needs c++14. Also, turns out my proposed -std=gnu++1y flag is deprecated See here so -std=gnu++14 should be used instead.

I find that for me omitting this flag altogether and letting the compiler decide works fine. I think in the most common case the user will be installing OF11, which uses c++14, so EOF-Library should also compile fine.

So I propose in case of OF11: either 1) omit c++11 flag (current commit) or 2) add -std=gnu++14 flag to compiler and explicitly demand c++14