{"action":"created","comment":{"url":"https://api.github.com/repos/tardis-sn/tardis/pulls/comments/32625922","id":32625922,"diff_hunk":"@@ -0,0 +1,79 @@\n+#include <stdbool.h>\n+#include <stdio.h>\n+#include <math.h>\n+\n+#include \"cmontecarlo.h\"\n+\n+\n+rpacket_t * rp;\n+storage_model_t * sm;\n+\n+double TIME_EXPLOSION =  5.2e7; /* 10 days(in seconds)   ~      51840000.0 */\n+double R_INNER_VALUE =  6.2e11; /* 12,000xTIME_EXPLOSION ~  622080000000.0 */\n+double R_OUTER_VALUE =  7.8e12; /* 15,000xTIME_EXPLOSION ~ 7776600000000.0 */\n+\n+void init_rpacket(void);\n+void init_storage_model(void);\n+double test_compute_distance2boundary(void);\n+\n+/* initialise RPacket */\n+void\n+init_rpacket(void){\n+\trp = (rpacket_t *) malloc(sizeof(rpacket_t));\n+\t\n+\tdouble MU = 0.3;\n+\tdouble R = 6.7e11; /* 13,000xTIME_EXPLOSION */\n+\tdouble ENERGY = 0.9;\n+\n+\trpacket_set_current_shell_id(rp, 0);\n+\trpacket_set_mu(rp, MU);\n+\trpacket_set_r(rp, R);\n+\trpacket_set_recently_crossed_boundary(rp, 1);\n+\n+\t/*\n+\trpacket_set_virtual_packet(rp, 1);\n+\trpacket_set_current_shell_id(rp, 1);\n+\trpacket_set_tau_event(rp, TAU_EVENT);\n+\trpacket_set_nu_line(rp, NU_LINE);\n+\trpacket_set_last_line(rp, true);\n+\trpacket_set_energy(rp, ENERGY);\n+\trpacket_set_status(rp, TARDIS_PACKET_STATUS_IN_PROCESS);\n+\trpacket_set_d_electron(rp, D_ELECTRON);\n+\trpacket_set_d_line(rp, D_LINE);\n+\trpacket_set_next_line_id(rp, NEXT_LINE_ID);\n+\t*/\n+\n+}\n+\n+/* initialise storage model */\n+void\n+init_storage_model(void){\n+\tsm = (storage_model_t *) malloc(sizeof(storage_model_t));\n+\tdouble R_OUTER[2] = {R_OUTER_VALUE, R_OUTER_VALUE};\n+\tdouble R_INNER[2] = {R_INNER_VALUE, R_INNER_VALUE};\n+\tsm->r_outer = R_OUTER;\n+\tsm->r_inner = R_INNER;\n+\t","path":"tardis/montecarlo/src/test_montecarlo_line_scatter.c","position":56,"original_position":56,"commit_id":"fc62815d0b63d1256ea6ff9d5fb69d0ad2d29a3c","original_commit_id":"fc62815d0b63d1256ea6ff9d5fb69d0ad2d29a3c","user":{"login":"aoifeboyle","id":5586399,"avatar_url":"https://avatars.githubusercontent.com/u/5586399?v=3","gravatar_id":"","url":"https://api.github.com/users/aoifeboyle","html_url":"https://github.com/aoifeboyle","followers_url":"https://api.github.com/users/aoifeboyle/followers","following_url":"https://api.github.com/users/aoifeboyle/following{/other_user}","gists_url":"https://api.github.com/users/aoifeboyle/gists{/gist_id}","starred_url":"https://api.github.com/users/aoifeboyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoifeboyle/subscriptions","organizations_url":"https://api.github.com/users/aoifeboyle/orgs","repos_url":"https://api.github.com/users/aoifeboyle/repos","events_url":"https://api.github.com/users/aoifeboyle/events{/privacy}","received_events_url":"https://api.github.com/users/aoifeboyle/received_events","type":"User","site_admin":false},"body":"@kaushik94 I think the reason that `r_inner` and `r_outer` in the `calculate_distance2boundary` function are being assigned a value of 0 is that for some reason `sm->r_outer` is actually a pointer. When I change it so that `*sm->r_outer = R_OUTER_VALUE`, etc., the correct value can be obtained in `calculate_distance2boundary` like `double r_outer = *storage->r_outer`, and the function returns a value rather than nan, which looks correct on first glance. But there must be a proper solution somewhere that doesn't involve altering the function being tested itself.","created_at":"2015-06-17T13:31:02Z","updated_at":"2015-06-17T13:31:02Z","html_url":"https://github.com/tardis-sn/tardis/pull/334#discussion_r32625922","pull_request_url":"https://api.github.com/repos/tardis-sn/tardis/pulls/334","_links":{"self":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/comments/32625922"},"html":{"href":"https://github.com/tardis-sn/tardis/pull/334#discussion_r32625922"},"pull_request":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/334"}}},"pull_request":{"url":"https://api.github.com/repos/tardis-sn/tardis/pulls/334","id":37806351,"html_url":"https://github.com/tardis-sn/tardis/pull/334","diff_url":"https://github.com/tardis-sn/tardis/pull/334.diff","patch_url":"https://github.com/tardis-sn/tardis/pull/334.patch","issue_url":"https://api.github.com/repos/tardis-sn/tardis/issues/334","number":334,"state":"open","locked":false,"title":"[WIP GSoC 2015] test_montecarlo_line_scatter","user":{"login":"kaushik94","id":6545467,"avatar_url":"https://avatars.githubusercontent.com/u/6545467?v=3","gravatar_id":"","url":"https://api.github.com/users/kaushik94","html_url":"https://github.com/kaushik94","followers_url":"https://api.github.com/users/kaushik94/followers","following_url":"https://api.github.com/users/kaushik94/following{/other_user}","gists_url":"https://api.github.com/users/kaushik94/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushik94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushik94/subscriptions","organizations_url":"https://api.github.com/users/kaushik94/orgs","repos_url":"https://api.github.com/users/kaushik94/repos","events_url":"https://api.github.com/users/kaushik94/events{/privacy}","received_events_url":"https://api.github.com/users/kaushik94/received_events","type":"User","site_admin":false},"body":"@aoifeboyle, @wkerzendorf  ping !","created_at":"2015-06-16T15:15:44Z","updated_at":"2015-06-17T13:31:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4f0ba221cbf3edeb91357761eeac0cb2a5925f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tardis-sn/tardis/pulls/334/commits","review_comments_url":"https://api.github.com/repos/tardis-sn/tardis/pulls/334/comments","review_comment_url":"https://api.github.com/repos/tardis-sn/tardis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tardis-sn/tardis/issues/334/comments","statuses_url":"https://api.github.com/repos/tardis-sn/tardis/statuses/fc62815d0b63d1256ea6ff9d5fb69d0ad2d29a3c","head":{"label":"kaushik94:montecarlo_line_scatter","ref":"montecarlo_line_scatter","sha":"fc62815d0b63d1256ea6ff9d5fb69d0ad2d29a3c","user":{"login":"kaushik94","id":6545467,"avatar_url":"https://avatars.githubusercontent.com/u/6545467?v=3","gravatar_id":"","url":"https://api.github.com/users/kaushik94","html_url":"https://github.com/kaushik94","followers_url":"https://api.github.com/users/kaushik94/followers","following_url":"https://api.github.com/users/kaushik94/following{/other_user}","gists_url":"https://api.github.com/users/kaushik94/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushik94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushik94/subscriptions","organizations_url":"https://api.github.com/users/kaushik94/orgs","repos_url":"https://api.github.com/users/kaushik94/repos","events_url":"https://api.github.com/users/kaushik94/events{/privacy}","received_events_url":"https://api.github.com/users/kaushik94/received_events","type":"User","site_admin":false},"repo":{"id":31717067,"name":"tardis","full_name":"kaushik94/tardis","owner":{"login":"kaushik94","id":6545467,"avatar_url":"https://avatars.githubusercontent.com/u/6545467?v=3","gravatar_id":"","url":"https://api.github.com/users/kaushik94","html_url":"https://github.com/kaushik94","followers_url":"https://api.github.com/users/kaushik94/followers","following_url":"https://api.github.com/users/kaushik94/following{/other_user}","gists_url":"https://api.github.com/users/kaushik94/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushik94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushik94/subscriptions","organizations_url":"https://api.github.com/users/kaushik94/orgs","repos_url":"https://api.github.com/users/kaushik94/repos","events_url":"https://api.github.com/users/kaushik94/events{/privacy}","received_events_url":"https://api.github.com/users/kaushik94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaushik94/tardis","description":"TARDIS - Temperature And Radiative Diffusion In Supernovae","fork":true,"url":"https://api.github.com/repos/kaushik94/tardis","forks_url":"https://api.github.com/repos/kaushik94/tardis/forks","keys_url":"https://api.github.com/repos/kaushik94/tardis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaushik94/tardis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaushik94/tardis/teams","hooks_url":"https://api.github.com/repos/kaushik94/tardis/hooks","issue_events_url":"https://api.github.com/repos/kaushik94/tardis/issues/events{/number}","events_url":"https://api.github.com/repos/kaushik94/tardis/events","assignees_url":"https://api.github.com/repos/kaushik94/tardis/assignees{/user}","branches_url":"https://api.github.com/repos/kaushik94/tardis/branches{/branch}","tags_url":"https://api.github.com/repos/kaushik94/tardis/tags","blobs_url":"https://api.github.com/repos/kaushik94/tardis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaushik94/tardis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaushik94/tardis/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaushik94/tardis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaushik94/tardis/statuses/{sha}","languages_url":"https://api.github.com/repos/kaushik94/tardis/languages","stargazers_url":"https://api.github.com/repos/kaushik94/tardis/stargazers","contributors_url":"https://api.github.com/repos/kaushik94/tardis/contributors","subscribers_url":"https://api.github.com/repos/kaushik94/tardis/subscribers","subscription_url":"https://api.github.com/repos/kaushik94/tardis/subscription","commits_url":"https://api.github.com/repos/kaushik94/tardis/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaushik94/tardis/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaushik94/tardis/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaushik94/tardis/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaushik94/tardis/contents/{+path}","compare_url":"https://api.github.com/repos/kaushik94/tardis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaushik94/tardis/merges","archive_url":"https://api.github.com/repos/kaushik94/tardis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaushik94/tardis/downloads","issues_url":"https://api.github.com/repos/kaushik94/tardis/issues{/number}","pulls_url":"https://api.github.com/repos/kaushik94/tardis/pulls{/number}","milestones_url":"https://api.github.com/repos/kaushik94/tardis/milestones{/number}","notifications_url":"https://api.github.com/repos/kaushik94/tardis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaushik94/tardis/labels{/name}","releases_url":"https://api.github.com/repos/kaushik94/tardis/releases{/id}","created_at":"2015-03-05T14:15:20Z","updated_at":"2015-03-07T19:42:42Z","pushed_at":"2015-06-16T20:33:05Z","git_url":"git://github.com/kaushik94/tardis.git","ssh_url":"git@github.com:kaushik94/tardis.git","clone_url":"https://github.com/kaushik94/tardis.git","svn_url":"https://github.com/kaushik94/tardis","homepage":"","size":6812,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"tardis-sn:master","ref":"master","sha":"0dd77db2b7bcd4e150efd61148eb46706b89ff2d","user":{"login":"tardis-sn","id":6108234,"avatar_url":"https://avatars.githubusercontent.com/u/6108234?v=3","gravatar_id":"","url":"https://api.github.com/users/tardis-sn","html_url":"https://github.com/tardis-sn","followers_url":"https://api.github.com/users/tardis-sn/followers","following_url":"https://api.github.com/users/tardis-sn/following{/other_user}","gists_url":"https://api.github.com/users/tardis-sn/gists{/gist_id}","starred_url":"https://api.github.com/users/tardis-sn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardis-sn/subscriptions","organizations_url":"https://api.github.com/users/tardis-sn/orgs","repos_url":"https://api.github.com/users/tardis-sn/repos","events_url":"https://api.github.com/users/tardis-sn/events{/privacy}","received_events_url":"https://api.github.com/users/tardis-sn/received_events","type":"Organization","site_admin":false},"repo":{"id":2938270,"name":"tardis","full_name":"tardis-sn/tardis","owner":{"login":"tardis-sn","id":6108234,"avatar_url":"https://avatars.githubusercontent.com/u/6108234?v=3","gravatar_id":"","url":"https://api.github.com/users/tardis-sn","html_url":"https://github.com/tardis-sn","followers_url":"https://api.github.com/users/tardis-sn/followers","following_url":"https://api.github.com/users/tardis-sn/following{/other_user}","gists_url":"https://api.github.com/users/tardis-sn/gists{/gist_id}","starred_url":"https://api.github.com/users/tardis-sn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardis-sn/subscriptions","organizations_url":"https://api.github.com/users/tardis-sn/orgs","repos_url":"https://api.github.com/users/tardis-sn/repos","events_url":"https://api.github.com/users/tardis-sn/events{/privacy}","received_events_url":"https://api.github.com/users/tardis-sn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tardis-sn/tardis","description":"TARDIS - Temperature And Radiative Diffusion In Supernovae","fork":false,"url":"https://api.github.com/repos/tardis-sn/tardis","forks_url":"https://api.github.com/repos/tardis-sn/tardis/forks","keys_url":"https://api.github.com/repos/tardis-sn/tardis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tardis-sn/tardis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tardis-sn/tardis/teams","hooks_url":"https://api.github.com/repos/tardis-sn/tardis/hooks","issue_events_url":"https://api.github.com/repos/tardis-sn/tardis/issues/events{/number}","events_url":"https://api.github.com/repos/tardis-sn/tardis/events","assignees_url":"https://api.github.com/repos/tardis-sn/tardis/assignees{/user}","branches_url":"https://api.github.com/repos/tardis-sn/tardis/branches{/branch}","tags_url":"https://api.github.com/repos/tardis-sn/tardis/tags","blobs_url":"https://api.github.com/repos/tardis-sn/tardis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tardis-sn/tardis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tardis-sn/tardis/git/refs{/sha}","trees_url":"https://api.github.com/repos/tardis-sn/tardis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tardis-sn/tardis/statuses/{sha}","languages_url":"https://api.github.com/repos/tardis-sn/tardis/languages","stargazers_url":"https://api.github.com/repos/tardis-sn/tardis/stargazers","contributors_url":"https://api.github.com/repos/tardis-sn/tardis/contributors","subscribers_url":"https://api.github.com/repos/tardis-sn/tardis/subscribers","subscription_url":"https://api.github.com/repos/tardis-sn/tardis/subscription","commits_url":"https://api.github.com/repos/tardis-sn/tardis/commits{/sha}","git_commits_url":"https://api.github.com/repos/tardis-sn/tardis/git/commits{/sha}","comments_url":"https://api.github.com/repos/tardis-sn/tardis/comments{/number}","issue_comment_url":"https://api.github.com/repos/tardis-sn/tardis/issues/comments{/number}","contents_url":"https://api.github.com/repos/tardis-sn/tardis/contents/{+path}","compare_url":"https://api.github.com/repos/tardis-sn/tardis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tardis-sn/tardis/merges","archive_url":"https://api.github.com/repos/tardis-sn/tardis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tardis-sn/tardis/downloads","issues_url":"https://api.github.com/repos/tardis-sn/tardis/issues{/number}","pulls_url":"https://api.github.com/repos/tardis-sn/tardis/pulls{/number}","milestones_url":"https://api.github.com/repos/tardis-sn/tardis/milestones{/number}","notifications_url":"https://api.github.com/repos/tardis-sn/tardis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tardis-sn/tardis/labels{/name}","releases_url":"https://api.github.com/repos/tardis-sn/tardis/releases{/id}","created_at":"2011-12-08T06:20:19Z","updated_at":"2015-05-10T09:47:33Z","pushed_at":"2015-06-16T20:33:05Z","git_url":"git://github.com/tardis-sn/tardis.git","ssh_url":"git@github.com:tardis-sn/tardis.git","clone_url":"https://github.com/tardis-sn/tardis.git","svn_url":"https://github.com/tardis-sn/tardis","homepage":"","size":37840,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":75,"forks":82,"open_issues":75,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/334"},"html":{"href":"https://github.com/tardis-sn/tardis/pull/334"},"issue":{"href":"https://api.github.com/repos/tardis-sn/tardis/issues/334"},"comments":{"href":"https://api.github.com/repos/tardis-sn/tardis/issues/334/comments"},"review_comments":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/334/comments"},"review_comment":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tardis-sn/tardis/pulls/334/commits"},"statuses":{"href":"https://api.github.com/repos/tardis-sn/tardis/statuses/fc62815d0b63d1256ea6ff9d5fb69d0ad2d29a3c"}}}}