pysph run| LAPTOP LAPTOP=> pysph run
1. flow_past_cylinder_2d
A wind-tunnel flow past a cylinders. (20 minutes)
2. two_blocks
Two square blocks of water colliding with each other. (20 seconds)
3. hydrostatic_tank
Hydrostatic tank example. (2 minutes)
4. couette
Couette flow using the transport velocity formulation (30 seconds).
5. rayleigh_taylor
Rayleigh-Taylor instability problem. (16 hours)
6. cavity
Lid driven cavity using the Transport Velocity formulation. (10 minutes)
.
.
.
.
.
.
34. solid_mech.impact3d
High-velocity impact of an Steel projectile on an Aluminium plate"""
35. solid_mech.impact
High-velocity impact of an Steel projectile on an Aluminium plate"""
36. solid_mech.post_process_oscillating_plate
ort numpy as np
37. solid_mech.oscillating_plate
ort numpy as np
38. solid_mech.rings
Colliding Elastic Balls. (10 minutes)
39. solid_mech.oscillating_plate_gtvf
ort numpy as np
40. solid_mech.taylor_bar
Taylor bar example with SPH. (5 minutes)
Enter example number you wish to run: 13
Enter additional arguments (leave blank to skip):
--------------------------------------------------------------------------------
Running example pysph.examples.dam_break_2d.
Information for example: pysph.examples.dam_break_2d
Two-dimensional dam break over a dry bed. (30 minutes)
The case is described in "State of the art classical SPH for free surface
flows", Moncho Gomez-Gesteira, Benedict D Rogers, Robert A, Dalrymple and Alex
J.C Crespo, Journal of Hydraulic Research, Vol 48, Extra Issue (2010), pp
6-27. DOI:10.1080/00221686.2010.9641242
Using h = 0.039000
2D dam break with 2211 fluid, 1624 boundary particles
Generating output in /home/dinesh/dam_break_2d_output
----------------------------------------------------------------------
No of particles:
fluid: 2211
boundary: 1624
Total: 3835
----------------------------------------------------------------------
Setup took: 13.14449 secs
25%|█████ | 3.4kit | 6.1e-01s [00:23.1<01:10.8 | 0.007s/it]
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/50569a38-c764-442c-8c17-e1078c2a126f%40googlegroups.com.
Hi Dinesh,You asked me for the dam tank 2d and 3d, but the 3d requires 14 hours
Le dim. 2 févr. 2020 à 13:11, MOHAMED EL AMINE LAKHNICHI <lakhnichi.mohamedelamine.mp...@gmail.com> a écrit :
--
Le dimanche 19 janvier 2020 16:11:40 UTC+1, MOHAMED EL AMINE LAKHNICHI a écrit :I need to simulate the interaction between water(incompressible) with a solid structre(simple floater) in order to evaluate the energy transport between the two systems.I've just known about Pysph so i don't know from where I should start. If you can help please !
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.
python setup.py install
cd pysph
$LAPTOP LAPTOP=> ls
appveyor.yml docs old_examples requirements-test.txt shippable.yml
build LICENSE.txt pysph requirements.txt starcluster
CHANGES.rst Makefile PySPH.egg-info setup.cfg tox.ini
docker MANIFEST.in README.rst setup.py
$ LAPTOP LAPTOP=> cd pysph/examples
$ LAPTOP LAPTOP=> ls
cavity.py gas_dynamics run.py
couette.py ghia_cavity_data.py run.pyc
cube.py hydrostatic_tank.py solid_mech
dam_break_2d.py __init__.py spheric
dam_break_3d.py __init__.pyc sphysics
db_exp_data.py lattice_cylinders.py surface_tension
_db_geometry.py periodic_cylinders.py taylor_green_output
dem poiseuille.py taylor_green.py
elliptical_drop_no_scheme.py __pycache__ tests
elliptical_drop.py rayleigh_taylor.py trivial_inlet_outlet.py
elliptical_drop_simple.py rigid_body two_blocks.py
flow_past_cylinder_2d.py rigid_fluid
python dam_break_2d.py
python dam_break_2d.py --openmp
python dam_break_2d.py --opencl
python dam_break_2d.py --openmp --scheme wcsph
Hi Dinesh,
Thank you for taking the time to organize this tutorial. I have also been following the steps and was able to complete the first task with the 2d dam.
Next in the second task I did:
$ git clone https://github.com/pypr/pysph.git
$ cd pysph
$ cd pysph/examples
$ python dam_break_2d.py
and seem to be running into the same error that Mohamed is:
When I navigate to the elliptical_drop_output folder I see this:
I am able to open comparison.png, but I cannot open any of the other files, using for example,
$ pysph view elliptical_drop_300.hdf5
or even using like in task 1 just,
$ psych view elliptical_drop_output
How should we be visualizing this output?
I am also a little bit confused by the fact that it seems we have created two different pysph folders, one created in part 2 with the address:
/Users/EnriquedelCastillo/pysph/
and one from part 1:
/tmp/pysph/
Yet here the elliptical_drop_output folder was in the address from part 1
/tmp/pysph/pysph/examples/elliptical_drop_output
whereas
/Users/EnriquedelCastillo/pysph/pysph/examples/elliptical_drop_output
does not exist. I was wondering why the elliptical_drop_output file is going to this address, or if maybe I have done something wrong in the installation steps perhaps?
Thank you!
pip instal -r requirements.txt
python setup.py develop
python setup.py install
Hi Dinesh,
Yes I had installed it with pip and then followed the installation steps using git from the github repository itself, but I had not uninstalled the pip PySPH installation before doing that.
I have now uninstalled the pip PySPH and deleted the pysph folder from the git cloning, and redone the installation from the repository using git and
pip install -r requirements.txt
as well as
python setup.py develop
as you suggested, although I had already installed the “Core dependencies” in the PySPH documentation as well as those in the “Installing the dependencies on Mac OS X” and “Using Anaconda” sections of the document.
Now however, when I try running $python dam_break_2d.py
I receive a segmentation fault error after 38% progress is reached:
(Image 1)
I also tried $python setup.py install, but achieved the same result.
For $python dam_break_2d.py —openmp
I get the subsequent error:
(Image 2)
Thanks for the help.
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/375861e6-d280-4d2c-b860-92a3a8f55561%40googlegroups.com.
-- Prabhu Ramachandran http://www.aero.iitb.ac.in/~prabhu
$ python dam_break_2d.py --no-openmp --scheme aha
$ python dam_break_2d.py --no-openmp --scheme edac
$ python dam_break_2d.py --no-openmp --scheme sisph
$ python dam_break_2d.py --no-openmp --scheme gtvf
$ python poiseuille.py --no-openmp --alpha .5
$ python poiseuille.py --no-openmp --tdamp 2
$ python couette.py --no-openmp --nnps sh
$ python couette.py --no-openmp --zoltan-weights
$ python elliptical_drop.py --iisph --tensile-correction
among others, encountering no issues.
Is it possible to proceed onto the next steps without openmp (hopefully temporarily, while I continue to try to fix it)?
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/375861e6-d280-4d2c-b860-92a3a8f55561%40googlegroups.com.
Hi,I am unfortunately still unable to use openmp, and get the same error as before. I did already have gcc installed, and I had followed the steps in the pysph instructions using brew. $ brew install gcc $ export CC=gcc-9 $ export CXX=g++-9. Is this all that was needed for the gcc installation for MacOS? If I check my gcc version by typing g++ and pressing tab twice, I see g++-9 displayed.
With regards to the dam_break_2d, I tried out some of the different schemes and they work with no openmp for example:$ python dam_break_2d.py --no-openmp --scheme aha
$ python dam_break_2d.py --no-openmp --scheme edac
$ python dam_break_2d.py --no-openmp --scheme sisph
$ python dam_break_2d.py --no-openmp --scheme gtvf
Do you have any openmp libraries (or gcc) inside your conda environment? If so this could be a problem as it is possible that this library is being linked. One option is to not export CXX and try (that should pick up any local GCC). For example try this:
$ conda list | grep openmp
and if this returns something or the other then it is possible
that something is not linked correctly. If this is the case,
perhaps forget the brew installation and try with the conda
version of gcc and see if that works.
If you really want to get to the bottom of this, you can look for
the extension module that is compiled (see your error message),
for example on my system I have this:
$ otool -L ~/.pysph/source/py3.6-macosx-10.6-x86_64/m_189951b83f420e1adcb301ba3c31024c.cpython-36m-darwin.so
[...]
/usr/local/opt/gcc/lib/gcc/8/libgomp.1.dylib (compatibility
version 2.0.0, current version 2.0.0)
/usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version
1.0.0, current version 1.0.0)
As you can see, it links to the libgomp from brew and not
anywhere else.
Finally, if you do not use the --openmp argument, it will NOT use openmp and everything ought to work without using OpenMP.
cheers,
Prabhu
Generating output in /Users/EnriquedelCastillo/pysph/pysph/examples/ed_output
********************************************************************************
ERROR
running build_ext
cythoning /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.pyx to /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.cpp
building 'm_eca5403f6fd2d9e0c9b4331cfa431069' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/EnriquedelCastillo/.conda/envs/py3/include -arch x86_64 -I/Users/EnriquedelCastillo/.conda/envs/py3/include -arch x86_64 -I/Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/numpy/core/include -I/Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/PySPH-1.0b1.dev0-py3.5-macosx-10.6-x86_64.egg/pysph/base -I/usr/local/include -I/Users/EnriquedelCastillo/.conda/envs/py3/include/python3.5m -c /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.cpp -o /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/build/temp.macosx-10.6-x86_64-3.5/Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.o
/Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
warning: /Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/PySPH-1.0b1.dev0-py3.5-macosx-10.6-x86_64.egg/pysph/base/nnps_base.pxd:25:13: 'INT_MAX' redeclared
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from /Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.cpp:613:
In file included from /Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
/Users/EnriquedelCastillo/.conda/envs/py3/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
/Users/EnriquedelCastillo/.pysph/source/py3.5-macosx-10.6-x86_64/m_eca5403f6fd2d9e0c9b4331cfa431069.cpp:615:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
2 warnings and 1 error generated.
Looks like these (link) tutorials cover basics of PySPH. Before going forward, I want you guys to complete those tutorials. I will explain what not covered in those ipynotebooks. Finally we will implement discrete element method on our own in `PySPH` and run hopper flow.
I will explain how equations work (this is not covered in notebooks) in the next part. I have a simple assignment to start with. Consider a n-body problem ( I hope you know how a n body problem works, if not please ask, I will try to post more resources). Rosetta code has python implementation here. Look at the `_resolveCollisions` function and try to write your own `resolveCollision` (It is not much different) and post here. This will be a good start to understand the upcoming next part. Next part will come tonight after some one completes the above tasks.
Hi,
Sorry for the delay in replying. I've been having some issues again running some of the files in the tutorial. For example after I checked my solutions with the ed.py and the ed_no_scheme.py, I saved these files in the same examples folder and tried running them using$ python3 ed.pyfor example, and received the following error and warnings which are confusing me a bit.
dam_break.py. "advanced example" at the bottom of tutorial 2, I don't think it is in the solution folder. In any case it is Ok, I am ready to continue with the Hopper flow task.Hi,
Thank you Prabhu, that was exactly the issue! I have now fixed it.Dinesh -Here is my script for the interaction loop:from __future__ import print_functionfrom pysph.base.particle_array import ParticleArrayfrom matplotlib import pyplot as pltpa = ParticleArray(name='fluid', x=[1,2,3,4,5,6,7,8,9,0], y=[.3,5,1,8,5,3,1,3,3,5],m=[0.1,2,1,3,4,5,6,7,2,4],k=[0.1,.3,.6,.35,.43,.5,.6,.7,.21,.9] )plt.scatter(pa.x, pa.y, marker='.')plt.xlabel('x')plt.ylabel('y')force_list = [] #list of the total forces for each particle i (Tf_i) to be printed
for i in range(len(pa.m)):Tf_i = 0 #total force on each particle ifor j in range(len(pa.m)):#exclude case where i=j, cannot have force on particle produced by itselfif j!=i:k_i = pa.k[i]m_i = pa.m[i]m_j = pa.m[j]rij = ((pa.x[j]-pa.x[i])**2)+((pa.y[j]-pa.y[i])**2)**.5rij_2 = rij**2 # I assumed underscore 2 means squared.f_ij = k_i*m_i*m_j/(rij_2)Tf_i = Tf_i + f_ijforce_list.append(Tf_i)print(force_list)I had seen the solution folder within the tutorial which you put in the link, but I meant to ask about thedam_break.py. "advanced example" at the bottom of tutorial 2, I don't think it is in the solution folder. In any case it is Ok, I am ready to continue with the
Hopper flow task.
import numpy as np
from pysph.base.utils import get_particle_array
from pysph.solver.application import Application
from pysph.sph.scheme import WCSPHScheme
from pysph.tools.geometry import get_2d_tank
rho = 1.0
g = 9.81
container_height = 4.0
container_width = 4.0
nboundary_layers = 2
dx = 0.025
class DamBreak(Application):
def create_particles(self):
x, y = np.mgrid[0:1:dx, 0:2:dx]
xt, yt = get_2d_tank(dx=dx, length=container_width,
height=container_height, base_center=[2, 0],
num_layers=nboundary_layers)
h = 1.3*dx
m = rho*dx*dx
fluid = get_particle_array(
name='fluid', x=x, y=y, rho=rho,
m=m, h=h
)
boundary = get_particle_array(
name='boundary', x=xt, y=yt, rho=rho,
m=m, h=h
)
self.scheme.setup_properties([fluid, boundary])
return [fluid, boundary]
def create_scheme(self):
s = WCSPHScheme(
['fluid'], ['boundary'], dim=2, rho0=1.0, c0=1400,
h0=1.3*0.025, hdx=1.3, gamma=7.0, gy=-g, alpha=0.1, beta=0.0
)
dt = 5e-6
tf = 2.5
s.configure_solver(
dt=dt, tf=tf,
)
return s
if __name__ == '__main__':
app = DamBreak(fname='dam_break')
app.run()
Hi,
I have fixed the script as suggested. I noted that by leaving the array as Tf_i = [] , this produces values of 0, and makes the array the length of the other particlearray property arrays.from __future__ import print_functionfrom pysph.base.particle_array import ParticleArrayfrom matplotlib import pyplot as pltpa = ParticleArray(name='fluid', x=[1,2,3,4,5,6,7,8,9,0], y=[.3,5,1,8,5,3,1,3,3,5],m=[0.1,2,1,3,4,5,6,7,2,4],k=[0.1,.3,.6,.35,.43,.5,.6,.7,.21,.9], Tf_i = [])
x = np.linspace(0., 1., 10)
pa = get_particle_array(x=x, h=1., m=1.) # this function is in pysph.base.utils
# what do you think the following will have?
pa.m # will this be an array or a float
pa.h # same question here
# Question 2: similarly
pa = get_particle_array(x=x, h=1., m=[1.]) # this function is in pysph.base.utils
# what do you think the following will have?
pa.m # will this be an array or a float Question (2a)
pa.h # same question here Question (2b)
# Question 3: similarly
pa = get_particle_array(x=x, h=1., m=[1., 2.]) # this function is in pysph.base.utils
# what do you think the following will have?
pa.m # will this be an array or a float Question (3a)
pa.h # same question here Question (3b)
x = np.linspace(0., 1., 10)
pa = get_particle_array(x=x, h=1., m=1.)
pa.add_property('tf_i') # We now know that this is initialized with 10 length array (cyarray) with 0 values
# but I want to change the value to 10. now.
# Question 4
pa.tf_i = 10. # What happens here (question 4a)
pa.tf_i[:] = 10. # What happens here (question 4b)plt.scatter(pa.x, pa.y, marker='.')plt.xlabel('x')plt.ylabel('y')
for i in range(len(pa.m)):
# we don't need this line
# Tf_i_temp = 0 # total force on each particle i
for j in range(len(pa.m)):#exclude case where i=j, cannot have force on particle produced by itselfif j!=i:k_i = pa.k[i]m_i = pa.m[i]m_j = pa.m[j]rij = ((pa.x[j]-pa.x[i])**2)+((pa.y[j]-pa.y[i])**2)**.5rij_2 = rij**2f_ij = k_i*m_i*m_j/(rij_2)
pa.Tf_i[i] _+= f_ij# pa.Tf_i[i] = Tf_i_temp
The behavior of the fluid is quite different from the dam_break_2d.py example however, and looks physically impossible especially along the left boundary. I put some pictures attached. Did I make some mistake, or is it related to the scheme used? (Vmagnitude is plotted).Thanks!
Hi,Q1a) array Q2a) array Q3a) error, size of array was specified and is incompatibleQ1b) array Q2b) array Q3b) error, same.Q4a) errorQ4b) all values of length 10 array changed to 10.0Below is my code for the two particle arrays problem, and I attached the figures as pictures. The particles seem to congregate around x=0, which seems a bit unusual.
from pysph.base.particle_array import ParticleArrayfrom matplotlib import pyplot as plt
bodies1 = ParticleArray(name='fluid', x=[1,2,3,4,5,6,7,8,9,0], y=[.3,5,1,8,5,3,1,3,3,5],m=[0.1,2,1,3,4,5,6,7,2,4],k=[0.1,.3,.6,.35,.43,.5,.6,.7,.21,.9])bodies2 = ParticleArray(name='fluid', x=[.5,2,4,3,.3,.56,2,7,.9,3], y=[3,7,2,.4,3,3,.1,8,9,4.5],m=[.3,.5,.2,1,5,4,.44,.32,.11,.9],k=[0.14,.22,.5,.25,.88,.94,.32,.17,.421,.24])
bodies1.add_property('tfx',type='double')bodies1.add_property('tfy',type='double')bodies1.add_property('vx',type='double')bodies1.add_property('vy',type='double')bodies1.add_property('ax',type='double')bodies1.add_property('ay',type='double')bodies2.add_property('tfx',type='double')bodies2.add_property('tfy',type='double')bodies2.add_property('vx',type='double')bodies2.add_property('vy',type='double')bodies2.add_property('ax',type='double')bodies2.add_property('ay',type='double')
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/7763cceb-6c00-4122-b054-5c616f092dd6%40googlegroups.com.
Where `pa` is your particle array. This will create a folder in the current directory. (Assignment) To visualize this file do `pysph view learn_running_equation_output`.
Then execute the `SummationDensity` equation on our particle array as follows
sph_eval = evaluate([pa], eqns, kernel, dim)
Should be
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/3d34e7bf-2ba7-47c7-adcb-60e7aae9d2bd%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/5c0e9a85-8135-4a13-9c98-e965e85c60ba%40googlegroups.com.
Traceback (most recent call last):
File "density.py", line 25, in <module>
dict(t=0, dt=0.1, count=0), detailed_output=True, only_real=False)
TypeError: dump() takes at most 4 arguments (5 given)
while if I try to run it in a jupyter notebook (where I only have python2.7)
I receive the warning:
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
and the error:
error: 'ios' file not found #include "ios"
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/5c0e9a85-8135-4a13-9c98-e965e85c60ba%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/16466983-127a-44e3-ab70-708da78ac138%40googlegroups.com.
I still get the same error unfortunately. Note I had to change the makedirs() to not take the exist_ok argument as I was also getting this error before.
makedirs() got an unexpected keyword argument 'exist_ok'
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/16466983-127a-44e3-ab70-708da78ac138%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/e43ed226-97bf-49ae-a5a2-27451ba7a7f4%40googlegroups.com.
Specifically read this section,
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/e43ed226-97bf-49ae-a5a2-27451ba7a7f4%40googlegroups.com.
"""A cube bouncing inside a box. (5 seconds)
This is used to test the rigid body equations.
"""
import numpy as np
from pysph.base.kernels import CubicSpline
from pysph.base.utils import get_particle_array_rigid_body
from pysph.sph.equation import Group
from pysph.sph.integrator import EPECIntegrator
from pysph.solver.application import Application
from pysph.solver.solver import Solver
from pysph.sph.rigid_body import (BodyForce, RigidBodyCollision,
RigidBodyMoments, RigidBodyMotion,
RK2StepRigidBody)
dim = 3
dt = 5e-3
tf = 5.0
gz = -9.81
hdx = 1.0
dx = dy = 0.02
rho0 = 10.0
class BouncingCube(Application):
def create_particles(self):
nx, ny, nz = 10, 10, 10
dx = 1.0 / (nx - 1)
x, y, z = np.mgrid[0:1:nx * 1j, 0:1:ny * 1j, 0:1:nz * 1j]
x = x.flat
y = y.flat
z = (z - 1).flat
m = np.ones_like(x) * dx * dx * rho0
h = np.ones_like(x) * hdx * dx
# radius of each sphere constituting in cube
rad_s = np.ones_like(x) * dx
body = get_particle_array_rigid_body(name='body', x=x, y=y, z=z, h=h,
m=m, rad_s=rad_s)
body.vc[0] = -5.0
body.vc[2] = -5.0
# Create the tank.
nx, ny, nz = 40, 40, 40
dx = 1.0 / (nx - 1)
xmin, xmax, ymin, ymax, zmin, zmax = -2, 2, -2, 2, -2, 2
x, y, z = np.mgrid[xmin:xmax:nx * 1j, ymin:ymax:ny * 1j, zmin:zmax:nz *
1j]
interior = ((x < 1.8) & (x > -1.8)) & ((y < 1.8) & (y > -1.8)) & (
(z > -1.8) & (z <= 2))
tank = np.logical_not(interior)
x = x[tank].flat
y = y[tank].flat
z = z[tank].flat
m = np.ones_like(x) * dx * dx * rho0
h = np.ones_like(x) * hdx * dx
# radius of each sphere constituting in cube
rad_s = np.ones_like(x) * dx
tank = get_particle_array_rigid_body(name='tank', x=x, y=y, z=z, h=h,
m=m, rad_s=rad_s)
tank.total_mass[0] = np.sum(m)
return [body, tank]
def create_solver(self):
kernel = CubicSpline(dim=dim)
integrator = EPECIntegrator(body=RK2StepRigidBody())
solver = Solver(kernel=kernel, dim=dim, integrator=integrator, dt=dt,
tf=tf, adaptive_timestep=False)
solver.set_print_freq(10)
return solver
def create_equations(self):
equations = [
Group(equations=[
BodyForce(dest='body', sources=None, gz=gz),
RigidBodyCollision(dest='body', sources=['tank'], kn=1e4, en=1)
]),
Group(equations=[RigidBodyMoments(dest='body', sources=None)]),
Group(equations=[RigidBodyMotion(dest='body', sources=None)]),
]
return equations
if __name__ == '__main__':
app = BouncingCube()
app.run()
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/466ba586-6e65-4277-b746-68a2184c7235%40googlegroups.com.
ERROR
running build_ext
fatal error: 'ios' file not found
#include "ios"
and the warnings:
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
#warning "Using deprecated NumPy API, disable it with " \
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border
Ok, I understand this example. The only issue is when I try to run it, I receive the same error I was getting before,ERROR
running build_ext
fatal error: 'ios' file not found
#include "ios"
and the warnings:
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
#warning "Using deprecated NumPy API, disable it with " \
Again, it is likely because it is not finding the right
compiler. On a jupyter notebook you will need to set the CXX env
var (see here:
https://stackoverflow.com/questions/37890898/how-to-set-env-variable-in-jupyter-notebook).
There are many ways of doing this and some may work and some may
not. Sorry but jupyter notebooks do make some of this a bit more
complex. Regardless, I am not sure why clang is not installed
properly with the c++ libraries? Have you installed xcode?
Prabhu
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/1ad96895-cd7b-423a-9b4e-a29ed9c40e67%40googlegroups.com.
import numpy as np
from pysph.base.kernels import CubicSpline
from pysph.base.utils import get_particle_array_rigid_body
from pysph.sph.equation import Group
from pysph.sph.integrator import EPECIntegrator
from pysph.solver.application import Application
from pysph.solver.solver import Solver
from pysph.sph.rigid_body import (BodyForce, RigidBodyCollision,
RigidBodyMoments, RigidBodyMotion,
RK2StepRigidBody)
dim = 3
dt = 5e-3
tf = 1.0
gz = -9.81
hdx = 1.0
dx = dy = 0.02
rho0 = 10.0
class TWOcube(Application):
def create_particles(self):
nx, ny, nz = 10, 10, 10
dx = 1.0 / (nx - 1)
x, y, z = np.mgrid[0:1:nx * 1j, 0:1:ny * 1j, 0:1:nz * 1j]
x1, y1, z1 = np.mgrid[.5:1.5:nx * 1j, .5:1.5:ny * 1j, .5:1.5:nz * 1j]
x2, y2, z2 = np.mgrid[.5:1.5:nx * 1j, .5:1.5:ny * 1j, .5:1.5:nz * 1j]
x = x.flat
y = y.flat
z = (z - 1).flat
x1 = x1.flat
y1 = y1.flat
z1 = (z1).flat
x2 = x2.flat
y2 = y2.flat
z2 = (z2 - 1.2).flat
m = np.ones_like(x) * dx * dx * rho0
h = np.ones_like(x) * hdx * dx
# radius of each sphere constituting in cube
rad_s = np.ones_like(x) * dx
body = get_particle_array_rigid_body(name='body', x=x, y=y, z=z, h=h,
m=m, rad_s=rad_s)
body1 = get_particle_array_rigid_body(name='body1', x=x1, y=y1, z=z1, h=h,
m=m, rad_s=rad_s)
body2 = get_particle_array_rigid_body(name='body2', x=x2, y=y2, z=z2, h=h,
m=m, rad_s=rad_s)
# Create the tank.
nx, ny, nz = 40, 40, 40
dx = 1.0 / (nx - 1)
xmin, xmax, ymin, ymax, zmin, zmax = -2, 2, -2, 2, -2, 2
x, y, z = np.mgrid[xmin:xmax:nx * 1j, ymin:ymax:ny * 1j, zmin:zmax:nz *
1j]
interior = ((x < 1.8) & (x > -1.8)) & ((y < 1.8) & (y > -1.8)) & (
(z > -1.8) & (z <= 2))
tank = np.logical_not(interior)
x = x[tank].flat
y = y[tank].flat
z = z[tank].flat
m = np.ones_like(x) * dx * dx * rho0
h = np.ones_like(x) * hdx * dx
# radius of each sphere constituting in cube
rad_s = np.ones_like(x) * dx
tank = get_particle_array_rigid_body(name='tank', x=x, y=y, z=z, h=h,
m=m, rad_s=rad_s)
tank.total_mass[0] = np.sum(m)
return [body2, body, body1, tank]
def create_solver(self):
kernel = CubicSpline(dim=dim)
integrator = EPECIntegrator(body=RK2StepRigidBody(), body1=RK2StepRigidBody(), body2=RK2StepRigidBody())
solver = Solver(kernel=kernel, dim=dim, integrator=integrator, dt=dt,
tf=tf, adaptive_timestep=False)
solver.set_print_freq(10)
return solver
def create_equations(self):
equations = [
Group(equations=[
BodyForce(dest='body', sources=None, gz=gz),
RigidBodyCollision(dest='body', sources=['tank', 'body1', 'body2'], kn=1e4, en=1)
]),
Group(equations=[
BodyForce(dest='body1', sources=None, gz=gz),
RigidBodyCollision(dest='body1', sources=['tank', 'body', 'body2'], kn=1e4, en=1)
]),
Group(equations=[
BodyForce(dest='body2', sources=None, gz=gz),
RigidBodyCollision(dest='body2', sources=['tank', 'body1', 'body'], kn=1e4, en=1)
]),
Group(equations=[RigidBodyMoments(dest='body', sources=None)]),
Group(equations=[RigidBodyMotion(dest='body', sources=None)]),
Group(equations=[RigidBodyMoments(dest='body1', sources=None)]),
Group(equations=[RigidBodyMotion(dest='body1', sources=None)]),
Group(equations=[RigidBodyMoments(dest='body2', sources=None)]),
Group(equations=[RigidBodyMotion(dest='body2', sources=None)]),
]
return equations
if __name__ == '__main__':
app = TWOcube()
app.run()
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/86e2b801-914d-4007-ab27-43ee1762f646%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/86e2b801-914d-4007-ab27-43ee1762f646%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/4251d389-7f9a-4969-af21-d096162e5cce%40googlegroups.com.
RuntimeError: ERROR: LinkedListNNPS requires too many cells (268588224).
Was it expected to take so long to run?
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/4251d389-7f9a-4969-af21-d096162e5cce%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/76e0ffa0-5dad-4050-8564-fc4a38a998fb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/76e0ffa0-5dad-4050-8564-fc4a38a998fb%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/6ccce229-4f7b-435e-85b0-c9364b08f263%40googlegroups.com.
dam_break_2d.info dam_break_2d_16000.hdf5 dam_break_2d_3700.hdf5
dam_break_2d.log dam_break_2d_16100.hdf5 dam_break_2d_3800.hdf5
dam_break_2d_0.hdf5 dam_break_2d_16200.hdf5 dam_break_2d_3900.hdf5
dam_break_2d_100.hdf5 dam_break_2d_16300.hdf5 dam_break_2d_400.hdf5
dam_break_2d_1000.hdf5 dam_break_2d_16400.hdf5 dam_break_2d_4000.hdf5
dam_break_2d_10000.hdf5 dam_break_2d_16500.hdf5 dam_break_2d_4100.hdf5
dam_break_2d_10100.hdf5 dam_break_2d_16600.hdf5 dam_break_2d_4200.hdf5
dam_break_2d_10200.hdf5 dam_break_2d_16700.hdf5 dam_break_2d_4300.hdf5
dam_break_2d_10280.hdf5 dam_break_2d_16800.hdf5 dam_break_2d_4400.hdf5
dam_break_2d_10300.hdf5 dam_break_2d_16900.hdf5 dam_break_2d_4500.hdf5
dam_break_2d_10400.hdf5 dam_break_2d_1700.hdf5 dam_break_2d_4600.hdf5
dam_break_2d_10500.hdf5 dam_break_2d_17000.hdf5 dam_break_2d_4700.hdf5
dam_break_2d_10600.hdf5 dam_break_2d_17100.hdf5 dam_break_2d_4800.hdf5
dam_break_2d_10700.hdf5 dam_break_2d_17200.hdf5 dam_break_2d_4900.hdf5
dam_break_2d_10800.hdf5 dam_break_2d_17300.hdf5 dam_break_2d_500.hdf5
dam_break_2d_10900.hdf5 dam_break_2d_17400.hdf5 dam_break_2d_5000.hdf5
dam_break_2d_1100.hdf5 dam_break_2d_17500.hdf5 dam_break_2d_5100.hdf5
dam_break_2d_11000.hdf5 dam_break_2d_17600.hdf5 dam_break_2d_5140.hdf5
dam_break_2d_11100.hdf5 dam_break_2d_17700.hdf5 dam_break_2d_5200.hdf5
dam_break_2d_11200.hdf5 dam_break_2d_17800.hdf5 dam_break_2d_5300.hdf5
dam_break_2d_11300.hdf5 dam_break_2d_17900.hdf5 dam_break_2d_5400.hdf5
dam_break_2d_11400.hdf5 dam_break_2d_1800.hdf5 dam_break_2d_5500.hdf5
dam_break_2d_11500.hdf5 dam_break_2d_18000.hdf5 dam_break_2d_5600.hdf5
dam_break_2d_11600.hdf5 dam_break_2d_18100.hdf5 dam_break_2d_5700.hdf5
dam_break_2d_11700.hdf5 dam_break_2d_18200.hdf5 dam_break_2d_5800.hdf5
dam_break_2d_11800.hdf5 dam_break_2d_18300.hdf5 dam_break_2d_5900.hdf5
dam_break_2d_11900.hdf5 dam_break_2d_18400.hdf5 dam_break_2d_600.hdf5
dam_break_2d_1200.hdf5 dam_break_2d_18500.hdf5 dam_break_2d_6000.hdf5
dam_break_2d_12000.hdf5 dam_break_2d_18600.hdf5 dam_break_2d_6100.hdf5
dam_break_2d_12100.hdf5 dam_break_2d_18700.hdf5 dam_break_2d_6200.hdf5
dam_break_2d_12200.hdf5 dam_break_2d_18800.hdf5 dam_break_2d_6300.hdf5
dam_break_2d_12300.hdf5 dam_break_2d_18900.hdf5 dam_break_2d_6400.hdf5
dam_break_2d_12400.hdf5 dam_break_2d_1900.hdf5 dam_break_2d_6500.hdf5
dam_break_2d_12500.hdf5 dam_break_2d_19000.hdf5 dam_break_2d_6600.hdf5
dam_break_2d_12600.hdf5 dam_break_2d_19100.hdf5 dam_break_2d_6700.hdf5
dam_break_2d_12700.hdf5 dam_break_2d_19200.hdf5 dam_break_2d_6800.hdf5
dam_break_2d_12800.hdf5 dam_break_2d_19300.hdf5 dam_break_2d_6900.hdf5
dam_break_2d_12850.hdf5 dam_break_2d_19400.hdf5 dam_break_2d_700.hdf5
dam_break_2d_12900.hdf5 dam_break_2d_19500.hdf5 dam_break_2d_7000.hdf5
dam_break_2d_1300.hdf5 dam_break_2d_19600.hdf5 dam_break_2d_7100.hdf5
dam_break_2d_13000.hdf5 dam_break_2d_19700.hdf5 dam_break_2d_7200.hdf5
dam_break_2d_13100.hdf5 dam_break_2d_19800.hdf5 dam_break_2d_7300.hdf5
dam_break_2d_13200.hdf5 dam_break_2d_19900.hdf5 dam_break_2d_7400.hdf5
dam_break_2d_13300.hdf5 dam_break_2d_200.hdf5 dam_break_2d_7500.hdf5
dam_break_2d_13400.hdf5 dam_break_2d_2000.hdf5 dam_break_2d_7600.hdf5
dam_break_2d_13500.hdf5 dam_break_2d_20000.hdf5 dam_break_2d_7700.hdf5
dam_break_2d_13600.hdf5 dam_break_2d_20100.hdf5 dam_break_2d_7710.hdf5
dam_break_2d_13700.hdf5 dam_break_2d_20200.hdf5 dam_break_2d_7800.hdf5
dam_break_2d_13800.hdf5 dam_break_2d_20300.hdf5 dam_break_2d_7900.hdf5
dam_break_2d_13900.hdf5 dam_break_2d_20400.hdf5 dam_break_2d_800.hdf5
dam_break_2d_1400.hdf5 dam_break_2d_20500.hdf5 dam_break_2d_8000.hdf5
dam_break_2d_14000.hdf5 dam_break_2d_20600.hdf5 dam_break_2d_8100.hdf5
dam_break_2d_14100.hdf5 dam_break_2d_20700.hdf5 dam_break_2d_8200.hdf5
dam_break_2d_14200.hdf5 dam_break_2d_20800.hdf5 dam_break_2d_8300.hdf5
dam_break_2d_14300.hdf5 dam_break_2d_20900.hdf5 dam_break_2d_8400.hdf5
dam_break_2d_14400.hdf5 dam_break_2d_2100.hdf5 dam_break_2d_8500.hdf5
dam_break_2d_14500.hdf5 dam_break_2d_21000.hdf5 dam_break_2d_8600.hdf5
dam_break_2d_14600.hdf5 dam_break_2d_2200.hdf5 dam_break_2d_8700.hdf5
dam_break_2d_14700.hdf5 dam_break_2d_2300.hdf5 dam_break_2d_8800.hdf5
dam_break_2d_14800.hdf5 dam_break_2d_2400.hdf5 dam_break_2d_8900.hdf5
dam_break_2d_14900.hdf5 dam_break_2d_2500.hdf5 dam_break_2d_900.hdf5
dam_break_2d_1500.hdf5 dam_break_2d_2600.hdf5 dam_break_2d_9000.hdf5
dam_break_2d_15000.hdf5 dam_break_2d_2700.hdf5 dam_break_2d_9100.hdf5
dam_break_2d_15100.hdf5 dam_break_2d_2800.hdf5 dam_break_2d_9200.hdf5
dam_break_2d_15200.hdf5 dam_break_2d_2900.hdf5 dam_break_2d_9300.hdf5
dam_break_2d_15300.hdf5 dam_break_2d_300.hdf5 dam_break_2d_9400.hdf5
dam_break_2d_15400.hdf5 dam_break_2d_3000.hdf5 dam_break_2d_9500.hdf5
dam_break_2d_15500.hdf5 dam_break_2d_3100.hdf5 dam_break_2d_9600.hdf5
dam_break_2d_15600.hdf5 dam_break_2d_3200.hdf5 dam_break_2d_9700.hdf5
dam_break_2d_15700.hdf5 dam_break_2d_3300.hdf5 dam_break_2d_9800.hdf5
dam_break_2d_15800.hdf5 dam_break_2d_3400.hdf5 dam_break_2d_9900.hdf5
dam_break_2d_15900.hdf5 dam_break_2d_3500.hdf5 mayavi_config.py
dam_break_2d_1600.hdf5 dam_break_2d_3600.hdf5
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/6ccce229-4f7b-435e-85b0-c9364b08f263%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/7ae080d4-3ac5-40e4-8036-20a9bc84872e%40googlegroups.com.