{"action":"created","comment":{"url":"https://api.github.com/repos/dealii/dealii/pulls/comments/48754041","id":48754041,"diff_hunk":"@@ -284,27 +432,14 @@ MGTransferPrebuilt<VectorType>::copy_from_mg_add\n  OutVector                       &dst,\n  const MGLevelObject<VectorType> &src) const\n {\n-  // For non-DG: degrees of\n-  // freedom in the refinement\n-  // face may need special\n-  // attention, since they belong\n-  // to the coarse level, but\n-  // have fine level basis\n-  // functions\n+  // For non-DG: degrees of freedom in the refinement face may need special\n+  // attention, since they belong to the coarse level, but have fine level\n+  // basis functions\n   for (unsigned int level=0; level<mg_dof_handler.get_triangulation().n_global_levels(); ++level)\n     {\n-      typedef std::vector<std::pair<types::global_dof_index, types::global_dof_index> >::const_iterator dof_pair_iterator;\n-\n-      // First add all indices local to this process\n-      for (dof_pair_iterator i= copy_indices[level].begin();\n-           i != copy_indices[level].end(); ++i)\n-        dst(i->first) += src[level](i->second);\n-\n-      // Do the same for the indices where the level index is local,\n-      // but the global index is not\n-      for (dof_pair_iterator i= copy_indices_level_mine[level].begin();\n-           i != copy_indices_level_mine[level].end(); ++i)\n-        dst(i->first) += src[level](i->second);\n+      internal::copy_vector_from_mg(src[level], copy_indices[level],\n+                                    copy_indices_level_mine[level],\n+                                    level, true, additional_vector_data, dst);\n     }\n   dst.compress(VectorOperation::add);","path":"include/deal.II/multigrid/mg_transfer.templates.h","position":284,"original_position":284,"commit_id":"ebb9870e207b889cfc3d8ecab40be2a8329e70a8","original_commit_id":"ebb9870e207b889cfc3d8ecab40be2a8329e70a8","user":{"login":"kronbichler","id":8276200,"avatar_url":"https://avatars.githubusercontent.com/u/8276200?v=3","gravatar_id":"","url":"https://api.github.com/users/kronbichler","html_url":"https://github.com/kronbichler","followers_url":"https://api.github.com/users/kronbichler/followers","following_url":"https://api.github.com/users/kronbichler/following{/other_user}","gists_url":"https://api.github.com/users/kronbichler/gists{/gist_id}","starred_url":"https://api.github.com/users/kronbichler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronbichler/subscriptions","organizations_url":"https://api.github.com/users/kronbichler/orgs","repos_url":"https://api.github.com/users/kronbichler/repos","events_url":"https://api.github.com/users/kronbichler/events{/privacy}","received_events_url":"https://api.github.com/users/kronbichler/received_events","type":"User","site_admin":false},"body":"Good question. I thought it would not but on a second thought I think you are right - we need to insert a `zero_out_ghosts()` in the copy function to avoid possible problems. I'll include that in my refactoring.","created_at":"2016-01-04T17:12:36Z","updated_at":"2016-01-04T17:12:36Z","html_url":"https://github.com/dealii/dealii/pull/2017#discussion_r48754041","pull_request_url":"https://api.github.com/repos/dealii/dealii/pulls/2017","_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments/48754041"},"html":{"href":"https://github.com/dealii/dealii/pull/2017#discussion_r48754041"},"pull_request":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2017"}}},"pull_request":{"url":"https://api.github.com/repos/dealii/dealii/pulls/2017","id":54581416,"html_url":"https://github.com/dealii/dealii/pull/2017","diff_url":"https://github.com/dealii/dealii/pull/2017.diff","patch_url":"https://github.com/dealii/dealii/pull/2017.patch","issue_url":"https://api.github.com/repos/dealii/dealii/issues/2017","number":2017,"state":"open","locked":false,"title":"Parallel adaptive multigrid for parallel::distributed::Vector","user":{"login":"kronbichler","id":8276200,"avatar_url":"https://avatars.githubusercontent.com/u/8276200?v=3","gravatar_id":"","url":"https://api.github.com/users/kronbichler","html_url":"https://github.com/kronbichler","followers_url":"https://api.github.com/users/kronbichler/followers","following_url":"https://api.github.com/users/kronbichler/following{/other_user}","gists_url":"https://api.github.com/users/kronbichler/gists{/gist_id}","starred_url":"https://api.github.com/users/kronbichler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronbichler/subscriptions","organizations_url":"https://api.github.com/users/kronbichler/orgs","repos_url":"https://api.github.com/users/kronbichler/repos","events_url":"https://api.github.com/users/kronbichler/events{/privacy}","received_events_url":"https://api.github.com/users/kronbichler/received_events","type":"User","site_admin":false},"body":"This commit introduces parallel adaptive multigrid for parallel::distributed::Vector. As opposed to the PETSc and Trilinos vectors where we can write to remote entries but cannot read them (for the vectors coming into `copy_{to,from}_mg`), we need to switch the logic from which locations to read and where to write. This is because parallel::distributed::Vector has a pre-defined layout for ghost entries (i.e., it does not allocate them upon request) and thus cannot handle entries written to off-processor locations correctly when setting vector entries (as supposed to adding them). The read operation is done by creating a ghosted vector that includes off-processor entries from which to read from and importing that processor's data (`update_ghost_values`).\r\n\r\nWhile there, I also made the parallel vector do the read in local index space (Vector::local_element) rather than global index space (Vector::operator()) because that is faster.\r\n\r\nI put the additional data structures needed for the parallel vector (ghosted vectors, localized indices) in the new struct `internal::ParallelVectorData` to have them nicely grouped. Any other suggestion?","created_at":"2015-12-25T09:22:01Z","updated_at":"2016-01-04T17:12:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c7d10429836e1f0e10e8f862bc7ff84daad2207","assignee":null,"milestone":{"url":"https://api.github.com/repos/dealii/dealii/milestones/1","html_url":"https://github.com/dealii/dealii/milestones/Release%208.4","labels_url":"https://api.github.com/repos/dealii/dealii/milestones/1/labels","id":1272179,"number":1,"title":"Release 8.4","description":"","creator":{"login":"tamiko","id":3432917,"avatar_url":"https://avatars.githubusercontent.com/u/3432917?v=3","gravatar_id":"","url":"https://api.github.com/users/tamiko","html_url":"https://github.com/tamiko","followers_url":"https://api.github.com/users/tamiko/followers","following_url":"https://api.github.com/users/tamiko/following{/other_user}","gists_url":"https://api.github.com/users/tamiko/gists{/gist_id}","starred_url":"https://api.github.com/users/tamiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamiko/subscriptions","organizations_url":"https://api.github.com/users/tamiko/orgs","repos_url":"https://api.github.com/users/tamiko/repos","events_url":"https://api.github.com/users/tamiko/events{/privacy}","received_events_url":"https://api.github.com/users/tamiko/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":45,"state":"open","created_at":"2015-08-25T19:53:43Z","updated_at":"2016-01-04T14:09:37Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dealii/dealii/pulls/2017/commits","review_comments_url":"https://api.github.com/repos/dealii/dealii/pulls/2017/comments","review_comment_url":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/2017/comments","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/ebb9870e207b889cfc3d8ecab40be2a8329e70a8","head":{"label":"kronbichler:master","ref":"master","sha":"ebb9870e207b889cfc3d8ecab40be2a8329e70a8","user":{"login":"kronbichler","id":8276200,"avatar_url":"https://avatars.githubusercontent.com/u/8276200?v=3","gravatar_id":"","url":"https://api.github.com/users/kronbichler","html_url":"https://github.com/kronbichler","followers_url":"https://api.github.com/users/kronbichler/followers","following_url":"https://api.github.com/users/kronbichler/following{/other_user}","gists_url":"https://api.github.com/users/kronbichler/gists{/gist_id}","starred_url":"https://api.github.com/users/kronbichler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronbichler/subscriptions","organizations_url":"https://api.github.com/users/kronbichler/orgs","repos_url":"https://api.github.com/users/kronbichler/repos","events_url":"https://api.github.com/users/kronbichler/events{/privacy}","received_events_url":"https://api.github.com/users/kronbichler/received_events","type":"User","site_admin":false},"repo":{"id":22549298,"name":"dealii","full_name":"kronbichler/dealii","owner":{"login":"kronbichler","id":8276200,"avatar_url":"https://avatars.githubusercontent.com/u/8276200?v=3","gravatar_id":"","url":"https://api.github.com/users/kronbichler","html_url":"https://github.com/kronbichler","followers_url":"https://api.github.com/users/kronbichler/followers","following_url":"https://api.github.com/users/kronbichler/following{/other_user}","gists_url":"https://api.github.com/users/kronbichler/gists{/gist_id}","starred_url":"https://api.github.com/users/kronbichler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronbichler/subscriptions","organizations_url":"https://api.github.com/users/kronbichler/orgs","repos_url":"https://api.github.com/users/kronbichler/repos","events_url":"https://api.github.com/users/kronbichler/events{/privacy}","received_events_url":"https://api.github.com/users/kronbichler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kronbichler/dealii","description":"The development repository for the deal.II finite element library.","fork":true,"url":"https://api.github.com/repos/kronbichler/dealii","forks_url":"https://api.github.com/repos/kronbichler/dealii/forks","keys_url":"https://api.github.com/repos/kronbichler/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kronbichler/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kronbichler/dealii/teams","hooks_url":"https://api.github.com/repos/kronbichler/dealii/hooks","issue_events_url":"https://api.github.com/repos/kronbichler/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/kronbichler/dealii/events","assignees_url":"https://api.github.com/repos/kronbichler/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/kronbichler/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/kronbichler/dealii/tags","blobs_url":"https://api.github.com/repos/kronbichler/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kronbichler/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kronbichler/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/kronbichler/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kronbichler/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/kronbichler/dealii/languages","stargazers_url":"https://api.github.com/repos/kronbichler/dealii/stargazers","contributors_url":"https://api.github.com/repos/kronbichler/dealii/contributors","subscribers_url":"https://api.github.com/repos/kronbichler/dealii/subscribers","subscription_url":"https://api.github.com/repos/kronbichler/dealii/subscription","commits_url":"https://api.github.com/repos/kronbichler/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/kronbichler/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/kronbichler/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/kronbichler/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/kronbichler/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/kronbichler/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kronbichler/dealii/merges","archive_url":"https://api.github.com/repos/kronbichler/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kronbichler/dealii/downloads","issues_url":"https://api.github.com/repos/kronbichler/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/kronbichler/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/kronbichler/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/kronbichler/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kronbichler/dealii/labels{/name}","releases_url":"https://api.github.com/repos/kronbichler/dealii/releases{/id}","created_at":"2014-08-02T15:52:43Z","updated_at":"2015-04-22T06:52:50Z","pushed_at":"2016-01-03T19:45:39Z","git_url":"git://github.com/kronbichler/dealii.git","ssh_url":"git@github.com:kronbichler/dealii.git","clone_url":"https://github.com/kronbichler/dealii.git","svn_url":"https://github.com/kronbichler/dealii","homepage":"http://www.dealii.org/","size":129985,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"dealii:master","ref":"master","sha":"58e30abcbaf6b0a2e0e61259a28f9b31c67307cc","user":{"login":"dealii","id":7506070,"avatar_url":"https://avatars.githubusercontent.com/u/7506070?v=3","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"repo":{"id":21943980,"name":"dealii","full_name":"dealii/dealii","owner":{"login":"dealii","id":7506070,"avatar_url":"https://avatars.githubusercontent.com/u/7506070?v=3","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dealii/dealii","description":"The development repository for the deal.II finite element library.","fork":false,"url":"https://api.github.com/repos/dealii/dealii","forks_url":"https://api.github.com/repos/dealii/dealii/forks","keys_url":"https://api.github.com/repos/dealii/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dealii/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dealii/dealii/teams","hooks_url":"https://api.github.com/repos/dealii/dealii/hooks","issue_events_url":"https://api.github.com/repos/dealii/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/dealii/dealii/events","assignees_url":"https://api.github.com/repos/dealii/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/dealii/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/dealii/dealii/tags","blobs_url":"https://api.github.com/repos/dealii/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dealii/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dealii/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/dealii/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/dealii/dealii/languages","stargazers_url":"https://api.github.com/repos/dealii/dealii/stargazers","contributors_url":"https://api.github.com/repos/dealii/dealii/contributors","subscribers_url":"https://api.github.com/repos/dealii/dealii/subscribers","subscription_url":"https://api.github.com/repos/dealii/dealii/subscription","commits_url":"https://api.github.com/repos/dealii/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/dealii/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/dealii/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/dealii/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/dealii/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/dealii/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dealii/dealii/merges","archive_url":"https://api.github.com/repos/dealii/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dealii/dealii/downloads","issues_url":"https://api.github.com/repos/dealii/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/dealii/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/dealii/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/dealii/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dealii/dealii/labels{/name}","releases_url":"https://api.github.com/repos/dealii/dealii/releases{/id}","created_at":"2014-07-17T14:00:26Z","updated_at":"2015-12-31T14:02:29Z","pushed_at":"2016-01-04T16:47:23Z","git_url":"git://github.com/dealii/dealii.git","ssh_url":"git@github.com:dealii/dealii.git","clone_url":"https://github.com/dealii/dealii.git","svn_url":"https://github.com/dealii/dealii","homepage":"http://www.dealii.org/","size":137731,"stargazers_count":118,"watchers_count":118,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":139,"forks":135,"open_issues":139,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2017"},"html":{"href":"https://github.com/dealii/dealii/pull/2017"},"issue":{"href":"https://api.github.com/repos/dealii/dealii/issues/2017"},"comments":{"href":"https://api.github.com/repos/dealii/dealii/issues/2017/comments"},"review_comments":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2017/comments"},"review_comment":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2017/commits"},"statuses":{"href":"https://api.github.com/repos/dealii/dealii/statuses/ebb9870e207b889cfc3d8ecab40be2a8329e70a8"}}}}