{"action":"created","comment":{"url":"https://api.github.com/repos/dealii/dealii/pulls/comments/37535627","id":37535627,"diff_hunk":"@@ -0,0 +1,168 @@\n+// ---------------------------------------------------------------------\n+//\n+// Copyright (C) 2003 - 2015 by the deal.II authors\n+//\n+// This file is part of the deal.II library.\n+//\n+// The deal.II library is free software; you can use it, redistribute\n+// it, and/or modify it under the terms of the GNU Lesser General\n+// Public License as published by the Free Software Foundation; either\n+// version 2.1 of the License, or (at your option) any later version.\n+// The full text of the license can be found in the file LICENSE at\n+// the top level of the deal.II distribution.\n+//\n+// ---------------------------------------------------------------------\n+\n+\n+// Integrate the derivatives in the interior and compare the result to the\n+// integral of the values on the boundary.\n+\n+#include \"../tests.h\"\n+#include <deal.II/base/logstream.h>\n+#include <deal.II/base/function.h>\n+#include <deal.II/base/quadrature_lib.h>\n+#include <deal.II/lac/vector.h>\n+#include <deal.II/grid/grid_generator.h>\n+#include <deal.II/grid/tria_boundary_lib.h>\n+#include <deal.II/dofs/dof_handler.h>\n+#include <deal.II/fe/fe_q.h>\n+#include <deal.II/fe/fe_raviart_thomas.h>\n+#include <deal.II/fe/fe_nedelec.h>\n+#include <deal.II/fe/fe_abf.h>\n+#include <deal.II/fe/fe_dgq.h>\n+#include <deal.II/fe/fe_system.h>\n+#include <deal.II/fe/fe_values.h>\n+#include <deal.II/fe/mapping_q1.h>\n+\n+#include <sstream>\n+#include <fstream>\n+\n+\n+\n+template<int dim>\n+Tensor<1,dim> ones ()\n+{\n+\tTensor<1,dim> result;\n+\tfor(unsigned int i=0; i<dim; ++i)\n+\t\tresult[i] = 1.0;\n+\treturn result;\n+}\n+\n+template<int dim>\n+void test (const Triangulation<dim> &tr,\n+\t\tconst FiniteElement<dim> &fe,\n+\t\tconst double tolerance)\n+{\n+\tDoFHandler<dim> dof(tr);\n+\tdof.distribute_dofs(fe);\n+\n+\tstd::stringstream ss;\n+\n+\tdeallog << \"FE=\" << fe.get_name() << std::endl;\n+\n+\tconst QGauss<dim> quadrature(4);\n+\tFEValues<dim> fe_values (fe, quadrature, update_gradients\n+\t\t\t| update_quadrature_points\n+\t\t\t| update_JxW_values);\n+\n+\tconst QGauss<dim-1> face_quadrature(4);\n+\tFEFaceValues<dim> fe_face_values (fe, face_quadrature,\n+\t\t\tupdate_values\n+\t\t\t| update_quadrature_points\n+\t\t\t| update_normal_vectors\n+\t\t\t| update_JxW_values);\n+\n+\tfor(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();\n+\t\t\tcell != dof.end();\n+\t\t\t++cell)\n+\t{\n+\t\tfe_values.reinit (cell);\n+\n+\t\tdeallog << \"Cell nodes:\" << std::endl;\n+\t\tfor(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)\n+\t\t\tdeallog << i << \": (\" << cell->vertex(i) << \")\" << std::endl;\n+\n+\t\tbool cell_ok = true;\n+\n+\t\tfor (unsigned int c=0; c<fe.n_components(); ++c)\n+\t\t{\n+\t\t\tFEValuesExtractors::Scalar single_component (c);\n+\n+\t\t\tfor (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)\n+\t\t\t{\n+\t\t\t\tss << \"component=\" << c\n+\t\t\t\t\t\t<< \", dof=\" << i\n+\t\t\t\t\t\t<< std::endl;\n+\n+\t\t\t\tTensor<1,dim> bulk_integral;\n+\t\t\t\tfor (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)\n+\t\t\t\t{\n+\t\t\t\t\tbulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);\n+\t\t\t\t}\n+\n+\t\t\t\tTensor<1,dim> boundary_integral;\n+\t\t\t\tfor (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)\n+\t\t\t\t{\n+\t\t\t\t\tfe_face_values.reinit(cell,face);\n+\t\t\t\t\tfor (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)\n+\t\t\t\t\t{\n+\t\t\t\t\t\tboundary_integral += fe_face_values[single_component].value (i,q)\n+\t\t\t\t\t\t\t\t\t\t\t\t\t* fe_face_values.normal_vector(q)\n+\t\t\t\t\t\t\t\t\t\t\t\t\t* fe_face_values.JxW(q);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t\t\tif ( (bulk_integral-boundary_integral).norm_square() > tolerance )","path":"tests/fe/fe_abf_gradient_divergence_theorem.cc","position":115,"original_position":115,"commit_id":"834c4ca58cf137438a61db918395bb327a967392","original_commit_id":"834c4ca58cf137438a61db918395bb327a967392","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":"As a general rule, absolute tolerances are often hard to understand because we don't know how large the thing on the left is. How about\r\n```\r\n  if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))\r\n```\r\nto make things relative?","created_at":"2015-08-20T14:32:39Z","updated_at":"2015-08-20T14:32:39Z","html_url":"https://github.com/dealii/dealii/pull/1394#discussion_r37535627","pull_request_url":"https://api.github.com/repos/dealii/dealii/pulls/1394","_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments/37535627"},"html":{"href":"https://github.com/dealii/dealii/pull/1394#discussion_r37535627"},"pull_request":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1394"}}},"pull_request":{"url":"https://api.github.com/repos/dealii/dealii/pulls/1394","id":42880242,"html_url":"https://github.com/dealii/dealii/pull/1394","diff_url":"https://github.com/dealii/dealii/pull/1394.diff","patch_url":"https://github.com/dealii/dealii/pull/1394.patch","issue_url":"https://api.github.com/repos/dealii/dealii/issues/1394","number":1394,"state":"open","locked":false,"title":"Added missing term in gradient computations in FE_PolyTensor","user":{"login":"maieneuro","id":8012418,"avatar_url":"https://avatars.githubusercontent.com/u/8012418?v=3","gravatar_id":"","url":"https://api.github.com/users/maieneuro","html_url":"https://github.com/maieneuro","followers_url":"https://api.github.com/users/maieneuro/followers","following_url":"https://api.github.com/users/maieneuro/following{/other_user}","gists_url":"https://api.github.com/users/maieneuro/gists{/gist_id}","starred_url":"https://api.github.com/users/maieneuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maieneuro/subscriptions","organizations_url":"https://api.github.com/users/maieneuro/orgs","repos_url":"https://api.github.com/users/maieneuro/repos","events_url":"https://api.github.com/users/maieneuro/events{/privacy}","received_events_url":"https://api.github.com/users/maieneuro/received_events","type":"User","site_admin":false},"body":"Added missing term corresponding to the mapping gradient in FE_PolyTensor gradient computations (This is extracting the part of PR #1377 pertaining to the gradients).\r\n\r\nAlso included here are some test cases to verify the computations for several FE's that rely on the divergence theorem testing each of the components of the gradient, one at a time.\r\n\r\nChanged reference output for fe_values_views_* test files that were affected by adding the missing gradient terms, since the divergence theorem-based tests confirm correctness of the modification.","created_at":"2015-08-20T00:32:58Z","updated_at":"2015-08-20T14:32:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83cd29dd706bc28a795f9d7bec325495fab2d997","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dealii/dealii/pulls/1394/commits","review_comments_url":"https://api.github.com/repos/dealii/dealii/pulls/1394/comments","review_comment_url":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/1394/comments","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/834c4ca58cf137438a61db918395bb327a967392","head":{"label":"maieneuro:add_missing_term_in_fe_poly_tensor_gradients","ref":"add_missing_term_in_fe_poly_tensor_gradients","sha":"834c4ca58cf137438a61db918395bb327a967392","user":{"login":"maieneuro","id":8012418,"avatar_url":"https://avatars.githubusercontent.com/u/8012418?v=3","gravatar_id":"","url":"https://api.github.com/users/maieneuro","html_url":"https://github.com/maieneuro","followers_url":"https://api.github.com/users/maieneuro/followers","following_url":"https://api.github.com/users/maieneuro/following{/other_user}","gists_url":"https://api.github.com/users/maieneuro/gists{/gist_id}","starred_url":"https://api.github.com/users/maieneuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maieneuro/subscriptions","organizations_url":"https://api.github.com/users/maieneuro/orgs","repos_url":"https://api.github.com/users/maieneuro/repos","events_url":"https://api.github.com/users/maieneuro/events{/privacy}","received_events_url":"https://api.github.com/users/maieneuro/received_events","type":"User","site_admin":false},"repo":{"id":37921506,"name":"dealii","full_name":"maieneuro/dealii","owner":{"login":"maieneuro","id":8012418,"avatar_url":"https://avatars.githubusercontent.com/u/8012418?v=3","gravatar_id":"","url":"https://api.github.com/users/maieneuro","html_url":"https://github.com/maieneuro","followers_url":"https://api.github.com/users/maieneuro/followers","following_url":"https://api.github.com/users/maieneuro/following{/other_user}","gists_url":"https://api.github.com/users/maieneuro/gists{/gist_id}","starred_url":"https://api.github.com/users/maieneuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maieneuro/subscriptions","organizations_url":"https://api.github.com/users/maieneuro/orgs","repos_url":"https://api.github.com/users/maieneuro/repos","events_url":"https://api.github.com/users/maieneuro/events{/privacy}","received_events_url":"https://api.github.com/users/maieneuro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maieneuro/dealii","description":"The development repository for the deal.II finite element library.","fork":true,"url":"https://api.github.com/repos/maieneuro/dealii","forks_url":"https://api.github.com/repos/maieneuro/dealii/forks","keys_url":"https://api.github.com/repos/maieneuro/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maieneuro/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maieneuro/dealii/teams","hooks_url":"https://api.github.com/repos/maieneuro/dealii/hooks","issue_events_url":"https://api.github.com/repos/maieneuro/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/maieneuro/dealii/events","assignees_url":"https://api.github.com/repos/maieneuro/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/maieneuro/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/maieneuro/dealii/tags","blobs_url":"https://api.github.com/repos/maieneuro/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maieneuro/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maieneuro/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/maieneuro/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maieneuro/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/maieneuro/dealii/languages","stargazers_url":"https://api.github.com/repos/maieneuro/dealii/stargazers","contributors_url":"https://api.github.com/repos/maieneuro/dealii/contributors","subscribers_url":"https://api.github.com/repos/maieneuro/dealii/subscribers","subscription_url":"https://api.github.com/repos/maieneuro/dealii/subscription","commits_url":"https://api.github.com/repos/maieneuro/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/maieneuro/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/maieneuro/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/maieneuro/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/maieneuro/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/maieneuro/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maieneuro/dealii/merges","archive_url":"https://api.github.com/repos/maieneuro/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maieneuro/dealii/downloads","issues_url":"https://api.github.com/repos/maieneuro/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/maieneuro/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/maieneuro/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/maieneuro/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maieneuro/dealii/labels{/name}","releases_url":"https://api.github.com/repos/maieneuro/dealii/releases{/id}","created_at":"2015-06-23T13:45:25Z","updated_at":"2015-06-23T13:46:32Z","pushed_at":"2015-08-20T00:30:54Z","git_url":"git://github.com/maieneuro/dealii.git","ssh_url":"git@github.com:maieneuro/dealii.git","clone_url":"https://github.com/maieneuro/dealii.git","svn_url":"https://github.com/maieneuro/dealii","homepage":"http://www.dealii.org/","size":121540,"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":"c746bec43ae894a39a89920aae7dec49e37280da","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-08-19T13:12:06Z","pushed_at":"2015-08-20T13:41:24Z","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":156797,"stargazers_count":81,"watchers_count":81,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":120,"forks":114,"open_issues":120,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1394"},"html":{"href":"https://github.com/dealii/dealii/pull/1394"},"issue":{"href":"https://api.github.com/repos/dealii/dealii/issues/1394"},"comments":{"href":"https://api.github.com/repos/dealii/dealii/issues/1394/comments"},"review_comments":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1394/comments"},"review_comment":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1394/commits"},"statuses":{"href":"https://api.github.com/repos/dealii/dealii/statuses/834c4ca58cf137438a61db918395bb327a967392"}}}}