{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/40217580","id":40217580,"diff_hunk":"@@ -211,29 +211,26 @@ __global__ void computeFSRFissionSourcesOnDevice(int* FSR_materials,\n   FP_PRECISION fission_source;\n \n   dev_material* curr_material;\n-  FP_PRECISION* nu_sigma_f;\n   FP_PRECISION* sigma_t;\n-  FP_PRECISION* chi;\n+  FP_PRECISION* fiss_mat;\n \n   /* Iterate over all FSRs */\n   while (tid < *num_FSRs) {\n \n     curr_material = &materials[FSR_materials[tid]];\n \n-    nu_sigma_f = curr_material->_nu_sigma_f;\n     sigma_t = curr_material->_sigma_t;\n-    chi = curr_material->_chi;\n+    fiss_mat = curr_material->_fiss_matrix;\n \n-    /* Initialize the fission source to zero for this FSR */\n-    fission_source = 0;\n+    /* Compute fission source for group g */\n+    for (int g=0; g < *num_groups; g++) {\n+      fission_source = 0;\n \n-    /* Compute total fission source for current FSR */\n-    for (int g_prime=0; g_prime < *num_groups; g_prime++)\n-      fission_source += scalar_flux(tid,g_prime) * nu_sigma_f[g_prime];\n+      for (int g_prime=0; g_prime < *num_groups; g_prime++)\n+        fission_source += fiss_mat[g*(*num_groups)+g_prime] * scalar_flux(tid,g_prime);\n \n-    /* Set the reduced source for FSR r in each group g */\n-    for (int g=0; g < *num_groups; g++) {\n-      reduced_sources(tid,g) = fission_source * chi[g];\n+      /* Compute total (scatter+fission+fixed) reduced source */","path":"src/accel/cuda/GPUSolver.cu","position":34,"original_position":34,"commit_id":"44e9fca764d541107034d7800003898aad53ab91","original_commit_id":"e9dd6eff228476f8c04b8a55e47cdf0bccb104af","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":"That is right, I've denoted this in the doxygen comment now. Do you want me to change the method signature? ","created_at":"2015-09-23T15:28:34Z","updated_at":"2015-09-23T15:28:34Z","html_url":"https://github.com/mit-crpg/OpenMOC/pull/187#discussion_r40217580","pull_request_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/40217580"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/187#discussion_r40217580"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187","id":40859581,"html_url":"https://github.com/mit-crpg/OpenMOC/pull/187","diff_url":"https://github.com/mit-crpg/OpenMOC/pull/187.diff","patch_url":"https://github.com/mit-crpg/OpenMOC/pull/187.patch","issue_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/187","number":187,"state":"open","locked":false,"title":"New adjoint calculation mode","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 a new adjoint calculation mode for both fixed source and criticality problems. The adjoint mode builds upon PRs #183 and #186 which made it surprisingly simple to this feature. There is a new ``solverMode`` enumerated type which can take on values ``FORWARD`` or ``ADJOINT``. All of the following routines have been modified to take a new ``mode`` parameter (which defaults to ``FORWARD``):\r\n\r\n* ``Solver::computeFlux(...)``\r\n* ``Solver::computeSource(...)``\r\n* ``Solver::computeEigenvalue(...)``\r\n\r\nThe following snippet illustrates how easily one may now toggle between ``FORWARD`` and ``ADJOINT`` modes:\r\n\r\n```python\r\nsolver.computeEigenvalue(max_iters=1000, mode=ADJOINT)\r\n```\r\n\r\nThe adjoint calculation mode is made possible by the new ``Material::transposeProductionMatrices()`` routine. If in ``ADJOINT`` mode, the ``Solver`` calls the routine when the materials are initialized. At the end of a calculation performed by one of the ``Solvers`` three main methods above, the new ``Solver::resetMaterials()`` routine will return each ``Material's`` production matrices to its original state.\r\n\r\nIn addition, this PR illustrates the use of the ``ADJOINT`` mode in the homogeneous one and two group sample input scripts. Per an email conversation with @robertsj, I've included some new code in each of these sample inputs which uses NumPy to solve for the forward and adjoint eigenvalues to compare with OpenMOC. \r\n\r\nOn a side note, this PR breaks ups the C5G7 inputs into an importable \"geometry.py\" file with separate scripts to run simulations in different modes (CPU/GPU, CMFD) akin to what was discussed in #165.\r\n\r\nBoth ``FORWARD`` and ``ADJOINT`` modes have been validated for the ``CPUSolver``, ``VectorizedSolver`` and ``GPUSolver``. However, I have not modified CMFD to work for an adjoint calculation. I believe that this would simply require making CMFD use the fission matrix per #186.","created_at":"2015-07-26T20:52:25Z","updated_at":"2015-09-23T15:28:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3757f7ea56fa663d8d9160fe20edd4534b1a8730","assignee":{"login":"cjosey","id":354602,"avatar_url":"https://avatars.githubusercontent.com/u/354602?v=3","gravatar_id":"","url":"https://api.github.com/users/cjosey","html_url":"https://github.com/cjosey","followers_url":"https://api.github.com/users/cjosey/followers","following_url":"https://api.github.com/users/cjosey/following{/other_user}","gists_url":"https://api.github.com/users/cjosey/gists{/gist_id}","starred_url":"https://api.github.com/users/cjosey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjosey/subscriptions","organizations_url":"https://api.github.com/users/cjosey/orgs","repos_url":"https://api.github.com/users/cjosey/repos","events_url":"https://api.github.com/users/cjosey/events{/privacy}","received_events_url":"https://api.github.com/users/cjosey/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/milestones/3","html_url":"https://github.com/mit-crpg/OpenMOC/milestones/v0.1.5","labels_url":"https://api.github.com/repos/mit-crpg/OpenMOC/milestones/3/labels","id":980734,"number":3,"title":"v0.1.5","description":"","creator":{"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},"open_issues":5,"closed_issues":38,"state":"open","created_at":"2015-02-16T04:36:42Z","updated_at":"2015-08-16T23:59:56Z","due_on":"2015-05-31T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187/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/187/comments","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/44e9fca764d541107034d7800003898aad53ab91","head":{"label":"wbinventor:adjoint","ref":"adjoint","sha":"44e9fca764d541107034d7800003898aad53ab91","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-09-23T15:26:12Z","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":74728,"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":"d2e5c50267193a0bbccdc7c217961598af0547f1","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-07-19T18:33:59Z","pushed_at":"2015-09-23T15:25:52Z","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":115143,"stargazers_count":16,"watchers_count":16,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":21,"mirror_url":null,"open_issues_count":25,"forks":21,"open_issues":25,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/187"},"issue":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/187"},"comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/187/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/187/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/44e9fca764d541107034d7800003898aad53ab91"}}}}