Replies: 1 comment 1 reply
-
|
Well, yes, I would like to have it back too, but technically I don't see how to do this. The reason for the move to .hpp is essentially that the former hydro class has become a class template. This allowed us to create several "flavours" of fluids without rewriting all of the code for the rhs, curvature, passive scalars, etc. This is very interesting for dust fluids and radiative transfer, for instance. Now, with .cpp, you tell the compiler to compile the cpp with an explicit path to the cpp, so this is easy to modify in the Makefile, and it's exactly what With .hpp, the game is different. These files are included from another .cpp file. For instance, the fluid.hpp is typically included by the DataBlock class, because this class defines the method Now, how does the compiler goes looking for these .hpp file? It turns out the C++ standard doesn't tell you anything, so that's implementation dependent (i.e. it depends on the compiler you use). It seems that compilers usually go first looking in the current directory, and that's not a feature you can bypass (because that's in the compiler code!). So if you include a .hpp that is in your current directory, then there's nothing you can do to force include a file with the same name in another directory instead. Hence, you can't do what we used to do with .cpp files. Now, maybe some people here now tricks that could circumvent this, but for the moment, I don't see any way to restore this functionality in idefix v2+. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am opening this discussion to advocate for a very useful early feature of the code, namely the replace_idefix_source CMake function, that has lapsed in more recent versions of the code. As far as I understand, replace_idefix_source works great with cpp files, but not that much with hpp files (I don't know why though). However, since version 2.0 I guess, a lot of the code content has been moved from cpp to hpp files, making this feature no longer useable. I also noted that it was no longer part of the current documentation, so I was wondering if it was a design choice or a real difficulty to incorporate in recent versions of IDEFIX. If there is anything I can do to help reviving this feature, let me know!
Cheers,
Jean
Beta Was this translation helpful? Give feedback.
All reactions