{"action":"created","comment":{"url":"https://api.github.com/repos/pypr/pysph/pulls/comments/200850608","pull_request_review_id":135242667,"id":200850608,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDg1MDYwOA==","diff_hunk":"@@ -0,0 +1,1677 @@\n+\"\"\"\n+Basic Equations for solving shallow water problems\n+#####################\n+\"\"\"\n+\n+from pysph.sph.equation import Equation\n+from pysph.sph.integrator_step import IntegratorStep\n+from pysph.sph.integrator import Integrator\n+from pysph.cpy.api import declare\n+from pysph.sph.wc.density_correction import gj_solve\n+\n+from numpy import sqrt, cos, sin, zeros, pi\n+import numpy as np\n+\n+\n+class CheckForParticlesToSplit(Equation):\n+    r\"\"\"Particles are tagged for splitting if the following condition is\n+    satisfied:\n+\n+    .. math::\n+        (A_i > A_max) and (h_i < h_max) and (x_min < x_i < x_max) and (y_min <\n+        y_i < y_max)\n+\n+    References\n+    ----------\n+    .. [Vacondio2010] R. Vacondio, B.D. Rodgers and P.K. Stansby, \"Accurate\n+    particle splitting for smoothed particle hydrodynamics in shallow water\n+    with shock capturing\", Int. J. Numer. Meth. Fluids, 69 (2012), pp.\n+    1377-1410\n+\n+    \"\"\"\n+    def __init__(self, dest, h_max=1e9, A_max=1e9, x_min=-1e9, x_max=1e9,\n+                 y_min=-1e9, y_max=1e9):\n+        r\"\"\"\n+        Parameters\n+        ----------\n+        h_max : float\n+            maximum smoothing length beyond which splitting is deactivated\n+        A_max : float\n+            maximum area beyond which splitting is activated\n+        x_min : float\n+            minimum distance along x-direction beyond which splitting is\n+            activated\n+        x_max : float\n+            maximum distance along x-direction beyond which splitting is\n+            deactivated\n+        y_min : float\n+            minimum distance along y-direction beyond which splitting is\n+            activated\n+        y_max : float\n+            maximum distance along y-direction beyond which splitting is\n+            deactivated\n+\n+        \"\"\"\n+        self.A_max = A_max\n+        self.h_max = h_max\n+        self.x_min = x_min\n+        self.x_max = x_max\n+        self.y_min = y_min\n+        self.y_max = y_max\n+        super(CheckForParticlesToSplit, self).__init__(dest, None)\n+\n+    def initialize(self, d_pa_to_split, d_idx):\n+        d_pa_to_split[d_idx] = 0.0\n+\n+    def post_loop(self, d_idx, d_rho0, d_A, d_h, d_x, d_y, d_pa_to_split):\n+        if (d_A[d_idx] > self.A_max and d_h[d_idx] < self.h_max\n+           and (self.x_min < d_x[d_idx] < self.x_max)\n+           and (self.y_min < d_y[d_idx] < self.y_max)):\n+            d_pa_to_split[d_idx] = 1\n+\n+\n+class ParticleSplit(object):\n+    r\"\"\"**Hexagonal particle splitting algorithm**\n+\n+    References\n+    ----------\n+    .. [Vacondio2010] R. Vacondio, B.D. Rodgers and P.K. Stansby, \"Accurate\n+    particle splitting for smoothed particle hydrodynamics in shallow water\n+    with shock capturing\", Int. J. Numer. Meth. Fluids, 69 (2012), pp.\n+    1377-1410\n+\n+    \"\"\"\n+    def __init__(self, pa_arr):\n+        r\"\"\"\n+        Parameters\n+        ----------\n+        pa_arr : pysph.base.particle_array.ParticleArray\n+            particle array of fluid\n+\n+        \"\"\"\n+        self.pa_arr = pa_arr\n+\n+        # Ratio of mass of daughter particle located at center of hexagon to\n+        # that of its parents mass\n+        self.center_pa_mass_frac = 0.178705766141917\n+\n+        # Ratio of mass of daughter particle located at edge of hexagon to that\n+        # of its parents mass\n+        self.edge_pa_mass_frac = 0.136882287617319","path":"pysph/sph/swe/basic.py","position":null,"original_position":100,"commit_id":"32f925dd4437e0b9574fe6fd4e0e6437b79f1380","original_commit_id":"6879c11a2e51f347364607a80ef1342be14b34e8","user":{"login":"dileepmenon","id":15815907,"node_id":"MDQ6VXNlcjE1ODE1OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/15815907?v=4","gravatar_id":"","url":"https://api.github.com/users/dileepmenon","html_url":"https://github.com/dileepmenon","followers_url":"https://api.github.com/users/dileepmenon/followers","following_url":"https://api.github.com/users/dileepmenon/following{/other_user}","gists_url":"https://api.github.com/users/dileepmenon/gists{/gist_id}","starred_url":"https://api.github.com/users/dileepmenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileepmenon/subscriptions","organizations_url":"https://api.github.com/users/dileepmenon/orgs","repos_url":"https://api.github.com/users/dileepmenon/repos","events_url":"https://api.github.com/users/dileepmenon/events{/privacy}","received_events_url":"https://api.github.com/users/dileepmenon/received_events","type":"User","site_admin":false},"body":"I have changed this to vertex_pa instead of edge_pa. There are actually daughter particles located at the center of the hexagon and vertices of the hexagon after splitting, so to distinguish between them I used these names.","created_at":"2018-07-08T19:20:39Z","updated_at":"2018-07-08T19:20:40Z","html_url":"https://github.com/pypr/pysph/pull/107#discussion_r200850608","pull_request_url":"https://api.github.com/repos/pypr/pysph/pulls/107","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/pypr/pysph/pulls/comments/200850608"},"html":{"href":"https://github.com/pypr/pysph/pull/107#discussion_r200850608"},"pull_request":{"href":"https://api.github.com/repos/pypr/pysph/pulls/107"}},"in_reply_to_id":199628842},"pull_request":{"url":"https://api.github.com/repos/pypr/pysph/pulls/107","id":198146940,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MTQ2OTQw","html_url":"https://github.com/pypr/pysph/pull/107","diff_url":"https://github.com/pypr/pysph/pull/107.diff","patch_url":"https://github.com/pypr/pysph/pull/107.patch","issue_url":"https://api.github.com/repos/pypr/pysph/issues/107","number":107,"state":"open","locked":false,"title":"Shallow water equations","user":{"login":"dileepmenon","id":15815907,"node_id":"MDQ6VXNlcjE1ODE1OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/15815907?v=4","gravatar_id":"","url":"https://api.github.com/users/dileepmenon","html_url":"https://github.com/dileepmenon","followers_url":"https://api.github.com/users/dileepmenon/followers","following_url":"https://api.github.com/users/dileepmenon/following{/other_user}","gists_url":"https://api.github.com/users/dileepmenon/gists{/gist_id}","starred_url":"https://api.github.com/users/dileepmenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileepmenon/subscriptions","organizations_url":"https://api.github.com/users/dileepmenon/orgs","repos_url":"https://api.github.com/users/dileepmenon/repos","events_url":"https://api.github.com/users/dileepmenon/events{/privacy}","received_events_url":"https://api.github.com/users/dileepmenon/received_events","type":"User","site_admin":false},"body":"Added equations for solving shallow water problems. It consists of variable-h formulation, particle splitting/merging, bed surface discretization, SPH stabilization, bed friction, open boundary inflow/outflow, closed boundary treatment, etc.  Also added a particle array specific to the case of shallow water flows.","created_at":"2018-06-28T20:40:15Z","updated_at":"2018-07-08T19:20:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e3d622624588c63d9ff426143f9ca6c7082991f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pypr/pysph/pulls/107/commits","review_comments_url":"https://api.github.com/repos/pypr/pysph/pulls/107/comments","review_comment_url":"https://api.github.com/repos/pypr/pysph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypr/pysph/issues/107/comments","statuses_url":"https://api.github.com/repos/pypr/pysph/statuses/32f925dd4437e0b9574fe6fd4e0e6437b79f1380","head":{"label":"dileepmenon:shallow_water_eqns","ref":"shallow_water_eqns","sha":"32f925dd4437e0b9574fe6fd4e0e6437b79f1380","user":{"login":"dileepmenon","id":15815907,"node_id":"MDQ6VXNlcjE1ODE1OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/15815907?v=4","gravatar_id":"","url":"https://api.github.com/users/dileepmenon","html_url":"https://github.com/dileepmenon","followers_url":"https://api.github.com/users/dileepmenon/followers","following_url":"https://api.github.com/users/dileepmenon/following{/other_user}","gists_url":"https://api.github.com/users/dileepmenon/gists{/gist_id}","starred_url":"https://api.github.com/users/dileepmenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileepmenon/subscriptions","organizations_url":"https://api.github.com/users/dileepmenon/orgs","repos_url":"https://api.github.com/users/dileepmenon/repos","events_url":"https://api.github.com/users/dileepmenon/events{/privacy}","received_events_url":"https://api.github.com/users/dileepmenon/received_events","type":"User","site_admin":false},"repo":{"id":138998477,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5OTg0Nzc=","name":"pysph","full_name":"dileepmenon/pysph","owner":{"login":"dileepmenon","id":15815907,"node_id":"MDQ6VXNlcjE1ODE1OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/15815907?v=4","gravatar_id":"","url":"https://api.github.com/users/dileepmenon","html_url":"https://github.com/dileepmenon","followers_url":"https://api.github.com/users/dileepmenon/followers","following_url":"https://api.github.com/users/dileepmenon/following{/other_user}","gists_url":"https://api.github.com/users/dileepmenon/gists{/gist_id}","starred_url":"https://api.github.com/users/dileepmenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dileepmenon/subscriptions","organizations_url":"https://api.github.com/users/dileepmenon/orgs","repos_url":"https://api.github.com/users/dileepmenon/repos","events_url":"https://api.github.com/users/dileepmenon/events{/privacy}","received_events_url":"https://api.github.com/users/dileepmenon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dileepmenon/pysph","description":"A framework for Smoothed Particle Hydrodynamics in Python","fork":true,"url":"https://api.github.com/repos/dileepmenon/pysph","forks_url":"https://api.github.com/repos/dileepmenon/pysph/forks","keys_url":"https://api.github.com/repos/dileepmenon/pysph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dileepmenon/pysph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dileepmenon/pysph/teams","hooks_url":"https://api.github.com/repos/dileepmenon/pysph/hooks","issue_events_url":"https://api.github.com/repos/dileepmenon/pysph/issues/events{/number}","events_url":"https://api.github.com/repos/dileepmenon/pysph/events","assignees_url":"https://api.github.com/repos/dileepmenon/pysph/assignees{/user}","branches_url":"https://api.github.com/repos/dileepmenon/pysph/branches{/branch}","tags_url":"https://api.github.com/repos/dileepmenon/pysph/tags","blobs_url":"https://api.github.com/repos/dileepmenon/pysph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dileepmenon/pysph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dileepmenon/pysph/git/refs{/sha}","trees_url":"https://api.github.com/repos/dileepmenon/pysph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dileepmenon/pysph/statuses/{sha}","languages_url":"https://api.github.com/repos/dileepmenon/pysph/languages","stargazers_url":"https://api.github.com/repos/dileepmenon/pysph/stargazers","contributors_url":"https://api.github.com/repos/dileepmenon/pysph/contributors","subscribers_url":"https://api.github.com/repos/dileepmenon/pysph/subscribers","subscription_url":"https://api.github.com/repos/dileepmenon/pysph/subscription","commits_url":"https://api.github.com/repos/dileepmenon/pysph/commits{/sha}","git_commits_url":"https://api.github.com/repos/dileepmenon/pysph/git/commits{/sha}","comments_url":"https://api.github.com/repos/dileepmenon/pysph/comments{/number}","issue_comment_url":"https://api.github.com/repos/dileepmenon/pysph/issues/comments{/number}","contents_url":"https://api.github.com/repos/dileepmenon/pysph/contents/{+path}","compare_url":"https://api.github.com/repos/dileepmenon/pysph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dileepmenon/pysph/merges","archive_url":"https://api.github.com/repos/dileepmenon/pysph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dileepmenon/pysph/downloads","issues_url":"https://api.github.com/repos/dileepmenon/pysph/issues{/number}","pulls_url":"https://api.github.com/repos/dileepmenon/pysph/pulls{/number}","milestones_url":"https://api.github.com/repos/dileepmenon/pysph/milestones{/number}","notifications_url":"https://api.github.com/repos/dileepmenon/pysph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dileepmenon/pysph/labels{/name}","releases_url":"https://api.github.com/repos/dileepmenon/pysph/releases{/id}","deployments_url":"https://api.github.com/repos/dileepmenon/pysph/deployments","created_at":"2018-06-28T09:41:58Z","updated_at":"2018-06-28T09:42:01Z","pushed_at":"2018-07-08T19:10:37Z","git_url":"git://github.com/dileepmenon/pysph.git","ssh_url":"git@github.com:dileepmenon/pysph.git","clone_url":"https://github.com/dileepmenon/pysph.git","svn_url":"https://github.com/dileepmenon/pysph","homepage":"http://pysph.readthedocs.io","size":5135,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pypr:master","ref":"master","sha":"6c3004da25051e5211b8b98e616d8885137dfb6f","user":{"login":"pypr","id":13086867,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDg2ODY3","avatar_url":"https://avatars3.githubusercontent.com/u/13086867?v=4","gravatar_id":"","url":"https://api.github.com/users/pypr","html_url":"https://github.com/pypr","followers_url":"https://api.github.com/users/pypr/followers","following_url":"https://api.github.com/users/pypr/following{/other_user}","gists_url":"https://api.github.com/users/pypr/gists{/gist_id}","starred_url":"https://api.github.com/users/pypr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypr/subscriptions","organizations_url":"https://api.github.com/users/pypr/orgs","repos_url":"https://api.github.com/users/pypr/repos","events_url":"https://api.github.com/users/pypr/events{/privacy}","received_events_url":"https://api.github.com/users/pypr/received_events","type":"Organization","site_admin":false},"repo":{"id":92426682,"node_id":"MDEwOlJlcG9zaXRvcnk5MjQyNjY4Mg==","name":"pysph","full_name":"pypr/pysph","owner":{"login":"pypr","id":13086867,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDg2ODY3","avatar_url":"https://avatars3.githubusercontent.com/u/13086867?v=4","gravatar_id":"","url":"https://api.github.com/users/pypr","html_url":"https://github.com/pypr","followers_url":"https://api.github.com/users/pypr/followers","following_url":"https://api.github.com/users/pypr/following{/other_user}","gists_url":"https://api.github.com/users/pypr/gists{/gist_id}","starred_url":"https://api.github.com/users/pypr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypr/subscriptions","organizations_url":"https://api.github.com/users/pypr/orgs","repos_url":"https://api.github.com/users/pypr/repos","events_url":"https://api.github.com/users/pypr/events{/privacy}","received_events_url":"https://api.github.com/users/pypr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypr/pysph","description":"A framework for Smoothed Particle Hydrodynamics in Python","fork":false,"url":"https://api.github.com/repos/pypr/pysph","forks_url":"https://api.github.com/repos/pypr/pysph/forks","keys_url":"https://api.github.com/repos/pypr/pysph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypr/pysph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypr/pysph/teams","hooks_url":"https://api.github.com/repos/pypr/pysph/hooks","issue_events_url":"https://api.github.com/repos/pypr/pysph/issues/events{/number}","events_url":"https://api.github.com/repos/pypr/pysph/events","assignees_url":"https://api.github.com/repos/pypr/pysph/assignees{/user}","branches_url":"https://api.github.com/repos/pypr/pysph/branches{/branch}","tags_url":"https://api.github.com/repos/pypr/pysph/tags","blobs_url":"https://api.github.com/repos/pypr/pysph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypr/pysph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypr/pysph/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypr/pysph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypr/pysph/statuses/{sha}","languages_url":"https://api.github.com/repos/pypr/pysph/languages","stargazers_url":"https://api.github.com/repos/pypr/pysph/stargazers","contributors_url":"https://api.github.com/repos/pypr/pysph/contributors","subscribers_url":"https://api.github.com/repos/pypr/pysph/subscribers","subscription_url":"https://api.github.com/repos/pypr/pysph/subscription","commits_url":"https://api.github.com/repos/pypr/pysph/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypr/pysph/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypr/pysph/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypr/pysph/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypr/pysph/contents/{+path}","compare_url":"https://api.github.com/repos/pypr/pysph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypr/pysph/merges","archive_url":"https://api.github.com/repos/pypr/pysph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypr/pysph/downloads","issues_url":"https://api.github.com/repos/pypr/pysph/issues{/number}","pulls_url":"https://api.github.com/repos/pypr/pysph/pulls{/number}","milestones_url":"https://api.github.com/repos/pypr/pysph/milestones{/number}","notifications_url":"https://api.github.com/repos/pypr/pysph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypr/pysph/labels{/name}","releases_url":"https://api.github.com/repos/pypr/pysph/releases{/id}","deployments_url":"https://api.github.com/repos/pypr/pysph/deployments","created_at":"2017-05-25T17:17:00Z","updated_at":"2018-07-08T14:15:10Z","pushed_at":"2018-07-08T19:10:38Z","git_url":"git://github.com/pypr/pysph.git","ssh_url":"git@github.com:pypr/pysph.git","clone_url":"https://github.com/pypr/pysph.git","svn_url":"https://github.com/pypr/pysph","homepage":"http://pysph.readthedocs.io","size":5121,"stargazers_count":58,"watchers_count":58,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":40,"open_issues":5,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypr/pysph/pulls/107"},"html":{"href":"https://github.com/pypr/pysph/pull/107"},"issue":{"href":"https://api.github.com/repos/pypr/pysph/issues/107"},"comments":{"href":"https://api.github.com/repos/pypr/pysph/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/pypr/pysph/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/pypr/pysph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypr/pysph/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/pypr/pysph/statuses/32f925dd4437e0b9574fe6fd4e0e6437b79f1380"}},"author_association":"NONE"}}
{"actor":{"display_login":"dileepmenon"}}