{"action":"created","issue":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/732","repository_url":"https://api.github.com/repos/KratosMultiphysics/Kratos","labels_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/732/labels{/name}","comments_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/732/comments","events_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/732/events","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/732","id":251906093,"number":732,"title":"Non const Get functions in base classes (element.h, condition.h, etc.)","user":{"login":"inigolcanalejo","id":28628414,"avatar_url":"https://avatars0.githubusercontent.com/u/28628414?v=4","gravatar_id":"","url":"https://api.github.com/users/inigolcanalejo","html_url":"https://github.com/inigolcanalejo","followers_url":"https://api.github.com/users/inigolcanalejo/followers","following_url":"https://api.github.com/users/inigolcanalejo/following{/other_user}","gists_url":"https://api.github.com/users/inigolcanalejo/gists{/gist_id}","starred_url":"https://api.github.com/users/inigolcanalejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inigolcanalejo/subscriptions","organizations_url":"https://api.github.com/users/inigolcanalejo/orgs","repos_url":"https://api.github.com/users/inigolcanalejo/repos","events_url":"https://api.github.com/users/inigolcanalejo/events{/privacy}","received_events_url":"https://api.github.com/users/inigolcanalejo/received_events","type":"User","site_admin":false},"labels":[{"id":539269431,"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/c++","name":"c++","color":"c5def5","default":false},{"id":538609887,"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/discussion","name":"discussion","color":"cc317c","default":false},{"id":538395922,"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":539268135,"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/kratos%20core","name":"kratos core","color":"d4c5f9","default":false},{"id":538395924,"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"jcotela","id":5071546,"avatar_url":"https://avatars3.githubusercontent.com/u/5071546?v=4","gravatar_id":"","url":"https://api.github.com/users/jcotela","html_url":"https://github.com/jcotela","followers_url":"https://api.github.com/users/jcotela/followers","following_url":"https://api.github.com/users/jcotela/following{/other_user}","gists_url":"https://api.github.com/users/jcotela/gists{/gist_id}","starred_url":"https://api.github.com/users/jcotela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcotela/subscriptions","organizations_url":"https://api.github.com/users/jcotela/orgs","repos_url":"https://api.github.com/users/jcotela/repos","events_url":"https://api.github.com/users/jcotela/events{/privacy}","received_events_url":"https://api.github.com/users/jcotela/received_events","type":"User","site_admin":false},"assignees":[{"login":"jcotela","id":5071546,"avatar_url":"https://avatars3.githubusercontent.com/u/5071546?v=4","gravatar_id":"","url":"https://api.github.com/users/jcotela","html_url":"https://github.com/jcotela","followers_url":"https://api.github.com/users/jcotela/followers","following_url":"https://api.github.com/users/jcotela/following{/other_user}","gists_url":"https://api.github.com/users/jcotela/gists{/gist_id}","starred_url":"https://api.github.com/users/jcotela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcotela/subscriptions","organizations_url":"https://api.github.com/users/jcotela/orgs","repos_url":"https://api.github.com/users/jcotela/repos","events_url":"https://api.github.com/users/jcotela/events{/privacy}","received_events_url":"https://api.github.com/users/jcotela/received_events","type":"User","site_admin":false},{"login":"RiccardoRossi","id":8059665,"avatar_url":"https://avatars1.githubusercontent.com/u/8059665?v=4","gravatar_id":"","url":"https://api.github.com/users/RiccardoRossi","html_url":"https://github.com/RiccardoRossi","followers_url":"https://api.github.com/users/RiccardoRossi/followers","following_url":"https://api.github.com/users/RiccardoRossi/following{/other_user}","gists_url":"https://api.github.com/users/RiccardoRossi/gists{/gist_id}","starred_url":"https://api.github.com/users/RiccardoRossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RiccardoRossi/subscriptions","organizations_url":"https://api.github.com/users/RiccardoRossi/orgs","repos_url":"https://api.github.com/users/RiccardoRossi/repos","events_url":"https://api.github.com/users/RiccardoRossi/events{/privacy}","received_events_url":"https://api.github.com/users/RiccardoRossi/received_events","type":"User","site_admin":false},{"login":"pooyan-dadvand","id":8911479,"avatar_url":"https://avatars3.githubusercontent.com/u/8911479?v=4","gravatar_id":"","url":"https://api.github.com/users/pooyan-dadvand","html_url":"https://github.com/pooyan-dadvand","followers_url":"https://api.github.com/users/pooyan-dadvand/followers","following_url":"https://api.github.com/users/pooyan-dadvand/following{/other_user}","gists_url":"https://api.github.com/users/pooyan-dadvand/gists{/gist_id}","starred_url":"https://api.github.com/users/pooyan-dadvand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pooyan-dadvand/subscriptions","organizations_url":"https://api.github.com/users/pooyan-dadvand/orgs","repos_url":"https://api.github.com/users/pooyan-dadvand/repos","events_url":"https://api.github.com/users/pooyan-dadvand/events{/privacy}","received_events_url":"https://api.github.com/users/pooyan-dadvand/received_events","type":"User","site_admin":false},{"login":"msandre","id":22290001,"avatar_url":"https://avatars0.githubusercontent.com/u/22290001?v=4","gravatar_id":"","url":"https://api.github.com/users/msandre","html_url":"https://github.com/msandre","followers_url":"https://api.github.com/users/msandre/followers","following_url":"https://api.github.com/users/msandre/following{/other_user}","gists_url":"https://api.github.com/users/msandre/gists{/gist_id}","starred_url":"https://api.github.com/users/msandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msandre/subscriptions","organizations_url":"https://api.github.com/users/msandre/orgs","repos_url":"https://api.github.com/users/msandre/repos","events_url":"https://api.github.com/users/msandre/events{/privacy}","received_events_url":"https://api.github.com/users/msandre/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2017-08-22T10:11:31Z","updated_at":"2017-08-27T11:13:42Z","closed_at":null,"body":"@RiccardoRossi , @pooyan-dadvand or anyone that can answer this question,\r\n\r\nI observed there are several Get functions defined in element.h (e.g. GetValuesVector, GetValueOnIntegrationPoints), which are not const. I thought the nature of a Get function is to get some values without changing them and therefore it should be defined as const to avoid problems. What is the reason for not doing it like this? Flexibility?\r\n\r\nThis came up because I have a function (CalculateGradient) that inputs a constant element (because again, we do not want to change it) and of course, I cannot call GetValuesVector because it is not defined as const.\r\n\r\nSolutions we came up with together with @msandre : \r\n\r\n1. Just not define the function CalculateGradient to input a constant element, but just an element (and risk that the element can be changed inside this function)\r\n\r\n2. const_cast the element when calling the non const GetValuesVector\r\n\r\n3. Define another GetValuesVector in element.h which is const. This is actually is done for: GetProperties and GetValue, which are defined twice: once as const and once as non const (why?)\r\n\r\n4. Change all Get functions to const (which will involve overriding them again as const in all of the applications)\r\n\r\nAny ideas how to proceed or explanation why it is done like this?\r\n\r\nThank you in advance."},"comment":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/comments/325191974","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/732#issuecomment-325191974","issue_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/732","id":325191974,"user":{"login":"RiccardoRossi","id":8059665,"avatar_url":"https://avatars1.githubusercontent.com/u/8059665?v=4","gravatar_id":"","url":"https://api.github.com/users/RiccardoRossi","html_url":"https://github.com/RiccardoRossi","followers_url":"https://api.github.com/users/RiccardoRossi/followers","following_url":"https://api.github.com/users/RiccardoRossi/following{/other_user}","gists_url":"https://api.github.com/users/RiccardoRossi/gists{/gist_id}","starred_url":"https://api.github.com/users/RiccardoRossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RiccardoRossi/subscriptions","organizations_url":"https://api.github.com/users/RiccardoRossi/orgs","repos_url":"https://api.github.com/users/RiccardoRossi/repos","events_url":"https://api.github.com/users/RiccardoRossi/events{/privacy}","received_events_url":"https://api.github.com/users/RiccardoRossi/received_events","type":"User","site_admin":false},"created_at":"2017-08-27T11:13:42Z","updated_at":"2017-08-27T11:13:42Z","body":"Hi Mike,\n\nIn any case before doing any move in this direction, it would be important\nthat all the overrides are added to all of th application s (clang tidy can\ndo it automwtixally., There is an how-to in the wiki).\n\nAlso this is a sort of disruptive change, so let s also wait for Pooyan's\nfeedback\n\nRiccardo\n\n\nEl 27 ago. 2017 9:01 a. m., \"Michael Andre\" <notifications@github.com>\nescribió:\n\n> We could probably add\n>\n>    - EquationIdVector\n>\n> to the list above.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/KratosMultiphysics/Kratos/issues/732#issuecomment-325183372>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AHr7EWfeAWOU3ToMRmqnpw2rlcOcvsd9ks5scSJHgaJpZM4O-ZzU>\n> .\n>\n"}}
{"actor":{"display_login":"RiccardoRossi"}}