{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/46237173","id":46237173,"diff_hunk":"@@ -388,6 +506,88 @@ void Cell::setFill(Universe* fill) {\n \n \n /**\n+ * @brief Set the Cell's rotation angles about the x, y and z axes.\n+ * @details This method is a helper function to allow OpenMOC users to assign\n+ *          the Cell's rotation angles in Python. A user must initialize a\n+ *          length 3 NumPy array as input to this function. This function then\n+ *          stores the data values in the NumPy array in the Cell's rotation\n+ *          array. An example of how this function might be called in Python\n+ *          is as follows:\n+ *\n+ * @code\n+ *          rotation = numpy.array([0., 0., 90.])\n+ *          cell = openmoc.Cell()\n+ *          cell.setRotation(rotation)\n+ * @endcode\n+ *\n+ * @param rotation the array of rotation angles\n+ * @param num_axes the number of axes (this must always be 3)\n+ */\n+void Cell::setRotation(double* rotation, int num_axes) {","path":"src/Cell.cpp","position":153,"original_position":153,"commit_id":"5b06cb3e217aa3fc13ad90966b5ce60841587e50","original_commit_id":"8a000a386f4b953900b7e963dc66c39e407b7e14","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},"body":"I've clarified the comment as well as revised the code here to match up with the equations on Wolfram.","created_at":"2015-12-01T03:38:16Z","updated_at":"2015-12-01T03:38:16Z","html_url":"https://github.com/mit-crpg/OpenMOC/pull/225#discussion_r46237173","pull_request_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/46237173"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/225#discussion_r46237173"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225","id":51485752,"html_url":"https://github.com/mit-crpg/OpenMOC/pull/225","diff_url":"https://github.com/mit-crpg/OpenMOC/pull/225.diff","patch_url":"https://github.com/mit-crpg/OpenMOC/pull/225.patch","issue_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/225","number":225,"state":"open","locked":false,"title":"Cell Rotations and Translations","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},"body":"This PR introduces cell rotations and translations. These features enable us to model the fully-detailed (3D) BEAVRS benchmark generated by the OpenCG BEAVRS builder for the first time! \r\n\r\nUnfortunately, adding in rotations/translations was a little more difficult than I had expected (but not overly cumbersome). Fortunately, the process of putting in these features required some refactoring of the ray tracing code - but it keeps getting better and better and is far more methodical than a few years ago.\r\n\r\nIn particular, this PR introduces length 3 `_rotation` and `_translation` arrays for the `Cell` class which may be optionally set by the user. The ray tracing code in the `Geometry` and `Universe` classes has been refactored such that all updates to `LocalCoords` positions take place directly within the `LocalCoords` object (which is a cleaner abstraction than before). In addition, the 2D angle `phi` wrt the x-axis is now an attribute of `LocalCoords`, where it is defined based on a track's starting angle and the rotations applied to any `Cells` found during CSG tree traversal.\r\n\r\nWith the changes made here, it is quite simple to build a full-core OpenMOC model of the 3D BEAVRS core. In particular, with an installation of the BEAVRS model builder from the mit-crpg/PWR_benchmarks repo, along with OpenCG (a pre-requisite for the BEAVRS builder), one can instantiate an OpenMOC model of BEAVRS as follows:\r\n\r\n```python\r\nimport opencg\r\nfrom beavrs.builder import BEAVRS\r\nfrom openmoc.compatible import get_openmoc_geometry\r\n\r\n# Instantiate a BEAVRS OpencG model from mit-crpg/PWR_benchmarks\r\nbeavrs = BEAVRS(nndc_xs=True)\r\n\r\n# Construct an OpenCG Geometry for the BEAVRS reactor model\r\nopencg_geometry = opencg.Geometry()\r\nopencg_geometry.root_universe = beavrs.main_universe\r\n\r\n# Export the 3D OpenCG Geometry to OpenMOC\r\nopenmoc_geometry = get_openmoc_geometry(opencg_geometry)\r\n\r\n# Voila!\r\n```\r\n\r\nPreviously, if one attempted to export the model as above, the baffles were not placed in the correct positions. This is because the baffles have rotations applied. Now that the baffles can be properly treated, the model above can be plotted as shown below and the baffles look as they should. \r\n\r\n**Full core**\r\n<img src=\"https://cloud.githubusercontent.com/assets/209492/11329373/5c442d5a-9169-11e5-82c2-fe82b9f2220b.png\" width=\"250\">\r\n\r\n**Upper right core**\r\n<img src=\"https://cloud.githubusercontent.com/assets/209492/11329171/5837e632-9166-11e5-8fd5-2b5894592228.png\" width=\"250\">\r\n\r\nNote that the OpenMOC `Geometry` created above will *not* have a bounding box applied, and hence is not yet ready for ray tracing. In order to make the `Geometry` \"ray tracing-ready\", one would must create a `Cell` outside the core vessel filled by a dummy `Material` and bounded by the core vessel's `ZCylinder` and some bounding `XPlanes` and `YPlanes` with `VACUUM` boundary conditions.","created_at":"2015-11-23T03:45:35Z","updated_at":"2015-12-01T03:38:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ace01537fe3059232f8377a04f5a2adee86d136e","assignee":{"login":"samuelshaner","id":1244537,"avatar_url":"https://avatars.githubusercontent.com/u/1244537?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelshaner","html_url":"https://github.com/samuelshaner","followers_url":"https://api.github.com/users/samuelshaner/followers","following_url":"https://api.github.com/users/samuelshaner/following{/other_user}","gists_url":"https://api.github.com/users/samuelshaner/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelshaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelshaner/subscriptions","organizations_url":"https://api.github.com/users/samuelshaner/orgs","repos_url":"https://api.github.com/users/samuelshaner/repos","events_url":"https://api.github.com/users/samuelshaner/events{/privacy}","received_events_url":"https://api.github.com/users/samuelshaner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/225/comments","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/5b06cb3e217aa3fc13ad90966b5ce60841587e50","head":{"label":"wbinventor:rotation-translation","ref":"rotation-translation","sha":"5b06cb3e217aa3fc13ad90966b5ce60841587e50","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},"repo":{"id":17987110,"name":"OpenMOC","full_name":"wbinventor/OpenMOC","owner":{"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},"private":false,"html_url":"https://github.com/wbinventor/OpenMOC","description":"A method of characteristics code for nuclear reactor physics calculations.","fork":true,"url":"https://api.github.com/repos/wbinventor/OpenMOC","forks_url":"https://api.github.com/repos/wbinventor/OpenMOC/forks","keys_url":"https://api.github.com/repos/wbinventor/OpenMOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wbinventor/OpenMOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wbinventor/OpenMOC/teams","hooks_url":"https://api.github.com/repos/wbinventor/OpenMOC/hooks","issue_events_url":"https://api.github.com/repos/wbinventor/OpenMOC/issues/events{/number}","events_url":"https://api.github.com/repos/wbinventor/OpenMOC/events","assignees_url":"https://api.github.com/repos/wbinventor/OpenMOC/assignees{/user}","branches_url":"https://api.github.com/repos/wbinventor/OpenMOC/branches{/branch}","tags_url":"https://api.github.com/repos/wbinventor/OpenMOC/tags","blobs_url":"https://api.github.com/repos/wbinventor/OpenMOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wbinventor/OpenMOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wbinventor/OpenMOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/wbinventor/OpenMOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wbinventor/OpenMOC/statuses/{sha}","languages_url":"https://api.github.com/repos/wbinventor/OpenMOC/languages","stargazers_url":"https://api.github.com/repos/wbinventor/OpenMOC/stargazers","contributors_url":"https://api.github.com/repos/wbinventor/OpenMOC/contributors","subscribers_url":"https://api.github.com/repos/wbinventor/OpenMOC/subscribers","subscription_url":"https://api.github.com/repos/wbinventor/OpenMOC/subscription","commits_url":"https://api.github.com/repos/wbinventor/OpenMOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/wbinventor/OpenMOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/wbinventor/OpenMOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/wbinventor/OpenMOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/wbinventor/OpenMOC/contents/{+path}","compare_url":"https://api.github.com/repos/wbinventor/OpenMOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wbinventor/OpenMOC/merges","archive_url":"https://api.github.com/repos/wbinventor/OpenMOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wbinventor/OpenMOC/downloads","issues_url":"https://api.github.com/repos/wbinventor/OpenMOC/issues{/number}","pulls_url":"https://api.github.com/repos/wbinventor/OpenMOC/pulls{/number}","milestones_url":"https://api.github.com/repos/wbinventor/OpenMOC/milestones{/number}","notifications_url":"https://api.github.com/repos/wbinventor/OpenMOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wbinventor/OpenMOC/labels{/name}","releases_url":"https://api.github.com/repos/wbinventor/OpenMOC/releases{/id}","created_at":"2014-03-21T16:55:16Z","updated_at":"2015-07-22T15:37:55Z","pushed_at":"2015-12-01T03:37:13Z","git_url":"git://github.com/wbinventor/OpenMOC.git","ssh_url":"git@github.com:wbinventor/OpenMOC.git","clone_url":"https://github.com/wbinventor/OpenMOC.git","svn_url":"https://github.com/wbinventor/OpenMOC","homepage":"https://mit-crpg.github.io/OpenMOC/","size":76045,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"f95ea7873e0e34c1438141ed51d343040ccb9796","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":8780988,"name":"OpenMOC","full_name":"mit-crpg/OpenMOC","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/OpenMOC","description":"A method of characteristics code for nuclear reactor physics calculations.","fork":false,"url":"https://api.github.com/repos/mit-crpg/OpenMOC","forks_url":"https://api.github.com/repos/mit-crpg/OpenMOC/forks","keys_url":"https://api.github.com/repos/mit-crpg/OpenMOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/OpenMOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/OpenMOC/teams","hooks_url":"https://api.github.com/repos/mit-crpg/OpenMOC/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/OpenMOC/events","assignees_url":"https://api.github.com/repos/mit-crpg/OpenMOC/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/OpenMOC/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/OpenMOC/tags","blobs_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/OpenMOC/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/OpenMOC/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/OpenMOC/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/OpenMOC/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/OpenMOC/subscription","commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/OpenMOC/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/OpenMOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/OpenMOC/merges","archive_url":"https://api.github.com/repos/mit-crpg/OpenMOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/OpenMOC/downloads","issues_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/OpenMOC/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/OpenMOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/OpenMOC/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/OpenMOC/releases{/id}","created_at":"2013-03-14T17:19:26Z","updated_at":"2015-11-13T17:57:57Z","pushed_at":"2015-12-01T03:37:14Z","git_url":"git://github.com/mit-crpg/OpenMOC.git","ssh_url":"git@github.com:mit-crpg/OpenMOC.git","clone_url":"https://github.com/mit-crpg/OpenMOC.git","svn_url":"https://github.com/mit-crpg/OpenMOC","homepage":"https://mit-crpg.github.io/OpenMOC/","size":117021,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":26,"mirror_url":null,"open_issues_count":22,"forks":26,"open_issues":22,"watchers":19,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/225"},"issue":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/225"},"comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/225/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/225/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/5b06cb3e217aa3fc13ad90966b5ce60841587e50"}}}}