Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72742255
test_acc.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 16, 20:15
Size
552 B
Mime Type
text/x-python
Expires
Thu, Jul 18, 20:15 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
19100376
Attached To
rPNBODY pNbody
test_acc.py
View Options
from
numarray
import
*
import
SM
import
treelib
from
pNbody
import
*
import
time
eps
=
0.1
# open a model
nb
=
Nbody
(
'disk.dat'
,
ftype
=
'gadget'
)
#nb = nb.selectc(nb.rxyz()<2)
# create a tree object
MyTree
=
nb
.
getTree
()
R
=
arange
(
0
,
200
,
1.0
)
print
len
(
R
)
pos
=
concatenate
((
R
,
zeros
(
len
(
R
)),
zeros
(
len
(
R
))))
pos
.
shape
=
(
3
,
len
(
R
))
pos
=
transpose
(
pos
)
pos
=
pos
.
astype
(
Float32
)
acc
=
MyTree
.
Acceleration
(
pos
,
eps
)
acc
=
acc
.
astype
(
Float32
)
R
=
R
.
astype
(
Float32
)
g
=
SM
.
plot
()
g
.
limits
(
R
,
acc
[:,
0
])
g
.
box
()
g
.
connect
(
R
,
acc
[:,
0
])
g
.
show
()
Event Timeline
Log In to Comment