Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

[Node] It is about time to remove the dimension template argument from node.h

Open loumalouomega opened this issue 3 years ago • 3 comments

Description Long time ago (when Kratos just started in Github), the point dimension template argument was removed. A priori, the idea was to remove this template argument from the node.h.

https://github.com/KratosMultiphysics/Kratos/blob/0e8c5c0b03553ba20d16ebcf27e52752a7f3e2e6/kratos/includes/node.h#L72

Reasons why:

  • It is actually not used
  • Cleaner code
  • Part of the code could be moved to a source file, and due to the fact that node.h is included many times the compilation time could be reduced considerably
  • Now with the magic of the VSCode search tool it is easy to replace code (at that time I used an IDE for Java that I think doesn't exist anymore for this kind of replacements)

To discuss:

  • Should we remove the TDofType argument if we are always considering Dof? (in any case, it is possible to do an explicit instantation)

TODO

  • [ ] Remove template argument
  • [ ] Replace the code everywhere
  • [ ] Move as much code as possible to source file
  • [x] Hope not to break anything

loumalouomega avatar Jul 15 '22 13:07 loumalouomega

I added as assignees to the @KratosMultiphysics/technical-committee

loumalouomega avatar Jul 15 '22 14:07 loumalouomega

About the dimension argument, totally agree. About the TDofType, not sure at all. I remember discussing at some point how we could extend this to DOFs with an imaginary component.

rubenzorrilla avatar Jul 15 '22 14:07 rubenzorrilla

About the dimension argument, totally agree. About the TDofType, not sure at all. I remember discussing at some point how we could extend this to DOFs with an imaginary component.

Or maybe with floats...for some specific cases, the reason why many video games C++ is so fast is because they use single floats (they don't care about precision), but additions are 4x faster and multiplications 12x faster (if I remember properly)

loumalouomega avatar Jul 15 '22 14:07 loumalouomega