GitHub PullRequestReviewCommentEvent at 2014-10-27 14:46:29
Repository: ogs
Actor: wenqing
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ufz/ogs/pulls/comments/19409005","id":19409005,"diff_hunk":"@@ -0,0 +1,112 @@\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 PROCESS_LIB_GROUNDWATERFLOW_FEM_H_\n+#define PROCESS_LIB_GROUNDWATERFLOW_FEM_H_\n+\n+#include \"NumLib/Fem/FiniteElement/TemplateIsoparametric.h\"\n+#include \"NumLib/Fem/ShapeMatrixPolicy.h\"\n+\n+namespace ProcessLib\n+{\n+\n+namespace GroundwaterFlow\n+{\n+\n+template <typename GlobalMatrix, typename GlobalVector>\n+struct LocalAssemblerDataBase\n+{\n+    virtual ~LocalAssemblerDataBase() = default;\n+\n+    virtual void init(MeshLib::Element const& e,\n+            double const hydraulic_conductivity) = 0;\n+\n+    virtual void assemble(std::size_t const rows, std::size_t const columns) = 0;\n+\n+    virtual void addToGlobal(GlobalMatrix& A, GlobalVector& rhs,\n+            AssemblerLib::LocalToGlobalIndexMap::RowColumnIndices const&) const = 0;\n+};\n+\n+template <typename ShapeFunction_,\n+         typename IntegrationMethod_,\n+         unsigned IntegrationOrder_,\n+         typename GlobalMatrix,\n+         typename GlobalVector>\n+struct LocalAssemblerData : public LocalAssemblerDataBase<GlobalMatrix, GlobalVector>\n+{\n+    using ShapeFunction = ShapeFunction_;\n+    using NodalMatrixType = typename ShapeMatrixPolicyType<ShapeFunction>::NodalMatrixType;\n+    using NodalVectorType = typename ShapeMatrixPolicyType<ShapeFunction>::NodalVectorType;\n+\n+    using ShapeMatrices = typename ShapeMatrixPolicyType<ShapeFunction>::ShapeMatrices;\n+\n+\n+    static unsigned constexpr integration_order = IntegrationOrder_;\n+    static unsigned constexpr n_integration_points =\n+        MathLib::pow(integration_order, ShapeFunction::DIM);\n+    using IntegrationMethod = IntegrationMethod_;\n+\n+    /// The hydraulic_conductivity factor is directly integrated into the local\n+    /// element matrix.\n+    void\n+    init(MeshLib::Element const& e, double const hydraulic_conductivity)\n+    {\n+        using FemType = NumLib::TemplateIsoparametric<\n+            ShapeFunction, ShapeMatrices>;\n+\n+        FemType fe(*static_cast<const typename ShapeFunction::MeshElement*>(&e));\n+\n+\n+        IntegrationMethod _integration_method(integration_order);\n+\n+        for (std::size_t ip(0); ip < n_integration_points; ip++) {\n+            fe.computeShapeFunctions(\n+                    _integration_method.getWeightedPoint(ip).getCoords(),\n+                    _shape_matrices[ip]);\n+        }\n+    }\n+\n+    void assemble(std::size_t const rows, std::size_t const columns)","path":"ProcessLib/GroundwaterFlowFEM.h","position":75,"original_position":75,"commit_id":"964dd23abe52d0283806598b54b450507a838146","original_commit_id":"964dd23abe52d0283806598b54b450507a838146","user":{"login":"wenqing","id":1343839,"avatar_url":"https://avatars.githubusercontent.com/u/1343839?v=2","gravatar_id":"","url":"https://api.github.com/users/wenqing","html_url":"https://github.com/wenqing","followers_url":"https://api.github.com/users/wenqing/followers","following_url":"https://api.github.com/users/wenqing/following{/other_user}","gists_url":"https://api.github.com/users/wenqing/gists{/gist_id}","starred_url":"https://api.github.com/users/wenqing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenqing/subscriptions","organizations_url":"https://api.github.com/users/wenqing/orgs","repos_url":"https://api.github.com/users/wenqing/repos","events_url":"https://api.github.com/users/wenqing/events{/privacy}","received_events_url":"https://api.github.com/users/wenqing/received_events","type":"User","site_admin":false},"body":"The current one seems only contains the Laplacian term. Will you put the calculation of the mass term in other function? If it is, the first four lines should moved to somewhere before the start of local assembly.","created_at":"2014-10-27T14:46:29Z","updated_at":"2014-10-27T14:46:29Z","html_url":"https://github.com/ufz/ogs/pull/521#discussion_r19409005","pull_request_url":"https://api.github.com/repos/ufz/ogs/pulls/521","_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/19409005"},"html":{"href":"https://github.com/ufz/ogs/pull/521#discussion_r19409005"},"pull_request":{"href":"https://api.github.com/repos/ufz/ogs/pulls/521"}}},"pull_request":{"url":"https://api.github.com/repos/ufz/ogs/pulls/521","id":23308617,"html_url":"https://github.com/ufz/ogs/pull/521","diff_url":"https://github.com/ufz/ogs/pull/521.diff","patch_url":"https://github.com/ufz/ogs/pull/521.patch","issue_url":"https://api.github.com/repos/ufz/ogs/issues/521","number":521,"state":"open","locked":false,"title":"Local assembler for GroundwaterFlowProcess and LocalDataInitializer","user":{"login":"endJunction","id":329493,"avatar_url":"https://avatars.githubusercontent.com/u/329493?v=2","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":"~~This is follow up of #519 (Refactor dof table) and must not be merged before.~~\r\n~~There are 5 commits in this PR starting at \"[AL] Add back addToGlobal() in VectorMatrixAsm\".~~\r\n__Update:__ Rebased on master including the \"Refactor dof table\"\r\n\r\nThree main changes included:\r\n - Add back the `VectorMatrixAssembler::addToGlobal()`: The local matrix/vector types are required in VectorMatrixAssembler otherwise, and having the `GlobalSetupType` already at hand the suggested way seems easier.\r\n - Add `LocalDataAssembler<ShapeFunction>` derived from `LocalDataAssemblerBase` in `ProcessLib::GroundwaterFlow` namespace. The base class is needed, because we store a vector of local assemblers in the process for each element or element type.\r\n - Add `LocalDataInitializer`, which calls the `LocalDataAssembler<ShapeFunction>::init()` function knowing the `ShapeFunction` type from the mesh element type passed by the `LocalAssemblerBuilder`.\r\n\r\nThat's it!\r\n\r\nI already see that the documentation needs some updates/extensions; shall add soon.","created_at":"2014-10-24T16:42:51Z","updated_at":"2014-10-27T14:46:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ed0cdaef5811c44283a1c79c33c38470bee76ce","assignee":null,"milestone":{"url":"https://api.github.com/repos/ufz/ogs/milestones/12","labels_url":"https://api.github.com/repos/ufz/ogs/milestones/12/labels","id":740538,"number":12,"title":"Assembling and Solving of Elliptic Linear Equations","description":"Implement elliptic solver for line, quad, and hex elements.\r\n - Standalone executable\r\n - Reading of simplistic project configuration file (https://github.com/ufz/ogs/issues/428, https://github.com/ufz/ogs/issues/427)\r\n - Dynamic and static size local asm matrices (WIP: https://github.com/endJunction/ogs/2dGroundwaterFlow)\r\n - Test against analytical solution (Dirichlet BC)\r\n","creator":{"login":"endJunction","id":329493,"avatar_url":"https://avatars.githubusercontent.com/u/329493?v=2","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},"open_issues":5,"closed_issues":18,"state":"open","created_at":"2014-08-02T12:45:23Z","updated_at":"2014-10-27T06:22:39Z","due_on":null},"commits_url":"https://api.github.com/repos/ufz/ogs/pulls/521/commits","review_comments_url":"https://api.github.com/repos/ufz/ogs/pulls/521/comments","review_comment_url":"https://api.github.com/repos/ufz/ogs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ufz/ogs/issues/521/comments","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/964dd23abe52d0283806598b54b450507a838146","head":{"label":"endJunction:GWPLocalAsm","ref":"GWPLocalAsm","sha":"964dd23abe52d0283806598b54b450507a838146","user":{"login":"endJunction","id":329493,"avatar_url":"https://avatars.githubusercontent.com/u/329493?v=2","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},"repo":{"id":6429859,"name":"ogs","full_name":"endJunction/ogs","owner":{"login":"endJunction","id":329493,"avatar_url":"https://avatars.githubusercontent.com/u/329493?v=2","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},"private":false,"html_url":"https://github.com/endJunction/ogs","description":"OGS source code","fork":true,"url":"https://api.github.com/repos/endJunction/ogs","forks_url":"https://api.github.com/repos/endJunction/ogs/forks","keys_url":"https://api.github.com/repos/endJunction/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endJunction/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endJunction/ogs/teams","hooks_url":"https://api.github.com/repos/endJunction/ogs/hooks","issue_events_url":"https://api.github.com/repos/endJunction/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/endJunction/ogs/events","assignees_url":"https://api.github.com/repos/endJunction/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/endJunction/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/endJunction/ogs/tags","blobs_url":"https://api.github.com/repos/endJunction/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endJunction/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endJunction/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/endJunction/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endJunction/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/endJunction/ogs/languages","stargazers_url":"https://api.github.com/repos/endJunction/ogs/stargazers","contributors_url":"https://api.github.com/repos/endJunction/ogs/contributors","subscribers_url":"https://api.github.com/repos/endJunction/ogs/subscribers","subscription_url":"https://api.github.com/repos/endJunction/ogs/subscription","commits_url":"https://api.github.com/repos/endJunction/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/endJunction/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/endJunction/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/endJunction/ogs/issues/comments/{number}","contents_url":"https://api.github.com/repos/endJunction/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/endJunction/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endJunction/ogs/merges","archive_url":"https://api.github.com/repos/endJunction/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endJunction/ogs/downloads","issues_url":"https://api.github.com/repos/endJunction/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/endJunction/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/endJunction/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/endJunction/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endJunction/ogs/labels{/name}","releases_url":"https://api.github.com/repos/endJunction/ogs/releases{/id}","created_at":"2012-10-28T17:18:48Z","updated_at":"2014-07-31T11:35:56Z","pushed_at":"2014-10-27T11:22:26Z","git_url":"git://github.com/endJunction/ogs.git","ssh_url":"git@github.com:endJunction/ogs.git","clone_url":"https://github.com/endJunction/ogs.git","svn_url":"https://github.com/endJunction/ogs","homepage":"www.opengeosys.net","size":11372,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"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":"58db1d0ec747f23f732f82a5006d5ffc0c0a6672","user":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=2","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=2","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-09-02T11:52:00Z","pushed_at":"2014-10-27T06:23:30Z","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":16382,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":59,"forks":28,"open_issues":59,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/521"},"html":{"href":"https://github.com/ufz/ogs/pull/521"},"issue":{"href":"https://api.github.com/repos/ufz/ogs/issues/521"},"comments":{"href":"https://api.github.com/repos/ufz/ogs/issues/521/comments"},"review_comments":{"href":"https://api.github.com/repos/ufz/ogs/pulls/521/comments"},"review_comment":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ufz/ogs/pulls/521/commits"},"statuses":{"href":"https://api.github.com/repos/ufz/ogs/statuses/964dd23abe52d0283806598b54b450507a838146"}}}}