openfoam-adapter
openfoam-adapter copied to clipboard
Replace raw pointers with std::vector / Foam::autoPtr
We use several raw pointers throughout the code. We should replace them by std:vector
(or std::array
) or unique_ptr
wherever possible.
For smart pointers we should probably not use unique_ptr
: it would be ugly, as we should not use make_unique
, which is C++14 (OpenFOAM requires C++11, although preCICE requires C++14, so it probably does not matter).
In any case, OpenFOAM seems to offer similar functionality: autoPtr.H
.
Description
Pointer management similar to std::unique_ptr, with some additional
methods and type checking.
Raw pointers, delete, new, .... etc should not appear in modern C++ as long as needed ;)
@MakisH
OpenFOAM requires C++11, although preCICE requires C++14, so it probably does not matter
C++ standard and ABI are different --> So it does not matter which standard you use to build your code. Only the ABI must be compatible. ABI on one Linux system is the same :)
Edit: The target library must be able to read the corresponding interface
Thanks! My worry is not about ABI, it is about sticking to the minimum requirements of the solver, as we also want to target older systems (usually compute clusters). But again, preCICE already requires C++14, so it does not matter. :)