From 44ab293832b4e224d4adea0aa978374735b93ea8 Mon Sep 17 00:00:00 2001 From: Carlisle Wishard Date: Tue, 6 Dec 2022 10:36:12 -0500 Subject: [PATCH] cleaned up Basic_Simulation directory --- examples/Basic_Simulation/cb.in | 7 - .../Basic_Simulation/initial_conditions.ipynb | 190 ---- examples/Basic_Simulation/pl.in | 85 -- examples/Basic_Simulation/read_old_run.ipynb | 853 ------------------ examples/Basic_Simulation/read_old_run.py | 2 - examples/Basic_Simulation/run_from_file.ipynb | 119 --- .../Basic_Simulation/run_simulation.ipynb | 67 -- examples/Basic_Simulation/tp.in | 31 - 8 files changed, 1354 deletions(-) delete mode 100644 examples/Basic_Simulation/cb.in delete mode 100644 examples/Basic_Simulation/initial_conditions.ipynb delete mode 100644 examples/Basic_Simulation/pl.in delete mode 100644 examples/Basic_Simulation/read_old_run.ipynb delete mode 100644 examples/Basic_Simulation/read_old_run.py delete mode 100644 examples/Basic_Simulation/run_from_file.ipynb delete mode 100644 examples/Basic_Simulation/run_simulation.ipynb delete mode 100644 examples/Basic_Simulation/tp.in diff --git a/examples/Basic_Simulation/cb.in b/examples/Basic_Simulation/cb.in deleted file mode 100644 index b2cb85c35..000000000 --- a/examples/Basic_Simulation/cb.in +++ /dev/null @@ -1,7 +0,0 @@ -Sun -39.476926408897626 -0.004650467260962157 -4.7535806948127355e-12 --2.2473967953572827e-18 -0.0 0.0 0.07 -11.209306302144773 -38.759372036774764 82.25088158389266 diff --git a/examples/Basic_Simulation/initial_conditions.ipynb b/examples/Basic_Simulation/initial_conditions.ipynb deleted file mode 100644 index 60581d22a..000000000 --- a/examples/Basic_Simulation/initial_conditions.ipynb +++ /dev/null @@ -1,190 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "2c4f59ea-1251-49f6-af1e-5695d7e25500", - "metadata": {}, - "outputs": [], - "source": [ - "import swiftest\n", - "import numpy as np\n", - "from numpy.random import default_rng\n", - "%env OMP_NUM_THREADS=4" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6054c7ab-c748-4b39-9fee-d8b27326f497", - "metadata": {}, - "outputs": [], - "source": [ - "# Initialize the simulation object as a variable\n", - "sim = swiftest.Simulation(fragmentation=True, minimum_fragment_mass = 2.5e-11, mtiny=2.5e-8)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1c122676-bacb-447c-bc37-5ef8019be0d0", - "metadata": {}, - "outputs": [], - "source": [ - "# Add the modern planets and the Sun using the JPL Horizons Database\n", - "sim.add_solar_system_body([\"Sun\",\"Mercury\",\"Venus\",\"Earth\",\"Mars\",\"Jupiter\",\"Saturn\",\"Uranus\",\"Neptune\",\"Pluto\"])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "97fe9f16-bc2e-443c-856b-7dacb1267f2d", - "metadata": {}, - "outputs": [], - "source": [ - "# Add 5 user-defined massive bodies\n", - "npl = 5\n", - "density_pl = 3000.0 / (sim.param['MU2KG'] / sim.param['DU2M'] ** 3)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "566a742e-3935-484d-9c7a-87310b6aaa3a", - "metadata": {}, - "outputs": [], - "source": [ - "name_pl = [\"MassiveBody_01\", \"MassiveBody_02\", \"MassiveBody_03\", \"MassiveBody_04\", \"MassiveBody_05\"]\n", - "a_pl = default_rng().uniform(0.3, 1.5, npl)\n", - "e_pl = default_rng().uniform(0.0, 0.3, npl)\n", - "inc_pl = default_rng().uniform(0.0, 90, npl)\n", - "capom_pl = default_rng().uniform(0.0, 360.0, npl)\n", - "omega_pl = default_rng().uniform(0.0, 360.0, npl)\n", - "capm_pl = default_rng().uniform(0.0, 360.0, npl)\n", - "GM_pl = (np.array([6e23, 8e23, 1e24, 3e24, 5e24]) / sim.param['MU2KG']) * sim.GU\n", - "R_pl = np.full(npl, (3 * (GM_pl / sim.GU) / (4 * np.pi * density_pl)) ** (1.0 / 3.0))\n", - "Rh_pl = a_pl * ((GM_pl) / (3 * sim.GU)) ** (1.0 / 3.0)\n", - "Ip_pl = np.full((npl,3),0.4,)\n", - "rot_pl = np.zeros((npl,3))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d2c14121-e5b4-45bd-99a7-acde0ee77955", - "metadata": {}, - "outputs": [], - "source": [ - "sim.add_body(name=name_pl, a=a_pl, e=e_pl, inc=inc_pl, capom=capom_pl, omega=omega_pl, capm=capm_pl, Gmass=GM_pl, radius=R_pl, rhill=Rh_pl, Ip=Ip_pl, rot=rot_pl)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b3f979b3-5238-492f-8589-0cf5d9a3c2bc", - "metadata": {}, - "outputs": [], - "source": [ - "# Add 10 user-defined test particles\n", - "ntp = 10" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5777c1bb-8c91-452a-8869-ce6f951b33a3", - "metadata": {}, - "outputs": [], - "source": [ - "name_tp = [\"TestParticle_01\", \"TestParticle_02\", \"TestParticle_03\", \"TestParticle_04\", \"TestParticle_05\", \"TestParticle_06\", \"TestParticle_07\", \"TestParticle_08\", \"TestParticle_09\", \"TestParticle_10\"]\n", - "a_tp = default_rng().uniform(0.3, 1.5, ntp)\n", - "e_tp = default_rng().uniform(0.0, 0.3, ntp)\n", - "inc_tp = default_rng().uniform(0.0, 90, ntp)\n", - "capom_tp = default_rng().uniform(0.0, 360.0, ntp)\n", - "omega_tp = default_rng().uniform(0.0, 360.0, ntp)\n", - "capm_tp = default_rng().uniform(0.0, 360.0, ntp)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8df4bcb7-46a6-402a-b10f-f37c55a0fdee", - "metadata": {}, - "outputs": [], - "source": [ - "sim.add_body(name=name_tp, a=a_tp, e=e_tp, inc=inc_tp, capom=capom_tp, omega=omega_tp, capm=capm_tp)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "135bd3f8-0a56-4d62-b728-f150debc1a76", - "metadata": {}, - "outputs": [], - "source": [ - "# Display the run configuration parameters\n", - "p = sim.get_parameter()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fd30638b-6868-4162-bc05-1011bb255968", - "metadata": {}, - "outputs": [], - "source": [ - "# Run the simulation\n", - "sim.run(tstart=0.0, tstop=1.0e3, dt=0.01, tstep_out=1.0e0, dump_cadence=0)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "02a8911d-3b2c-415c-9290-bf1519a3f5c6", - "metadata": {}, - "outputs": [], - "source": [ - "sim.ic" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5f8d1ac3-5ad0-4b8a-ad9d-1b63486920aa", - "metadata": {}, - "outputs": [], - "source": [ - "sim.data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fb93805d-377b-47d6-a565-c26acd2a7cbc", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python (My debug_env Kernel)", - "language": "python", - "name": "debug_env" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/examples/Basic_Simulation/pl.in b/examples/Basic_Simulation/pl.in deleted file mode 100644 index 215b91f1d..000000000 --- a/examples/Basic_Simulation/pl.in +++ /dev/null @@ -1,85 +0,0 @@ -14 -Mercury 6.553709809565314e-06 -1.6306381826061646e-05 -0.3870985843095394 0.2056234010897001 7.003302508001384 -48.29611837378607 29.20442403952454 338.3394874682879 -0.0 0.0 0.346 -3.573018077015318 -18.380317085416586 34.36143850429876 -Venus 9.663313399581537e-05 -4.0453784346544176e-05 -0.7233297579736101 0.006717605698865438 3.394439273342282 -76.60235891771119 54.96037946082961 200.4789339550648 -0.0 0.0 0.4 -0.17650282045605922 -3.6612475825356214 8.702866268072764 -Earth 0.00012002693582795245 -4.25875607065041e-05 -0.9999904874543223 0.01671400376545858 0.003637862608863003 -175.025172600231 287.9619628812575 114.3482934042427 -0.0 0.0 0.3307 -6.157239621449141 0.057224133705898524 2301.2082528350797 -Mars 1.2739802010675942e-05 -2.2657408050928896e-05 -1.523711925589535 0.09344151133508208 1.847441673557901 -49.4728572124747 286.7379771285891 209.3396773477138 -0.0 0.0 0.3644 -997.9224351226384 -909.5549030011778 1783.3823046046184 -Jupiter 0.037692251088985676 -0.0004673261703049093 -5.2027278008516 0.04824497711637968 1.303631134570075 -100.5192588433081 273.5898402882514 129.5536700659942 -0.0 0.0 0.2756 --80.9864396731672 -2388.0246092955053 5008.722318533006 -Saturn 0.011285899820091273 -0.00038925687730393614 -9.532011952667288 0.05486329870433341 2.487906363280301 -113.6305781676206 339.5467356402391 290.8995806568904 -0.0 0.0 0.22 -441.95954822014636 378.52638822638795 5135.909115928892 -Uranus 0.001723658947826773 -0.00016953449859497232 -19.24498838290236 0.04796174942301296 0.7730102596086205 -74.0125809801658 93.59554912280227 262.8658637277515 -0.0 0.0 0.23 --677.3000258209181 -3008.1099071905787 -836.3013266185699 -Neptune 0.0020336100526728304 -0.00016458790412449367 -30.03895991152209 0.008955570138096731 1.771119354296142 -131.8221159748827 284.4748429674216 308.4513720536233 -0.0 0.0 0.23 -1232.224106980634 -2177.3040821077648 2329.8227878119233 -Pluto 2.924216771029454e-07 -7.943294877391593e-06 -39.36791814672583 0.2487178537481577 17.1705505990969 -110.3314332962701 113.0826635900664 55.11416408345664 -0.0 0.0 0.4 --243.59404988903637 261.28663002814227 -38.57352022187049 -MassiveBody_01 1.1912109366578089e-05 -2.425055692051245e-05 -0.7452368716298337 0.0633011418780484 0.11151363780595558 -203.01823417718037 284.9353898127118 266.79344592519305 -0.4 0.4 0.4 -0.0 0.0 0.0 -MassiveBody_02 1.5882812488770783e-05 -2.6691191565570074e-05 -0.7671203280602826 0.10149029388964753 53.46706656938751 -61.74738152068808 68.20565593722856 271.3352706902475 -0.4 0.4 0.4 -0.0 0.0 0.0 -MassiveBody_03 1.985351561096348e-05 -2.8752214513575297e-05 -1.4698824276418418 0.13621250684495437 23.635498327264845 -38.071905339231236 283.134612455057 250.67457601578352 -0.4 0.4 0.4 -0.0 0.0 0.0 -MassiveBody_04 5.9560546832890444e-05 -4.14678690275904e-05 -0.9741731590760117 0.1519713326893784 20.51335588582416 -350.53780805624825 304.05941264938997 142.62713592644738 -0.4 0.4 0.4 -0.0 0.0 0.0 -MassiveBody_05 9.926757805481742e-05 -4.916559523190238e-05 -0.6633500122731075 0.13550930562584215 10.680323453316653 -328.45970148163457 49.93948991697533 316.2109831817007 -0.4 0.4 0.4 -0.0 0.0 0.0 diff --git a/examples/Basic_Simulation/read_old_run.ipynb b/examples/Basic_Simulation/read_old_run.ipynb deleted file mode 100644 index 0a7459084..000000000 --- a/examples/Basic_Simulation/read_old_run.ipynb +++ /dev/null @@ -1,853 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "86b309f3-d400-4164-88fc-cf56b6cfcf5f", - "metadata": {}, - "outputs": [], - "source": [ - "import swiftest" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "353b2559-83a2-496f-8648-60f6121333a5", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Reading Swiftest file /home/daminton/git_debug/swiftest/examples/Basic_Simulation/simdata/param.in\n", - "\n", - "Creating Dataset from NetCDF file\n", - "Successfully converted 78 output frames.\n", - "Swiftest simulation data stored as xarray DataSet .data\n" - ] - } - ], - "source": [ - "sim = swiftest.Simulation(read_old_output_file=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "c7bceca2-678d-469d-a3a7-06cfa9f29fc0", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
<xarray.Dataset>\n",
-       "Dimensions:          (time: 78, name: 25)\n",
-       "Coordinates:\n",
-       "  * time             (time) float64 0.0 2.0 nan 4.0 nan ... nan 76.0 nan 78.0\n",
-       "  * name             (name) <U32 'Sun' 'Mercury' ... 'TestParticle_10'\n",
-       "Data variables: (12/45)\n",
-       "    id               (name) int64 0 1 2 3 4 5 6 7 8 ... 17 18 19 20 21 22 23 24\n",
-       "    npl              (time) int64 14 14 -2147483647 14 ... 14 -2147483647 14\n",
-       "    ntp              (time) int64 10 10 -2147483647 10 ... 10 -2147483647 10\n",
-       "    nplm             (time) int64 13 13 -2147483647 13 ... 13 -2147483647 13\n",
-       "    particle_type    (name) <U32 'Central Body' ... 'Test Particle'\n",
-       "    status           (name) <U32 'ACTIVE' 'ACTIVE' ... 'ACTIVE' 'ACTIVE'\n",
-       "    ...               ...\n",
-       "    Ip3              (time, name) float64 0.07 0.346 0.4 0.3307 ... nan nan nan\n",
-       "    rotx             (time, name) float64 11.21 3.573 0.1765 ... nan nan nan\n",
-       "    roty             (time, name) float64 -38.76 -18.38 -3.661 ... nan nan nan\n",
-       "    rotz             (time, name) float64 82.25 34.36 8.703 ... nan nan nan\n",
-       "    j2rp2            (time) float64 4.754e-12 4.754e-12 nan ... nan 4.754e-12\n",
-       "    j4rp4            (time) float64 -2.247e-18 -2.247e-18 nan ... nan -2.247e-18
" - ], - "text/plain": [ - "\n", - "Dimensions: (time: 78, name: 25)\n", - "Coordinates:\n", - " * time (time) float64 0.0 2.0 nan 4.0 nan ... nan 76.0 nan 78.0\n", - " * name (name)