GitHub PullRequestReviewCommentEvent at 2014-12-15 13:37:31
Repository: ogs
Actor: rinkk
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ufz/ogs/pulls/comments/21823500","id":21823500,"diff_hunk":"@@ -0,0 +1,204 @@\n+/**\n+ * \\file\n+ * \\brief  Definition of the class Properties that implements a container of\n+ *         properties.\n+ *\n+ * \\copyright\n+ * Copyright (c) 2012-2014, OpenGeoSys Community (http://www.opengeosys.org)\n+ *            Distributed under a Modified BSD License.\n+ *              See accompanying file LICENSE.txt or\n+ *              http://www.opengeosys.org/project/license\n+ *\n+ */\n+\n+#ifndef PROPERTIES_H_\n+#define PROPERTIES_H_\n+\n+#include <cstdlib>\n+#include <string>\n+#include <map>\n+\n+#include <boost/any.hpp>\n+#include <boost/optional.hpp>\n+\n+#include \"logog/include/logog.hpp\"\n+\n+#include \"Location.h\"\n+\n+#include \"PropertyVector.h\"\n+\n+namespace MeshLib\n+{\n+\n+/// @brief Material property manager on mesh items.\n+/// Class Properties manages scalar, vector or matrix properties. For instance\n+/// in groundwater flow porosity is a scalar property and permeabilty can be\n+/// stored as a tensor property. Properties are assigned to mesh items, i.e.\n+/// Node or Element objects. The newProperty() method first creates a\n+/// PropertyVector of template type T (scalar, vector or matrix).\n+/// This class stores the PropertyVector, accessible by a combination of the\n+/// name and the type of the mesh item (Node or Element).\n+class Properties\n+{\n+public:\n+\t/// Method creates a PropertyVector if a PropertyVector with the same name\n+\t/// and the same type T was not already created before.\n+\t/// There are two versions of this method. This method is used\n+\t/// when every mesh item at hand has its own property value, i.e. \\f$n\\f$\n+\t/// mesh item and \\f$n\\f$ different property values.\n+\t/// The user has to ensure the correct usage of the vector later on.\n+\t/// @tparam T type of the property value\n+\t/// @param name the name of the property\n+\t/// @param mesh_item_type for instance node or element assigned properties\n+\t/// @return On success a reference to a PropertyVector packed into a\n+\t///   boost::optional else an empty boost::optional.\n+\ttemplate <typename T>\n+\tboost::optional<PropertyVector<T> &>\n+\tnewProperty(std::string const& name, MeshItemType mesh_item_type)\n+\t{\n+\t\tPropertyKeyType property_key(name, mesh_item_type);\n+\t\tstd::map<PropertyKeyType, boost::any>::const_iterator it(\n+\t\t\t_properties.find(property_key)\n+\t\t);\n+\t\tif (it != _properties.end()) {\n+\t\t\tWARN(\"A property of the name \\\"%s\\\" is already assigned to the mesh.\",\n+\t\t\t\tname.c_str());\n+\t\t\treturn boost::optional<PropertyVector<T> &>();\n+\t\t}\n+\t\tauto entry_info(\n+\t\t\t_properties.insert(\n+\t\t\t\tstd::pair<PropertyKeyType, boost::any>(\n+\t\t\t\t\tproperty_key, boost::any(PropertyVector<T>())\n+\t\t\t\t)\n+\t\t\t)\n+\t\t);\n+\t\treturn boost::optional<PropertyVector<T> &>(\n+\t\t\tboost::any_cast<PropertyVector<T> &>((entry_info.first)->second)\n+\t\t\t);\n+\t}\n+\n+\t/// Method creates a PropertyVector if a PropertyVector with the same name\n+\t/// and the same type T was not already created before.\n+\t/// This method is used if only a small number of distinct property values\n+\t/// in a property exist (e.g. mapping material groups to elements).\n+\t/// In this case a mapping between mesh items and properties (stored\n+\t/// on the heap), see the parameter item2group_mapping, is required.\n+\t/// @tparam T type of the property value\n+\t/// @param name the name of the property\n+\t/// @param mesh_item_type for instance node or element assigned properties","path":"MeshLib/Properties.h","position":88,"original_position":88,"commit_id":"2cf55d1b747605756bdf68b932c497d8e5120fdc","original_commit_id":"2cf55d1b747605756bdf68b932c497d8e5120fdc","user":{"login":"rinkk","id":798445,"avatar_url":"https://avatars.githubusercontent.com/u/798445?v=3","gravatar_id":"","url":"https://api.github.com/users/rinkk","html_url":"https://github.com/rinkk","followers_url":"https://api.github.com/users/rinkk/followers","following_url":"https://api.github.com/users/rinkk/following{/other_user}","gists_url":"https://api.github.com/users/rinkk/gists{/gist_id}","starred_url":"https://api.github.com/users/rinkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rinkk/subscriptions","organizations_url":"https://api.github.com/users/rinkk/orgs","repos_url":"https://api.github.com/users/rinkk/repos","events_url":"https://api.github.com/users/rinkk/events{/privacy}","received_events_url":"https://api.github.com/users/rinkk/received_events","type":"User","site_admin":false},"body":"param-documentation for ```n_prop_groups``` and  ```item2group_mapping``` are missing","created_at":"2014-12-15T13:37:31Z","updated_at":"2014-12-15T13:37:31Z","html_url":"https://github.com/ufz/ogs/pull/542#discussion_r21823500","pull_request_url":"https://api.github.com/repos/ufz/ogs/pulls/542","_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/21823500"},"html":{"href":"https://github.com/ufz/ogs/pull/542#discussion_r21823500"},"pull_request":{"href":"https://api.github.com/repos/ufz/ogs/pulls/542"}}},"pull_request":{"url":"https://api.github.com/repos/ufz/ogs/pulls/542","id":25414657,"html_url":"https://github.com/ufz/ogs/pull/542","diff_url":"https://github.com/ufz/ogs/pull/542.diff","patch_url":"https://github.com/ufz/ogs/pull/542.patch","issue_url":"https://api.github.com/repos/ufz/ogs/issues/542","number":542,"state":"open","locked":false,"title":"MeshLib add properties","user":{"login":"TomFischer","id":800065,"avatar_url":"https://avatars.githubusercontent.com/u/800065?v=3","gravatar_id":"","url":"https://api.github.com/users/TomFischer","html_url":"https://github.com/TomFischer","followers_url":"https://api.github.com/users/TomFischer/followers","following_url":"https://api.github.com/users/TomFischer/following{/other_user}","gists_url":"https://api.github.com/users/TomFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/TomFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomFischer/subscriptions","organizations_url":"https://api.github.com/users/TomFischer/orgs","repos_url":"https://api.github.com/users/TomFischer/repos","events_url":"https://api.github.com/users/TomFischer/events{/privacy}","received_events_url":"https://api.github.com/users/TomFischer/received_events","type":"User","site_admin":false},"body":"This PR is based on the discussion in PR #531:\r\n- It adds an implemention to manage properties within the Mesh.\r\n- The properties are associated to specific mesh items like mesh nodes or mesh\r\n  elements via an enum class (see enum class MeshItemType).\r\n- The properties are not restricted to a particular data type, you can use several types like double, vector or matrix\r\n  types at run time together (see tests).\r\n- There is not a possibility to get the value data type.","created_at":"2014-12-03T12:18:47Z","updated_at":"2014-12-15T13:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70732b29b544e4bcedc187adc20ad7e6ca02afff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ufz/ogs/pulls/542/commits","review_comments_url":"https://api.github.com/repos/ufz/ogs/pulls/542/comments","review_comment_url":"https://api.github.com/repos/ufz/ogs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ufz/ogs/issues/542/comments","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/2cf55d1b747605756bdf68b932c497d8e5120fdc","head":{"label":"TomFischer:MeshLibAddProperties","ref":"MeshLibAddProperties","sha":"2cf55d1b747605756bdf68b932c497d8e5120fdc","user":{"login":"TomFischer","id":800065,"avatar_url":"https://avatars.githubusercontent.com/u/800065?v=3","gravatar_id":"","url":"https://api.github.com/users/TomFischer","html_url":"https://github.com/TomFischer","followers_url":"https://api.github.com/users/TomFischer/followers","following_url":"https://api.github.com/users/TomFischer/following{/other_user}","gists_url":"https://api.github.com/users/TomFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/TomFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomFischer/subscriptions","organizations_url":"https://api.github.com/users/TomFischer/orgs","repos_url":"https://api.github.com/users/TomFischer/repos","events_url":"https://api.github.com/users/TomFischer/events{/privacy}","received_events_url":"https://api.github.com/users/TomFischer/received_events","type":"User","site_admin":false},"repo":{"id":6882427,"name":"ogs","full_name":"TomFischer/ogs","owner":{"login":"TomFischer","id":800065,"avatar_url":"https://avatars.githubusercontent.com/u/800065?v=3","gravatar_id":"","url":"https://api.github.com/users/TomFischer","html_url":"https://github.com/TomFischer","followers_url":"https://api.github.com/users/TomFischer/followers","following_url":"https://api.github.com/users/TomFischer/following{/other_user}","gists_url":"https://api.github.com/users/TomFischer/gists{/gist_id}","starred_url":"https://api.github.com/users/TomFischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomFischer/subscriptions","organizations_url":"https://api.github.com/users/TomFischer/orgs","repos_url":"https://api.github.com/users/TomFischer/repos","events_url":"https://api.github.com/users/TomFischer/events{/privacy}","received_events_url":"https://api.github.com/users/TomFischer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomFischer/ogs","description":"OGS source code","fork":true,"url":"https://api.github.com/repos/TomFischer/ogs","forks_url":"https://api.github.com/repos/TomFischer/ogs/forks","keys_url":"https://api.github.com/repos/TomFischer/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomFischer/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomFischer/ogs/teams","hooks_url":"https://api.github.com/repos/TomFischer/ogs/hooks","issue_events_url":"https://api.github.com/repos/TomFischer/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/TomFischer/ogs/events","assignees_url":"https://api.github.com/repos/TomFischer/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/TomFischer/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/TomFischer/ogs/tags","blobs_url":"https://api.github.com/repos/TomFischer/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomFischer/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomFischer/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomFischer/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomFischer/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/TomFischer/ogs/languages","stargazers_url":"https://api.github.com/repos/TomFischer/ogs/stargazers","contributors_url":"https://api.github.com/repos/TomFischer/ogs/contributors","subscribers_url":"https://api.github.com/repos/TomFischer/ogs/subscribers","subscription_url":"https://api.github.com/repos/TomFischer/ogs/subscription","commits_url":"https://api.github.com/repos/TomFischer/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomFischer/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomFischer/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomFischer/ogs/issues/comments/{number}","contents_url":"https://api.github.com/repos/TomFischer/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/TomFischer/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomFischer/ogs/merges","archive_url":"https://api.github.com/repos/TomFischer/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomFischer/ogs/downloads","issues_url":"https://api.github.com/repos/TomFischer/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/TomFischer/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/TomFischer/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/TomFischer/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomFischer/ogs/labels{/name}","releases_url":"https://api.github.com/repos/TomFischer/ogs/releases{/id}","created_at":"2012-11-27T11:49:36Z","updated_at":"2014-12-12T05:16:55Z","pushed_at":"2014-12-12T05:38:35Z","git_url":"git://github.com/TomFischer/ogs.git","ssh_url":"git@github.com:TomFischer/ogs.git","clone_url":"https://github.com/TomFischer/ogs.git","svn_url":"https://github.com/TomFischer/ogs","homepage":"www.opengeosys.org","size":10843,"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":"ufz:master","ref":"master","sha":"5434bf67d782f4bb552e44c78a4239db26697372","user":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"repo":{"id":1701384,"name":"ogs","full_name":"ufz/ogs","owner":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ufz/ogs","description":"OGS source code","fork":false,"url":"https://api.github.com/repos/ufz/ogs","forks_url":"https://api.github.com/repos/ufz/ogs/forks","keys_url":"https://api.github.com/repos/ufz/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ufz/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ufz/ogs/teams","hooks_url":"https://api.github.com/repos/ufz/ogs/hooks","issue_events_url":"https://api.github.com/repos/ufz/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/ufz/ogs/events","assignees_url":"https://api.github.com/repos/ufz/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/ufz/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/ufz/ogs/tags","blobs_url":"https://api.github.com/repos/ufz/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ufz/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ufz/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ufz/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/ufz/ogs/languages","stargazers_url":"https://api.github.com/repos/ufz/ogs/stargazers","contributors_url":"https://api.github.com/repos/ufz/ogs/contributors","subscribers_url":"https://api.github.com/repos/ufz/ogs/subscribers","subscription_url":"https://api.github.com/repos/ufz/ogs/subscription","commits_url":"https://api.github.com/repos/ufz/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ufz/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ufz/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ufz/ogs/issues/comments/{number}","contents_url":"https://api.github.com/repos/ufz/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/ufz/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ufz/ogs/merges","archive_url":"https://api.github.com/repos/ufz/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ufz/ogs/downloads","issues_url":"https://api.github.com/repos/ufz/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/ufz/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/ufz/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/ufz/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ufz/ogs/labels{/name}","releases_url":"https://api.github.com/repos/ufz/ogs/releases{/id}","created_at":"2011-05-04T14:09:57Z","updated_at":"2014-12-12T05:13:06Z","pushed_at":"2014-12-12T05:13:05Z","git_url":"git://github.com/ufz/ogs.git","ssh_url":"git@github.com:ufz/ogs.git","clone_url":"https://github.com/ufz/ogs.git","svn_url":"https://github.com/ufz/ogs","homepage":"www.opengeosys.org","size":13479,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":39,"forks":29,"open_issues":39,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/542"},"html":{"href":"https://github.com/ufz/ogs/pull/542"},"issue":{"href":"https://api.github.com/repos/ufz/ogs/issues/542"},"comments":{"href":"https://api.github.com/repos/ufz/ogs/issues/542/comments"},"review_comments":{"href":"https://api.github.com/repos/ufz/ogs/pulls/542/comments"},"review_comment":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ufz/ogs/pulls/542/commits"},"statuses":{"href":"https://api.github.com/repos/ufz/ogs/statuses/2cf55d1b747605756bdf68b932c497d8e5120fdc"}}}}