{"action":"created","comment":{"url":"https://api.github.com/repos/flow123d/flow123d/pulls/comments/52306124","id":52306124,"diff_hunk":"@@ -0,0 +1,385 @@\n+/*\n+ * region_set.cc\n+ *\n+ *  Created on: Nov 27, 2012\n+ *      Author: jb\n+ */\n+\n+#include \"mesh/region_set.hh\"\n+#include <string>\n+#include <sstream>\n+\n+\n+namespace IT = Input::Type;\n+\n+\n+/*******************************************************************\n+ * implementation of RegionSetBase\n+ */\n+\n+RegionSetBase::RegionSetBase(Mesh *mesh)\n+: region_db_(mesh->region_db_),\n+  el_to_reg_map_(mesh->region_db_.el_to_reg_map_) {}\n+\n+IT::Abstract & RegionSetBase::get_input_type() {\n+\treturn IT::Abstract(\"Region\", \"Abstract record for Region.\")\n+\t\t\t.close();\n+}\n+\n+\n+\n+/*******************************************************************\n+ * implementation of RegionSetFromId\n+ */\n+\n+RegionSetFromId::RegionSetFromId(const Input::Record &rec, Mesh *mesh)\n+: RegionSetBase(mesh)\n+{\n+\tRegion reg;\n+\tstring region_label = rec.val<string>(\"name\");\n+\tunsigned int region_id = rec.val<unsigned int>(\"id\");\n+\n+\treg = mesh->region_db().find_label(region_label);\n+\tif ( reg.is_valid() ) {\n+\t\tif ( region_id != reg.id() )\n+\t\t\tTHROW( ExcInconsistentLabelId() << EI_Label(region_label) << EI_ID( region_id ) << rec.ei_address() );\n+\t} else {\n+\t\ttry {\n+\t\t\treg = mesh->region_db().find_id(region_id);\n+\t\t} catch(RegionDB::ExcUniqueRegionId &e) {\n+\t\t\te << rec.ei_address();\n+\t\t}\n+\t\tif ( reg.is_valid() ) {\n+\t\t\tregion_db_.rename_region(reg, region_label);\n+\t\t} else {\n+\t\t\tstringstream ss;\n+\t\t\tss << \"declare at address \\'\" << rec.address_string() << \"\\'\";\n+\t\t\tregion_db_.add_region(region_id, region_label, RegionDB::undefined_dim, ss.str() );\n+\t\t}\n+\t}\n+}\n+\n+\n+\n+const IT::Record & RegionSetFromId::get_region_input_type()\n+{\n+    return IT::Record(\"From_Id\", \"Region declared by id and name.\\n\"\n+    \t\t\t\t\t\"Allows to create new region with given id and label\\n\"\n+    \t\t\t\t\t\"or specify existing region by id which will be renamed.\")\n+        .derive_from(RegionSetBase::get_input_type())\n+\t\t.declare_key(\"name\", IT::String(), IT::Default::obligatory(),\n+\t\t\t\t\"Label (name) of the region. Has to be unique in one mesh.\\n\")\n+\t\t.declare_key(\"id\", IT::Integer(0), IT::Default::obligatory(),\n+\t\t\t\t\"The ID of the region to which you assign label.\")","path":"src/mesh/region_set.cc","position":73,"original_position":73,"commit_id":"66cb60ff8483b147b20455e5e5d5871c869d2049","original_commit_id":"66cb60ff8483b147b20455e5e5d5871c869d2049","user":{"login":"jbrezmorf","id":326204,"avatar_url":"https://avatars.githubusercontent.com/u/326204?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrezmorf","html_url":"https://github.com/jbrezmorf","followers_url":"https://api.github.com/users/jbrezmorf/followers","following_url":"https://api.github.com/users/jbrezmorf/following{/other_user}","gists_url":"https://api.github.com/users/jbrezmorf/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrezmorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrezmorf/subscriptions","organizations_url":"https://api.github.com/users/jbrezmorf/orgs","repos_url":"https://api.github.com/users/jbrezmorf/repos","events_url":"https://api.github.com/users/jbrezmorf/events{/privacy}","received_events_url":"https://api.github.com/users/jbrezmorf/received_events","type":"User","site_admin":false},"body":"Could we add also an optional key for specification of the dimension?","created_at":"2016-02-09T13:24:11Z","updated_at":"2016-02-09T13:24:11Z","html_url":"https://github.com/flow123d/flow123d/pull/505#discussion_r52306124","pull_request_url":"https://api.github.com/repos/flow123d/flow123d/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/comments/52306124"},"html":{"href":"https://github.com/flow123d/flow123d/pull/505#discussion_r52306124"},"pull_request":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/flow123d/flow123d/pulls/505","id":56896847,"html_url":"https://github.com/flow123d/flow123d/pull/505","diff_url":"https://github.com/flow123d/flow123d/pull/505.diff","patch_url":"https://github.com/flow123d/flow123d/pull/505.patch","issue_url":"https://api.github.com/repos/flow123d/flow123d/issues/505","number":505,"state":"open","locked":false,"title":"Df review mesh","user":{"login":"dflanderka","id":5627762,"avatar_url":"https://avatars.githubusercontent.com/u/5627762?v=3","gravatar_id":"","url":"https://api.github.com/users/dflanderka","html_url":"https://github.com/dflanderka","followers_url":"https://api.github.com/users/dflanderka/followers","following_url":"https://api.github.com/users/dflanderka/following{/other_user}","gists_url":"https://api.github.com/users/dflanderka/gists{/gist_id}","starred_url":"https://api.github.com/users/dflanderka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dflanderka/subscriptions","organizations_url":"https://api.github.com/users/dflanderka/orgs","repos_url":"https://api.github.com/users/dflanderka/repos","events_url":"https://api.github.com/users/dflanderka/events{/privacy}","received_events_url":"https://api.github.com/users/dflanderka/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-22T14:53:46Z","updated_at":"2016-02-09T13:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82731e6d0c06cf9de78607231a0b76da7f4a1e4b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flow123d/flow123d/pulls/505/commits","review_comments_url":"https://api.github.com/repos/flow123d/flow123d/pulls/505/comments","review_comment_url":"https://api.github.com/repos/flow123d/flow123d/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flow123d/flow123d/issues/505/comments","statuses_url":"https://api.github.com/repos/flow123d/flow123d/statuses/66cb60ff8483b147b20455e5e5d5871c869d2049","head":{"label":"flow123d:DF_review_mesh","ref":"DF_review_mesh","sha":"66cb60ff8483b147b20455e5e5d5871c869d2049","user":{"login":"flow123d","id":5418109,"avatar_url":"https://avatars.githubusercontent.com/u/5418109?v=3","gravatar_id":"","url":"https://api.github.com/users/flow123d","html_url":"https://github.com/flow123d","followers_url":"https://api.github.com/users/flow123d/followers","following_url":"https://api.github.com/users/flow123d/following{/other_user}","gists_url":"https://api.github.com/users/flow123d/gists{/gist_id}","starred_url":"https://api.github.com/users/flow123d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flow123d/subscriptions","organizations_url":"https://api.github.com/users/flow123d/orgs","repos_url":"https://api.github.com/users/flow123d/repos","events_url":"https://api.github.com/users/flow123d/events{/privacy}","received_events_url":"https://api.github.com/users/flow123d/received_events","type":"Organization","site_admin":false},"repo":{"id":13628170,"name":"flow123d","full_name":"flow123d/flow123d","owner":{"login":"flow123d","id":5418109,"avatar_url":"https://avatars.githubusercontent.com/u/5418109?v=3","gravatar_id":"","url":"https://api.github.com/users/flow123d","html_url":"https://github.com/flow123d","followers_url":"https://api.github.com/users/flow123d/followers","following_url":"https://api.github.com/users/flow123d/following{/other_user}","gists_url":"https://api.github.com/users/flow123d/gists{/gist_id}","starred_url":"https://api.github.com/users/flow123d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flow123d/subscriptions","organizations_url":"https://api.github.com/users/flow123d/orgs","repos_url":"https://api.github.com/users/flow123d/repos","events_url":"https://api.github.com/users/flow123d/events{/privacy}","received_events_url":"https://api.github.com/users/flow123d/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flow123d/flow123d","description":"Main repository of the Flow123d project.","fork":false,"url":"https://api.github.com/repos/flow123d/flow123d","forks_url":"https://api.github.com/repos/flow123d/flow123d/forks","keys_url":"https://api.github.com/repos/flow123d/flow123d/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flow123d/flow123d/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flow123d/flow123d/teams","hooks_url":"https://api.github.com/repos/flow123d/flow123d/hooks","issue_events_url":"https://api.github.com/repos/flow123d/flow123d/issues/events{/number}","events_url":"https://api.github.com/repos/flow123d/flow123d/events","assignees_url":"https://api.github.com/repos/flow123d/flow123d/assignees{/user}","branches_url":"https://api.github.com/repos/flow123d/flow123d/branches{/branch}","tags_url":"https://api.github.com/repos/flow123d/flow123d/tags","blobs_url":"https://api.github.com/repos/flow123d/flow123d/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flow123d/flow123d/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flow123d/flow123d/git/refs{/sha}","trees_url":"https://api.github.com/repos/flow123d/flow123d/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flow123d/flow123d/statuses/{sha}","languages_url":"https://api.github.com/repos/flow123d/flow123d/languages","stargazers_url":"https://api.github.com/repos/flow123d/flow123d/stargazers","contributors_url":"https://api.github.com/repos/flow123d/flow123d/contributors","subscribers_url":"https://api.github.com/repos/flow123d/flow123d/subscribers","subscription_url":"https://api.github.com/repos/flow123d/flow123d/subscription","commits_url":"https://api.github.com/repos/flow123d/flow123d/commits{/sha}","git_commits_url":"https://api.github.com/repos/flow123d/flow123d/git/commits{/sha}","comments_url":"https://api.github.com/repos/flow123d/flow123d/comments{/number}","issue_comment_url":"https://api.github.com/repos/flow123d/flow123d/issues/comments{/number}","contents_url":"https://api.github.com/repos/flow123d/flow123d/contents/{+path}","compare_url":"https://api.github.com/repos/flow123d/flow123d/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flow123d/flow123d/merges","archive_url":"https://api.github.com/repos/flow123d/flow123d/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flow123d/flow123d/downloads","issues_url":"https://api.github.com/repos/flow123d/flow123d/issues{/number}","pulls_url":"https://api.github.com/repos/flow123d/flow123d/pulls{/number}","milestones_url":"https://api.github.com/repos/flow123d/flow123d/milestones{/number}","notifications_url":"https://api.github.com/repos/flow123d/flow123d/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flow123d/flow123d/labels{/name}","releases_url":"https://api.github.com/repos/flow123d/flow123d/releases{/id}","deployments_url":"https://api.github.com/repos/flow123d/flow123d/deployments","created_at":"2013-10-16T18:56:28Z","updated_at":"2016-01-11T16:48:25Z","pushed_at":"2016-02-09T11:47:00Z","git_url":"git://github.com/flow123d/flow123d.git","ssh_url":"git@github.com:flow123d/flow123d.git","clone_url":"https://github.com/flow123d/flow123d.git","svn_url":"https://github.com/flow123d/flow123d","homepage":"<img> http://dev.nti.tul.cz:8080/job/Flow123d/badge/icon </img>","size":99730,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":126,"forks":4,"open_issues":126,"watchers":4,"default_branch":"master"}},"base":{"label":"flow123d:master","ref":"master","sha":"35afda4510687d3b281cf99ddfb92e2999b4ae4c","user":{"login":"flow123d","id":5418109,"avatar_url":"https://avatars.githubusercontent.com/u/5418109?v=3","gravatar_id":"","url":"https://api.github.com/users/flow123d","html_url":"https://github.com/flow123d","followers_url":"https://api.github.com/users/flow123d/followers","following_url":"https://api.github.com/users/flow123d/following{/other_user}","gists_url":"https://api.github.com/users/flow123d/gists{/gist_id}","starred_url":"https://api.github.com/users/flow123d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flow123d/subscriptions","organizations_url":"https://api.github.com/users/flow123d/orgs","repos_url":"https://api.github.com/users/flow123d/repos","events_url":"https://api.github.com/users/flow123d/events{/privacy}","received_events_url":"https://api.github.com/users/flow123d/received_events","type":"Organization","site_admin":false},"repo":{"id":13628170,"name":"flow123d","full_name":"flow123d/flow123d","owner":{"login":"flow123d","id":5418109,"avatar_url":"https://avatars.githubusercontent.com/u/5418109?v=3","gravatar_id":"","url":"https://api.github.com/users/flow123d","html_url":"https://github.com/flow123d","followers_url":"https://api.github.com/users/flow123d/followers","following_url":"https://api.github.com/users/flow123d/following{/other_user}","gists_url":"https://api.github.com/users/flow123d/gists{/gist_id}","starred_url":"https://api.github.com/users/flow123d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flow123d/subscriptions","organizations_url":"https://api.github.com/users/flow123d/orgs","repos_url":"https://api.github.com/users/flow123d/repos","events_url":"https://api.github.com/users/flow123d/events{/privacy}","received_events_url":"https://api.github.com/users/flow123d/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flow123d/flow123d","description":"Main repository of the Flow123d project.","fork":false,"url":"https://api.github.com/repos/flow123d/flow123d","forks_url":"https://api.github.com/repos/flow123d/flow123d/forks","keys_url":"https://api.github.com/repos/flow123d/flow123d/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flow123d/flow123d/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flow123d/flow123d/teams","hooks_url":"https://api.github.com/repos/flow123d/flow123d/hooks","issue_events_url":"https://api.github.com/repos/flow123d/flow123d/issues/events{/number}","events_url":"https://api.github.com/repos/flow123d/flow123d/events","assignees_url":"https://api.github.com/repos/flow123d/flow123d/assignees{/user}","branches_url":"https://api.github.com/repos/flow123d/flow123d/branches{/branch}","tags_url":"https://api.github.com/repos/flow123d/flow123d/tags","blobs_url":"https://api.github.com/repos/flow123d/flow123d/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flow123d/flow123d/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flow123d/flow123d/git/refs{/sha}","trees_url":"https://api.github.com/repos/flow123d/flow123d/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flow123d/flow123d/statuses/{sha}","languages_url":"https://api.github.com/repos/flow123d/flow123d/languages","stargazers_url":"https://api.github.com/repos/flow123d/flow123d/stargazers","contributors_url":"https://api.github.com/repos/flow123d/flow123d/contributors","subscribers_url":"https://api.github.com/repos/flow123d/flow123d/subscribers","subscription_url":"https://api.github.com/repos/flow123d/flow123d/subscription","commits_url":"https://api.github.com/repos/flow123d/flow123d/commits{/sha}","git_commits_url":"https://api.github.com/repos/flow123d/flow123d/git/commits{/sha}","comments_url":"https://api.github.com/repos/flow123d/flow123d/comments{/number}","issue_comment_url":"https://api.github.com/repos/flow123d/flow123d/issues/comments{/number}","contents_url":"https://api.github.com/repos/flow123d/flow123d/contents/{+path}","compare_url":"https://api.github.com/repos/flow123d/flow123d/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flow123d/flow123d/merges","archive_url":"https://api.github.com/repos/flow123d/flow123d/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flow123d/flow123d/downloads","issues_url":"https://api.github.com/repos/flow123d/flow123d/issues{/number}","pulls_url":"https://api.github.com/repos/flow123d/flow123d/pulls{/number}","milestones_url":"https://api.github.com/repos/flow123d/flow123d/milestones{/number}","notifications_url":"https://api.github.com/repos/flow123d/flow123d/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flow123d/flow123d/labels{/name}","releases_url":"https://api.github.com/repos/flow123d/flow123d/releases{/id}","deployments_url":"https://api.github.com/repos/flow123d/flow123d/deployments","created_at":"2013-10-16T18:56:28Z","updated_at":"2016-01-11T16:48:25Z","pushed_at":"2016-02-09T11:47:00Z","git_url":"git://github.com/flow123d/flow123d.git","ssh_url":"git@github.com:flow123d/flow123d.git","clone_url":"https://github.com/flow123d/flow123d.git","svn_url":"https://github.com/flow123d/flow123d","homepage":"<img> http://dev.nti.tul.cz:8080/job/Flow123d/badge/icon </img>","size":99730,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":126,"forks":4,"open_issues":126,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/505"},"html":{"href":"https://github.com/flow123d/flow123d/pull/505"},"issue":{"href":"https://api.github.com/repos/flow123d/flow123d/issues/505"},"comments":{"href":"https://api.github.com/repos/flow123d/flow123d/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flow123d/flow123d/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/flow123d/flow123d/statuses/66cb60ff8483b147b20455e5e5d5871c869d2049"}}}}