{"action":"created","issue":{"url":"https://api.github.com/repos/martinjrobins/Aboria/issues/32","repository_url":"https://api.github.com/repos/martinjrobins/Aboria","labels_url":"https://api.github.com/repos/martinjrobins/Aboria/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/martinjrobins/Aboria/issues/32/comments","events_url":"https://api.github.com/repos/martinjrobins/Aboria/issues/32/events","html_url":"https://github.com/martinjrobins/Aboria/issues/32","id":336618173,"node_id":"MDU6SXNzdWUzMzY2MTgxNzM=","number":32,"title":"Accumulate for Expressions of 2 Particle Labels","user":{"login":"JabirSS","id":38516400,"node_id":"MDQ6VXNlcjM4NTE2NDAw","avatar_url":"https://avatars2.githubusercontent.com/u/38516400?v=4","gravatar_id":"","url":"https://api.github.com/users/JabirSS","html_url":"https://github.com/JabirSS","followers_url":"https://api.github.com/users/JabirSS/followers","following_url":"https://api.github.com/users/JabirSS/following{/other_user}","gists_url":"https://api.github.com/users/JabirSS/gists{/gist_id}","starred_url":"https://api.github.com/users/JabirSS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabirSS/subscriptions","organizations_url":"https://api.github.com/users/JabirSS/orgs","repos_url":"https://api.github.com/users/JabirSS/repos","events_url":"https://api.github.com/users/JabirSS/events{/privacy}","received_events_url":"https://api.github.com/users/JabirSS/received_events","type":"User","site_admin":false},"labels":[{"id":77600043,"node_id":"MDU6TGFiZWw3NzYwMDA0Mw==","url":"https://api.github.com/repos/martinjrobins/Aboria/labels/bug","name":"bug","color":"fc2929","default":true},{"id":77600047,"node_id":"MDU6TGFiZWw3NzYwMDA0Nw==","url":"https://api.github.com/repos/martinjrobins/Aboria/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"martinjrobins","id":1148404,"node_id":"MDQ6VXNlcjExNDg0MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1148404?v=4","gravatar_id":"","url":"https://api.github.com/users/martinjrobins","html_url":"https://github.com/martinjrobins","followers_url":"https://api.github.com/users/martinjrobins/followers","following_url":"https://api.github.com/users/martinjrobins/following{/other_user}","gists_url":"https://api.github.com/users/martinjrobins/gists{/gist_id}","starred_url":"https://api.github.com/users/martinjrobins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinjrobins/subscriptions","organizations_url":"https://api.github.com/users/martinjrobins/orgs","repos_url":"https://api.github.com/users/martinjrobins/repos","events_url":"https://api.github.com/users/martinjrobins/events{/privacy}","received_events_url":"https://api.github.com/users/martinjrobins/received_events","type":"User","site_admin":false},"assignees":[{"login":"martinjrobins","id":1148404,"node_id":"MDQ6VXNlcjExNDg0MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1148404?v=4","gravatar_id":"","url":"https://api.github.com/users/martinjrobins","html_url":"https://github.com/martinjrobins","followers_url":"https://api.github.com/users/martinjrobins/followers","following_url":"https://api.github.com/users/martinjrobins/following{/other_user}","gists_url":"https://api.github.com/users/martinjrobins/gists{/gist_id}","starred_url":"https://api.github.com/users/martinjrobins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinjrobins/subscriptions","organizations_url":"https://api.github.com/users/martinjrobins/orgs","repos_url":"https://api.github.com/users/martinjrobins/repos","events_url":"https://api.github.com/users/martinjrobins/events{/privacy}","received_events_url":"https://api.github.com/users/martinjrobins/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-06-28T13:19:14Z","updated_at":"2018-07-02T09:21:30Z","closed_at":null,"author_association":"NONE","body":"Dear @martinjrobins,\r\n\r\nI have been trying to evaluate the result of something like:\r\n\r\n\r\n```\r\n//create particle labels a and b and symbols\r\nAccumulate<Aboria::max<double>> max;\r\n\r\ndouble  maxVal= eval(max(a,b,SomeFunction(a,b)));\r\n\r\n```\r\n\r\nThis is straight-forward when SomeFunction  only deals with one particle label, i.e. `eval(max(a,SomeFunction(a)));`  I tied  looking at Symbolic.h but I couldn't figure out the syntax to use when the expression involves more than one label. Seems like dx has to be somewhere in there?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/martinjrobins/Aboria/issues/comments/401729585","html_url":"https://github.com/martinjrobins/Aboria/issues/32#issuecomment-401729585","issue_url":"https://api.github.com/repos/martinjrobins/Aboria/issues/32","id":401729585,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTcyOTU4NQ==","user":{"login":"martinjrobins","id":1148404,"node_id":"MDQ6VXNlcjExNDg0MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1148404?v=4","gravatar_id":"","url":"https://api.github.com/users/martinjrobins","html_url":"https://github.com/martinjrobins","followers_url":"https://api.github.com/users/martinjrobins/followers","following_url":"https://api.github.com/users/martinjrobins/following{/other_user}","gists_url":"https://api.github.com/users/martinjrobins/gists{/gist_id}","starred_url":"https://api.github.com/users/martinjrobins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinjrobins/subscriptions","organizations_url":"https://api.github.com/users/martinjrobins/orgs","repos_url":"https://api.github.com/users/martinjrobins/repos","events_url":"https://api.github.com/users/martinjrobins/events{/privacy}","received_events_url":"https://api.github.com/users/martinjrobins/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T09:21:30Z","updated_at":"2018-07-02T09:21:30Z","author_association":"OWNER","body":"I notice that you are only looping through particles within each bucket, so you are not taking into account interactions between particles that are in different buckets.\r\n\r\nYou could write something like this to loop though all neighbour pairs within radius:\r\n\r\n```cpp\r\nfor (auto i: particles) {\r\n   for (auto j = euclidean_search(particles.get_query(), get<position>(i), radius);\r\n         j != false; ++j) {\r\n  // do something with i and j\r\n }\r\n}\r\n```\r\n\r\nNote that openmp will only be able to parallise the outter loop if it is an index loop, so you can change to:\r\n\r\n```cpp\r\nfor (int ii = 0; ii < particles.size(); ++ii) {\r\n  auto& i = particles[ii];\r\n   for (auto j = euclidean_search(particles.get_query(), get<position>(i), radius);\r\n         j != false; ++j) {\r\n  // do something with i and j\r\n }\r\n}\r\n```\r\nNote that if you want to do something on a per-bucket basis, and you don't want to double evaluate pairs of particles, and you are using the cell list data structure,  then you can use the fast cell list neighbour search described here: https://martinjrobins.github.io/Aboria/aboria/neighbourhood_searching.html#aboria.neighbourhood_searching.fast_cell_list_neighbour_search"}}
{"actor":{"display_login":"martinjrobins"}}