Skip to content

Commit

Permalink
nbody lite update
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdonlon committed Mar 1, 2021
1 parent e285b6e commit eeb8097
Show file tree
Hide file tree
Showing 5 changed files with 444 additions and 24 deletions.
16 changes: 14 additions & 2 deletions lite/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ working as of the time you read this)
Usage
======================================================

- Change settings in run.sh and ./bin/for_developers.lua
- Change settings in ./bin/settings.lua
(optional, which settings you change depends on what type
of simulation you are running, and the parameters for that
specific simulation)
specific simulation. The parameters that you can change
are explained in the settings.lua file.)

- Open Terminal in the mwah_nbody_lite folder and run

Expand All @@ -46,4 +47,15 @@ chmod +x run.sh

once before executing the run.sh file if you get an error that
you do not have the necessary permissions to execute run.sh.

======================================================
Manual Body Input
======================================================
Nbody Lite supports the input of a list of bodies with manually
determined positions, velocities, and masses. These files must
be in a specific format (tab separated value, or TSV) with a
simple header.

An example file with the correct formatting is provided in the
./bin folder as "manual_bodies_example.in".

18 changes: 2 additions & 16 deletions lite/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,7 @@
#==========================================================

#This script will run an Nbody simulation based on the given parameters
#below and in the for_developers.lua file (located in the ./bin folder)

#for -i, the parameters are:
# <evolveTime, revTime, rscale_l, light_r_ratio, mass_l, light_mass_ratio>
#optional parameters:
# <... l, b, r, vx, vy, vz, manual_bodies.in>
#the meaning of all of these parameters are provided in for_developers.lua
#NOTE: the manual_bodies file can be provided even the orbital parameters are not.

#valid examples:
# -i 1.0 1.0 0.3 0.2 45 0.1
# -i 1.0 1.0 0.3 0.2 45 0.1 extra_particles.in
# -i 1.0 1.0 0.3 0.2 45 0.1 200.0 30.0 15.0 -50.0 100.0 -75.0
# -i 1.0 1.0 0.3 0.2 45 0.1 200.0 30.0 15.0 -50.0 100.0 -75.0 extra_particles.in
#in the settings.lua file (located in the ./bin folder)

#for info on other flags, you can run:
#cd ./bin
Expand All @@ -29,8 +16,7 @@

cd ./bin
./milkyway_nbody \
-f ./for_developers.lua \
-f ./settings.lua \
-o output.out \
-n 8 -b -P \
-i 1.0 1.0 0.3 0.2 45 0.1 \

12 changes: 6 additions & 6 deletions make_mwah_lite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ then
#get binary file
cp ./build/bin/milkyway_nbody ./mwah_nbody_lite/bin

#get for_developers.lua
cp ./milkywayathome_client/nbody/sample_workunits/for_developers.lua ./mwah_nbody_lite/bin
#get .lua file
cp ./milkywayathome_client/nbody/sample_workunits/settings.lua ./mwah_nbody_lite/bin

#get mwah_lite documentation and make.sh
#get exmaple manual bodies file
cp ./milkywayathome_client/nbody/sample_workunits/manual_bodies_example.in ./mwah_nbody_lite/bin

#get mwah_lite documentation and run.sh
cp -r ./milkywayathome_client/lite/. ./mwah_nbody_lite

echo "Nbody Lite: Nbody Lite successfully built"

fi




22 changes: 22 additions & 0 deletions nbody/sample_workunits/manual_bodies_example.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ignore id x y z vx vy vz m
1 0 127.08255834124016 -55.812479909570804 -30.261553934739133 24.969684547641247 -46.49010910106857 82.94782437879348 8.540595395141278
1 1 63.510272177039454 -6.5938082103703435 -64.14349573393518 14.987472142546457 131.3937750857233 34.22795142512741 8.540595395141278
1 2 155.9829530587446 -14.037250182436134 -58.5227798851518 -14.19124494431037 47.72718132170138 50.04985626302452 8.540595395141278
1 3 -33.563199990439124 -55.631097453607445 -76.00478566557786 -165.28291256307313 -87.60453021943616 -14.457355838567901 8.540595395141278
1 4 -28.880421041955326 -127.71943772871559 -23.606340345322756 81.73889828495882 43.488693948196506 -63.63438128207109 8.540595395141278
1 5 0.2226569039982619 -4.000049097970552 -0.23255256439910305 -175.89182065948364 210.56582268373757 356.83483306433664 8.540595395141278
1 6 -87.01417068349858 -6.351556546236179 -26.54696493274184 -74.64606122413187 -76.62457084487744 183.28404063761923 8.540595395141278
1 7 7.9610491007616355 -70.47614435875853 -35.21569262951858 9.671498498452488 -15.669978023791565 -160.813200590929 8.540595395141278
1 8 -5.65889247600892 25.969646314698807 -17.139586567500462 88.55986971730752 5.757552596035165 3.1171163628844747 8.540595395141278
1 9 23.601178953831184 -6.75043063243215 -22.7824318984131 -25.55127213156222 -34.840821589376795 -90.94984413458963 8.540595395141278
1 10 12.618329999987719 9.956180248924278 5.583753834968731 -58.48149385127235 -15.999106281765677 -206.4557333013213 8.540595395141278
1 11 -15.716885758710573 36.768055310975534 5.527092260858798 193.61342385887272 90.53783889212167 60.61796256114264 8.540595395141278
1 12 -2.885977392563735 2.252432266728683 13.347988611863045 -90.11996171538705 -92.59987675827864 209.8220378766748 8.540595395141278
1 13 -81.05430491542508 -36.280119163969154 -6.274657226861998 33.874617578340995 -70.94973766447394 -34.995390480006094 8.540595395141278
1 14 145.04321179822261 -46.37374919885066 -26.589315120703883 -46.340851520948235 45.35634851598802 11.04282888514187 8.540595395141278
1 15 117.1350337160535 -7.801970930630117 -92.94489212487856 24.591008010800742 -23.05351214802331 50.41096335295902 8.540595395141278
1 16 133.485128481551 30.84707038037095 22.344774389549553 0.444124453958467 15.316810074731062 77.34205397623657 8.540595395141278
1 17 -3.644829629200809 9.50867789245069 -1.1233745156283703 -11.708732781268186 136.16765825032394 14.632731867113051 8.540595395141278
1 18 16.696738126724856 12.217586701607042 55.18887595756164 67.68367613387306 122.31332596248525 -82.14528983992406 8.540595395141278
1 19 43.21969296970576 -36.82862470634365 -176.27471531711782 1.9746011243447221 -3.083632441430211 -0.03915638304439306 8.540595395141278
1 20 36.91324595485429 68.86104531413915 -96.85954798597979 39.46966845810581 39.95906704911454 -134.0414120058831 8.540595395141278
Loading

0 comments on commit eeb8097

Please sign in to comment.