[GeoMechanicsApplication] Removed all unused math utilities#12383
[GeoMechanicsApplication] Removed all unused math utilities#12383
Conversation
The removal of these unused functions fixes many code smells. Also removed unused/incorrect `#include`s from the math utilities file. As a result, several other `#include`s had to be updated as well.
WPK4FEM
left a comment
There was a problem hiding this comment.
Not used is bad, not there is better.
markelov208
left a comment
There was a problem hiding this comment.
Anne, very good to remove a lot of unused staff with their code smells!
| namespace Kratos | ||
| { | ||
|
|
||
| class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoMechanicsMathUtilities |
There was a problem hiding this comment.
Is there need to have 'KRATOS_API(GEO_MECHANICS_APPLICATION)' now?
There was a problem hiding this comment.
You are correct that strictly speaking at the moment there is no need to export this class. However, with the upcoming migration to GTest, I believe it is desirable to have this export in place. Otherwise, we'll need to update the GTest branch to account for that. (The unit test would no longer compile on Windows without this export when we start using GTest.) And I wouldn't want to delay that PR since it got so close to being merged ;-)
There was a problem hiding this comment.
I think it actually is, since it has a header and source file. When everything is in the header it works, but if I remember correctly I got linking errors when I didn't export this. At least we had similar issues when splitting processes into header and sources
There was a problem hiding this comment.
I have tried to remove the export and rebuild the project, and that worked just fine. The export is just for changing the visibility of the function at the DLL level. As long as the function is being called by other functions that are in the same DLL, the export should not be needed. Only when functions that live in other DLLs need to access this function, the visibility becomes important (or else, linker errors will occur).
There was a problem hiding this comment.
Ahh okay, I think I was confused because in the past we needed to add the export when splitting into cpp and header for the processes, probably because they are also used in python then?
In any case it's necessary for gtest so indeed it doesn't really matter.
rfaasse
left a comment
There was a problem hiding this comment.
Thanks for taking this over!
📝 Description
The removal of these unused functions fixes many code smells. Also removed unused/incorrect
#includes from the math utilities file. As a result, several other#includes had to be updated as well.