{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/65927326","id":65927326,"diff_hunk":"@@ -4,6 +4,147 @@\n \n \n /**\n+ * @brief Constructor for MaxOpticalLength calls the TraverseTracks\n+ *        constructor and sets the max optical path length to zero\n+ * @param track_generator The TrackGenerator to pull tracking information from\n+ */\n+MaxOpticalLength::MaxOpticalLength(TrackGenerator* track_generator)\n+                                 : TraverseTracks(track_generator) {\n+  _max_tau = 0;\n+}\n+\n+\n+/**\n+ * @brief Determines the maximum optical path length for the TrackGenerator\n+ *        provided during construction\n+ * @details The maximum optical path length is initialized to infinity for\n+ *          segmentation within the TrackGenerator. Then Tracks are traversed\n+ *          and onTrack(...) is applied, calculating a maximum optical length\n+ *          and setting it on the TrackGenerator.\n+*/\n+void MaxOpticalLength::execute() {\n+  FP_PRECISION infinity = std::numeric_limits<FP_PRECISION>::max();\n+  _track_generator->setMaxOpticalLength(infinity);\n+#pragma omp parallel\n+  {\n+    loopOverTracks(NULL);\n+  }\n+  _track_generator->setMaxOpticalLength(_max_tau);\n+}\n+\n+\n+/**\n+ * @brief Calculates the optical path length for the provided segments and\n+ *        updates the maximum optical path length if necessary\n+ * @param track The track associated with the segments\n+ * @param segments The segments for which the optical path length is calculated\n+ */\n+void MaxOpticalLength::onTrack(Track* track, segment* segments) {\n+  for (int s=0; s < track->getNumSegments(); s++) {\n+    FP_PRECISION length = segments[s]._length;\n+    Material* material = segments[s]._material;\n+    FP_PRECISION* sigma_t = material->getSigmaT();\n+\n+    for (int e=0; e < material->getNumEnergyGroups(); e++) {\n+      FP_PRECISION tau = length*sigma_t[e];\n+      if (tau > _max_tau) {\n+#pragma omp critical\n+        _max_tau = std::max(_max_tau, tau);\n+      }\n+    }\n+  }\n+}\n+\n+\n+/**\n+ * @brief Constructor for SegmentSplitter calls the TraverseTracks\n+ *        constructor\n+ * @param track_generator The TrackGenerator to pull tracking information from\n+ */\n+SegmentSplitter::SegmentSplitter(TrackGenerator* track_generator)\n+                               : TraverseTracks(track_generator) {\n+}\n+\n+\n+/**\n+ * @brief Splits segments stored explicity along each Track\n+ * @details No MOCKernels are initialized for this function.\n+ */\n+void SegmentSplitter::execute() {\n+#pragma omp parallel\n+  {\n+    loopOverTracks(NULL);\n+  }\n+}\n+\n+\n+/**\n+ * @brief Segments for the provided Track are split so that no segment has a\n+ *        larger optical path length than the maximum optical path length\n+ * @param track The Track whose segments are potentially split\n+ * @param segments The segments associated with the Track\n+ */\n+void SegmentSplitter::onTrack(Track* track, segment* segments) {","path":"src/TrackTraversingAlgorithms.cpp","position":84,"original_position":84,"commit_id":"3295d3ebc2cd155b18901343a95f43c530c905ae","original_commit_id":"3295d3ebc2cd155b18901343a95f43c530c905ae","user":{"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},"body":"Is it necessary to have an argument for the segments? The track should have an array of its segments.","created_at":"2016-06-06T16:59:54Z","updated_at":"2016-06-06T16:59:54Z","html_url":"https://github.com/mit-crpg/OpenMOC/pull/316#discussion_r65927326","pull_request_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/65927326"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/316#discussion_r65927326"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316","id":72637117,"html_url":"https://github.com/mit-crpg/OpenMOC/pull/316","diff_url":"https://github.com/mit-crpg/OpenMOC/pull/316.diff","patch_url":"https://github.com/mit-crpg/OpenMOC/pull/316.patch","issue_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/316","number":316,"state":"open","locked":false,"title":"Extend Tracking Algorithms with Abstract Tracking Structure","user":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"body":"This PR build off of #307 to include more \"micro-algorithms\" with the abstract tracking/looping structure:\r\n* Calculating the maximum optical path length\r\n* Splitting segments to conform to the maximum optical path length\r\n* Generating FSR centroids for use in CMFD calculations\r\n* Writing tracking data to a file\r\n* Reading tracking data from a file","created_at":"2016-06-05T18:52:58Z","updated_at":"2016-06-06T16:59:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c0ab0ccfb89c52c03fd90b8f3db4170c2c7402b","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316/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/316/comments","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/3295d3ebc2cd155b18901343a95f43c530c905ae","head":{"label":"geogunow:ExtendTrackingAlgorithms","ref":"ExtendTrackingAlgorithms","sha":"3295d3ebc2cd155b18901343a95f43c530c905ae","user":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"repo":{"id":17528654,"name":"OpenMOC","full_name":"geogunow/OpenMOC","owner":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geogunow/OpenMOC","description":"A method of characteristics code for nuclear reactor physics calculations.","fork":true,"url":"https://api.github.com/repos/geogunow/OpenMOC","forks_url":"https://api.github.com/repos/geogunow/OpenMOC/forks","keys_url":"https://api.github.com/repos/geogunow/OpenMOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geogunow/OpenMOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geogunow/OpenMOC/teams","hooks_url":"https://api.github.com/repos/geogunow/OpenMOC/hooks","issue_events_url":"https://api.github.com/repos/geogunow/OpenMOC/issues/events{/number}","events_url":"https://api.github.com/repos/geogunow/OpenMOC/events","assignees_url":"https://api.github.com/repos/geogunow/OpenMOC/assignees{/user}","branches_url":"https://api.github.com/repos/geogunow/OpenMOC/branches{/branch}","tags_url":"https://api.github.com/repos/geogunow/OpenMOC/tags","blobs_url":"https://api.github.com/repos/geogunow/OpenMOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geogunow/OpenMOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geogunow/OpenMOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/geogunow/OpenMOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geogunow/OpenMOC/statuses/{sha}","languages_url":"https://api.github.com/repos/geogunow/OpenMOC/languages","stargazers_url":"https://api.github.com/repos/geogunow/OpenMOC/stargazers","contributors_url":"https://api.github.com/repos/geogunow/OpenMOC/contributors","subscribers_url":"https://api.github.com/repos/geogunow/OpenMOC/subscribers","subscription_url":"https://api.github.com/repos/geogunow/OpenMOC/subscription","commits_url":"https://api.github.com/repos/geogunow/OpenMOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/geogunow/OpenMOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/geogunow/OpenMOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/geogunow/OpenMOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/geogunow/OpenMOC/contents/{+path}","compare_url":"https://api.github.com/repos/geogunow/OpenMOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geogunow/OpenMOC/merges","archive_url":"https://api.github.com/repos/geogunow/OpenMOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geogunow/OpenMOC/downloads","issues_url":"https://api.github.com/repos/geogunow/OpenMOC/issues{/number}","pulls_url":"https://api.github.com/repos/geogunow/OpenMOC/pulls{/number}","milestones_url":"https://api.github.com/repos/geogunow/OpenMOC/milestones{/number}","notifications_url":"https://api.github.com/repos/geogunow/OpenMOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geogunow/OpenMOC/labels{/name}","releases_url":"https://api.github.com/repos/geogunow/OpenMOC/releases{/id}","deployments_url":"https://api.github.com/repos/geogunow/OpenMOC/deployments","created_at":"2014-03-07T21:58:36Z","updated_at":"2016-03-30T00:37:08Z","pushed_at":"2016-06-05T18:56:06Z","git_url":"git://github.com/geogunow/OpenMOC.git","ssh_url":"git@github.com:geogunow/OpenMOC.git","clone_url":"https://github.com/geogunow/OpenMOC.git","svn_url":"https://github.com/geogunow/OpenMOC","homepage":"https://mit-crpg.github.io/OpenMOC/","size":126153,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"dae2b79c625bb32411cb5dd996be36575e1c924b","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}","deployments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/deployments","created_at":"2013-03-14T17:19:26Z","updated_at":"2016-04-12T01:26:33Z","pushed_at":"2016-06-05T18:56:06Z","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":148247,"stargazers_count":21,"watchers_count":21,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":31,"mirror_url":null,"open_issues_count":20,"forks":31,"open_issues":20,"watchers":21,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/316"},"issue":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/316"},"comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/316/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/316/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/316/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/3295d3ebc2cd155b18901343a95f43c530c905ae"}}}}
{"actor":{"display_login":"samuelshaner"}}