Commit 85bfccc2 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

more help on falcON

parent dc615dba
Pipeline #1853 failed with stages
in 8 minutes and 30 seconds
## ABOUT
UNSIOTOOLS contains a collection of [unsio](https://projets.lam.fr/projects/unsio) based programs.
You have access to falcON algorithm to compute density and to compute gravity.
You have access to [falcON](https://iopscience.iop.org/article/10.1086/312724/pdf) algorithm to compute density and to compute gravity.
## Installing python wrapper
```
......@@ -14,7 +14,7 @@ pydoc unsiotools.simulations.cfalcon
```
## Usage
In the example below, we load a RAMSES simulation, and compute density on HALO particles
- In the example below, we load a RAMSES simulation, and compute density on HALO particles
```python
import unsio.input as uns_in # unsio reading module
import unsiotools.simulations.cfalcon as falcon
......@@ -39,7 +39,21 @@ ok,rho,hsml=cf.getDensity(pos,mass)
print("Rho=",rho)
```
- In this more simple example, we compute density on random data. Note that data must be in **float32** format
```python
import unsiotools.simulations.cfalcon as falcon
import numpy as np
pos=np.float32(np.random.random_sample((300,)))
mass=np.float32(np.random.random_sample((100,)))
cf=falcon.CFalcon()
ok,rho,hsml=cf.getDensity(pos,mass)
print(ok,rho)
```
## Licence
UNSIOTOOLS is open source and released under the terms of the [CeCILL2 Licence](http://www.cecill.info/licences/Licence_CeCILL_V2-en.html)
......
......@@ -26,8 +26,8 @@ class CFalcon:
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 )
pos : float32 one dimension numpy array ( nbody x 3 )
mass : float32 one dimension numpy array ( nbody )
eps : softening value
G : gravitationnal constant Value
theta : opening angle
......@@ -37,8 +37,8 @@ class CFalcon:
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
acc : float32 one dimension numpy array (nbody x 3) with acceleration values
phi : float32 one dimension numpy array (nbody ) with potential values
"""
# init returns array
......@@ -54,8 +54,8 @@ class CFalcon:
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 )
pos : float32 one dimension numpy array ( nbody x 3 )
mass : float32 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)
......@@ -64,8 +64,8 @@ class CFalcon:
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
rho : float32 one dimension numpy array (nbody) with density values
hsml : float32 one dimension numpy array (nbody) with distance of Kth neighnour
"""
if (ncrit==None):
......
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