Draft: Cleanup implementation of grid-functions
Summary
This is an extraction of some code changes from !345 (merged) to improve the readability and consistency of the code in the directory gridfunctions/
Major stylistic changes
- Use
class
instead oftypename
in templates - Use
std::size_t
instead of unprefixedsize_t
- No spaces between function name and argument list
- Spaces around assignment
=
sign - Prefer
using
overtypedef
- If possible (and not automatically provided) write deduction guide for class templates
Not consistently enforced styles
- Use curly braces for class instantiation instead of round braces (universal initialization), see http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list
-
share_ptr
that are stored in a class should be passed by value to the constructor and then moved into the instance variable, see https://stackoverflow.com/questions/12002480/passing-stdshared-ptr-to-constructors?noredirect=1&lq=1 and https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
Other changes
- Implement global evaluation function for
CompositeGridFunction
. - Move implementation detail
closestFaceIndex
into the classFaceNormalGridFunction
where it is used.
Edited by Simon Praetorius