the serveur will be in maintenance mode Thursday February 25 from 7:00 to 12:00 ( git and registry will be unreacheable)

Commit 0218fc48 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

fix py3 regresssion, add doc to falcON

parent d19d57a1
......@@ -11,12 +11,36 @@ except ImportError:
class CFalcon:
"""methods imported from FalcON engine"""
"""
methods imported from FalcON engine
see help on:
- getGravity
- getDensity
"""
def __init__(self):
#print ("simname = ", simname)
pass
def getGravity(self,pos,mass,eps,G=1.0,theta=0.6,kernel_type=1,ncrit=6):
"""
Compute acceleration and potential using falcON algorithm (see https://iopscience.iop.org/article/10.1086/312724/pdf)
Arguments:
pos : one dimension numpy array ( nbody x 3 )
mass : one dimension numpy array ( nbody )
eps : softening value
G : gravitationnal constant Value
theta : opening angle
kernel_type : kernel type
ncrit : #bodies separation criteria
Return : ok,acc,phi
ok : boolean True if success
acc : one dimension numpy array (nbody x 3) with acceleration values
phi : one dimension numpy array (nbody ) with potential values
"""
# init returns array
acc = np.zeros(pos.size,'f') # acc is 3D !!
phi = np.zeros(mass.size,'f')
......@@ -26,9 +50,26 @@ class CFalcon:
return ok,acc,phi
def getDensity(self,pos,mass,K=32,N=1,method=0,ncrit=None):
'compute density, method=0 (ferrers =1 (hackdens)'
"""
Compute density using falcON algorithm (see https://iopscience.iop.org/article/10.1086/312724/pdf)
Arguments:
pos : one dimension numpy array ( nbody x 3 )
mass : one dimension numpy array ( nbody )
K : #neighnours (default 32)
N : order of Ferrers's kernel
method : 0 based on hackdens, 1 on ferrers (default 0)
ncrit : #bodies separation criteria (default max(1,K/4))
Return : ok,rho,hsml
ok : boolean True if success
rho : one dimension numpy array (nbody) with density values
hsml : one dimension numpy array (nbody) with distance of Kth neighnour
"""
if (ncrit==None):
ncrit=max(1,K/4)
ncrit=int(max(1,K/4))
# init returns arrays
rho=np.zeros(mass.size,'f')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment