{"action":"created","comment":{"url":"https://api.github.com/repos/OPM/opm-parser/pulls/comments/64337442","id":64337442,"diff_hunk":"@@ -0,0 +1,422 @@\n+/*\n+  Copyright 2016 Statoil ASA.\n+\n+  This file is part of the Open Porous Media project (OPM).\n+\n+  OPM is free software: you can redistribute it and/or modify\n+  it under the terms of the GNU General Public License as published by\n+  the Free Software Foundation, either version 3 of the License, or\n+  (at your option) any later version.\n+\n+  OPM is distributed in the hope that it will be useful,\n+  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+  GNU General Public License for more details.\n+\n+  You should have received a copy of the GNU General Public License\n+  along with OPM.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>\n+#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>\n+\n+namespace Opm {\n+\n+    template <>\n+    GridProperties<double>::GridProperties(const EclipseGrid& eclipseGrid,\n+                                           const UnitSystem*  deckUnitSystem,\n+                                           std::vector< GridProperty<double>::SupportedKeywordInfo >&& supportedKeywords) :\n+        m_eclipseGrid( eclipseGrid ),\n+        m_deckUnitSystem( deckUnitSystem )\n+    {\n+        for (auto iter = supportedKeywords.begin(); iter != supportedKeywords.end(); ++iter)\n+            m_supportedKeywords.emplace( iter->getKeywordName(), std::move( *iter ) );\n+    }\n+\n+\n+    template <>\n+    GridProperties<int>::GridProperties(const EclipseGrid& eclipseGrid,\n+                                        std::vector< GridProperty<int>::SupportedKeywordInfo >&& supportedKeywords) :\n+        m_eclipseGrid( eclipseGrid )\n+    {\n+        for (auto iter = supportedKeywords.begin(); iter != supportedKeywords.end(); ++iter)\n+            m_supportedKeywords.emplace( iter->getKeywordName(), std::move( *iter ) );\n+    }\n+\n+\n+\n+    /*\n+      In the case of integer properties we never really do any\n+      transformation, but we have implemented this dummy int\n+      specializations to enable a uniform implementation.\n+    */\n+\n+\n+    template<>\n+    double GridProperties<double>::convertInputValue(const GridProperty<double>& property, double doubleValue) const {\n+        const std::string& dimensionString = property.getDimensionString( );\n+        return m_deckUnitSystem->getDimension(dimensionString)->getSIScaling() * doubleValue;\n+    }\n+\n+\n+    template<>\n+    double GridProperties<double>::convertInputValue( double doubleValue) const {\n+        return doubleValue;\n+    }\n+\n+\n+    template<>\n+    int GridProperties<int>::convertInputValue(double doubleValue) const {\n+        if (fabs( nearbyint( doubleValue ) - doubleValue ) < 1e-6)\n+            return static_cast<int>( doubleValue );\n+        else\n+            throw std::invalid_argument(\"Expected integer argument - got: \" + std::to_string( doubleValue ));\n+    }\n+\n+    template<>\n+    int GridProperties<int>::convertInputValue(const GridProperty<int>& property, double doubleValue) const {\n+        return convertInputValue(doubleValue);\n+    }\n+\n+\n+    void setKeywordBox( const DeckRecord& deckRecord,\n+                        BoxManager& boxManager) {\n+        const auto& I1Item = deckRecord.getItem(\"I1\");\n+        const auto& I2Item = deckRecord.getItem(\"I2\");\n+        const auto& J1Item = deckRecord.getItem(\"J1\");\n+        const auto& J2Item = deckRecord.getItem(\"J2\");\n+        const auto& K1Item = deckRecord.getItem(\"K1\");\n+        const auto& K2Item = deckRecord.getItem(\"K2\");\n+\n+        size_t setCount = 0;\n+\n+        if (!I1Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (!I2Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (!J1Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (!J2Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (!K1Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (!K2Item.defaultApplied(0))\n+            setCount++;\n+\n+        if (setCount == 6) {\n+            boxManager.setKeywordBox( I1Item.get< int >(0) - 1,\n+                                      I2Item.get< int >(0) - 1,\n+                                      J1Item.get< int >(0) - 1,\n+                                      J2Item.get< int >(0) - 1,\n+                                      K1Item.get< int >(0) - 1,\n+                                      K2Item.get< int >(0) - 1);\n+        } else if (setCount != 0) {\n+            std::string msg = \"BOX modifiers on keywords must be either \"\n+                \"specified completely or not at all. Ignoring.\";\n+            throw std::invalid_argument( msg );\n+            //getMessageContainer().error(deckKeyword.getFileName() + std::to_string(deckKeyword.getLineNumber()) + msg);\n+        }\n+    }\n+\n+\n+    const MessageContainer& GridProperties<T>::getMessageContainer() const {\n+        return m_messages;\n+    }\n+\n+    MessageContainer& GridProperties<T>::getMessageContainer() {","path":"opm/parser/eclipse/EclipseState/Grid/GridProperties.cpp","position":null,"original_position":131,"commit_id":"c695bf2f2418634f3cf8798383a20d9e6f5b5d2b","original_commit_id":"889ac99d230ae6698cfbe6a168a612a15f5bb7ac","user":{"login":"pgdr","id":17569537,"avatar_url":"https://avatars.githubusercontent.com/u/17569537?v=3","gravatar_id":"","url":"https://api.github.com/users/pgdr","html_url":"https://github.com/pgdr","followers_url":"https://api.github.com/users/pgdr/followers","following_url":"https://api.github.com/users/pgdr/following{/other_user}","gists_url":"https://api.github.com/users/pgdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pgdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgdr/subscriptions","organizations_url":"https://api.github.com/users/pgdr/orgs","repos_url":"https://api.github.com/users/pgdr/repos","events_url":"https://api.github.com/users/pgdr/events{/privacy}","received_events_url":"https://api.github.com/users/pgdr/received_events","type":"User","site_admin":false},"body":"If I'm not mistaking, these two functions lack `template< typename T >` or?","created_at":"2016-05-24T07:03:20Z","updated_at":"2016-05-24T07:03:20Z","html_url":"https://github.com/OPM/opm-parser/pull/808#discussion_r64337442","pull_request_url":"https://api.github.com/repos/OPM/opm-parser/pulls/808","_links":{"self":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/comments/64337442"},"html":{"href":"https://github.com/OPM/opm-parser/pull/808#discussion_r64337442"},"pull_request":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/808"}}},"pull_request":{"url":"https://api.github.com/repos/OPM/opm-parser/pulls/808","id":70483193,"html_url":"https://github.com/OPM/opm-parser/pull/808","diff_url":"https://github.com/OPM/opm-parser/pull/808.diff","patch_url":"https://github.com/OPM/opm-parser/pull/808.patch","issue_url":"https://api.github.com/repos/OPM/opm-parser/issues/808","number":808,"state":"open","locked":false,"title":"Set ACTNUM = 0 for cells with PORV == 0","user":{"login":"joakim-hove","id":1321665,"avatar_url":"https://avatars.githubusercontent.com/u/1321665?v=3","gravatar_id":"","url":"https://api.github.com/users/joakim-hove","html_url":"https://github.com/joakim-hove","followers_url":"https://api.github.com/users/joakim-hove/followers","following_url":"https://api.github.com/users/joakim-hove/following{/other_user}","gists_url":"https://api.github.com/users/joakim-hove/gists{/gist_id}","starred_url":"https://api.github.com/users/joakim-hove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakim-hove/subscriptions","organizations_url":"https://api.github.com/users/joakim-hove/orgs","repos_url":"https://api.github.com/users/joakim-hove/repos","events_url":"https://api.github.com/users/joakim-hove/events{/privacy}","received_events_url":"https://api.github.com/users/joakim-hove/received_events","type":"User","site_admin":false},"body":"This should fix: https://github.com/OPM/opm-parser/issues/802 \r\n\r\nUnfortunately the solution is semi-ugly special case hack; the ordering requirements required to get it to work as post processor just made my head spin.","created_at":"2016-05-18T07:55:50Z","updated_at":"2016-05-24T07:03:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df64f67082eb497206d69b9d2a9cc684087e5afd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OPM/opm-parser/pulls/808/commits","review_comments_url":"https://api.github.com/repos/OPM/opm-parser/pulls/808/comments","review_comment_url":"https://api.github.com/repos/OPM/opm-parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OPM/opm-parser/issues/808/comments","statuses_url":"https://api.github.com/repos/OPM/opm-parser/statuses/c695bf2f2418634f3cf8798383a20d9e6f5b5d2b","head":{"label":"joakim-hove:actnum-post","ref":"actnum-post","sha":"c695bf2f2418634f3cf8798383a20d9e6f5b5d2b","user":{"login":"joakim-hove","id":1321665,"avatar_url":"https://avatars.githubusercontent.com/u/1321665?v=3","gravatar_id":"","url":"https://api.github.com/users/joakim-hove","html_url":"https://github.com/joakim-hove","followers_url":"https://api.github.com/users/joakim-hove/followers","following_url":"https://api.github.com/users/joakim-hove/following{/other_user}","gists_url":"https://api.github.com/users/joakim-hove/gists{/gist_id}","starred_url":"https://api.github.com/users/joakim-hove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakim-hove/subscriptions","organizations_url":"https://api.github.com/users/joakim-hove/orgs","repos_url":"https://api.github.com/users/joakim-hove/repos","events_url":"https://api.github.com/users/joakim-hove/events{/privacy}","received_events_url":"https://api.github.com/users/joakim-hove/received_events","type":"User","site_admin":false},"repo":{"id":8883572,"name":"opm-parser","full_name":"joakim-hove/opm-parser","owner":{"login":"joakim-hove","id":1321665,"avatar_url":"https://avatars.githubusercontent.com/u/1321665?v=3","gravatar_id":"","url":"https://api.github.com/users/joakim-hove","html_url":"https://github.com/joakim-hove","followers_url":"https://api.github.com/users/joakim-hove/followers","following_url":"https://api.github.com/users/joakim-hove/following{/other_user}","gists_url":"https://api.github.com/users/joakim-hove/gists{/gist_id}","starred_url":"https://api.github.com/users/joakim-hove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakim-hove/subscriptions","organizations_url":"https://api.github.com/users/joakim-hove/orgs","repos_url":"https://api.github.com/users/joakim-hove/repos","events_url":"https://api.github.com/users/joakim-hove/events{/privacy}","received_events_url":"https://api.github.com/users/joakim-hove/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joakim-hove/opm-parser","description":"","fork":true,"url":"https://api.github.com/repos/joakim-hove/opm-parser","forks_url":"https://api.github.com/repos/joakim-hove/opm-parser/forks","keys_url":"https://api.github.com/repos/joakim-hove/opm-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joakim-hove/opm-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joakim-hove/opm-parser/teams","hooks_url":"https://api.github.com/repos/joakim-hove/opm-parser/hooks","issue_events_url":"https://api.github.com/repos/joakim-hove/opm-parser/issues/events{/number}","events_url":"https://api.github.com/repos/joakim-hove/opm-parser/events","assignees_url":"https://api.github.com/repos/joakim-hove/opm-parser/assignees{/user}","branches_url":"https://api.github.com/repos/joakim-hove/opm-parser/branches{/branch}","tags_url":"https://api.github.com/repos/joakim-hove/opm-parser/tags","blobs_url":"https://api.github.com/repos/joakim-hove/opm-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joakim-hove/opm-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joakim-hove/opm-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/joakim-hove/opm-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joakim-hove/opm-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/joakim-hove/opm-parser/languages","stargazers_url":"https://api.github.com/repos/joakim-hove/opm-parser/stargazers","contributors_url":"https://api.github.com/repos/joakim-hove/opm-parser/contributors","subscribers_url":"https://api.github.com/repos/joakim-hove/opm-parser/subscribers","subscription_url":"https://api.github.com/repos/joakim-hove/opm-parser/subscription","commits_url":"https://api.github.com/repos/joakim-hove/opm-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/joakim-hove/opm-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/joakim-hove/opm-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/joakim-hove/opm-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/joakim-hove/opm-parser/contents/{+path}","compare_url":"https://api.github.com/repos/joakim-hove/opm-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joakim-hove/opm-parser/merges","archive_url":"https://api.github.com/repos/joakim-hove/opm-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joakim-hove/opm-parser/downloads","issues_url":"https://api.github.com/repos/joakim-hove/opm-parser/issues{/number}","pulls_url":"https://api.github.com/repos/joakim-hove/opm-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/joakim-hove/opm-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/joakim-hove/opm-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joakim-hove/opm-parser/labels{/name}","releases_url":"https://api.github.com/repos/joakim-hove/opm-parser/releases{/id}","deployments_url":"https://api.github.com/repos/joakim-hove/opm-parser/deployments","created_at":"2013-03-19T16:41:12Z","updated_at":"2015-05-08T04:40:51Z","pushed_at":"2016-05-24T07:03:01Z","git_url":"git://github.com/joakim-hove/opm-parser.git","ssh_url":"git@github.com:joakim-hove/opm-parser.git","clone_url":"https://github.com/joakim-hove/opm-parser.git","svn_url":"https://github.com/joakim-hove/opm-parser","homepage":null,"size":6709,"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":"OPM:master","ref":"master","sha":"9e91bc5a8634552bd694deaf99e3d14f5ad0afe0","user":{"login":"OPM","id":1827197,"avatar_url":"https://avatars.githubusercontent.com/u/1827197?v=3","gravatar_id":"","url":"https://api.github.com/users/OPM","html_url":"https://github.com/OPM","followers_url":"https://api.github.com/users/OPM/followers","following_url":"https://api.github.com/users/OPM/following{/other_user}","gists_url":"https://api.github.com/users/OPM/gists{/gist_id}","starred_url":"https://api.github.com/users/OPM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OPM/subscriptions","organizations_url":"https://api.github.com/users/OPM/orgs","repos_url":"https://api.github.com/users/OPM/repos","events_url":"https://api.github.com/users/OPM/events{/privacy}","received_events_url":"https://api.github.com/users/OPM/received_events","type":"Organization","site_admin":false},"repo":{"id":8604178,"name":"opm-parser","full_name":"OPM/opm-parser","owner":{"login":"OPM","id":1827197,"avatar_url":"https://avatars.githubusercontent.com/u/1827197?v=3","gravatar_id":"","url":"https://api.github.com/users/OPM","html_url":"https://github.com/OPM","followers_url":"https://api.github.com/users/OPM/followers","following_url":"https://api.github.com/users/OPM/following{/other_user}","gists_url":"https://api.github.com/users/OPM/gists{/gist_id}","starred_url":"https://api.github.com/users/OPM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OPM/subscriptions","organizations_url":"https://api.github.com/users/OPM/orgs","repos_url":"https://api.github.com/users/OPM/repos","events_url":"https://api.github.com/users/OPM/events{/privacy}","received_events_url":"https://api.github.com/users/OPM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OPM/opm-parser","description":"","fork":false,"url":"https://api.github.com/repos/OPM/opm-parser","forks_url":"https://api.github.com/repos/OPM/opm-parser/forks","keys_url":"https://api.github.com/repos/OPM/opm-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OPM/opm-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OPM/opm-parser/teams","hooks_url":"https://api.github.com/repos/OPM/opm-parser/hooks","issue_events_url":"https://api.github.com/repos/OPM/opm-parser/issues/events{/number}","events_url":"https://api.github.com/repos/OPM/opm-parser/events","assignees_url":"https://api.github.com/repos/OPM/opm-parser/assignees{/user}","branches_url":"https://api.github.com/repos/OPM/opm-parser/branches{/branch}","tags_url":"https://api.github.com/repos/OPM/opm-parser/tags","blobs_url":"https://api.github.com/repos/OPM/opm-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OPM/opm-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OPM/opm-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/OPM/opm-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OPM/opm-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/OPM/opm-parser/languages","stargazers_url":"https://api.github.com/repos/OPM/opm-parser/stargazers","contributors_url":"https://api.github.com/repos/OPM/opm-parser/contributors","subscribers_url":"https://api.github.com/repos/OPM/opm-parser/subscribers","subscription_url":"https://api.github.com/repos/OPM/opm-parser/subscription","commits_url":"https://api.github.com/repos/OPM/opm-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/OPM/opm-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/OPM/opm-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/OPM/opm-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/OPM/opm-parser/contents/{+path}","compare_url":"https://api.github.com/repos/OPM/opm-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OPM/opm-parser/merges","archive_url":"https://api.github.com/repos/OPM/opm-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OPM/opm-parser/downloads","issues_url":"https://api.github.com/repos/OPM/opm-parser/issues{/number}","pulls_url":"https://api.github.com/repos/OPM/opm-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/OPM/opm-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/OPM/opm-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OPM/opm-parser/labels{/name}","releases_url":"https://api.github.com/repos/OPM/opm-parser/releases{/id}","deployments_url":"https://api.github.com/repos/OPM/opm-parser/deployments","created_at":"2013-03-06T13:39:46Z","updated_at":"2016-04-11T07:18:13Z","pushed_at":"2016-05-24T07:03:02Z","git_url":"git://github.com/OPM/opm-parser.git","ssh_url":"git@github.com:OPM/opm-parser.git","clone_url":"https://github.com/OPM/opm-parser.git","svn_url":"https://github.com/OPM/opm-parser","homepage":"http://www.opm-project.org","size":7572,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":8,"forks":31,"open_issues":8,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/808"},"html":{"href":"https://github.com/OPM/opm-parser/pull/808"},"issue":{"href":"https://api.github.com/repos/OPM/opm-parser/issues/808"},"comments":{"href":"https://api.github.com/repos/OPM/opm-parser/issues/808/comments"},"review_comments":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/808/comments"},"review_comment":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OPM/opm-parser/pulls/808/commits"},"statuses":{"href":"https://api.github.com/repos/OPM/opm-parser/statuses/c695bf2f2418634f3cf8798383a20d9e6f5b5d2b"}}}}
{"actor":{"display_login":"pgdr"}}