File: particles_in_disk.py

package info (click to toggle)
pysph 1.0~b2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,100 kB
  • sloc: python: 58,494; makefile: 212; cpp: 206; sh: 165
file content (6 lines) | stat: -rw-r--r-- 233 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
import numpy as np
from pysph.base.utils import get_particle_array_wcsph
x, y = np.mgrid[-1:1:50j, -1:1:50j]
mask = x*x + y*y < 1.0
pa = get_particle_array_wcsph(name='fluid', x=x[mask], y=y[mask])
plt.scatter(pa.x, pa.y, marker='.')