{"action":"created","issue":{"url":"https://api.github.com/repos/mit-crpg/openmc/issues/379","labels_url":"https://api.github.com/repos/mit-crpg/openmc/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/issues/379/comments","events_url":"https://api.github.com/repos/mit-crpg/openmc/issues/379/events","html_url":"https://github.com/mit-crpg/openmc/pull/379","id":71952253,"number":379,"title":"Distributed cell (distribcell) tally filters","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mit-crpg/openmc/labels/Geometry","name":"Geometry","color":"CD6600"},{"url":"https://api.github.com/repos/mit-crpg/openmc/labels/Other%20Enhancement","name":"Other Enhancement","color":"e102d8"},{"url":"https://api.github.com/repos/mit-crpg/openmc/labels/Tallies","name":"Tallies","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-04-29T18:30:34Z","updated_at":"2015-05-27T03:43:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/379","html_url":"https://github.com/mit-crpg/openmc/pull/379","diff_url":"https://github.com/mit-crpg/openmc/pull/379.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/379.patch"},"body":"This PR introduces distributed cell (distribcell) tally filters into OpenMC. Presently, when a \"cell\" filter is specified for a tally, particles traveling through any instance of that cell will be tallied into the same location (*e.g.*, a fuel pin cell placed many times throughout a geometry). In contrast, \"distribcell\" filters enable users to compute tallies for each unique **instance** of a cell throughout the geometry.\r\n\r\nThe algorithm for distribcell tallies is a generalization of the algorithm developed and applied to identify flat source regions in constructive solid geometries (CSG) for OpenMOC. The basic premise of the algorithm is to build **offset tables** at each level of a CSG tree as a pre-processing step. The **instance ID** for each cell instance can be rapidly computed on the fly for a given nested particle coordinates list by traversing the tree and summing up the appropriate offsets from the offset tables at each level. A detailed explanation of the algorithm, including pseudocode as well as a performance model for the memory footprint can be found in the following paper:\r\n\r\n* D. Lax, W. Boyd and N. Horelik. \"An Algorithm for Identifying Unique Regions in Constructive Solid Geometries.\" *Proc. of PHYSOR*, Kyoto, Japan (2014).\r\n\r\nA user can simply place a distribcell\" filter on a tally in the same way as a typical \"cell\" filter:\r\n\r\n```xml\r\n...\r\n\r\n    <tally id=\"1\">\r\n        <filter bins=\"101\" type=\"distribcell\" />\r\n        <scores>flux</scores>\r\n    </tally>\r\n\r\n...\r\n```\r\n\r\nAt the beginning of a simulation, OpenMC will count the number of unique instances of the cell, allocate an array for the tally bins for each instance. During the simulation, each event occurring within a distributed cell will be incremented into the appropriate tally bin(s) based on the instance ID for the location of the particle.\r\n\r\nThe majority of the development work for distribcell tallies was done by @laxderek. Both @nhorelik and I have used this functionality on the closed source repo for over a year now and believe that it is ready for use by the broader community now. This functionality forms the basis for unstructured mesh tallies needed for large scale tallies, and is a prerequisite for @nhorelik's coming spatial domain decomposition PR."},"comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/issues/comments/105744225","html_url":"https://github.com/mit-crpg/openmc/pull/379#issuecomment-105744225","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/379","id":105744225,"user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T03:43:37Z","updated_at":"2015-05-27T03:43:37Z","body":"This is up-to-date wrt your comments @paulromano "}}