{"action":"created","comment":{"url":"https://api.github.com/repos/ufz/ogs/pulls/comments/54504620","id":54504620,"diff_hunk":"@@ -68,30 +66,70 @@ class VectorMatrixAssembler\n             indices.insert(indices.end(), idcs.begin(), idcs.end());\n         }\n \n-        std::vector<double> localX;\n-        std::vector<double> localX_pts;\n+        std::vector<double> local_x;\n+        local_x.reserve(indices.size());\n \n-        if (_x)         localX.reserve(indices.size());\n-        if (_x_prev_ts) localX_pts.reserve(indices.size());\n+        for (auto i : indices) {\n+            local_x.emplace_back(x.get(i));\n+        }\n+\n+        LocalToGlobalIndexMap::RowColumnIndices const r_c_indices(\n+                    indices, indices);\n+\n+        local_assembler->assemble(t, local_x);\n+        local_assembler->addToGlobal(r_c_indices, M, K, b);\n+    }\n \n-        for (auto i : indices)\n+private:\n+    LocalToGlobalIndexMap const& _data_pos;\n+};\n+\n+\n+//! Specialization used to add Neumann boundary conditions.\n+template<typename GlobalMatrix, typename GlobalVector>\n+class VectorMatrixAssembler<GlobalMatrix, GlobalVector,\n+        NumLib::ODESystemTag::NeumannBC> final\n+{\n+public:\n+    VectorMatrixAssembler(\n+        LocalToGlobalIndexMap const& data_pos)\n+    : _data_pos(data_pos)\n+    {}\n+\n+    /// Executes local assembler for the given mesh item and adds the result\n+    /// into the global matrix and vector.\n+    /// The positions in the global matrix/vector are taken from\n+    /// the LocalToGlobalIndexMap provided in the constructor at index \\c id.\n+    /// \\attention The index \\c id is not necesserily the mesh item's id.\n+    template <typename LocalAssembler_>\n+    void operator()(std::size_t const id,\n+        LocalAssembler_* const local_assembler,\n+        const double t, GlobalVector& b) const\n+    {\n+        // TODO I hope the changes to the VectorMatrixAssembler don't break multi-components\n+        assert(_data_pos.size() > id);\n+\n+        // TODO Refactor: GlobalMatrix and GlobalVector are always given as\n+        // template params but GlobalIndexType is a global constant.\n+        std::vector<GlobalIndexType> indices;\n+\n+        // Local matrices and vectors will always be ordered by component,\n+        // no matter what the order of the global matrix is.\n+        for (unsigned c=0; c<_data_pos.getNumComponents(); ++c)\n         {\n-            if (_x)         localX.emplace_back(_x->get(i));\n-            if (_x_prev_ts) localX_pts.emplace_back(_x_prev_ts->get(i));\n+            auto const& idcs = _data_pos(id, c).rows;\n+            indices.reserve(indices.size() + idcs.size());\n+            indices.insert(indices.end(), idcs.begin(), idcs.end());\n         }\n \n         LocalToGlobalIndexMap::RowColumnIndices const r_c_indices(\n                     indices, indices);\n \n-        local_assembler->assemble(localX, localX_pts);\n-        local_assembler->addToGlobal(_A, _rhs, r_c_indices);\n+        local_assembler->assemble(t);\n+        local_assembler->addToGlobal(r_c_indices, b);","path":"AssemblerLib/VectorMatrixAssembler.h","position":146,"original_position":146,"commit_id":"710a6357f974836499555ef51a515ad4ae1afe32","original_commit_id":"710a6357f974836499555ef51a515ad4ae1afe32","user":{"login":"endJunction","id":329493,"avatar_url":"https://avatars.githubusercontent.com/u/329493?v=3","gravatar_id":"","url":"https://api.github.com/users/endJunction","html_url":"https://github.com/endJunction","followers_url":"https://api.github.com/users/endJunction/followers","following_url":"https://api.github.com/users/endJunction/following{/other_user}","gists_url":"https://api.github.com/users/endJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/endJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endJunction/subscriptions","organizations_url":"https://api.github.com/users/endJunction/orgs","repos_url":"https://api.github.com/users/endJunction/repos","events_url":"https://api.github.com/users/endJunction/events{/privacy}","received_events_url":"https://api.github.com/users/endJunction/received_events","type":"User","site_admin":false},"body":"Understanding question: For the first order implicit quasi linear system a system Mdx/dt+Kx+b=0 is assembled. What equation is assembled here for the \"neumann bc\" specialization?\r\nMaybe this will help to choose a better name instead of NeumannBC...","created_at":"2016-03-01T00:29:31Z","updated_at":"2016-03-01T00:29:31Z","html_url":"https://github.com/ufz/ogs/pull/1050#discussion_r54504620","pull_request_url":"https://api.github.com/repos/ufz/ogs/pulls/1050","_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/54504620"},"html":{"href":"https://github.com/ufz/ogs/pull/1050#discussion_r54504620"},"pull_request":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1050"}}},"pull_request":{"url":"https://api.github.com/repos/ufz/ogs/pulls/1050","id":60148690,"html_url":"https://github.com/ufz/ogs/pull/1050","diff_url":"https://github.com/ufz/ogs/pull/1050.diff","patch_url":"https://github.com/ufz/ogs/pull/1050.patch","issue_url":"https://api.github.com/repos/ufz/ogs/issues/1050","number":1050,"state":"open","locked":false,"title":"ODE Solver for transient and nonlinear processes – organ transplantation","user":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"body":"TODO\r\n* [x] cleanup\r\n* [x] docs\r\n* [x] adapt input files\r\n\r\nFuture work:\r\n* save some matrices (i.e. save space)\r\n* adaptive time stepping\r\n* different error norms\r\n* numerical Jacobians\r\n* process coupling\r\n* ...","created_at":"2016-02-22T09:59:19Z","updated_at":"2016-03-01T00:29:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0098de2ccdc930745153b2a3f19e2cde81c9180c","assignee":null,"milestone":{"url":"https://api.github.com/repos/ufz/ogs/milestones/15","html_url":"https://github.com/ufz/ogs/milestones/TES%20Process","labels_url":"https://api.github.com/repos/ufz/ogs/milestones/15/labels","id":1459510,"number":15,"title":"TES Process","description":"","creator":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":8,"state":"open","created_at":"2015-12-14T15:47:32Z","updated_at":"2016-02-29T17:37:59Z","due_on":"2016-03-30T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ufz/ogs/pulls/1050/commits","review_comments_url":"https://api.github.com/repos/ufz/ogs/pulls/1050/comments","review_comment_url":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ufz/ogs/issues/1050/comments","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/710a6357f974836499555ef51a515ad4ae1afe32","head":{"label":"chleh:t-int-ogs6","ref":"t-int-ogs6","sha":"710a6357f974836499555ef51a515ad4ae1afe32","user":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"repo":{"id":40347084,"name":"ogs6","full_name":"chleh/ogs6","owner":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chleh/ogs6","description":"Experimental OGS-6 source code","fork":true,"url":"https://api.github.com/repos/chleh/ogs6","forks_url":"https://api.github.com/repos/chleh/ogs6/forks","keys_url":"https://api.github.com/repos/chleh/ogs6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chleh/ogs6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chleh/ogs6/teams","hooks_url":"https://api.github.com/repos/chleh/ogs6/hooks","issue_events_url":"https://api.github.com/repos/chleh/ogs6/issues/events{/number}","events_url":"https://api.github.com/repos/chleh/ogs6/events","assignees_url":"https://api.github.com/repos/chleh/ogs6/assignees{/user}","branches_url":"https://api.github.com/repos/chleh/ogs6/branches{/branch}","tags_url":"https://api.github.com/repos/chleh/ogs6/tags","blobs_url":"https://api.github.com/repos/chleh/ogs6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chleh/ogs6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chleh/ogs6/git/refs{/sha}","trees_url":"https://api.github.com/repos/chleh/ogs6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chleh/ogs6/statuses/{sha}","languages_url":"https://api.github.com/repos/chleh/ogs6/languages","stargazers_url":"https://api.github.com/repos/chleh/ogs6/stargazers","contributors_url":"https://api.github.com/repos/chleh/ogs6/contributors","subscribers_url":"https://api.github.com/repos/chleh/ogs6/subscribers","subscription_url":"https://api.github.com/repos/chleh/ogs6/subscription","commits_url":"https://api.github.com/repos/chleh/ogs6/commits{/sha}","git_commits_url":"https://api.github.com/repos/chleh/ogs6/git/commits{/sha}","comments_url":"https://api.github.com/repos/chleh/ogs6/comments{/number}","issue_comment_url":"https://api.github.com/repos/chleh/ogs6/issues/comments{/number}","contents_url":"https://api.github.com/repos/chleh/ogs6/contents/{+path}","compare_url":"https://api.github.com/repos/chleh/ogs6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chleh/ogs6/merges","archive_url":"https://api.github.com/repos/chleh/ogs6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chleh/ogs6/downloads","issues_url":"https://api.github.com/repos/chleh/ogs6/issues{/number}","pulls_url":"https://api.github.com/repos/chleh/ogs6/pulls{/number}","milestones_url":"https://api.github.com/repos/chleh/ogs6/milestones{/number}","notifications_url":"https://api.github.com/repos/chleh/ogs6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chleh/ogs6/labels{/name}","releases_url":"https://api.github.com/repos/chleh/ogs6/releases{/id}","deployments_url":"https://api.github.com/repos/chleh/ogs6/deployments","created_at":"2015-08-07T07:24:24Z","updated_at":"2016-01-14T16:07:04Z","pushed_at":"2016-02-29T16:52:47Z","git_url":"git://github.com/chleh/ogs6.git","ssh_url":"git@github.com:chleh/ogs6.git","clone_url":"https://github.com/chleh/ogs6.git","svn_url":"https://github.com/chleh/ogs6","homepage":"www.opengeosys.org","size":12165,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ufz:master","ref":"master","sha":"b7dd83bfd6c6a5f1729e0dcd358fe106fed3435e","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":"Experimental OGS-6 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}","deployments_url":"https://api.github.com/repos/ufz/ogs/deployments","created_at":"2011-05-04T14:09:57Z","updated_at":"2015-10-23T03:43:52Z","pushed_at":"2016-02-29T17:54:25Z","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":12966,"stargazers_count":18,"watchers_count":18,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":87,"forks":40,"open_issues":87,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1050"},"html":{"href":"https://github.com/ufz/ogs/pull/1050"},"issue":{"href":"https://api.github.com/repos/ufz/ogs/issues/1050"},"comments":{"href":"https://api.github.com/repos/ufz/ogs/issues/1050/comments"},"review_comments":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1050/comments"},"review_comment":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1050/commits"},"statuses":{"href":"https://api.github.com/repos/ufz/ogs/statuses/710a6357f974836499555ef51a515ad4ae1afe32"}}}}