File: particles_in_disk.py

package info (click to toggle)
pysph 0~20180411.git1ae58e1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,348 kB
  • sloc: python: 34,214; sh: 459; cpp: 206; makefile: 193; ansic: 168
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='.')