{"action":"created","issue":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/739","repository_url":"https://api.github.com/repos/KratosMultiphysics/Kratos","labels_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/739/labels{/name}","comments_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/739/comments","events_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/739/events","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/739","id":253933987,"number":739,"title":"Problem with types of design variables when calculating sensitivities","user":{"login":"MFusseder","id":30687316,"avatar_url":"https://avatars2.githubusercontent.com/u/30687316?v=4","gravatar_id":"","url":"https://api.github.com/users/MFusseder","html_url":"https://github.com/MFusseder","followers_url":"https://api.github.com/users/MFusseder/followers","following_url":"https://api.github.com/users/MFusseder/following{/other_user}","gists_url":"https://api.github.com/users/MFusseder/gists{/gist_id}","starred_url":"https://api.github.com/users/MFusseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFusseder/subscriptions","organizations_url":"https://api.github.com/users/MFusseder/orgs","repos_url":"https://api.github.com/users/MFusseder/repos","events_url":"https://api.github.com/users/MFusseder/events{/privacy}","received_events_url":"https://api.github.com/users/MFusseder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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},{"login":"armingeiser","id":25903585,"avatar_url":"https://avatars2.githubusercontent.com/u/25903585?v=4","gravatar_id":"","url":"https://api.github.com/users/armingeiser","html_url":"https://github.com/armingeiser","followers_url":"https://api.github.com/users/armingeiser/followers","following_url":"https://api.github.com/users/armingeiser/following{/other_user}","gists_url":"https://api.github.com/users/armingeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/armingeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armingeiser/subscriptions","organizations_url":"https://api.github.com/users/armingeiser/orgs","repos_url":"https://api.github.com/users/armingeiser/repos","events_url":"https://api.github.com/users/armingeiser/events{/privacy}","received_events_url":"https://api.github.com/users/armingeiser/received_events","type":"User","site_admin":false},{"login":"KlausBSautter","id":26179700,"avatar_url":"https://avatars2.githubusercontent.com/u/26179700?v=4","gravatar_id":"","url":"https://api.github.com/users/KlausBSautter","html_url":"https://github.com/KlausBSautter","followers_url":"https://api.github.com/users/KlausBSautter/followers","following_url":"https://api.github.com/users/KlausBSautter/following{/other_user}","gists_url":"https://api.github.com/users/KlausBSautter/gists{/gist_id}","starred_url":"https://api.github.com/users/KlausBSautter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KlausBSautter/subscriptions","organizations_url":"https://api.github.com/users/KlausBSautter/orgs","repos_url":"https://api.github.com/users/KlausBSautter/repos","events_url":"https://api.github.com/users/KlausBSautter/events{/privacy}","received_events_url":"https://api.github.com/users/KlausBSautter/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2017-08-30T09:27:15Z","updated_at":"2017-09-01T11:23:45Z","closed_at":null,"author_association":"MEMBER","body":"Hey all!\r\n\r\nI am currently working on adjoint sensitivity analysis especially for structural problems. \r\nIn the actual concept for computing sensitivities the element base class (and also the condition base class) provides two types of design variables (double and array_1d):\r\n\r\n``  virtual void CalculateSensitivityMatrix(const Variable<double>& rDesignVariable, Matrix& rOutput,\r\nconst ProcessInfo& rCurrentProcessInfo)``\r\nand\r\n`` virtual void CalculateSensitivityMatrix(const Variable<array_1d<double,3> >& rDesignVariable, Matrix& rOutput,\r\nconst ProcessInfo& rCurrentProcessInfo)  ``.\r\n\r\nUntil now this was sufficient also for my work. But now I detected a problem:\r\n\r\nI saw for example in the CrBeamElement in the Structural Mechanics Application changes at the used variables which are problematic for computing sensitivities. So the inertias are now coupled in a Vector variable and are no longer separated in three individual double variables:\r\n`Vector inertia = this->GetProperties()[LOCAL_INERTIA_VECTOR];`\r\n  `const double J = inertia[0];`\r\n ` const double Iy = inertia[1];`\r\n  `const double Iz = inertia[2];`\r\n\r\nSure this reduces the number of variables but this summing up of variables makes live in sensitivity analysis much harder. This change makes it in the current implementation impossible to use the inertias or e.g. only Iy as design variable(s) in sensitivity analysis. \r\n\r\nBut for my work it would be essential to use all (or most) variables in an specific element as design variables. \r\n\r\nTo resolve this one solution could be, to look that potential interesting variables for sensitivity analysis are used in the specific elements as double or array_1d variables (e.g. use the inertias again as three individual double variables and not summing them up in a Vector variable).\r\nSure one could also provide more additional CalculateSensitivityMatrix(...)-functions with other types of variables in the element and condition base classes. But in my eyes double and array_1d are enough if individual variables are not collected. \r\n\r\nWhat is your opinion to this problem?\r\n\r\nThanks in advance!!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/comments/326556657","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/739#issuecomment-326556657","issue_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/739","id":326556657,"user":{"login":"armingeiser","id":25903585,"avatar_url":"https://avatars2.githubusercontent.com/u/25903585?v=4","gravatar_id":"","url":"https://api.github.com/users/armingeiser","html_url":"https://github.com/armingeiser","followers_url":"https://api.github.com/users/armingeiser/followers","following_url":"https://api.github.com/users/armingeiser/following{/other_user}","gists_url":"https://api.github.com/users/armingeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/armingeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armingeiser/subscriptions","organizations_url":"https://api.github.com/users/armingeiser/orgs","repos_url":"https://api.github.com/users/armingeiser/repos","events_url":"https://api.github.com/users/armingeiser/events{/privacy}","received_events_url":"https://api.github.com/users/armingeiser/received_events","type":"User","site_admin":false},"created_at":"2017-09-01T11:23:45Z","updated_at":"2017-09-01T11:23:45Z","author_association":"MEMBER","body":"I agree that it could be done using an if/else clause to get the `double&` as you suggested @loumalouomega.\r\n\r\nBut this will only work as long the Variables `IT,IY,IZ` exist, and as far as I see the are not used anywhere. At the moment they exist, but they do not store any information. So we can use them to identify the desired entry of the `LOCAL_INERTIA_VECTOR` but i don't see why there should be two variables for basically the same thing.\r\n\r\nWhat I'm trying to say is, that the `LOCAL_INERTIA_VECTOR`  seems to be treated differently than other variables like e.g. `CROSS_AREA`, ` AREA_EFFECTIVE_Y` or ` AREA_EFFECTIVE_Z`.\r\n\r\n"}}
{"actor":{"display_login":"armingeiser"}}