{"action":"created","comment":{"url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/comments/49671413","id":49671413,"diff_hunk":"@@ -0,0 +1,163 @@\n+//-----------------------------------------------------------\n+//\n+//    Copyright (C) 2016 by the deal2lkit authors\n+//\n+//    This file is part of the deal2lkit library.\n+//\n+//    The deal2lkit 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 deal2lkit distribution.\n+//\n+//-----------------------------------------------------------\n+\n+#ifndef _d2k_parsed_zero_average_constraints_h\n+#define _d2k_parsed_zero_average_constraints_h\n+\n+#include <deal2lkit/config.h>\n+#include <deal.II/base/exceptions.h>\n+#include <deal.II/base/parsed_function.h>\n+#include <deal2lkit/parameter_acceptor.h>\n+#include <deal.II/fe/component_mask.h>\n+#include <algorithm>\n+#include <map>\n+#include <deal2lkit/utilities.h>\n+#include <deal.II/dofs/dof_handler.h>\n+#include <deal.II/lac/constraint_matrix.h>\n+\n+\n+using namespace dealii;\n+\n+\n+D2K_NAMESPACE_OPEN\n+\n+/**\n+ * ParsedZeroAverageConstraints class. It allows you to set a zero\n+ * average constraint to a ConstraintMatrix. The variable to be\n+ * constrained (e.g. the pressure for Stokes problem) can be specified\n+ * in the parameter file either by its component name (e.g. \"p\") or by\n+ * the component number.\n+ *\n+ * The zero mean value can be set on the whole domain, or on the\n+ * boundary.\n+ *\n+ * A typical usage of this class is as follows:\n+ *\n+ * @code\n+ * ConstraintMatrix cm;\n+ * ParsedZeroAverageConstraints<dim> pnac(\"Parsed Zero Average Constraints\",\n+ *              dim+1,\n+ *            (dim==2?\"u,u,p\":\"u,u,u,p\"),\n+ *            \"p\");\n+ *\n+ *\n+ *\n+ * ParameterAcceptor::initialize();\n+ * pnac.apply_zero_average_constraints(dof_handler,cm);\n+ * @endcode\n+ */\n+\n+\n+\n+template <int dim, int spacedim=dim>\n+class ParsedZeroAverageConstraints : public ParameterAcceptor\n+{\n+public:\n+  /**\n+   * Constructor.\n+   *\n+   * It takes:\n+   * - the name for the section of the Parameter Handler to use\n+   *\n+   * - the number of components that this function has\n+   *\n+   * - the default names of known components that can be used instead\n+   *   of component numbers. If empty, in the parameter file will be\n+   *   filled with n_components 'u'\n+   *\n+   * - a list of components, separated by a \",\" (i.e. 0,p,5), that are\n+   *   to be constrained on the whole domain\n+   *\n+   * - a list of components, separated by a \",\" (i.e. 0,p,5), that are\n+   *   to be constrained on the boundary\n+   */\n+  ParsedZeroAverageConstraints  (const std::string &name,\n+                                 const unsigned int &n_components=1,\n+                                 const std::string &component_names = \"\",\n+                                 const std::string &default_components = \"\",\n+                                 const std::string &default_boundary_components =\"\");\n+\n+\n+  /**\n+   * Compute the zero average constraints on the boundary, and apply","path":"include/deal2lkit/parsed_zero_average_constraints.h","position":94,"original_position":94,"commit_id":"a06ad80a7cabf81e46674055db6255638904902c","original_commit_id":"a06ad80a7cabf81e46674055db6255638904902c","user":{"login":"luca-heltai","id":2919756,"avatar_url":"https://avatars.githubusercontent.com/u/2919756?v=3","gravatar_id":"","url":"https://api.github.com/users/luca-heltai","html_url":"https://github.com/luca-heltai","followers_url":"https://api.github.com/users/luca-heltai/followers","following_url":"https://api.github.com/users/luca-heltai/following{/other_user}","gists_url":"https://api.github.com/users/luca-heltai/gists{/gist_id}","starred_url":"https://api.github.com/users/luca-heltai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luca-heltai/subscriptions","organizations_url":"https://api.github.com/users/luca-heltai/orgs","repos_url":"https://api.github.com/users/luca-heltai/repos","events_url":"https://api.github.com/users/luca-heltai/events{/privacy}","received_events_url":"https://api.github.com/users/luca-heltai/received_events","type":"User","site_admin":false},"body":"This is not only on the boundary now...","created_at":"2016-01-14T00:09:53Z","updated_at":"2016-01-14T00:09:53Z","html_url":"https://github.com/mathLab/deal2lkit/pull/270#discussion_r49671413","pull_request_url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/comments/49671413"},"html":{"href":"https://github.com/mathLab/deal2lkit/pull/270#discussion_r49671413"},"pull_request":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270","id":55810751,"html_url":"https://github.com/mathLab/deal2lkit/pull/270","diff_url":"https://github.com/mathLab/deal2lkit/pull/270.diff","patch_url":"https://github.com/mathLab/deal2lkit/pull/270.patch","issue_url":"https://api.github.com/repos/mathLab/deal2lkit/issues/270","number":270,"state":"open","locked":false,"title":"introduced ParsedZeroAverageConstraints","user":{"login":"asartori86","id":10710861,"avatar_url":"https://avatars.githubusercontent.com/u/10710861?v=3","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-12T20:16:03Z","updated_at":"2016-01-14T00:09:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfd72c544ab72947420c5d9721e34e3474fcb677","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270/commits","review_comments_url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270/comments","review_comment_url":"https://api.github.com/repos/mathLab/deal2lkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mathLab/deal2lkit/issues/270/comments","statuses_url":"https://api.github.com/repos/mathLab/deal2lkit/statuses/a06ad80a7cabf81e46674055db6255638904902c","head":{"label":"asartori86:null_average","ref":"null_average","sha":"a06ad80a7cabf81e46674055db6255638904902c","user":{"login":"asartori86","id":10710861,"avatar_url":"https://avatars.githubusercontent.com/u/10710861?v=3","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"repo":{"id":34106805,"name":"deal2lkit","full_name":"asartori86/deal2lkit","owner":{"login":"asartori86","id":10710861,"avatar_url":"https://avatars.githubusercontent.com/u/10710861?v=3","gravatar_id":"","url":"https://api.github.com/users/asartori86","html_url":"https://github.com/asartori86","followers_url":"https://api.github.com/users/asartori86/followers","following_url":"https://api.github.com/users/asartori86/following{/other_user}","gists_url":"https://api.github.com/users/asartori86/gists{/gist_id}","starred_url":"https://api.github.com/users/asartori86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asartori86/subscriptions","organizations_url":"https://api.github.com/users/asartori86/orgs","repos_url":"https://api.github.com/users/asartori86/repos","events_url":"https://api.github.com/users/asartori86/events{/privacy}","received_events_url":"https://api.github.com/users/asartori86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asartori86/deal2lkit","description":"A ToolKit library for deal.II http://mathlab.github.io/deal2lkit","fork":true,"url":"https://api.github.com/repos/asartori86/deal2lkit","forks_url":"https://api.github.com/repos/asartori86/deal2lkit/forks","keys_url":"https://api.github.com/repos/asartori86/deal2lkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asartori86/deal2lkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asartori86/deal2lkit/teams","hooks_url":"https://api.github.com/repos/asartori86/deal2lkit/hooks","issue_events_url":"https://api.github.com/repos/asartori86/deal2lkit/issues/events{/number}","events_url":"https://api.github.com/repos/asartori86/deal2lkit/events","assignees_url":"https://api.github.com/repos/asartori86/deal2lkit/assignees{/user}","branches_url":"https://api.github.com/repos/asartori86/deal2lkit/branches{/branch}","tags_url":"https://api.github.com/repos/asartori86/deal2lkit/tags","blobs_url":"https://api.github.com/repos/asartori86/deal2lkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asartori86/deal2lkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asartori86/deal2lkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/asartori86/deal2lkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asartori86/deal2lkit/statuses/{sha}","languages_url":"https://api.github.com/repos/asartori86/deal2lkit/languages","stargazers_url":"https://api.github.com/repos/asartori86/deal2lkit/stargazers","contributors_url":"https://api.github.com/repos/asartori86/deal2lkit/contributors","subscribers_url":"https://api.github.com/repos/asartori86/deal2lkit/subscribers","subscription_url":"https://api.github.com/repos/asartori86/deal2lkit/subscription","commits_url":"https://api.github.com/repos/asartori86/deal2lkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/asartori86/deal2lkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/asartori86/deal2lkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/asartori86/deal2lkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/asartori86/deal2lkit/contents/{+path}","compare_url":"https://api.github.com/repos/asartori86/deal2lkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asartori86/deal2lkit/merges","archive_url":"https://api.github.com/repos/asartori86/deal2lkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asartori86/deal2lkit/downloads","issues_url":"https://api.github.com/repos/asartori86/deal2lkit/issues{/number}","pulls_url":"https://api.github.com/repos/asartori86/deal2lkit/pulls{/number}","milestones_url":"https://api.github.com/repos/asartori86/deal2lkit/milestones{/number}","notifications_url":"https://api.github.com/repos/asartori86/deal2lkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asartori86/deal2lkit/labels{/name}","releases_url":"https://api.github.com/repos/asartori86/deal2lkit/releases{/id}","created_at":"2015-04-17T09:00:30Z","updated_at":"2015-09-21T12:30:52Z","pushed_at":"2016-01-13T21:30:08Z","git_url":"git://github.com/asartori86/deal2lkit.git","ssh_url":"git@github.com:asartori86/deal2lkit.git","clone_url":"https://github.com/asartori86/deal2lkit.git","svn_url":"https://github.com/asartori86/deal2lkit","homepage":"","size":4424,"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":"mathLab:master","ref":"master","sha":"9a5f1b2d4fa3f552bedd7aab45e669ef2bd3cf6e","user":{"login":"mathLab","id":14195552,"avatar_url":"https://avatars.githubusercontent.com/u/14195552?v=3","gravatar_id":"","url":"https://api.github.com/users/mathLab","html_url":"https://github.com/mathLab","followers_url":"https://api.github.com/users/mathLab/followers","following_url":"https://api.github.com/users/mathLab/following{/other_user}","gists_url":"https://api.github.com/users/mathLab/gists{/gist_id}","starred_url":"https://api.github.com/users/mathLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathLab/subscriptions","organizations_url":"https://api.github.com/users/mathLab/orgs","repos_url":"https://api.github.com/users/mathLab/repos","events_url":"https://api.github.com/users/mathLab/events{/privacy}","received_events_url":"https://api.github.com/users/mathLab/received_events","type":"Organization","site_admin":false},"repo":{"id":23152486,"name":"deal2lkit","full_name":"mathLab/deal2lkit","owner":{"login":"mathLab","id":14195552,"avatar_url":"https://avatars.githubusercontent.com/u/14195552?v=3","gravatar_id":"","url":"https://api.github.com/users/mathLab","html_url":"https://github.com/mathLab","followers_url":"https://api.github.com/users/mathLab/followers","following_url":"https://api.github.com/users/mathLab/following{/other_user}","gists_url":"https://api.github.com/users/mathLab/gists{/gist_id}","starred_url":"https://api.github.com/users/mathLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathLab/subscriptions","organizations_url":"https://api.github.com/users/mathLab/orgs","repos_url":"https://api.github.com/users/mathLab/repos","events_url":"https://api.github.com/users/mathLab/events{/privacy}","received_events_url":"https://api.github.com/users/mathLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mathLab/deal2lkit","description":"A ToolKit library for deal.II","fork":false,"url":"https://api.github.com/repos/mathLab/deal2lkit","forks_url":"https://api.github.com/repos/mathLab/deal2lkit/forks","keys_url":"https://api.github.com/repos/mathLab/deal2lkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathLab/deal2lkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathLab/deal2lkit/teams","hooks_url":"https://api.github.com/repos/mathLab/deal2lkit/hooks","issue_events_url":"https://api.github.com/repos/mathLab/deal2lkit/issues/events{/number}","events_url":"https://api.github.com/repos/mathLab/deal2lkit/events","assignees_url":"https://api.github.com/repos/mathLab/deal2lkit/assignees{/user}","branches_url":"https://api.github.com/repos/mathLab/deal2lkit/branches{/branch}","tags_url":"https://api.github.com/repos/mathLab/deal2lkit/tags","blobs_url":"https://api.github.com/repos/mathLab/deal2lkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathLab/deal2lkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathLab/deal2lkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathLab/deal2lkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathLab/deal2lkit/statuses/{sha}","languages_url":"https://api.github.com/repos/mathLab/deal2lkit/languages","stargazers_url":"https://api.github.com/repos/mathLab/deal2lkit/stargazers","contributors_url":"https://api.github.com/repos/mathLab/deal2lkit/contributors","subscribers_url":"https://api.github.com/repos/mathLab/deal2lkit/subscribers","subscription_url":"https://api.github.com/repos/mathLab/deal2lkit/subscription","commits_url":"https://api.github.com/repos/mathLab/deal2lkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathLab/deal2lkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathLab/deal2lkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathLab/deal2lkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathLab/deal2lkit/contents/{+path}","compare_url":"https://api.github.com/repos/mathLab/deal2lkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathLab/deal2lkit/merges","archive_url":"https://api.github.com/repos/mathLab/deal2lkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathLab/deal2lkit/downloads","issues_url":"https://api.github.com/repos/mathLab/deal2lkit/issues{/number}","pulls_url":"https://api.github.com/repos/mathLab/deal2lkit/pulls{/number}","milestones_url":"https://api.github.com/repos/mathLab/deal2lkit/milestones{/number}","notifications_url":"https://api.github.com/repos/mathLab/deal2lkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathLab/deal2lkit/labels{/name}","releases_url":"https://api.github.com/repos/mathLab/deal2lkit/releases{/id}","created_at":"2014-08-20T14:52:37Z","updated_at":"2016-01-11T10:57:32Z","pushed_at":"2016-01-13T21:30:09Z","git_url":"git://github.com/mathLab/deal2lkit.git","ssh_url":"git@github.com:mathLab/deal2lkit.git","clone_url":"https://github.com/mathLab/deal2lkit.git","svn_url":"https://github.com/mathLab/deal2lkit","homepage":"http://mathlab.github.io/deal2lkit","size":10663,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":11,"forks":8,"open_issues":11,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270"},"html":{"href":"https://github.com/mathLab/deal2lkit/pull/270"},"issue":{"href":"https://api.github.com/repos/mathLab/deal2lkit/issues/270"},"comments":{"href":"https://api.github.com/repos/mathLab/deal2lkit/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mathLab/deal2lkit/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/mathLab/deal2lkit/statuses/a06ad80a7cabf81e46674055db6255638904902c"}}}}