{"action":"created","comment":{"url":"https://api.github.com/repos/dealii/dealii/pulls/comments/57354706","id":57354706,"diff_hunk":"@@ -591,6 +591,98 @@ GridRefinement::refine_and_coarsen_optimize (Triangulation<dim,spacedim> &tria,\n   refine (tria, criteria, criteria(tmp[min_arg]));\n }\n \n+template<int dim, int spacedim>\n+std::pair<unsigned int, double>\n+GridRefinement::get_longest_direction(typename Triangulation<dim, spacedim>::active_cell_iterator cell)\n+{\n+  double max_ratio = 1;\n+  unsigned int index = 0;\n+\n+  for (unsigned int i = 0; i < dim; ++i)\n+    {\n+      unsigned int ax = i % dim;\n+      unsigned int next_ax = (i+1) % dim;\n+\n+      double ratio =  cell->extent_in_direction(ax) / cell->extent_in_direction(next_ax);","path":"source/grid/grid_refinement.cc","position":16,"original_position":16,"commit_id":"1616289e757a6afc9e4d7e9223db0e918bdb5ba2","original_commit_id":"1616289e757a6afc9e4d7e9223db0e918bdb5ba2","user":{"login":"bangerth","id":7504421,"avatar_url":"https://avatars.githubusercontent.com/u/7504421?v=3","gravatar_id":"","url":"https://api.github.com/users/bangerth","html_url":"https://github.com/bangerth","followers_url":"https://api.github.com/users/bangerth/followers","following_url":"https://api.github.com/users/bangerth/following{/other_user}","gists_url":"https://api.github.com/users/bangerth/gists{/gist_id}","starred_url":"https://api.github.com/users/bangerth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bangerth/subscriptions","organizations_url":"https://api.github.com/users/bangerth/orgs","repos_url":"https://api.github.com/users/bangerth/repos","events_url":"https://api.github.com/users/bangerth/events{/privacy}","received_events_url":"https://api.github.com/users/bangerth/received_events","type":"User","site_admin":false},"body":"this algorithm only considers the ratio between successive directions. This covers all possible pairs in 2d and 3d, but it would fail in 4d if we ever go there. I think it would be useful if the algorithm just stored all of the extents in a vector of size dim, and then did a pairwise comparison between all.","created_at":"2016-03-24T17:29:09Z","updated_at":"2016-03-24T17:29:09Z","html_url":"https://github.com/dealii/dealii/pull/2403#discussion_r57354706","pull_request_url":"https://api.github.com/repos/dealii/dealii/pulls/2403","_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments/57354706"},"html":{"href":"https://github.com/dealii/dealii/pull/2403#discussion_r57354706"},"pull_request":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2403"}}},"pull_request":{"url":"https://api.github.com/repos/dealii/dealii/pulls/2403","id":64060267,"html_url":"https://github.com/dealii/dealii/pull/2403","diff_url":"https://github.com/dealii/dealii/pull/2403.diff","patch_url":"https://github.com/dealii/dealii/pull/2403.patch","issue_url":"https://api.github.com/repos/dealii/dealii/issues/2403","number":2403,"state":"open","locked":false,"title":"remove anisotropic and remove hanging nodes","user":{"login":"ESeNonFossiIo","id":8956997,"avatar_url":"https://avatars.githubusercontent.com/u/8956997?v=3","gravatar_id":"","url":"https://api.github.com/users/ESeNonFossiIo","html_url":"https://github.com/ESeNonFossiIo","followers_url":"https://api.github.com/users/ESeNonFossiIo/followers","following_url":"https://api.github.com/users/ESeNonFossiIo/following{/other_user}","gists_url":"https://api.github.com/users/ESeNonFossiIo/gists{/gist_id}","starred_url":"https://api.github.com/users/ESeNonFossiIo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ESeNonFossiIo/subscriptions","organizations_url":"https://api.github.com/users/ESeNonFossiIo/orgs","repos_url":"https://api.github.com/users/ESeNonFossiIo/repos","events_url":"https://api.github.com/users/ESeNonFossiIo/events{/privacy}","received_events_url":"https://api.github.com/users/ESeNonFossiIo/received_events","type":"User","site_admin":false},"body":"with *remove_anisotropy* it is possible to \"squarify\" the grid. Form cells like this \r\n<img width=\"523\" alt=\"screen shot 2016-03-24 at 17 20 26\" src=\"https://cloud.githubusercontent.com/assets/8956997/14023508/f8e589a2-f1e4-11e5-8f24-7b4a2225221c.png\">\r\nto this:\r\n<img width=\"511\" alt=\"screen shot 2016-03-24 at 17 19 48\" src=\"https://cloud.githubusercontent.com/assets/8956997/14023514/fc44efca-f1e4-11e5-9f8c-b2d247cd3ea3.png\">\r\n( all specs in the doc )\r\n\r\nwith *remove_hanging_nodes* it is possible to refine a grid like this:\r\n<img width=\"524\" alt=\"screen shot 2016-03-24 at 16 39 12\" src=\"https://cloud.githubusercontent.com/assets/8956997/14023547/1fd002b8-f1e5-11e5-83f6-4bf0c304c6ca.png\">\r\n\r\nremoving hanging nodes with the minor number of cells:\r\n<img width=\"527\" alt=\"screen shot 2016-03-24 at 16 44 16\" src=\"https://cloud.githubusercontent.com/assets/8956997/14023577/3e926dc6-f1e5-11e5-9926-80a956216171.png\">\r\nor maintaining the isotropy:\r\n<img width=\"523\" alt=\"screen shot 2016-03-24 at 16 39 49\" src=\"https://cloud.githubusercontent.com/assets/8956997/14023596/528506ae-f1e5-11e5-880a-5b43b9e042e6.png\">\r\n","created_at":"2016-03-24T16:26:44Z","updated_at":"2016-03-24T17:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4503a6a70e8830bc21be7b5a5ac3e8580e34774","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dealii/dealii/pulls/2403/commits","review_comments_url":"https://api.github.com/repos/dealii/dealii/pulls/2403/comments","review_comment_url":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/2403/comments","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/1616289e757a6afc9e4d7e9223db0e918bdb5ba2","head":{"label":"ESeNonFossiIo:refinement","ref":"refinement","sha":"1616289e757a6afc9e4d7e9223db0e918bdb5ba2","user":{"login":"ESeNonFossiIo","id":8956997,"avatar_url":"https://avatars.githubusercontent.com/u/8956997?v=3","gravatar_id":"","url":"https://api.github.com/users/ESeNonFossiIo","html_url":"https://github.com/ESeNonFossiIo","followers_url":"https://api.github.com/users/ESeNonFossiIo/followers","following_url":"https://api.github.com/users/ESeNonFossiIo/following{/other_user}","gists_url":"https://api.github.com/users/ESeNonFossiIo/gists{/gist_id}","starred_url":"https://api.github.com/users/ESeNonFossiIo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ESeNonFossiIo/subscriptions","organizations_url":"https://api.github.com/users/ESeNonFossiIo/orgs","repos_url":"https://api.github.com/users/ESeNonFossiIo/repos","events_url":"https://api.github.com/users/ESeNonFossiIo/events{/privacy}","received_events_url":"https://api.github.com/users/ESeNonFossiIo/received_events","type":"User","site_admin":false},"repo":{"id":33110155,"name":"dealii","full_name":"ESeNonFossiIo/dealii","owner":{"login":"ESeNonFossiIo","id":8956997,"avatar_url":"https://avatars.githubusercontent.com/u/8956997?v=3","gravatar_id":"","url":"https://api.github.com/users/ESeNonFossiIo","html_url":"https://github.com/ESeNonFossiIo","followers_url":"https://api.github.com/users/ESeNonFossiIo/followers","following_url":"https://api.github.com/users/ESeNonFossiIo/following{/other_user}","gists_url":"https://api.github.com/users/ESeNonFossiIo/gists{/gist_id}","starred_url":"https://api.github.com/users/ESeNonFossiIo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ESeNonFossiIo/subscriptions","organizations_url":"https://api.github.com/users/ESeNonFossiIo/orgs","repos_url":"https://api.github.com/users/ESeNonFossiIo/repos","events_url":"https://api.github.com/users/ESeNonFossiIo/events{/privacy}","received_events_url":"https://api.github.com/users/ESeNonFossiIo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ESeNonFossiIo/dealii","description":"The development repository for the deal.II finite element library.","fork":true,"url":"https://api.github.com/repos/ESeNonFossiIo/dealii","forks_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/forks","keys_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/teams","hooks_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/hooks","issue_events_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/events","assignees_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/tags","blobs_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/languages","stargazers_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/stargazers","contributors_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/contributors","subscribers_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/subscribers","subscription_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/subscription","commits_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/merges","archive_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/downloads","issues_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/labels{/name}","releases_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/releases{/id}","deployments_url":"https://api.github.com/repos/ESeNonFossiIo/dealii/deployments","created_at":"2015-03-30T07:57:41Z","updated_at":"2016-01-12T17:28:30Z","pushed_at":"2016-03-24T16:27:42Z","git_url":"git://github.com/ESeNonFossiIo/dealii.git","ssh_url":"git@github.com:ESeNonFossiIo/dealii.git","clone_url":"https://github.com/ESeNonFossiIo/dealii.git","svn_url":"https://github.com/ESeNonFossiIo/dealii","homepage":"http://www.dealii.org/","size":135735,"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":"f8ed3eef6d25d029f8a10cdd315d2996b8996f0e","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}","deployments_url":"https://api.github.com/repos/dealii/dealii/deployments","created_at":"2014-07-17T14:00:26Z","updated_at":"2016-03-20T16:34:52Z","pushed_at":"2016-03-24T16:26:45Z","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":156161,"stargazers_count":128,"watchers_count":128,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":166,"forks":156,"open_issues":166,"watchers":128,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2403"},"html":{"href":"https://github.com/dealii/dealii/pull/2403"},"issue":{"href":"https://api.github.com/repos/dealii/dealii/issues/2403"},"comments":{"href":"https://api.github.com/repos/dealii/dealii/issues/2403/comments"},"review_comments":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2403/comments"},"review_comment":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dealii/dealii/pulls/2403/commits"},"statuses":{"href":"https://api.github.com/repos/dealii/dealii/statuses/1616289e757a6afc9e4d7e9223db0e918bdb5ba2"}}}}