{"action":"created","issue":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2840","repository_url":"https://api.github.com/repos/KratosMultiphysics/Kratos","labels_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2840/labels{/name}","comments_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2840/comments","events_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2840/events","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/2840","id":358643741,"node_id":"MDU6SXNzdWUzNTg2NDM3NDE=","number":2840,"title":"Kratos ParticleMechanics fails when running large problems","user":{"login":"bodhinandach","id":37140224,"node_id":"MDQ6VXNlcjM3MTQwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/37140224?v=4","gravatar_id":"","url":"https://api.github.com/users/bodhinandach","html_url":"https://github.com/bodhinandach","followers_url":"https://api.github.com/users/bodhinandach/followers","following_url":"https://api.github.com/users/bodhinandach/following{/other_user}","gists_url":"https://api.github.com/users/bodhinandach/gists{/gist_id}","starred_url":"https://api.github.com/users/bodhinandach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bodhinandach/subscriptions","organizations_url":"https://api.github.com/users/bodhinandach/orgs","repos_url":"https://api.github.com/users/bodhinandach/repos","events_url":"https://api.github.com/users/bodhinandach/events{/privacy}","received_events_url":"https://api.github.com/users/bodhinandach/received_events","type":"User","site_admin":false},"labels":[{"id":539268248,"node_id":"MDU6TGFiZWw1MzkyNjgyNDg=","url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/Applications","name":"Applications","color":"0052cc","default":false},{"id":538597496,"node_id":"MDU6TGFiZWw1Mzg1OTc0OTY=","url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/Error","name":"Error","color":"b60205","default":false},{"id":539268135,"node_id":"MDU6TGFiZWw1MzkyNjgxMzU=","url":"https://api.github.com/repos/KratosMultiphysics/Kratos/labels/Kratos%20Core","name":"Kratos Core","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"roigcarlo","id":1935791,"node_id":"MDQ6VXNlcjE5MzU3OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1935791?v=4","gravatar_id":"","url":"https://api.github.com/users/roigcarlo","html_url":"https://github.com/roigcarlo","followers_url":"https://api.github.com/users/roigcarlo/followers","following_url":"https://api.github.com/users/roigcarlo/following{/other_user}","gists_url":"https://api.github.com/users/roigcarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/roigcarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roigcarlo/subscriptions","organizations_url":"https://api.github.com/users/roigcarlo/orgs","repos_url":"https://api.github.com/users/roigcarlo/repos","events_url":"https://api.github.com/users/roigcarlo/events{/privacy}","received_events_url":"https://api.github.com/users/roigcarlo/received_events","type":"User","site_admin":false},"assignees":[{"login":"roigcarlo","id":1935791,"node_id":"MDQ6VXNlcjE5MzU3OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1935791?v=4","gravatar_id":"","url":"https://api.github.com/users/roigcarlo","html_url":"https://github.com/roigcarlo","followers_url":"https://api.github.com/users/roigcarlo/followers","following_url":"https://api.github.com/users/roigcarlo/following{/other_user}","gists_url":"https://api.github.com/users/roigcarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/roigcarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roigcarlo/subscriptions","organizations_url":"https://api.github.com/users/roigcarlo/orgs","repos_url":"https://api.github.com/users/roigcarlo/repos","events_url":"https://api.github.com/users/roigcarlo/events{/privacy}","received_events_url":"https://api.github.com/users/roigcarlo/received_events","type":"User","site_admin":false},{"login":"bodhinandach","id":37140224,"node_id":"MDQ6VXNlcjM3MTQwMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/37140224?v=4","gravatar_id":"","url":"https://api.github.com/users/bodhinandach","html_url":"https://github.com/bodhinandach","followers_url":"https://api.github.com/users/bodhinandach/followers","following_url":"https://api.github.com/users/bodhinandach/following{/other_user}","gists_url":"https://api.github.com/users/bodhinandach/gists{/gist_id}","starred_url":"https://api.github.com/users/bodhinandach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bodhinandach/subscriptions","organizations_url":"https://api.github.com/users/bodhinandach/orgs","repos_url":"https://api.github.com/users/bodhinandach/repos","events_url":"https://api.github.com/users/bodhinandach/events{/privacy}","received_events_url":"https://api.github.com/users/bodhinandach/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2018-09-10T14:16:08Z","updated_at":"2018-10-09T09:36:34Z","closed_at":null,"author_association":"MEMBER","body":"I recently run my test examples for large static cantilevers and found them failing -  it should not fail since I didn't touch the corresponding constitutive law nor any related conditions within the last two months. After some checks, I found out that it only fails for large problems with relatively more elements, i.e. when I run problems with fewer meshes, it works! Since they are static problems, the time discretization issue is not present. Also, I checked that the same problems occur when OpenMP is deactivated. Therefore, it is not an issue of parallelism.\r\n\r\nThe same test cases used to work before, e.g. once I validated PR #2387. With the recent code, the nonlinear iteration of that example does not converge and the obtained ratio and absolute norm grow excessively. Please find **problem_1.gid** attached.\r\n[problem_1.gid.zip](https://github.com/KratosMultiphysics/Kratos/files/2366982/problem_1.gid.zip)\r\n\r\nPlease also find **problem_2_fine.gid** and **problem_2_coarse.gid** attached to see that the finer problem is not working while the coarser one is okay.\r\n[problem_2_coarse.gid.zip](https://github.com/KratosMultiphysics/Kratos/files/2366986/problem_2_coarse.gid.zip)\r\n[problem_2_fine.gid.zip](https://github.com/KratosMultiphysics/Kratos/files/2366988/problem_2_fine.gid.zip)\r\n\r\n\r\nI am guessing that the problem might be either in BuilderandSolver, ConvergenceCriteria or LinearSolver. I asked @loumalouomega and @roigcarlo about this issue and they suggested me to tag @RiccardoRossi and @adityaghantasala in case they can help me with this. \r\n\r\nThank you very much in advance! I would appreciate if anyone can give me any suggestions."},"comment":{"url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/comments/428126898","html_url":"https://github.com/KratosMultiphysics/Kratos/issues/2840#issuecomment-428126898","issue_url":"https://api.github.com/repos/KratosMultiphysics/Kratos/issues/2840","id":428126898,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODEyNjg5OA==","user":{"login":"roigcarlo","id":1935791,"node_id":"MDQ6VXNlcjE5MzU3OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1935791?v=4","gravatar_id":"","url":"https://api.github.com/users/roigcarlo","html_url":"https://github.com/roigcarlo","followers_url":"https://api.github.com/users/roigcarlo/followers","following_url":"https://api.github.com/users/roigcarlo/following{/other_user}","gists_url":"https://api.github.com/users/roigcarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/roigcarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roigcarlo/subscriptions","organizations_url":"https://api.github.com/users/roigcarlo/orgs","repos_url":"https://api.github.com/users/roigcarlo/repos","events_url":"https://api.github.com/users/roigcarlo/events{/privacy}","received_events_url":"https://api.github.com/users/roigcarlo/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T09:36:34Z","updated_at":"2018-10-09T09:36:34Z","author_association":"MEMBER","body":"Finally some clues (long post incoming...). \r\n\r\nAfter some debugging I have found the following facts:\r\n* Reducing the size of the bins cells increases the change for the problem to converge\r\n* Results for the search of elements are not consistent from one size to other. Moreover, some particles land to zones where apparently there are no elements.\r\n\r\nAfter reviewing the code I think the problem is caused by the interaction of two classes:\r\n* bins_objects_dynamic.h \r\n* binsbased_fast_point_locator.h\r\n\r\nThe problem? The tolerance\r\n```C++\r\nconst bool is_found = geom.IsInside(rCoordinates, point_local_coordinates, Tolerance);\r\n```\r\nIntroducing a tolerance in the check of the intersection may cause odd results. \r\n\r\nFor example, imagine this part of the bins:\r\n```\r\n+----------+----------+\r\n|         E|E         | \r\n|       P E|E         | \r\n|         E|E         | \r\n+----------+----------+\r\n```\r\n\r\nHere **P** is very close to **E**, in fact imagine that the distance from **P** to **E** is less than our tolerance. Hence, the ```SearchObjectsInCell``` function will return a list with some elements, **E** among them. As the Intersection falls inside the tolerance the result will be positive and we will return **E** as a result.\r\n\r\nImagine what happens if we increase the size of the cell of the bins (just in x, to illustrate):\r\n```\r\n+------------+------------+\r\n|            | EE         | \r\n|           P| EE         | \r\n|            | EE         | \r\n+------------+------------+\r\n```\r\n\r\nIn this scenario **P** still should fall inside **E** due to being in a distance which is lesser than our tolerance, but ```SearchObjectsInCell``` does not take into account any tolerance, so the correct element will not even be considered to be a candidate.\r\n\r\nIn conclusion, right know as this search is being done is just a matter of luck and tolerance whether the correct elements are being found or not. \r\nThe recent changes on the `bins_objects_dynamic.h` made the bins cells much larger than they used to be, specially in cases that use to fit the bins (rectangles, squares, etc). \r\n\r\nIn conclusion. We had a hidden problem and you had the bad luck (or good) to found a case where this situation is specially hard.\r\n\r\n@RiccardoRossi as you did the binbased_fast_point_locator, my proposal if you agree would be add a search function in the bins that is aware of the tolerance, like  ```SearchObjectsInCell``` with an added tolerance. If you agree I will take care of the changes."}}
{"actor":{"display_login":"roigcarlo"}}