4C-multiphysics / 4C

4C: A Comprehensive Multi-Physics Simulation Framework
https://www.4c-multiphysics.org
GNU Lesser General Public License v3.0
26 stars 22 forks source link

Unify and specify the types of special-purpose C++ files #58

Open sebproell opened 5 days ago

sebproell commented 5 days ago

Originally based on this issue from Gitlab

Description

We use different special extensions to signify special purpose files, e.g., _fwd.hpp, _templates.hpp, .fwd.hpp.

Possible Solution and Definition of Done

Interested Parties

@knarfnitram (I adapted this slightly)

sebproell commented 4 days ago

Also related to the question of how we forward declare external symbols, see https://gitlab.lrz.de/baci/baci/-/issues/1346.

isteinbrecher commented 2 days ago

We also have some .cpp files that are automatically generated, e.g., https://github.com/4C-multiphysics/4C/tree/main/src/shell_kl_nurbs/src , I think it would make sense to add something like _autogen.cpp to distinguish these files from "normal" .cpp files.

sebproell commented 2 days ago

@isteinbrecher What would be the benefit of having this _autogen.cpp extension? The extensions I listed above are all relevant for the build system (and to some extent to developers). I guess this _autogen would notify devleopers that they are modifying a file that they should rather generate? The problem I see here is that it is not clear how to generate them. Currently the generating scripts are more for documentation and are not actually used and tested.

isteinbrecher commented 2 days ago

Yes the main feature would be that it is clear that functional changes should not be made to such files, but rather to the source file.

However, you are right, if we don’t test the generating script such a postfix for the name might be overkill. At least for AceGen scripts I don’t see a way to test this in the near future, so I am fine with just manually adding this to the file name.