-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.nemo
130 lines (79 loc) · 4.34 KB
/
README.nemo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Ubuntu install instuctions for NEMO - "A Stellar Dynamics Toolbox"
Dependencies:
(On mac hopefully similar with brew)
sudo apt install git gfortran libx11-dev libxt-dev libxext-dev libcairo2-dev build-essential cmake csh
Basic Installation
wget https://teuben.github.io/nemo/install_nemo
chmod +x install_nemo
./install_nemo nemo=$HOME/opt/nemo
(Run the following two commands again if you switch graphics cards because of pgplot)
cd $HOME/opt/nemo/
./configure
(Run again if you start a new session)
source $HOME/opt/nemo/nemo_start.sh
[Optional] Here are some commands you can run to get familiar with the commands
(Make one Galaxy in RMS-units (G=1, M=1, E=-1/2))
mkommod in=$NEMODAT/k7isot.dat out=tmp1 nbody=100 seed=280158
(convert to virial units (preferred but optional))
snapscale in=tmp1 out=tmp1s rscale=2 "vscale=1/sqrt(2.0)"
(Make second galaxy in same manner)
mkommod in=$NEMODAT/k7isot.dat out=tmp2 nbody=100 seed=130159
snapscale in=tmp2 out=tmp2s rscale=2 "vscale=1/sqrt(2.0)"
(Combine galaxy clusters)
snapstack in1=tmp1s in2=tmp2s out=i001.dat deltar=4,0,0 deltav=-1,0,0
(Visualize clusters, needs to be run in ~/opt/nemo because of pgplot)
cd $HOME/opt/nemo
snapplot ~/i001.dat xrange=-5:5 yrange=-5:5
(Run N-body integrator based on Barnes & Hut algorithm)
hackcode1 in=i001.dat out=r001.dat tstop=20 freqout=2 freq=40 eps=0.05 tol=0.7 options=mass,phase,phi > r001.log
(Visualize conservation of energy and center-of-mass motion)
cd $HOME/opt/nemo
snapdiagplot in=~/r001.dat
snapplot in=r001.dat
[Old]
Convert our data format (table) to nemos data format (snapshot, binary)
cd <our_repo>/src/utils/
./data_conversion <init_table_file> <init_snapshot_file>
Simulate with converted data
hackcode1 in=<init_snapshot_file> out=<result_snapshot_file> tstop=10 freqout=10000 freq=10000 eps=0.05 tol=0.0 options=mass,phase,phi > r001.log
Convert result (snapshot) to table
snapprint <result_snapshot_file> options=x,y,z,vx,vy,vz > <result_table_file>
[New]
Create data from our naive program
./bin/naive/sequential/prog -i test/resources/testsets/tab128.txt -n 128 -t 1 -s 0.1
Convert our data format (table) to nemos data format (snapshot, binary)
tabtos test/resources/testsets/tab128.txt test/resources/testsets/tab128.snap block1=mass,pos,vel
Simulate with converted data
nbody0 test/resources/testsets/tab128.snap tab128.snap.out tcrit=1 eta=0.1 deltat=0.1
Convert result (snapshot) to table
snapprint tab128.snap.out options=x,y,z,vx,vy,vz > tab128_nemo.txt.out
[Good results for fig8]
Create data from our naive program
./bin/naive/sequential/prog -i test/resources/testsets/figure8.txt -n 3 -t 10 -s 0.00001
Convert our data format (table) to nemos data format (snapshot, binary)
tabtos test/resources/testsets/figure8.txt test/resources/testsets/figure8.snap block1=mass,pos,vel
Simulate with converted data
hackcode1 in=test/resources/testsets/figure8.snap out=figure8.snap.out nbody=3 tstop=10 freqout=200 freq=10000 tol=0 eps=0 > junk
Convert result (snapshot) to table
snapprint figure8.snap.out options=x,y,z,vx,vy,vz > figure8_nemo.txt.out
<shape>=ball,cusp,shell
<N>=100,500,1000
[Make configuration]
Make configuration using mkconfig
mkconfig out=test/resources/testsets/galaxy<N>_<shape>.snap shape=<shape> nbody=<N> seed=0 zerocm=true
Convert from snap to table
snapprint test/resources/testsets/galaxy<N>_<shape>.snap options=m,x,y,z,vx,vy,vz > test/resources/testsets/galaxy<N>_<shape>.txt
3D Plot (optional)
gnuplot
splot "test/resources/testsets/galaxy<N>_<shape>.txt" u 2:3:4
[Run tests with made configurations]
Run with our sequential code and move to default directory
./bin/naive/sequential/prog -i test/resources/testsets/galaxy<N>_<shape>.txt -n <N> -t 1 -s 0.00001
mv galaxy<N>_<shape>.txt.out test/resources/expected/galaxy<N>_<shape>.txt.out
Run with nemo tool hackcode1
hackcode1 in=test/resources/testsets/galaxy<N>_<shape>.snap out=test/resources/expected/galaxy<N>_<shape>.snap.out nbody=<N> tstop=1 freqout=200 freq=10000 tol=0 eps=0.001 > junk
Convert from snap to tab
snapprint test/resources/expected/galaxy<N>_<shape>.snap.out options=x,y,z,vx,vy,vz > test/resources/expected/galaxy<N>_<shape>_nemo.txt.out
Plot in 3D (optional)
gnuplot
splot "test/resources/expected/galaxy<N>_<shape>_nemo.txt.out", "test/resources/expected/galaxy<N>_<shape>.txt.out"