{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/49527482","id":49527482,"diff_hunk":"@@ -0,0 +1,128 @@\n+#!/usr/bin/env python\n+\n+import os\n+import sys\n+sys.path.insert(0, os.pardir)\n+from testing_harness import TestHarness, PyAPITestHarness\n+import openmc\n+\n+\n+class DistribmatTestHarness(PyAPITestHarness):\n+    def _build_inputs(self):\n+        ####################\n+        # Materials\n+        ####################\n+\n+        moderator = openmc.Material(material_id=1)\n+        moderator.set_density('g/cc', 1.0)\n+        moderator.add_nuclide('H-1', 2.0)\n+        moderator.add_nuclide('O-16', 1.0)\n+\n+        dense_fuel = openmc.Material(material_id=2)\n+        dense_fuel.set_density('g/cc', 4.5)\n+        dense_fuel.add_nuclide('U-235', 1.0)\n+\n+        light_fuel = openmc.Material(material_id=3)\n+        light_fuel.set_density('g/cc', 2.0)\n+        light_fuel.add_nuclide('U-235', 1.0)\n+\n+        mats_file = openmc.MaterialsFile()\n+        mats_file.default_xs = '71c'\n+        mats_file.add_materials([moderator, dense_fuel, light_fuel])\n+        mats_file.export_to_xml()\n+\n+\n+        ####################\n+        # Geometry\n+        ####################\n+\n+        c1 = openmc.Cell(cell_id=1)\n+        c1.fill = moderator\n+        mod_univ = openmc.Universe(universe_id=1)\n+        mod_univ.add_cell(c1)\n+\n+        r0 = openmc.ZCylinder(R=0.3)\n+        c11 = openmc.Cell(cell_id=11)\n+        c11.region = -r0\n+        c11.fill = [dense_fuel, light_fuel, 'void', dense_fuel]\n+        c12 = openmc.Cell(cell_id=12)\n+        c12.region = +r0\n+        c12.fill = moderator\n+        fuel_univ = openmc.Universe(universe_id=11)\n+        fuel_univ.add_cells((c11, c12))\n+\n+        lat = openmc.RectLattice(lattice_id=101)\n+        lat.dimension = [2, 2]\n+        lat.lower_left = [-2.0, -2.0]\n+        lat.pitch = [2.0, 2.0]\n+        lat.universes = [[fuel_univ]*2]*2\n+        lat.outer = mod_univ\n+\n+        x0 = openmc.XPlane(x0=-3.0)\n+        x1 = openmc.XPlane(x0=3.0)\n+        y0 = openmc.YPlane(y0=-3.0)\n+        y1 = openmc.YPlane(y0=3.0)\n+        for s in [x0, x1, y0, y1]:\n+            s.boundary_type = 'reflective'\n+        c101 = openmc.Cell(cell_id=101)\n+        c101.region = +x0 & -x1 & +y0 & -y1\n+        c101.fill = lat\n+        root_univ = openmc.Universe(universe_id=0)\n+        root_univ.add_cell(c101)\n+\n+        geometry = openmc.Geometry()\n+        geometry.root_universe = root_univ\n+        geo_file = openmc.GeometryFile()\n+        geo_file.geometry = geometry\n+        geo_file.export_to_xml()\n+\n+\n+        ####################\n+        # Settings\n+        ####################\n+\n+        sets_file = openmc.SettingsFile()\n+        sets_file.batches = 5\n+        sets_file.inactive = 0\n+        sets_file.particles = 1000\n+        sets_file.set_source_space('box', [-1, -1, -1, 1, 1, 1])\n+        sets_file.output = {'summary': True}\n+        sets_file.export_to_xml()\n+\n+\n+#        ####################\n+#        # Plots\n+#        ####################\n+#\n+#        plots_file = openmc.PlotsFile()\n+#\n+#        plot = openmc.Plot(plot_id=1)\n+#        plot.basis = 'xy'\n+#        plot.color = 'cell'\n+#        plot.filename = 'cellplot'\n+#        plot.origin = (0, 0, 0)\n+#        plot.width = (7, 7)\n+#        plot.pixels = (400, 400)\n+#        plots_file.add_plot(plot)\n+#\n+#        plot = openmc.Plot(plot_id=2)\n+#        plot.basis = 'xy'\n+#        plot.color = 'mat'\n+#        plot.filename = 'matplot'\n+#        plot.origin = (0, 0, 0)\n+#        plot.width = (7, 7)\n+#        plot.pixels = (400, 400)\n+#        plots_file.add_plot(plot)\n+#\n+#        plots_file.export_to_xml()","path":"tests/test_distribmat/test_distribmat.py","position":117,"original_position":117,"commit_id":"a7ac2db068de2d81a5831c4817470170ff7e4efe","original_commit_id":"a7ac2db068de2d81a5831c4817470170ff7e4efe","user":{"login":"paulromano","id":743095,"avatar_url":"https://avatars.githubusercontent.com/u/743095?v=3","gravatar_id":"","url":"https://api.github.com/users/paulromano","html_url":"https://github.com/paulromano","followers_url":"https://api.github.com/users/paulromano/followers","following_url":"https://api.github.com/users/paulromano/following{/other_user}","gists_url":"https://api.github.com/users/paulromano/gists{/gist_id}","starred_url":"https://api.github.com/users/paulromano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulromano/subscriptions","organizations_url":"https://api.github.com/users/paulromano/orgs","repos_url":"https://api.github.com/users/paulromano/repos","events_url":"https://api.github.com/users/paulromano/events{/privacy}","received_events_url":"https://api.github.com/users/paulromano/received_events","type":"User","site_admin":false},"body":"I would either leave this code in un-commented or remove it altogether.","created_at":"2016-01-12T22:53:58Z","updated_at":"2016-01-12T22:53:58Z","html_url":"https://github.com/mit-crpg/openmc/pull/548#discussion_r49527482","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/548","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/49527482"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/548#discussion_r49527482"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/548"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/548","id":55557994,"html_url":"https://github.com/mit-crpg/openmc/pull/548","diff_url":"https://github.com/mit-crpg/openmc/pull/548.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/548.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/548","number":548,"state":"open","locked":false,"title":"Distributed materials","user":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"body":"This PR implements the distributed materials capability we discussed at the December meeting.  Here are some relevant inputs and plots from the test to show how it works:\r\n\r\n```python\r\n        c11.fill = [dense_fuel, light_fuel, 'void', dense_fuel]\r\n```\r\n```xml\r\n    <cell id=\"11\" material=\"2 3 void 2\" region=\"-10000\" universe=\"11\" />\r\n```\r\nCell plot:\r\n![cellplot](https://cloud.githubusercontent.com/assets/4622797/12220059/25e8d722-b72c-11e5-9490-4072e671cc5b.png)\r\n\r\nMaterial plot:\r\n![matplot](https://cloud.githubusercontent.com/assets/4622797/12220061/306ef5e6-b72c-11e5-8d98-c18cdc665dfe.png)\r\n\r\nNote that materials that go into an array will need to be input in the rather unintuitive order of z, y, x, but that's how distribcell offsets are calculated and I don't want to change that in this PR.","created_at":"2016-01-10T04:58:42Z","updated_at":"2016-01-12T22:53:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd0b5153376eaa6b27a54fa352d5775c88808ab4","assignee":null,"milestone":{"url":"https://api.github.com/repos/mit-crpg/openmc/milestones/14","html_url":"https://github.com/mit-crpg/openmc/milestones/v0.8","labels_url":"https://api.github.com/repos/mit-crpg/openmc/milestones/14/labels","id":1241750,"number":14,"title":"v0.8","description":"","creator":{"login":"paulromano","id":743095,"avatar_url":"https://avatars.githubusercontent.com/u/743095?v=3","gravatar_id":"","url":"https://api.github.com/users/paulromano","html_url":"https://github.com/paulromano","followers_url":"https://api.github.com/users/paulromano/followers","following_url":"https://api.github.com/users/paulromano/following{/other_user}","gists_url":"https://api.github.com/users/paulromano/gists{/gist_id}","starred_url":"https://api.github.com/users/paulromano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulromano/subscriptions","organizations_url":"https://api.github.com/users/paulromano/orgs","repos_url":"https://api.github.com/users/paulromano/repos","events_url":"https://api.github.com/users/paulromano/events{/privacy}","received_events_url":"https://api.github.com/users/paulromano/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":5,"state":"open","created_at":"2015-08-05T10:39:23Z","updated_at":"2016-01-11T15:28:53Z","due_on":"2016-04-30T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/548/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/548/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/issues/548/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/a7ac2db068de2d81a5831c4817470170ff7e4efe","head":{"label":"smharper:distribcell_mats","ref":"distribcell_mats","sha":"a7ac2db068de2d81a5831c4817470170ff7e4efe","user":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"repo":{"id":10507820,"name":"openmc","full_name":"smharper/openmc","owner":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smharper/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/smharper/openmc","forks_url":"https://api.github.com/repos/smharper/openmc/forks","keys_url":"https://api.github.com/repos/smharper/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smharper/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smharper/openmc/teams","hooks_url":"https://api.github.com/repos/smharper/openmc/hooks","issue_events_url":"https://api.github.com/repos/smharper/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/smharper/openmc/events","assignees_url":"https://api.github.com/repos/smharper/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/smharper/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/smharper/openmc/tags","blobs_url":"https://api.github.com/repos/smharper/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smharper/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smharper/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/smharper/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smharper/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/smharper/openmc/languages","stargazers_url":"https://api.github.com/repos/smharper/openmc/stargazers","contributors_url":"https://api.github.com/repos/smharper/openmc/contributors","subscribers_url":"https://api.github.com/repos/smharper/openmc/subscribers","subscription_url":"https://api.github.com/repos/smharper/openmc/subscription","commits_url":"https://api.github.com/repos/smharper/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/smharper/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/smharper/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/smharper/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/smharper/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/smharper/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smharper/openmc/merges","archive_url":"https://api.github.com/repos/smharper/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smharper/openmc/downloads","issues_url":"https://api.github.com/repos/smharper/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/smharper/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/smharper/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/smharper/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smharper/openmc/labels{/name}","releases_url":"https://api.github.com/repos/smharper/openmc/releases{/id}","created_at":"2013-06-05T16:55:01Z","updated_at":"2015-08-24T07:46:38Z","pushed_at":"2016-01-12T21:06:14Z","git_url":"git://github.com/smharper/openmc.git","ssh_url":"git@github.com:smharper/openmc.git","clone_url":"https://github.com/smharper/openmc.git","svn_url":"https://github.com/smharper/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":22031,"stargazers_count":1,"watchers_count":1,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"0df752dfa9d9af310877e5f48cc82fae8ebceb9c","user":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"repo":{"id":2081118,"name":"openmc","full_name":"mit-crpg/openmc","owner":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-crpg/openmc","description":"OpenMC Monte Carlo Code","fork":false,"url":"https://api.github.com/repos/mit-crpg/openmc","forks_url":"https://api.github.com/repos/mit-crpg/openmc/forks","keys_url":"https://api.github.com/repos/mit-crpg/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/openmc/teams","hooks_url":"https://api.github.com/repos/mit-crpg/openmc/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/openmc/events","assignees_url":"https://api.github.com/repos/mit-crpg/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/openmc/tags","blobs_url":"https://api.github.com/repos/mit-crpg/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/openmc/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/openmc/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/openmc/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/openmc/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/openmc/subscription","commits_url":"https://api.github.com/repos/mit-crpg/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/openmc/merges","archive_url":"https://api.github.com/repos/mit-crpg/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/openmc/downloads","issues_url":"https://api.github.com/repos/mit-crpg/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/openmc/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/openmc/releases{/id}","created_at":"2011-07-21T00:33:27Z","updated_at":"2016-01-08T13:05:35Z","pushed_at":"2016-01-12T21:14:53Z","git_url":"git://github.com/mit-crpg/openmc.git","ssh_url":"git@github.com:mit-crpg/openmc.git","clone_url":"https://github.com/mit-crpg/openmc.git","svn_url":"https://github.com/mit-crpg/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":39637,"stargazers_count":67,"watchers_count":67,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":88,"mirror_url":null,"open_issues_count":51,"forks":88,"open_issues":51,"watchers":67,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/548"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/548"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/548"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/548/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/548/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/548/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/a7ac2db068de2d81a5831c4817470170ff7e4efe"}}}}