# Path: pyparticles/utils/pypart_global.py
# def test_pyopencl():
#     try :
#         import pyopencl
#     except :
#         return False
#     else :
#         return True


import numpy as np
import pyparticles.pset.particles_set as ps
import pyparticles.pset.opencl_context as occ 
import pyparticles.ode.euler_solver as els
import pyparticles.ode.leapfrog_solver as lps
import pyparticles.ode.runge_kutta_solver as rks
import pyparticles.ode.stormer_verlet_solver as svs
import pyparticles.ode.midpoint_solver as mds
import pyparticles.forces.const_force as cf
import pyparticles.forces.drag as dr
import pyparticles.forces.multiple_force as mf
import pyparticles.animation.animated_ogl as aogl
import pyparticles.pset.default_boundary as db
from pyparticles.utils.pypart_global import test_pyopencl

            except :
                print( "Please insert a number! " )
            else :
                fl = False
        
 
    
    pset = ps.ParticlesSet( pcnt , dtype=np.float32 )
    
    pset.M[:] = 0.1
    pset.X[:,2] = 0.7 * np.random.rand( pset.size )
        
    grav = cf.ConstForce( pset.size , dim=pset.dim , u_force=( 0.0 , 0.0 , -10.0 ) )
    
    occx = None
    if test_pyopencl() :
        occx = occ.OpenCLcontext( pset.size , pset.dim , ( occ.OCLC_X | occ.OCLC_V | occ.OCLC_A | occ.OCLC_M ) )
        drag = dr.DragOCL( pset.size , dim=pset.dim , Consts=0.01 , ocl_context=occx )
    else :
        drag = dr.Drag( pset.size , dim=pset.dim , Consts=0.01 )
    
    
    multi = mf.MultipleForce( pset.size , dim=pset.dim )
    
    multi.append_force( grav )
    multi.append_force( drag )
    
    multi.set_masses( pset.M )
    
    #solver = mds.MidpointSolver( multi , pset , dt )

# Path: pyparticles/utils/pypart_global.py
# def test_pyopencl():
#     try :
#         import pyopencl
#     except :
#         return False
#     else :
#         return True


# Path: pyparticles/demo/fountain.py
import numpy as np
import pyparticles.pset.particles_set as ps
import pyparticles.pset.opencl_context as occ 
import pyparticles.ode.euler_solver as els
import pyparticles.ode.leapfrog_solver as lps
import pyparticles.ode.runge_kutta_solver as rks
import pyparticles.ode.stormer_verlet_solver as svs
import pyparticles.ode.midpoint_solver as mds
import pyparticles.forces.const_force as cf
import pyparticles.forces.drag as dr
import pyparticles.forces.multiple_force as mf
import pyparticles.animation.animated_ogl as aogl
import pyparticles.pset.default_boundary as db
from pyparticles.utils.pypart_global import test_pyopencl

            except :
                print( "Please insert a number! " )
            else :
                fl = False
        
 
    
    pset = ps.ParticlesSet( pcnt , dtype=np.float32 )
    
    pset.M[:] = 0.1
    pset.X[:,2] = 0.7 * np.random.rand( pset.size )
        
    grav = cf.ConstForce( pset.size , dim=pset.dim , u_force=( 0.0 , 0.0 , -10.0 ) )
    
    occx = None
    if test_pyopencl() :
        occx = occ.OpenCLcontext( pset.size , pset.dim , ( occ.OCLC_X | occ.OCLC_V | occ.OCLC_A | occ.OCLC_M ) )
        drag = dr.DragOCL( pset.size , dim=pset.dim , Consts=0.01 , ocl_context=occx )
    else :
        drag = dr.Drag( pset.size , dim=pset.dim , Consts=0.01 )
    
    
    multi = mf.MultipleForce( pset.size , dim=pset.dim )
    
    multi.append_force( grav )
    multi.append_force( drag )
    
    multi.set_masses( pset.M )
    
    #solver = mds.MidpointSolver( multi , pset , dt )

    if test_pyopencl() :
