{"action":"created","comment":{"url":"https://api.github.com/repos/tjhei/dealii/pulls/comments/59484311","id":59484311,"diff_hunk":"@@ -2526,6 +2529,108 @@ void GridOut::write_vtu (const Triangulation<dim,spacedim> &tria,\n \n \n \n+template <int dim, int spacedim>\n+void GridOut::write_debug_vtu_per_processor (const Triangulation<dim,spacedim> &tria,\n+                                             const std::string                 &filename_without_extension,\n+                                             const bool                        view_levels,\n+                                             const bool                        include_artificial) const\n+{\n+  std::vector<DataOutBase::Patch<dim,spacedim> > patches;\n+  const unsigned int n_datasets=4;\n+  std::vector<std::string> data_names;\n+  data_names.push_back(\"level\");\n+  data_names.push_back(\"subdomain\");\n+  data_names.push_back(\"lvlsubdomain\");\n+  data_names.push_back(\"proc_writing\");\n+\n+  const unsigned int n_q_points = GeometryInfo<dim>::vertices_per_cell;\n+\n+  typename Triangulation<dim, spacedim>::cell_iterator cell, endc;\n+  for (cell=tria.begin(), endc=tria.end();\n+       cell != endc; ++cell)\n+    {\n+      if (!include_artificial && cell->level_subdomain_id() ==\n+          numbers::artificial_subdomain_id)\n+        continue;\n+      if (!view_levels && cell->has_children())\n+        continue;\n+\n+      DataOutBase::Patch<dim,spacedim> patch;\n+      patch.data.reinit(n_datasets, n_q_points);\n+      patch.points_are_available = false;\n+\n+      for (unsigned int vertex=0; vertex<n_q_points; ++vertex)\n+        {\n+          patch.vertices[vertex] = cell->vertex(vertex);\n+          patch.data(0,vertex) = cell->level();\n+          if (!cell->has_children())\n+            patch.data(1,vertex) =\n+              (double)static_cast<int>(cell->subdomain_id());\n+          else\n+            patch.data(1,vertex) = -1.0;\n+          patch.data(2,vertex) =\n+            (double)static_cast<int>(cell->level_subdomain_id());\n+          patch.data(3,vertex) = tria.locally_owned_subdomain();\n+        }\n+\n+      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)\n+        patch.neighbors[f] = numbers::invalid_unsigned_int;\n+      patches.push_back(patch);\n+    }\n+\n+  const std::string new_file = (filename_without_extension + \".proc\" +\n+                                Utilities::int_to_string (tria.locally_owned_subdomain(), 4) +\n+                                \".vtu\");\n+  std::ofstream out(new_file.c_str());\n+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vector_data_ranges;\n+  DataOutBase::VtkFlags flags;\n+  DataOutBase::write_vtu (patches,\n+                          data_names,\n+                          vector_data_ranges,\n+                          flags,\n+                          out);\n+  //create .pvtu record\n+  if (tria.locally_owned_subdomain() == 0)\n+    {\n+      std::vector<std::string> filenames;\n+\n+      //.pvtu needs to reference the files without a relative path because it will be written \n+      //in the same directory. For this, remove any paths from filename.\n+      unsigned int indx = filename_without_extension.size();\n+      for (int i=indx-1; i>=0; --i)","path":"source/grid/grid_out.cc","position":87,"original_position":87,"commit_id":"7de9df4c8d6541f236b93876fd9b7dbec7b7f598","original_commit_id":"7de9df4c8d6541f236b93876fd9b7dbec7b7f598","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"body":"there is no reason to have ``i`` and ``indx`` I think. Even better (not tested):\r\n```\r\nsize_type pos = filename_without_extension.find_last_of('.');\r\nif (pos == std::npos)\r\n  pos = 0;\r\nelse\r\n  pos += 1; // skip '/'\r\n\r\n//now use filename_without_extension.substr(pos)\r\n```","created_at":"2016-04-13T02:18:42Z","updated_at":"2016-04-13T02:18:42Z","html_url":"https://github.com/tjhei/dealii/pull/2#discussion_r59484311","pull_request_url":"https://api.github.com/repos/tjhei/dealii/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/comments/59484311"},"html":{"href":"https://github.com/tjhei/dealii/pull/2#discussion_r59484311"},"pull_request":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/tjhei/dealii/pulls/2","id":66018262,"html_url":"https://github.com/tjhei/dealii/pull/2","diff_url":"https://github.com/tjhei/dealii/pull/2.diff","patch_url":"https://github.com/tjhei/dealii/pull/2.patch","issue_url":"https://api.github.com/repos/tjhei/dealii/issues/2","number":2,"state":"open","locked":false,"title":"Write parallel vtu","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"body":"(test PR to be able to comment)","created_at":"2016-04-11T15:57:39Z","updated_at":"2016-04-13T02:18:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7815fc2364798e54732ebadea282b10074a08e86","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tjhei/dealii/pulls/2/commits","review_comments_url":"https://api.github.com/repos/tjhei/dealii/pulls/2/comments","review_comment_url":"https://api.github.com/repos/tjhei/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tjhei/dealii/issues/2/comments","statuses_url":"https://api.github.com/repos/tjhei/dealii/statuses/7de9df4c8d6541f236b93876fd9b7dbec7b7f598","head":{"label":"tcclevenger:write_parallel_vtu","ref":"write_parallel_vtu","sha":"7de9df4c8d6541f236b93876fd9b7dbec7b7f598","user":{"login":"tcclevenger","id":11428698,"avatar_url":"https://avatars.githubusercontent.com/u/11428698?v=3","gravatar_id":"","url":"https://api.github.com/users/tcclevenger","html_url":"https://github.com/tcclevenger","followers_url":"https://api.github.com/users/tcclevenger/followers","following_url":"https://api.github.com/users/tcclevenger/following{/other_user}","gists_url":"https://api.github.com/users/tcclevenger/gists{/gist_id}","starred_url":"https://api.github.com/users/tcclevenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcclevenger/subscriptions","organizations_url":"https://api.github.com/users/tcclevenger/orgs","repos_url":"https://api.github.com/users/tcclevenger/repos","events_url":"https://api.github.com/users/tcclevenger/events{/privacy}","received_events_url":"https://api.github.com/users/tcclevenger/received_events","type":"User","site_admin":false},"repo":{"id":32033055,"name":"dealii","full_name":"tcclevenger/dealii","owner":{"login":"tcclevenger","id":11428698,"avatar_url":"https://avatars.githubusercontent.com/u/11428698?v=3","gravatar_id":"","url":"https://api.github.com/users/tcclevenger","html_url":"https://github.com/tcclevenger","followers_url":"https://api.github.com/users/tcclevenger/followers","following_url":"https://api.github.com/users/tcclevenger/following{/other_user}","gists_url":"https://api.github.com/users/tcclevenger/gists{/gist_id}","starred_url":"https://api.github.com/users/tcclevenger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcclevenger/subscriptions","organizations_url":"https://api.github.com/users/tcclevenger/orgs","repos_url":"https://api.github.com/users/tcclevenger/repos","events_url":"https://api.github.com/users/tcclevenger/events{/privacy}","received_events_url":"https://api.github.com/users/tcclevenger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tcclevenger/dealii","description":"The development repository for the deal.II finite element library.","fork":true,"url":"https://api.github.com/repos/tcclevenger/dealii","forks_url":"https://api.github.com/repos/tcclevenger/dealii/forks","keys_url":"https://api.github.com/repos/tcclevenger/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tcclevenger/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tcclevenger/dealii/teams","hooks_url":"https://api.github.com/repos/tcclevenger/dealii/hooks","issue_events_url":"https://api.github.com/repos/tcclevenger/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/tcclevenger/dealii/events","assignees_url":"https://api.github.com/repos/tcclevenger/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/tcclevenger/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/tcclevenger/dealii/tags","blobs_url":"https://api.github.com/repos/tcclevenger/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tcclevenger/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tcclevenger/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/tcclevenger/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tcclevenger/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/tcclevenger/dealii/languages","stargazers_url":"https://api.github.com/repos/tcclevenger/dealii/stargazers","contributors_url":"https://api.github.com/repos/tcclevenger/dealii/contributors","subscribers_url":"https://api.github.com/repos/tcclevenger/dealii/subscribers","subscription_url":"https://api.github.com/repos/tcclevenger/dealii/subscription","commits_url":"https://api.github.com/repos/tcclevenger/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/tcclevenger/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/tcclevenger/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/tcclevenger/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/tcclevenger/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/tcclevenger/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tcclevenger/dealii/merges","archive_url":"https://api.github.com/repos/tcclevenger/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tcclevenger/dealii/downloads","issues_url":"https://api.github.com/repos/tcclevenger/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/tcclevenger/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/tcclevenger/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/tcclevenger/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tcclevenger/dealii/labels{/name}","releases_url":"https://api.github.com/repos/tcclevenger/dealii/releases{/id}","deployments_url":"https://api.github.com/repos/tcclevenger/dealii/deployments","created_at":"2015-03-11T18:05:20Z","updated_at":"2015-03-11T18:06:26Z","pushed_at":"2016-04-12T21:46:37Z","git_url":"git://github.com/tcclevenger/dealii.git","ssh_url":"git@github.com:tcclevenger/dealii.git","clone_url":"https://github.com/tcclevenger/dealii.git","svn_url":"https://github.com/tcclevenger/dealii","homepage":"http://www.dealii.org/","size":137939,"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":"tjhei:master","ref":"master","sha":"fba6e1fb11ce927f705ac77cfde476b0edf81482","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"repo":{"id":22073053,"name":"dealii","full_name":"tjhei/dealii","owner":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjhei/dealii","description":"","fork":true,"url":"https://api.github.com/repos/tjhei/dealii","forks_url":"https://api.github.com/repos/tjhei/dealii/forks","keys_url":"https://api.github.com/repos/tjhei/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjhei/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjhei/dealii/teams","hooks_url":"https://api.github.com/repos/tjhei/dealii/hooks","issue_events_url":"https://api.github.com/repos/tjhei/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/tjhei/dealii/events","assignees_url":"https://api.github.com/repos/tjhei/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/tjhei/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/tjhei/dealii/tags","blobs_url":"https://api.github.com/repos/tjhei/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjhei/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjhei/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjhei/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjhei/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/tjhei/dealii/languages","stargazers_url":"https://api.github.com/repos/tjhei/dealii/stargazers","contributors_url":"https://api.github.com/repos/tjhei/dealii/contributors","subscribers_url":"https://api.github.com/repos/tjhei/dealii/subscribers","subscription_url":"https://api.github.com/repos/tjhei/dealii/subscription","commits_url":"https://api.github.com/repos/tjhei/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjhei/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjhei/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjhei/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjhei/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/tjhei/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjhei/dealii/merges","archive_url":"https://api.github.com/repos/tjhei/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjhei/dealii/downloads","issues_url":"https://api.github.com/repos/tjhei/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/tjhei/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/tjhei/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/tjhei/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjhei/dealii/labels{/name}","releases_url":"https://api.github.com/repos/tjhei/dealii/releases{/id}","deployments_url":"https://api.github.com/repos/tjhei/dealii/deployments","created_at":"2014-07-21T17:16:17Z","updated_at":"2016-02-07T14:42:30Z","pushed_at":"2016-04-12T21:46:37Z","git_url":"git://github.com/tjhei/dealii.git","ssh_url":"git@github.com:tjhei/dealii.git","clone_url":"https://github.com/tjhei/dealii.git","svn_url":"https://github.com/tjhei/dealii","homepage":null,"size":138855,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/2"},"html":{"href":"https://github.com/tjhei/dealii/pull/2"},"issue":{"href":"https://api.github.com/repos/tjhei/dealii/issues/2"},"comments":{"href":"https://api.github.com/repos/tjhei/dealii/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tjhei/dealii/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/tjhei/dealii/statuses/7de9df4c8d6541f236b93876fd9b7dbec7b7f598"}}}}