Skip to content

Commit

Permalink
Merged in prabhuramachandran/pysph/clean-parallel-tests (pull request #…
Browse files Browse the repository at this point in the history
…162)

Cleanup parallel tests
  • Loading branch information
prabhuramachandran committed May 4, 2015
2 parents 75039a9 + 50c0e0b commit e848680
Show file tree
Hide file tree
Showing 36 changed files with 1,040 additions and 429 deletions.
11 changes: 5 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include MANIFEST.in Makefile *.py *.txt pip_requirements.txt README.md
include build_zoltan.sh shippable.yml
recursive-include examples *.py
recursive-include docs *.* *
recursive-include pysph *.pxd *.h *.c *.src
recursive-include pyzoltan *.pxd *.h *.c *.src
include MANIFEST.in Makefile *.bat *.py *.rst *.sh *.txt *.yml
recursive-include examples *.py *.vtk.gz
recursive-include docs *.*
recursive-include pysph *.pxd *.src *.txt.gz
recursive-include pyzoltan *.pxd *.h *.src *.txt
103 changes: 0 additions & 103 deletions README.md

This file was deleted.

126 changes: 126 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
PySPH: a Python-based SPH framework
-----------------------------------

|Shippable Status| |Drone Status|

PySPH is an open source framework for Smoothed Particle Hydrodynamics
(SPH) simulations. It is implemented in
`Python <http://www.python.org>`__ and the performance critical parts
are implemented in `Cython <http://www.cython.org>`__.

PySPH allows users to write their high-level code in pure Python. This Python
code is automatically converted to high-performance Cython which is compiled
and executed. PySPH can also work with OpenMP and MPI for larger scale
computing.

The latest documentation for PySPH is available at
`pysph.readthedocs.org <http://pysph.readthedocs.org>`__.

.. |Shippable Status| image:: https://api.shippable.com/projects/540e849c3479c5ea8f9f030e/badge?branchName=master
:target: https://app.shippable.com/projects/540e849c3479c5ea8f9f030e/builds/latest
.. |Drone Status| image:: https://drone.io/bitbucket.org/pysph/pysph/status.png
:target: https://drone.io/bitbucket.org/pysph/pysph/latest

Features
--------

- Solver framework to add arbitrary collection of particles.
- Flexibility to define arbitrary SPH equations operating on particles
in pure Python.
- Any kind of user-defined multi-step integrator.
- Seamless parallel integration using
`Zoltan <http://www.cs.sandia.gov/zoltan/>`__.
- High-performance: our performance is comparable to hand-written
solvers implemented in FORTRAN.

Solvers
-------

Currently, PySPH has numerous examples to solve a variety of problems. The
features of the implementation are:

- `Weakly Compressible SPH
(WCSPH) <http://www.tandfonline.com/doi/abs/10.1080/00221686.2010.9641250>`__
for free-surface flows (Gesteira et al. 2010, Journal of Hydraulic
Research, 48, pp. 6--27)
- `Transport Velocity
Formulation <http://dx.doi.org/10.1016/j.jcp.2013.01.043>`__ for
incompressilbe fluids (Adami et al. 2013, JCP, 241, pp. 292--307)
- `SPH for elastic
dynamics <http://dx.doi.org/10.1016/S0045-7825(01)00254-7>`__ (Gray
et al. 2001, CMAME, Vol. 190, pp 6641--6662)
- `Compressible SPH <http://dx.doi.org/10.1016/j.jcp.2013.08.060>`__
(Puri et al. 2014, JCP, Vol. 256, pp 308--333)

Installation
============

Up-to-date details on how to install PySPH on Linux/OS X and Windows are
available from
`here <http://pysph.readthedocs.org/en/latest/installation.html>`__.

If you wish to see a working build/test script please see our
`shippable.yml <https://bitbucket.org/pysph/pysph/src/master/shippable.yml>`__.
Or you could see the `build
script <https://drone.io/bitbucket.org/pysph/pysph/admin>`__ hosted at
`drone.io <http://drone.io>`__.

Running the examples
--------------------

You can verify the installation by exploring some examples. A fairly
quick running example (taking about 5-10 minutes) would be the
following::

$ cd examples
$ python dam_break.py

The solution can be viewed live by running::

$ pysph_viewer

This requires that Mayavi be installed. The saved output data can be
viewed by running::

$ pysph_viewer dam_break_output/

A 3D version of the dam-break problem is also available, and may be run
as::

$ python dam_break3D.py

This runs the 3D dam-break problem which is also a SPHERIC benchmark
`Test 2 <https://wiki.manchester.ac.uk/spheric/index.php/Test2>`__

.. figure:: https://bitbucket.org/pysph/pysph/raw/master/docs/Images/db3d.png
:alt: IMAGE

PySPH is more than a tool for wave-body interactions:::

$ cd examples/transport_velocity
$ python cavity.py

This runs the driven cavity problem using the transport velocity
formulation of Adami et al. You can verify the results for this problem
using the helper script
``examples/transport_velocity/ldcavity_results.py`` to plot, for example
the streamlines:

.. figure:: https://bitbucket.org/pysph/pysph/raw/master/docs/Images/ldc-streamlines.png
:alt: IMAGE

If you want to use PySPH for elastic dynamics, you can try some of the
examples from the directory ``examples/solid_mech``::

$ cd examples/solid_mech
$ python rings.py

Which runs the problem of the collision of two elastic rings:

.. figure:: https://bitbucket.org/pysph/pysph/raw/master/docs/Images/rings-collision.png
:alt: IMAGE

The auto-generated code for the example resides in the directory
``~/.pysph/source``. A note of caution however, it's not for the faint
hearted.

6 changes: 0 additions & 6 deletions TODO.md

This file was deleted.

4 changes: 2 additions & 2 deletions examples/transport_velocity/cavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ def create_particles(**kwargs):

# set the output arrays
fluid.set_output_arrays( ['x', 'y', 'u', 'v', 'vmag2', 'rho', 'p',
'V', 'm', 'h'] )
'V', 'm', 'h', 'gid'] )

solid.set_output_arrays( ['x', 'y', 'u', 'rho', 'p'] )
solid.set_output_arrays( ['x', 'y', 'u', 'rho', 'p', 'gid'] )

return [fluid, solid]

Expand Down
4 changes: 4 additions & 0 deletions pysph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# See PEP 440 for more on suitable version numbers.
__version__ = '1.0a1.dev'


# Conditional Imports for Parallel stuff

# Check for MPI
Expand Down
6 changes: 4 additions & 2 deletions pysph/base/nnps.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ cdef class NNPS:
##########################################################################
# Data Attributes
##########################################################################
cdef public bint warn # Flag to warn when extending lists
cdef public bint trace # Flag for timing and debugging
cdef public list particles # list of particle arrays
cdef public list pa_wrappers # list of particle array wrappers
cdef public int narrays # Number of particle arrays
Expand All @@ -142,6 +140,7 @@ cdef class NNPS:
cdef public double radius_scale # Radius scale for kernel
cdef IntArray cell_shifts # cell shifts
cdef public int n_cells # number of cells
cdef public bint sort_gids # Sort neighbors by their gids.

##########################################################################
# Member functions
Expand All @@ -155,6 +154,9 @@ cdef class NNPS:
# assumed to be of type unsigned int and local to the NNPS object
cpdef _bin(self, int pa_index, UIntArray indices)

cdef void _sort_neighbors(self, unsigned int* nbrs, size_t length,
unsigned int *gids) nogil

# compute the min and max for the particle coordinates
cdef _compute_bounds(self)

Expand Down

0 comments on commit e848680

Please sign in to comment.