{"action":"created","comment":{"url":"https://api.github.com/repos/OPM/IFEM/pulls/comments/144543109","pull_request_review_id":69214661,"id":144543109,"diff_hunk":"@@ -352,6 +416,71 @@ ASMmxBase::VolumeVec ASMmxBase::establishBases(Go::SplineVolume* svol,\n                                                                  false,XYZ2));\n     result[3].reset(new Go::SplineVolume(*svol));\n     geoBasis = 4;\n+  } else if (type == SUBGRID) {\n+    // basis1 should be one degree higher than basis2 and C^p-1 continuous\n+    int ndim = svol->dimension();\n+    result[1].reset(new Go::SplineVolume(*svol));\n+    Go::SplineVolume tmp(*svol);\n+    for (size_t dir = 0; dir < 3; ++dir) {\n+      RealArray extraKnots;\n+      RealArray::const_iterator uit = tmp.basis(dir).begin();\n+      double ucurr, uprev = *(uit++);\n+      while (uit != tmp.basis(dir).end())\n+      {\n+        ucurr = *(uit++);\n+        if (ucurr > uprev)\n+          for (int i = 0; i < 1; i++)\n+          {\n+            double xi = (double)(i+1)/(double)(1+1);\n+            extraKnots.push_back(ucurr*xi + uprev*(1.0-xi));\n+          }\n+        uprev = ucurr;\n+      }\n+      tmp.insertKnot(dir, extraKnots);\n+    }\n+    Go::BsplineBasis b1 = tmp.basis(0).extendedBasis(tmp.order(0)+1);\n+    Go::BsplineBasis b2 = tmp.basis(1).extendedBasis(tmp.order(1)+1);\n+    Go::BsplineBasis b3 = tmp.basis(2).extendedBasis(tmp.order(2)+1);\n+\n+    // Compute parameter values of the Greville points\n+    size_t i;\n+    RealArray ug(b1.numCoefs()), vg(b2.numCoefs()), wg(b3.numCoefs());\n+    for (i = 0; i < ug.size(); i++)\n+      ug[i] = b1.grevilleParameter(i);\n+    for (i = 0; i < vg.size(); i++)\n+      vg[i] = b2.grevilleParameter(i);\n+    for (i = 0; i < wg.size(); i++)\n+      wg[i] = b3.grevilleParameter(i);\n+\n+    if (svol->rational()) {\n+      std::vector<double> rCoefs(tmp.rcoefs_begin(), tmp.rcoefs_end());\n+\n+      // we normally would set coefs as (x*w, y*w, w)\n+      // however, gotools use this representation internally already.\n+\n+      // instance a Bspline surface in ndim+1\n+      Go::SplineVolume svol2(tmp.basis(0), tmp.basis(1), tmp.basis(2), rCoefs.begin(), ndim+1, false);\n+\n+      // interpolate the Bspline surface onto new basis\n+      RealArray XYZ((ndim+1)*ug.size()*vg.size()*wg.size());\n+      svol2.gridEvaluator(ug,vg,wg,XYZ);\n+      std::unique_ptr<Go::SplineVolume> svol3(Go::VolumeInterpolator::regularInterpolation(b1,b2,b3,ug,vg,wg,XYZ,ndim+1,false,XYZ));\n+\n+      // new rational coefs are (x/w', y/w', w')\n+      // apparently gotools will rescale coeffs on surface creation.\n+      result[0].reset(new Go::SplineVolume(svol3->basis(0), svol3->basis(1), svol3->basis(2),svol3->coefs_begin(), ndim, true));\n+    } else {\n+      RealArray XYZ(ndim*ug.size()*vg.size()*wg.size());\n+      // Evaluate the spline surface at all points\n+      tmp.gridEvaluator(ug,vg,wg,XYZ);\n+\n+      // Project the coordinates onto the new basis (the 2nd XYZ is dummy here)\n+      result[0].reset(Go::VolumeInterpolator::regularInterpolation(b1,b2,b3,\n+                                                                   ug,vg,wg,\n+                                                                   XYZ,ndim,\n+                                                                   false,XYZ));","path":"src/ASM/ASMmxBase.C","position":129,"original_position":137,"commit_id":"20285b15df9cb7ec45fd058d1f1372f7d4ec36e3","original_commit_id":"20e64ce5f1fc7ee9c5fc89b799ffa96957310941","user":{"login":"akva2","id":2144327,"avatar_url":"https://avatars0.githubusercontent.com/u/2144327?v=4","gravatar_id":"","url":"https://api.github.com/users/akva2","html_url":"https://github.com/akva2","followers_url":"https://api.github.com/users/akva2/followers","following_url":"https://api.github.com/users/akva2/following{/other_user}","gists_url":"https://api.github.com/users/akva2/gists{/gist_id}","starred_url":"https://api.github.com/users/akva2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akva2/subscriptions","organizations_url":"https://api.github.com/users/akva2/orgs","repos_url":"https://api.github.com/users/akva2/repos","events_url":"https://api.github.com/users/akva2/events{/privacy}","received_events_url":"https://api.github.com/users/akva2/received_events","type":"User","site_admin":false},"body":"as discussed on skype i do order raising along with the knot insertion so cannot comply.","created_at":"2017-10-13T12:45:52Z","updated_at":"2017-10-13T12:45:52Z","html_url":"https://github.com/OPM/IFEM/pull/205#discussion_r144543109","pull_request_url":"https://api.github.com/repos/OPM/IFEM/pulls/205","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/comments/144543109"},"html":{"href":"https://github.com/OPM/IFEM/pull/205#discussion_r144543109"},"pull_request":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/205"}},"in_reply_to_id":144529386},"pull_request":{"url":"https://api.github.com/repos/OPM/IFEM/pulls/205","id":144687995,"html_url":"https://github.com/OPM/IFEM/pull/205","diff_url":"https://github.com/OPM/IFEM/pull/205.diff","patch_url":"https://github.com/OPM/IFEM/pull/205.patch","issue_url":"https://api.github.com/repos/OPM/IFEM/issues/205","number":205,"state":"open","locked":false,"title":"add support for sub-grid mixed elements","user":{"login":"akva2","id":2144327,"avatar_url":"https://avatars0.githubusercontent.com/u/2144327?v=4","gravatar_id":"","url":"https://api.github.com/users/akva2","html_url":"https://github.com/akva2","followers_url":"https://api.github.com/users/akva2/followers","following_url":"https://api.github.com/users/akva2/following{/other_user}","gists_url":"https://api.github.com/users/akva2/gists{/gist_id}","starred_url":"https://api.github.com/users/akva2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akva2/subscriptions","organizations_url":"https://api.github.com/users/akva2/orgs","repos_url":"https://api.github.com/users/akva2/repos","events_url":"https://api.github.com/users/akva2/events{/privacy}","received_events_url":"https://api.github.com/users/akva2/received_events","type":"User","site_admin":false},"body":"this is two field formulation with C^{p+1}/p and C^p/p-1 bases, but where the first basis has\r\nan additional subdivision of each element.\r\n\r\nthis is an inf-sup stable basis for Stokes.\r\n\r\nthis required rewriting the MNPC establishment for tensor splines, previous implementation assumed the same element structure for all grids.","created_at":"2017-10-04T14:38:36Z","updated_at":"2017-10-13T12:45:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"383c7f613d6ad78089181ab33d575a1461b334ec","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/OPM/IFEM/pulls/205/commits","review_comments_url":"https://api.github.com/repos/OPM/IFEM/pulls/205/comments","review_comment_url":"https://api.github.com/repos/OPM/IFEM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OPM/IFEM/issues/205/comments","statuses_url":"https://api.github.com/repos/OPM/IFEM/statuses/20285b15df9cb7ec45fd058d1f1372f7d4ec36e3","head":{"label":"akva2:add_subgrid_element","ref":"add_subgrid_element","sha":"20285b15df9cb7ec45fd058d1f1372f7d4ec36e3","user":{"login":"akva2","id":2144327,"avatar_url":"https://avatars0.githubusercontent.com/u/2144327?v=4","gravatar_id":"","url":"https://api.github.com/users/akva2","html_url":"https://github.com/akva2","followers_url":"https://api.github.com/users/akva2/followers","following_url":"https://api.github.com/users/akva2/following{/other_user}","gists_url":"https://api.github.com/users/akva2/gists{/gist_id}","starred_url":"https://api.github.com/users/akva2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akva2/subscriptions","organizations_url":"https://api.github.com/users/akva2/orgs","repos_url":"https://api.github.com/users/akva2/repos","events_url":"https://api.github.com/users/akva2/events{/privacy}","received_events_url":"https://api.github.com/users/akva2/received_events","type":"User","site_admin":false},"repo":{"id":53492643,"name":"IFEM","full_name":"akva2/IFEM","owner":{"login":"akva2","id":2144327,"avatar_url":"https://avatars0.githubusercontent.com/u/2144327?v=4","gravatar_id":"","url":"https://api.github.com/users/akva2","html_url":"https://github.com/akva2","followers_url":"https://api.github.com/users/akva2/followers","following_url":"https://api.github.com/users/akva2/following{/other_user}","gists_url":"https://api.github.com/users/akva2/gists{/gist_id}","starred_url":"https://api.github.com/users/akva2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akva2/subscriptions","organizations_url":"https://api.github.com/users/akva2/orgs","repos_url":"https://api.github.com/users/akva2/repos","events_url":"https://api.github.com/users/akva2/events{/privacy}","received_events_url":"https://api.github.com/users/akva2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akva2/IFEM","description":"IFEM - Isogeometric Toolbox for the solution of PDEs","fork":true,"url":"https://api.github.com/repos/akva2/IFEM","forks_url":"https://api.github.com/repos/akva2/IFEM/forks","keys_url":"https://api.github.com/repos/akva2/IFEM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akva2/IFEM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akva2/IFEM/teams","hooks_url":"https://api.github.com/repos/akva2/IFEM/hooks","issue_events_url":"https://api.github.com/repos/akva2/IFEM/issues/events{/number}","events_url":"https://api.github.com/repos/akva2/IFEM/events","assignees_url":"https://api.github.com/repos/akva2/IFEM/assignees{/user}","branches_url":"https://api.github.com/repos/akva2/IFEM/branches{/branch}","tags_url":"https://api.github.com/repos/akva2/IFEM/tags","blobs_url":"https://api.github.com/repos/akva2/IFEM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akva2/IFEM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akva2/IFEM/git/refs{/sha}","trees_url":"https://api.github.com/repos/akva2/IFEM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akva2/IFEM/statuses/{sha}","languages_url":"https://api.github.com/repos/akva2/IFEM/languages","stargazers_url":"https://api.github.com/repos/akva2/IFEM/stargazers","contributors_url":"https://api.github.com/repos/akva2/IFEM/contributors","subscribers_url":"https://api.github.com/repos/akva2/IFEM/subscribers","subscription_url":"https://api.github.com/repos/akva2/IFEM/subscription","commits_url":"https://api.github.com/repos/akva2/IFEM/commits{/sha}","git_commits_url":"https://api.github.com/repos/akva2/IFEM/git/commits{/sha}","comments_url":"https://api.github.com/repos/akva2/IFEM/comments{/number}","issue_comment_url":"https://api.github.com/repos/akva2/IFEM/issues/comments{/number}","contents_url":"https://api.github.com/repos/akva2/IFEM/contents/{+path}","compare_url":"https://api.github.com/repos/akva2/IFEM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akva2/IFEM/merges","archive_url":"https://api.github.com/repos/akva2/IFEM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akva2/IFEM/downloads","issues_url":"https://api.github.com/repos/akva2/IFEM/issues{/number}","pulls_url":"https://api.github.com/repos/akva2/IFEM/pulls{/number}","milestones_url":"https://api.github.com/repos/akva2/IFEM/milestones{/number}","notifications_url":"https://api.github.com/repos/akva2/IFEM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akva2/IFEM/labels{/name}","releases_url":"https://api.github.com/repos/akva2/IFEM/releases{/id}","deployments_url":"https://api.github.com/repos/akva2/IFEM/deployments","created_at":"2016-03-09T11:32:46Z","updated_at":"2016-03-09T11:32:48Z","pushed_at":"2017-10-13T12:45:13Z","git_url":"git://github.com/akva2/IFEM.git","ssh_url":"git@github.com:akva2/IFEM.git","clone_url":"https://github.com/akva2/IFEM.git","svn_url":"https://github.com/akva2/IFEM","homepage":null,"size":9392,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"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":"75317b18f2145ffc750d88e46e35733bb20f5893","user":{"login":"OPM","id":1827197,"avatar_url":"https://avatars0.githubusercontent.com/u/1827197?v=4","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":50664067,"name":"IFEM","full_name":"OPM/IFEM","owner":{"login":"OPM","id":1827197,"avatar_url":"https://avatars0.githubusercontent.com/u/1827197?v=4","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/IFEM","description":"IFEM - Isogeometric Toolbox for the solution of PDEs","fork":false,"url":"https://api.github.com/repos/OPM/IFEM","forks_url":"https://api.github.com/repos/OPM/IFEM/forks","keys_url":"https://api.github.com/repos/OPM/IFEM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OPM/IFEM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OPM/IFEM/teams","hooks_url":"https://api.github.com/repos/OPM/IFEM/hooks","issue_events_url":"https://api.github.com/repos/OPM/IFEM/issues/events{/number}","events_url":"https://api.github.com/repos/OPM/IFEM/events","assignees_url":"https://api.github.com/repos/OPM/IFEM/assignees{/user}","branches_url":"https://api.github.com/repos/OPM/IFEM/branches{/branch}","tags_url":"https://api.github.com/repos/OPM/IFEM/tags","blobs_url":"https://api.github.com/repos/OPM/IFEM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OPM/IFEM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OPM/IFEM/git/refs{/sha}","trees_url":"https://api.github.com/repos/OPM/IFEM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OPM/IFEM/statuses/{sha}","languages_url":"https://api.github.com/repos/OPM/IFEM/languages","stargazers_url":"https://api.github.com/repos/OPM/IFEM/stargazers","contributors_url":"https://api.github.com/repos/OPM/IFEM/contributors","subscribers_url":"https://api.github.com/repos/OPM/IFEM/subscribers","subscription_url":"https://api.github.com/repos/OPM/IFEM/subscription","commits_url":"https://api.github.com/repos/OPM/IFEM/commits{/sha}","git_commits_url":"https://api.github.com/repos/OPM/IFEM/git/commits{/sha}","comments_url":"https://api.github.com/repos/OPM/IFEM/comments{/number}","issue_comment_url":"https://api.github.com/repos/OPM/IFEM/issues/comments{/number}","contents_url":"https://api.github.com/repos/OPM/IFEM/contents/{+path}","compare_url":"https://api.github.com/repos/OPM/IFEM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OPM/IFEM/merges","archive_url":"https://api.github.com/repos/OPM/IFEM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OPM/IFEM/downloads","issues_url":"https://api.github.com/repos/OPM/IFEM/issues{/number}","pulls_url":"https://api.github.com/repos/OPM/IFEM/pulls{/number}","milestones_url":"https://api.github.com/repos/OPM/IFEM/milestones{/number}","notifications_url":"https://api.github.com/repos/OPM/IFEM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OPM/IFEM/labels{/name}","releases_url":"https://api.github.com/repos/OPM/IFEM/releases{/id}","deployments_url":"https://api.github.com/repos/OPM/IFEM/deployments","created_at":"2016-01-29T13:29:52Z","updated_at":"2017-09-05T12:08:21Z","pushed_at":"2017-10-13T12:45:14Z","git_url":"git://github.com/OPM/IFEM.git","ssh_url":"git@github.com:OPM/IFEM.git","clone_url":"https://github.com/OPM/IFEM.git","svn_url":"https://github.com/OPM/IFEM","homepage":null,"size":8337,"stargazers_count":7,"watchers_count":7,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":15,"forks":8,"open_issues":15,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/205"},"html":{"href":"https://github.com/OPM/IFEM/pull/205"},"issue":{"href":"https://api.github.com/repos/OPM/IFEM/issues/205"},"comments":{"href":"https://api.github.com/repos/OPM/IFEM/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OPM/IFEM/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/OPM/IFEM/statuses/20285b15df9cb7ec45fd058d1f1372f7d4ec36e3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"akva2"}}