{"action":"created","issue":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2333","repository_url":"https://api.github.com/repos/KratosMultiphysics/Kratos","labels_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2333/labels{/name}","comments_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2333/comments","events_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2333/events","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/2333","id":332990924,"node_id":"MDU6SXNzdWUzMzI5OTA5MjQ=","number":2333,"title":"Maybe inconsistent ModelPart.AddProperties","user":{"login":"miguelmaso","id":25640870,"node_id":"MDQ6VXNlcjI1NjQwODcw","avatar_url":"https://avatars1.githubusercontent.com/u/25640870?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelmaso","html_url":"https://github.com/miguelmaso","followers_url":"https://api.github.com/users/miguelmaso/followers","following_url":"https://api.github.com/users/miguelmaso/following{/other_user}","gists_url":"https://api.github.com/users/miguelmaso/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelmaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelmaso/subscriptions","organizations_url":"https://api.github.com/users/miguelmaso/orgs","repos_url":"https://api.github.com/users/miguelmaso/repos","events_url":"https://api.github.com/users/miguelmaso/events{/privacy}","received_events_url":"https://api.github.com/users/miguelmaso/received_events","type":"User","site_admin":false},"labels":[{"id":538395919,"node_id":"MDU6TGFiZWw1MzgzOTU5MTk=","url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/bug","name":"bug","color":"ee0701","default":true},{"id":539268135,"node_id":"MDU6TGFiZWw1MzkyNjgxMzU=","url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/kratos%20core","name":"kratos core","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"miguelmaso","id":25640870,"node_id":"MDQ6VXNlcjI1NjQwODcw","avatar_url":"https://avatars1.githubusercontent.com/u/25640870?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelmaso","html_url":"https://github.com/miguelmaso","followers_url":"https://api.github.com/users/miguelmaso/followers","following_url":"https://api.github.com/users/miguelmaso/following{/other_user}","gists_url":"https://api.github.com/users/miguelmaso/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelmaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelmaso/subscriptions","organizations_url":"https://api.github.com/users/miguelmaso/orgs","repos_url":"https://api.github.com/users/miguelmaso/repos","events_url":"https://api.github.com/users/miguelmaso/events{/privacy}","received_events_url":"https://api.github.com/users/miguelmaso/received_events","type":"User","site_admin":false},"assignees":[{"login":"miguelmaso","id":25640870,"node_id":"MDQ6VXNlcjI1NjQwODcw","avatar_url":"https://avatars1.githubusercontent.com/u/25640870?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelmaso","html_url":"https://github.com/miguelmaso","followers_url":"https://api.github.com/users/miguelmaso/followers","following_url":"https://api.github.com/users/miguelmaso/following{/other_user}","gists_url":"https://api.github.com/users/miguelmaso/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelmaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelmaso/subscriptions","organizations_url":"https://api.github.com/users/miguelmaso/orgs","repos_url":"https://api.github.com/users/miguelmaso/repos","events_url":"https://api.github.com/users/miguelmaso/events{/privacy}","received_events_url":"https://api.github.com/users/miguelmaso/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-06-16T14:31:00Z","updated_at":"2018-06-16T16:11:27Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"AddProperties is defined in\r\n\r\nhttps://github.com/KratosMultiphysics/Kratos/blob/c8c5e2ee5057650a0d2f641b96a7602e83766fc2/kratos/includes/model_part.h#L589\r\n\r\nwhich inserts a property (`pNewProperty`) with `ThisIndex` in the current mesh. But the property Id could be another which is not `ThisIndex`. In that case, strange things may occur.\r\n\r\nAdding a property with the default index `ThisIndex=0` is a possible bug (what happened to me) since an error is thrown if `Property 0` is already defined. Here is an example:\r\n\r\n~~~c++\r\n                Properties::Pointer dry_prop(new Properties(*wet_prop));\r\n                dry_prop->SetId(++last_id);\r\n                // mrModelPart.AddProperties(dry_prop); // This will throw an error if Property 0 is defined\r\n                mrModelPart.AddProperties(dry_prop, dry_prop->Id()); // This works fine\r\n~~~\r\n\r\nWhat is the meaning of `ThisIndex`?\r\n- It should be the mesh index\r\n- It is a useless parameter\r\n- ..."},"comment":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/comments/397822665","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/2333#issuecomment-397822665","issue_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2333","id":397822665,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzgyMjY2NQ==","user":{"login":"loumalouomega","id":19991680,"node_id":"MDQ6VXNlcjE5OTkxNjgw","avatar_url":"https://avatars2.githubusercontent.com/u/19991680?v=4","gravatar_id":"","url":"https://api.github.com/users/loumalouomega","html_url":"https://github.com/loumalouomega","followers_url":"https://api.github.com/users/loumalouomega/followers","following_url":"https://api.github.com/users/loumalouomega/following{/other_user}","gists_url":"https://api.github.com/users/loumalouomega/gists{/gist_id}","starred_url":"https://api.github.com/users/loumalouomega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loumalouomega/subscriptions","organizations_url":"https://api.github.com/users/loumalouomega/orgs","repos_url":"https://api.github.com/users/loumalouomega/repos","events_url":"https://api.github.com/users/loumalouomega/events{/privacy}","received_events_url":"https://api.github.com/users/loumalouomega/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T16:11:27Z","updated_at":"2018-06-16T16:11:27Z","author_association":"MEMBER","body":"@miguelmaso The index is not the index of the property, is the index of the mesh. Lon story short, before the model parts to differentiate between parts the mesh was used. Now it is keep to retro-compatibility, particularly because the mesh is the container of the elements, nodes..."}}
{"actor":{"display_login":"loumalouomega"}}