Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 840-unit-test-testtimeline-fails
  • 875-wendland-c6-missing-neighbour-contributions
  • 887-code-does-not-compile-with-parmetis-installed-locally-but-without-metis
  • CubeTest
  • FS_Del
  • GEARRT_Iliev1
  • GEARRT_Iliev3
  • GEARRT_Iliev4
  • GEARRT_Iliev5
  • GEARRT_Iliev5-fixed-nr-subcycles
  • GEARRT_Iliev7
  • GEARRT_Iliev_static
  • GEARRT_Ivanova
  • GEARRT_fixed_nr_subcycles
  • GEARRT_injection_tests_Iliev0
  • GPU_swift
  • GrackleCoolingUpdates2
  • Lambda-T-table
  • MAGMA2
  • MAGMA2_matthieu
  • MHD_FS
  • MHD_FS_TESTs
  • MHD_FS_VP_AdvectGauge
  • MHD_Orestis
  • MHD_canvas
  • MHD_canvas_RF_128
  • MHD_canvas_RF_growth_rate
  • MHD_canvas_RobertsFlow
  • MHD_canvas_SPH_errors
  • MHD_canvas_matthieu
  • MHD_canvas_nickishch
  • MHD_canvas_nickishch_Lorentz_force_test
  • MHD_canvas_nickishch_track_everything
  • MHD_canvas_sid
  • OAK/CPAW_updates
  • OAK/LoopAdvectionTest
  • OAK/adaptive_divv
  • OAK/kinetic_dedner
  • REMIX_cosmo
  • RT_dualc
  • RT_recombination_radiation
  • RT_test_mladen
  • SIDM
  • SIDM_wKDSDK
  • SNdust
  • SPHM1RT_CosmologicalStromgrenSphere
  • SPHM1RT_bincheck
  • SPHM1RT_smoothedRT
  • TangoSIDM
  • TestPropagation3D
  • Test_fixedhProb
  • activate_fewer_comms
  • active_h_max_optimization
  • adaptive_softening_Lieuwe
  • add_2p5D
  • add_black_holes_checks
  • adding_sidm_to_master
  • agn_crksph
  • agn_crksph_subtask_speedup
  • amd-optimization
  • arm_vec
  • automatic_tasks
  • better_ray_RNG
  • black_holes_accreted_angular_momenta_from_gas
  • burkert-potential
  • c11
  • c11_atomics_copy
  • cancel_all_sorts
  • cell_exchange_improvements
  • cell_types
  • cherry-pick-cd1c39e0
  • comm_tasks_are_special
  • conduction_velocities
  • cpp-fixes
  • cuda_test
  • darwin/adaptive_softening
  • darwin/gear_chemistry_fluxes
  • darwin/gear_mechanical_feedback
  • darwin/gear_preSN_feedback
  • darwin/gear_radiation
  • darwin/simulations
  • darwin/sink_formation_proba
  • darwin/sink_mpi
  • darwin/sink_mpi_physics
  • dead-time-stats
  • derijcke_cooling
  • dev_cms
  • do-not-activate-empty-star-pairs
  • domain_zoom_nometis
  • drift_flag_debug_check
  • driven_turbulence
  • driven_turbulence_forcings
  • engineering
  • eos_updates
  • evrard_disc
  • expand_fof_2022
  • explict_bkg_cdim
  • fewer_gpart_comms
  • fewer_star_comms
  • fewer_timestep_comms_no_empty_pairs
  • v0.0
  • v0.1
  • v0.1.0-pre
  • v0.2.0
  • v0.3.0
  • v0.4.0
  • v0.5.0
  • v0.6.0
  • v0.7.0
  • v0.8.0
  • v0.8.1
  • v0.8.2
  • v0.8.3
  • v0.8.4
  • v0.8.5
  • v0.9.0
  • v1.0.0
  • v2025.01
  • v2025.04
119 results

Target

Select target project
  • dc-oman1/swiftsim
  • swift/swiftsim
  • pdraper/swiftsim
  • tkchan/swiftsim
  • dc-turn5/swiftsim
5 results
Select Git revision
  • GPU_swift
  • Nifty-Clutser-Solution
  • Rsend_repart
  • Subsize
  • active_h_max
  • add-convergence-scripts
  • add_dehnen_aly_density_correction
  • add_particles_debug
  • advanced_opening_criteria
  • arm_vec
  • assume_for_gcc
  • atomic_read_writes
  • back_of_the_queue
  • c11_atomics
  • c11_atomics_copy
  • c11_standard
  • cache_time_bin
  • comm_tasks_are_special
  • cpp
  • cuda_test
  • dumper-thread
  • eagle-cooling-improvements
  • energy_logger
  • engineering
  • evrard_disc
  • ewald_correction
  • extra_EAGLE_EoS
  • feedback_after_hydro
  • gear
  • gear_feedback
  • gear_star_formation
  • generic_cache
  • genetic_partitioning2
  • gizmo
  • gizmo_mfv_entropy
  • gpart_assignment_speedup
  • gravity_testing
  • hydro_validation
  • isolated_galaxy_update
  • ivanova
  • ivanova-dirty
  • kahip
  • local_part
  • logger_index_file
  • logger_restart
  • logger_skip_fields
  • logger_write_hdf5
  • master
  • memalign-test
  • more_task_info
  • move_configure_to_m4
  • mpi-one-thread
  • mpi-packed-parts
  • mpi-send-subparts
  • mpi-send-subparts-vector
  • mpi-subparts-vector-grav
  • mpi-testsome
  • mpi-threads
  • multi_phase_bh
  • new_cpp
  • non-periodic-repart
  • non-periodic-repart-update
  • numa_alloc
  • numa_awareness
  • ontheflyimages
  • optimized_entropy_floor
  • parallel_compression
  • paranoid
  • planetary_ideal_gas
  • pyswiftsim
  • recurse_less_in_sort
  • recursive_star_ghosts
  • remove_long_long
  • reorder_rebuild
  • reverted_grav_depth_logic
  • reweight-fitted-costs
  • reweight-scaled-costs
  • sampled_stellar_evolution
  • scheduler_determinism
  • scotch
  • search-window-tests
  • signal-handler-dump
  • simba-stellar-feedback
  • skeleton
  • smarter_sends
  • snipes_data
  • sort-soa
  • spiral_potential
  • star_formation
  • stellar_disc_example
  • stf_output_dirs
  • streaming_io
  • subcell_sort
  • thread-dump-extract-waiters
  • threadpool_rmapper
  • timestep_limiter_update
  • top_level_cells
  • traphic
  • update-gravity
  • update_brute_force_checks
  • v0.0
  • v0.1
  • v0.1.0-pre
  • v0.2.0
  • v0.3.0
  • v0.4.0
  • v0.5.0
  • v0.6.0
  • v0.7.0
  • v0.8.0
  • v0.8.1
  • v0.8.2
  • v0.8.3
  • v0.8.4
114 results
Show changes
Showing
with 1250 additions and 352 deletions
......@@ -6,11 +6,10 @@ The cosmology is taken from Planck 2015.
The initial conditions have been cleaned to contain only the required
fields. The ICs have been created for Gadget and the positions and box
size are hence expressed in h-full units (e.g. box size of 32 / h Mpc).
size are hence expressed in h-full units (e.g. box size of 3.4 / h Mpc).
Similarly, the peculiar velocitites contain an extra sqrt(a) factor.
We will use SWIFT to cancel the h- and a-factors from the ICs. Gas
particles will be generated at startup.
We will use SWIFT to cancel the h- and a-factors from the ICs.
MD5 check-sum of the ICS:
9aafe154438478ed435e88664c1c5dba zoom_in.hdf5
#!/bin/bash
wget https://virgodb.cosma.dur.ac.uk/swift-webstorage/FeedbackTables/POPIIsw.h5
#!/bin/bash
wget https://virgodb.cosma.dur.ac.uk/swift-webstorage/CoolingTables/CloudyData_UVB=HM2012.h5
#!/bin/bash
wget https://obswww.unige.ch/~lhausamm/swift/IC/ZoomIn/zoom_in.hdf5
wget https://virgodb.cosma.dur.ac.uk/swift-webstorage/ICs/ZoomIn/h050.hdf5
#!/bin/bash
# wget https://obswww.unige.ch/~lhausamm/swift/ZoomIC/h177_final.hdf5
wget https://obswww.unige.ch/~lhausamm/swift/ZoomIC/h050_final.hdf5
#!/bin/bash
# Generate the initial conditions if they are not present.
if [ ! -e zoom_in.hdf5 ]
then
if [ ! -e h050.hdf5 ]
then
echo "Fetching initial conditions for the zoom in example..."
./getIC.sh
fi
../../swift --feedback --cosmology --self-gravity --hydro --stars --threads=8 zoom_in.yml 2>&1 | tee output.log
# Get the Grackle cooling table
if [ ! -e CloudyData_UVB=HM2012.h5 ]
then
echo "Fetching the Cloudy tables required by Grackle..."
./getGrackleCoolingTable.sh
fi
if [ ! -e POPIIsw.h5 ]
then
echo "Fetching the chemistry tables..."
./getChemistryTable.sh
fi
../../../swift --cooling --feedback --cosmology --limiter --sync --self-gravity --hydro --stars --star-formation --threads=8 zoom_in.yml 2>&1 | tee output.log
# Scale Factor
0.0141
0.0146484375
0.0156250000
0.0166015625
0.0175781250
0.0185546875
0.0195312500
0.0205078125
0.0214843750
0.0224609375
0.0234375000
0.0244140625
0.0253906250
0.0263671875
0.0273437500
0.0283203125
0.0292968750
0.0302734375
0.0312500000
0.0322265625
0.0332031250
0.0341796875
0.0351562500
0.0361328125
0.0371093750
0.0380859375
0.0390625000
0.0400390625
0.0410156250
0.0419921875
0.0429687500
0.0439453125
0.0449218750
0.0458984375
0.0468750000
0.0478515625
0.0488281250
0.0498046875
0.0507812500
0.0517578125
0.0527343750
0.0537109375
0.0546875000
0.0556640625
0.0566406250
0.0576171875
0.0585937500
0.0595703125
0.0605468750
0.0615234375
0.0625000000
0.0634765625
0.0644531250
0.0654296875
0.0664062500
0.0673828125
0.0683593750
0.0693359375
0.0703125000
0.0712890625
0.0722656250
0.0732421875
0.0742187500
0.0751953125
0.0761718750
0.0771484375
0.0781250000
0.0791015625
0.0800781250
0.0810546875
0.0820312500
0.0830078125
0.0839843750
0.0849609375
0.0859375000
0.0869140625
0.0878906250
0.0888671875
0.0898437500
0.0908203125
0.0917968750
0.0927734375
0.0937500000
0.0947265625
0.0957031250
0.0966796875
0.0976562500
0.0986328125
0.0996093750
0.1005859375
0.1015625000
0.1025390625
0.1035156250
0.1044921875
0.1054687500
0.1064453125
0.1074218750
0.1083984375
0.1093750000
0.1103515625
0.1113281250
0.1123046875
0.1132812500
0.1142578125
0.1152343750
0.1162109375
0.1171875000
0.1181640625
0.1191406250
0.1201171875
0.1210937500
0.1220703125
0.1230468750
0.1240234375
0.1250000000
0.1259765625
0.1269531250
0.1279296875
0.1289062500
0.1298828125
0.1308593750
0.1318359375
0.1328125000
0.1337890625
0.1347656250
0.1357421875
0.1367187500
0.1376953125
0.1386718750
0.1396484375
0.1406250000
0.1416015625
0.1425781250
0.1435546875
0.1445312500
0.1455078125
0.1464843750
0.1474609375
0.1484375000
0.1494140625
0.1503906250
0.1513671875
0.1523437500
0.1533203125
0.1542968750
0.1552734375
0.1562500000
0.1572265625
0.1582031250
0.1591796875
0.1601562500
0.1611328125
0.1621093750
0.1630859375
0.1640625000
0.1650390625
0.1660156250
0.1669921875
0.1679687500
0.1689453125
0.1699218750
0.1708984375
0.1718750000
0.1728515625
0.1738281250
0.1748046875
0.1757812500
0.1767578125
0.1777343750
0.1787109375
0.1796875000
0.1806640625
0.1816406250
0.1826171875
0.1835937500
0.1845703125
0.1855468750
0.1865234375
0.1875000000
0.1884765625
0.1894531250
0.1904296875
0.1914062500
0.1923828125
0.1933593750
0.1943359375
0.1953125000
0.1962890625
0.1972656250
0.1982421875
0.1992187500
0.2001953125
0.2011718750
0.2021484375
0.2031250000
0.2041015625
0.2050781250
0.2060546875
0.2070312500
0.2080078125
0.2089843750
0.2099609375
0.2109375000
0.2119140625
0.2128906250
0.2138671875
0.2148437500
0.2158203125
0.2167968750
0.2177734375
0.2187500000
0.2197265625
0.2207031250
0.2216796875
0.2226562500
0.2236328125
0.2246093750
0.2255859375
0.2265625000
0.2275390625
0.2285156250
0.2294921875
0.2304687500
0.2314453125
0.2324218750
0.2333984375
0.2343750000
0.2353515625
0.2363281250
0.2373046875
0.2382812500
0.2392578125
0.2402343750
0.2412109375
0.2421875000
0.2431640625
0.2441406250
0.2451171875
0.2460937500
0.2470703125
0.2480468750
0.2490234375
0.2500000000
0.2509765625
0.2519531250
0.2529296875
0.2539062500
0.2548828125
0.2558593750
0.2568359375
0.2578125000
0.2587890625
0.2597656250
0.2607421875
0.2617187500
0.2626953125
0.2636718750
0.2646484375
0.2656250000
0.2666015625
0.2675781250
0.2685546875
0.2695312500
0.2705078125
0.2714843750
0.2724609375
0.2734375000
0.2744140625
0.2753906250
0.2763671875
0.2773437500
0.2783203125
0.2792968750
0.2802734375
0.2812500000
0.2822265625
0.2832031250
0.2841796875
0.2851562500
0.2861328125
0.2871093750
0.2880859375
0.2890625000
0.2900390625
0.2910156250
0.2919921875
0.2929687500
0.2939453125
0.2949218750
0.2958984375
0.2968750000
0.2978515625
0.2988281250
0.2998046875
0.3007812500
0.3017578125
0.3027343750
0.3037109375
0.3046875000
0.3056640625
0.3066406250
0.3076171875
0.3085937500
0.3095703125
0.3105468750
0.3115234375
0.3125000000
0.3134765625
0.3144531250
0.3154296875
0.3164062500
0.3173828125
0.3183593750
0.3193359375
0.3203125000
0.3212890625
0.3222656250
0.3232421875
0.3242187500
0.3251953125
0.3261718750
0.3271484375
0.3281250000
0.3291015625
0.3300781250
0.3310546875
0.3320312500
0.3330078125
0.3339843750
0.3349609375
0.3359375000
0.3369140625
0.3378906250
0.3388671875
0.3398437500
0.3408203125
0.3417968750
0.3427734375
0.3437500000
0.3447265625
0.3457031250
0.3466796875
0.3476562500
0.3486328125
0.3496093750
0.3505859375
0.3515625000
0.3525390625
0.3535156250
0.3544921875
0.3554687500
0.3564453125
0.3574218750
0.3583984375
0.3593750000
0.3603515625
0.3613281250
0.3623046875
0.3632812500
0.3642578125
0.3652343750
0.3662109375
0.3671875000
0.3681640625
0.3691406250
0.3701171875
0.3710937500
0.3720703125
0.3730468750
0.3740234375
0.3750000000
0.3759765625
0.3769531250
0.3779296875
0.3789062500
0.3798828125
0.3808593750
0.3818359375
0.3828125000
0.3837890625
0.3847656250
0.3857421875
0.3867187500
0.3876953125
0.3886718750
0.3896484375
0.3906250000
0.3916015625
0.3925781250
0.3935546875
0.3945312500
0.3955078125
0.3964843750
0.3974609375
0.3984375000
0.3994140625
0.4003906250
0.4013671875
0.4023437500
0.4033203125
0.4042968750
0.4052734375
0.4062500000
0.4072265625
0.4082031250
0.4091796875
0.4101562500
0.4111328125
0.4121093750
0.4130859375
0.4140625000
0.4150390625
0.4160156250
0.4169921875
0.4179687500
0.4189453125
0.4199218750
0.4208984375
0.4218750000
0.4228515625
0.4238281250
0.4248046875
0.4257812500
0.4267578125
0.4277343750
0.4287109375
0.4296875000
0.4306640625
0.4316406250
0.4326171875
0.4335937500
0.4345703125
0.4355468750
0.4365234375
0.4375000000
0.4384765625
0.4394531250
0.4404296875
0.4414062500
0.4423828125
0.4433593750
0.4443359375
0.4453125000
0.4462890625
0.4472656250
0.4482421875
0.4492187500
0.4501953125
0.4511718750
0.4521484375
0.4531250000
0.4541015625
0.4550781250
0.4560546875
0.4570312500
0.4580078125
0.4589843750
0.4599609375
0.4609375000
0.4619140625
0.4628906250
0.4638671875
0.4648437500
0.4658203125
0.4667968750
0.4677734375
0.4687500000
0.4697265625
0.4707031250
0.4716796875
0.4726562500
0.4736328125
0.4746093750
0.4755859375
0.4765625000
0.4775390625
0.4785156250
0.4794921875
0.4804687500
0.4814453125
0.4824218750
0.4833984375
0.4843750000
0.4853515625
0.4863281250
0.4873046875
0.4882812500
0.4892578125
0.4902343750
0.4912109375
0.4921875000
0.4931640625
0.4941406250
0.4951171875
0.4960937500
0.4970703125
0.4980468750
0.4990234375
0.5000000000
0.5009765625
0.5019531250
0.5029296875
0.5039062500
0.5048828125
0.5058593750
0.5068359375
0.5078125000
0.5087890625
0.5097656250
0.5107421875
0.5117187500
0.5126953125
0.5136718750
0.5146484375
0.5156250000
0.5166015625
0.5175781250
0.5185546875
0.5195312500
0.5205078125
0.5214843750
0.5224609375
0.5234375000
0.5244140625
0.5253906250
0.5263671875
0.5273437500
0.5283203125
0.5292968750
0.5302734375
0.5312500000
0.5322265625
0.5332031250
0.5341796875
0.5351562500
0.5361328125
0.5371093750
0.5380859375
0.5390625000
0.5400390625
0.5410156250
0.5419921875
0.5429687500
0.5439453125
0.5449218750
0.5458984375
0.5468750000
0.5478515625
0.5488281250
0.5498046875
0.5507812500
0.5517578125
0.5527343750
0.5537109375
0.5546875000
0.5556640625
0.5566406250
0.5576171875
0.5585937500
0.5595703125
0.5605468750
0.5615234375
0.5625000000
0.5634765625
0.5644531250
0.5654296875
0.5664062500
0.5673828125
0.5683593750
0.5693359375
0.5703125000
0.5712890625
0.5722656250
0.5732421875
0.5742187500
0.5751953125
0.5761718750
0.5771484375
0.5781250000
0.5791015625
0.5800781250
0.5810546875
0.5820312500
0.5830078125
0.5839843750
0.5849609375
0.5859375000
0.5869140625
0.5878906250
0.5888671875
0.5898437500
0.5908203125
0.5917968750
0.5927734375
0.5937500000
0.5947265625
0.5957031250
0.5966796875
0.5976562500
0.5986328125
0.5996093750
0.6005859375
0.6015625000
0.6025390625
0.6035156250
0.6044921875
0.6054687500
0.6064453125
0.6074218750
0.6083984375
0.6093750000
0.6103515625
0.6113281250
0.6123046875
0.6132812500
0.6142578125
0.6152343750
0.6162109375
0.6171875000
0.6181640625
0.6191406250
0.6201171875
0.6210937500
0.6220703125
0.6230468750
0.6240234375
0.6250000000
0.6259765625
0.6269531250
0.6279296875
0.6289062500
0.6298828125
0.6308593750
0.6318359375
0.6328125000
0.6337890625
0.6347656250
0.6357421875
0.6367187500
0.6376953125
0.6386718750
0.6396484375
0.6406250000
0.6416015625
0.6425781250
0.6435546875
0.6445312500
0.6455078125
0.6464843750
0.6474609375
0.6484375000
0.6494140625
0.6503906250
0.6513671875
0.6523437500
0.6533203125
0.6542968750
0.6552734375
0.6562500000
0.6572265625
0.6582031250
0.6591796875
0.6601562500
0.6611328125
0.6621093750
0.6630859375
0.6640625000
0.6650390625
0.6660156250
0.6669921875
0.6679687500
0.6689453125
0.6699218750
0.6708984375
0.6718750000
0.6728515625
0.6738281250
0.6748046875
0.6757812500
0.6767578125
0.6777343750
0.6787109375
0.6796875000
0.6806640625
0.6816406250
0.6826171875
0.6835937500
0.6845703125
0.6855468750
0.6865234375
0.6875000000
0.6884765625
0.6894531250
0.6904296875
0.6914062500
0.6923828125
0.6933593750
0.6943359375
0.6953125000
0.6962890625
0.6972656250
0.6982421875
0.6992187500
0.7001953125
0.7011718750
0.7021484375
0.7031250000
0.7041015625
0.7050781250
0.7060546875
0.7070312500
0.7080078125
0.7089843750
0.7099609375
0.7109375000
0.7119140625
0.7128906250
0.7138671875
0.7148437500
0.7158203125
0.7167968750
0.7177734375
0.7187500000
0.7197265625
0.7207031250
0.7216796875
0.7226562500
0.7236328125
0.7246093750
0.7255859375
0.7265625000
0.7275390625
0.7285156250
0.7294921875
0.7304687500
0.7314453125
0.7324218750
0.7333984375
0.7343750000
0.7353515625
0.7363281250
0.7373046875
0.7382812500
0.7392578125
0.7402343750
0.7412109375
0.7421875000
0.7431640625
0.7441406250
0.7451171875
0.7460937500
0.7470703125
0.7480468750
0.7490234375
0.7500000000
0.7509765625
0.7519531250
0.7529296875
0.7539062500
0.7548828125
0.7558593750
0.7568359375
0.7578125000
0.7587890625
0.7597656250
0.7607421875
0.7617187500
0.7626953125
0.7636718750
0.7646484375
0.7656250000
0.7666015625
0.7675781250
0.7685546875
0.7695312500
0.7705078125
0.7714843750
0.7724609375
0.7734375000
0.7744140625
0.7753906250
0.7763671875
0.7773437500
0.7783203125
0.7792968750
0.7802734375
0.7812500000
0.7822265625
0.7832031250
0.7841796875
0.7851562500
0.7861328125
0.7871093750
0.7880859375
0.7890625000
0.7900390625
0.7910156250
0.7919921875
0.7929687500
0.7939453125
0.7949218750
0.7958984375
0.7968750000
0.7978515625
0.7988281250
0.7998046875
0.8007812500
0.8017578125
0.8027343750
0.8037109375
0.8046875000
0.8056640625
0.8066406250
0.8076171875
0.8085937500
0.8095703125
0.8105468750
0.8115234375
0.8125000000
0.8134765625
0.8144531250
0.8154296875
0.8164062500
0.8173828125
0.8183593750
0.8193359375
0.8203125000
0.8212890625
0.8222656250
0.8232421875
0.8242187500
0.8251953125
0.8261718750
0.8271484375
0.8281250000
0.8291015625
0.8300781250
0.8310546875
0.8320312500
0.8330078125
0.8339843750
0.8349609375
0.8359375000
0.8369140625
0.8378906250
0.8388671875
0.8398437500
0.8408203125
0.8417968750
0.8427734375
0.8437500000
0.8447265625
0.8457031250
0.8466796875
0.8476562500
0.8486328125
0.8496093750
0.8505859375
0.8515625000
0.8525390625
0.8535156250
0.8544921875
0.8554687500
0.8564453125
0.8574218750
0.8583984375
0.8593750000
0.8603515625
0.8613281250
0.8623046875
0.8632812500
0.8642578125
0.8652343750
0.8662109375
0.8671875000
0.8681640625
0.8691406250
0.8701171875
0.8710937500
0.8720703125
0.8730468750
0.8740234375
0.8750000000
0.8759765625
0.8769531250
0.8779296875
0.8789062500
0.8798828125
0.8808593750
0.8818359375
0.8828125000
0.8837890625
0.8847656250
0.8857421875
0.8867187500
0.8876953125
0.8886718750
0.8896484375
0.8906250000
0.8916015625
0.8925781250
0.8935546875
0.8945312500
0.8955078125
0.8964843750
0.8974609375
0.8984375000
0.8994140625
0.9003906250
0.9013671875
0.9023437500
0.9033203125
0.9042968750
0.9052734375
0.9062500000
0.9072265625
0.9082031250
0.9091796875
0.9101562500
0.9111328125
0.9121093750
0.9130859375
0.9140625000
0.9150390625
0.9160156250
0.9169921875
0.9179687500
0.9189453125
0.9199218750
0.9208984375
0.9218750000
0.9228515625
0.9238281250
0.9248046875
0.9257812500
0.9267578125
0.9277343750
0.9287109375
0.9296875000
0.9306640625
0.9316406250
0.9326171875
0.9335937500
0.9345703125
0.9355468750
0.9365234375
0.9375000000
0.9384765625
0.9394531250
0.9404296875
0.9414062500
0.9423828125
0.9433593750
0.9443359375
0.9453125000
0.9462890625
0.9472656250
0.9482421875
0.9492187500
0.9501953125
0.9511718750
0.9521484375
0.9531250000
0.9541015625
0.9550781250
0.9560546875
0.9570312500
0.9580078125
0.9589843750
0.9599609375
0.9609375000
0.9619140625
0.9628906250
0.9638671875
0.9648437500
0.9658203125
0.9667968750
0.9677734375
0.9687500000
0.9697265625
0.9707031250
0.9716796875
0.9726562500
0.9736328125
0.9746093750
0.9755859375
0.9765625000
0.9775390625
0.9785156250
0.9794921875
0.9804687500
0.9814453125
0.9824218750
0.9833984375
0.9843750000
0.9853515625
0.9863281250
0.9873046875
0.9882812500
0.9892578125
0.9902343750
0.9912109375
0.9921875000
0.9931640625
0.9941406250
0.9951171875
0.9960937500
0.9970703125
0.9980468750
0.9990234375
1.0000000000
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
UnitMass_in_cgs: 1.98841e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758e21 # kpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
Scheduler:
max_top_level_cells: 16
cell_sub_size_self_grav: 2048
cell_subdepth_diff_grav: 2
cell_split_size: 200
cell_extra_gparts: 100 # (Optional) Number of spare gparts per top-level allocated at rebuild time for on-the-fly creation.
# Parameters governing the time integration
TimeIntegration:
dt_min: 1e-16 # The minimal time-step size of the simulation (in internal units).
dt_max: 0.1 # The maximal time-step size of the simulation (in internal units).
max_dt_RMS_factor: 0.25 # (Optional) Dimensionless factor for the maximal displacement allowed based on the RMS velocities.
dt_RMS_use_gas_only: 1
# Cosmological parameters
Cosmology:
h: 0.673 # Reduced Hubble constant
a_begin: 0.9873046739 # Initial scale-factor of the simulation
a_begin: 0.014084507042253521 # Initial scale-factor of the simulation
a_end: 1.0 # Final scale factor of the simulation
Omega_m: 0.315 # Matter density parameter
Omega_cdm: 0.2664 # Cold Dark Matter density parameter
Omega_lambda: 0.685 # Dark-energy density parameter
Omega_b: 0.0486 # Baryon density parameter
Scheduler:
max_top_level_cells: 8
# Parameters governing the time integration
TimeIntegration:
time_begin: 0. # The starting time of the simulation (in internal units).
time_end: 1e-2 # The end time of the simulation (in internal units).
dt_min: 1e-10 # The minimal time-step size of the simulation (in internal units).
dt_max: 1e-3 # The maximal time-step size of the simulation (in internal units).
Omega_r: 0. # (Optional) Radiation density parameter
w_0: -1.0 # (Optional) Dark-energy equation-of-state parameter at z=0.
w_a: 0. # (Optional) Dark-energy equation-of-state time evolution parameter.
# Parameters governing the snapshots
Snapshots:
basename: zoom_in # Common part of the name of output files
scale_factor_first: 0.987345 # Scale-factor of the first snaphot (cosmological run)
time_first: 0.01 # Time of the first output (non-cosmological run) (in internal units)
delta_time: 1.01 # Time difference between consecutive outputs (in internal units)
compression: 1
basename: h050 # Common part of the name of output files
subdir: snap
time_first: 0. # Time of the first output (in internal units)
delta_time: 1e-2 # Time difference between consecutive outputs (in internal units)
compression: 4
output_list_on: 1 # (Optional) Enable the output list
output_list: snaplist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section)
# Parameters governing the conserved quantities statistics
Statistics:
scale_factor_first: 0.987345 # Scale-factor of the first stat dump (cosmological run)
time_first: 0.01 # Time of the first stat dump (non-cosmological run) (in internal units)
delta_time: 1.05 # Time between statistics output
scale_factor_first: 0.0141
delta_time: 1.02 # Time between statistics output
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
comoving_softening: 0.05 # Comoving softening length (in internal units).
max_physical_softening: 0.01 # Physical softening length (in internal units).
mesh_side_length: 16
eta: 0.05 # Constant dimensionless multiplier for time integration.
MAC: geometric # Choice of mulitpole acceptance criterion: 'adaptive' OR 'geometric'.
epsilon_fmm: 0.001 # Tolerance parameter for the adaptive multipole acceptance criterion.
theta_cr: 0.7 # Opening angle for the purely gemoetric criterion.
comoving_DM_softening: 0.2823 # Comoving softening length (in internal units).
max_physical_DM_softening: 0.07429 # Physical softening length (in internal units).
comoving_baryon_softening: 0.07429 # Comoving softening length (in internal units).
max_physical_baryon_softening: 0.01485 # Physical softening length (in internal units).
softening_ratio_background: 0.0285714 # Fraction of the mean inter-particle separation to use as Plummer-equivalent softening for the background DM particles.
mesh_side_length: 128 # Number of cells along each axis for the periodic gravity mesh.
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
minimal_temperature: 100 # (internal units)
minimal_temperature: 10. # Kelvin
h_min_ratio: 0.0714285714285 # (Optional) Minimal allowed smoothing length in units of the softening. Defaults to 0 if unspecified.
h_max: 100 # (Optional) Maximal allowed smoothing length in internal units. Defaults to FLT_MAX if unspecified.
# Parameters related to the initial conditions
InitialConditions:
file_name: ./zoom_in.hdf5 # The file to read
periodic: 1
cleanup_h_factors: 1 # Remove the h-factors inherited from Gadget
cleanup_velocity_factors: 1 # Remove the sqrt(a) factor in the velocities inherited from Gadget
file_name: ./h050.hdf5 # The file to read
periodic: 1 # Non-periodic BCs
cleanup_h_factors: 1 # Remove the h-factors inherited from Gadget
shift: [0, 0, 0] # Centre the box
cleanup_velocity_factors: 1 # (Optional) Clean up the scale-factors used in the definition of the velocity variable in the ICs (e.g. in Gadget files).
cleanup_smoothing_lengths: 1 # (Optional) Clean the values of the smoothing lengths that are read in to remove stupid values. Set to 1 to activate.
# Cooling with Grackle 2.0
GrackleCooling:
cloudy_table: CloudyData_UVB=HM2012.h5 # Name of the Cloudy Table (available on the grackle bitbucket repository)
with_UV_background: 1 # Enable or not the UV background
redshift: -1 # Redshift to use (-1 means time based redshift)
with_metal_cooling: 1 # Enable or not the metal cooling
provide_volumetric_heating_rates: 0 # User provide volumetric heating rates
provide_specific_heating_rates: 0 # User provide specific heating rates
self_shielding_method: -1 # Grackle (<= 3) or Gear self shielding method
self_shielding_threshold_atom_per_cm3: 0.007 # Required only with GEAR's self shielding. Density threshold of the self shielding
max_steps: 1000
convergence_limit: 1e-2
thermal_time_myr: 5
maximal_density_Hpcm3: -1 # Maximal density (in hydrogen atoms/cm^3) for cooling. Higher densities are floored to this value to ensure grackle works properly when interpolating beyond the cloudy_table maximal density. A value < 0 deactivates this parameter.
GEARStarFormation:
star_formation_efficiency: 0.01 # star formation efficiency (c_*)
maximal_temperature_K: 3e4 # Upper limit to the temperature of a star forming particle
density_threshold_Hpcm3: 0.1 # Density threshold in Hydrogen atoms/cm3
n_stars_per_particle: 4
min_mass_frac: 0.5
GEARPressureFloor:
jeans_factor: 10
GEARFeedback:
supernovae_energy_erg: 1e51
supernovae_efficiency: 0.1
yields_table: POPIIsw.h5
discrete_yields: 1
yields_table_first_stars: POPIIsw.h5 # Table containing the yields of the first stars.
metallicity_max_first_stars: -1 # Maximal metallicity (in mass fraction) for a first star (-1 to deactivate).
elements: [Fe, Mg, O, C, Al, Ca, Ba, Zn, Eu] # Elements to read in the yields table. The number of element should be one less than the number of elements (N) requested during the configuration (--with-chemistry=GEAR_N).
GEARChemistry:
initial_metallicity: 0
scale_initial_metallicity: 0
Restarts:
delta_hours: 1 # (Optional) decimal hours between dumps of restart files.
#!/bin/bash
wget https://obswww.unige.ch/lastro/projects/Clastro/PySWIFTsim/chemistry-AGB+OMgSFeZnSrYBaEu-16072013.h5
wget https://obswww.unige.ch/lastro/projects/Clastro/PySWIFTsim/chemistry-PopIII.hdf5
#!/bin/bash
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/HM80_HHe.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/HM80_ice.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/HM80_rock.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/SESAME_basalt_7530.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/SESAME_iron_2140.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/SESAME_water_7154.txt
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/EoS/SS08_water.txt
An example planetary simulation of a giant impact onto the young Uranus with
~10^6 SPH particles, as described in Kegerreis et al. (2018), ApJ, 861, 52.
This example requires the code to be configured to use the Planetary
hydrodynamics and equation of state:
--with-hydro=planetary --with-equation-of-state=planetary
with-hydro: planetary
with-equation-of-state: planetary
#!/bin/bash
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/ICs/GiantImpacts/uranus_1e6.hdf5
# Time
4000
9000
14000
20000
30000
40000
\ No newline at end of file
###############################################################################
# This file is part of SWIFT.
# Copyright (c) 2019 Jacob Kegerreis (jacob.kegerreis@durham.ac.uk)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Plot the snapshots from the example giant impact on Uranus, showing the
# particles in a thin slice near z=0, coloured by their material, similarish
# (but not identical) to Fig. 2 in Kegerreis et al. (2018).
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
# import swiftsimio as sw
import h5py
font_size = 20
params = {
'axes.labelsize' : font_size,
'font.size' : font_size,
'xtick.labelsize' : font_size,
'ytick.labelsize' : font_size,
'text.usetex' : True,
'font.family' : 'serif',
}
matplotlib.rcParams.update(params)
# Snapshot output times
output_list = [4000, 9000, 14000, 20000, 30000, 40000]
# Material IDs ( = type_id * type_factor + unit_id )
type_factor = 100
type_HM80 = 2
id_body = 10000
# Name and ID
Di_mat_id = {
'HM80_HHe' : type_HM80 * type_factor, # Hydrogen-helium atmosphere
'HM80_ice' : type_HM80 * type_factor + 1, # H20-CH4-NH3 ice mix
'HM80_ice_2' : type_HM80 * type_factor + 1 + id_body,
'HM80_rock' : type_HM80 * type_factor + 2, # SiO2-MgO-FeS-FeO rock mix
'HM80_rock_2' : type_HM80 * type_factor + 2 + id_body,
}
# ID and colour
Di_id_colour = {
Di_mat_id['HM80_HHe'] : '#33DDFF',
Di_mat_id['HM80_ice'] : 'lightsteelblue',
Di_mat_id['HM80_ice_2'] : '#A080D0',
Di_mat_id['HM80_rock'] : 'slategrey',
Di_mat_id['HM80_rock_2'] : '#706050',
}
def get_snapshot_slice(snapshot):
""" Load and select the particles to plot. """
# Load particle data
# data = load("uranus_1e6_%06d.hdf5" % snapshot)
# id = data.gas.particle_ids
# pos = data.gas.coordinates
# mat_id = data.gas.material
with h5py.File("uranus_1e6_%06d.hdf5" % snapshot, 'r') as f:
id = f['PartType0/ParticleIDs'].value
pos = (f['PartType0/Coordinates'].value
- 0.5 * f['Header'].attrs['BoxSize'])
mat_id = f['PartType0/MaterialID'].value
# Edit the material ID of particles in the impactor
num_in_target = 869104
sel_id = np.where(num_in_target < id)[0]
mat_id[sel_id] += id_body
# Select particles in a thin slice around z=0
z_min = -0.1
z_max = 0.1
sel_z = np.where((z_min < pos[:, 2]) & (pos[:, 2] < z_max))[0]
pos = pos[sel_z]
mat_id = mat_id[sel_z]
return pos, mat_id
def plot_snapshot_slice(pos, mat_id):
""" Plot the particles, coloured by their material. """
colour = np.empty(len(pos), dtype=object)
for id, c in Di_id_colour.items():
sel_c = np.where(mat_id == id)[0]
colour[sel_c] = c
ax.scatter(pos[:, 0], pos[:, 1], c=colour, edgecolors='none', marker='.',
s=10, alpha=0.5, zorder=0)
# Set up the figure
fig = plt.figure(figsize=(12, 8))
gs = matplotlib.gridspec.GridSpec(2, 3)
axes = [plt.subplot(gs[i_y, i_x]) for i_y in range(2) for i_x in range(3)]
# Plot each snapshot
for i_ax, ax in enumerate(axes):
plt.sca(ax)
ax.set_rasterization_zorder(1)
# Load and select the particles to plot
pos, mat_id = get_snapshot_slice(output_list[i_ax])
# Plot the particles, coloured by their material
plot_snapshot_slice(pos, mat_id)
# Axes etc.
ax.set_aspect('equal')
ax.set_facecolor('k')
ax.set_xlim(-13, 13)
ax.set_ylim(-13, 13)
if i_ax in [0, 3]:
ax.set_ylabel(r"y Postion $(R_\oplus)$")
else:
ax.set_yticklabels([])
if 2 < i_ax:
ax.set_xlabel(r"x Postion $(R_\oplus)$")
else:
ax.set_xticklabels([])
# Corner time labels
x = ax.get_xlim()[0] + 0.04 * (ax.get_xlim()[1] - ax.get_xlim()[0])
y = ax.get_ylim()[0] + 0.89 * (ax.get_ylim()[1] - ax.get_ylim()[0])
ax.text(x, y, "%.1f h" % (output_list[i_ax] / 60**2), color='w')
plt.subplots_adjust(wspace=0, hspace=0)
plt.tight_layout()
# Save
plt.savefig("uranus_1e6.pdf", dpi=200)
\ No newline at end of file
#!/bin/bash
# Get the initial conditions if they are not present.
if [ ! -e uranus_1e6.hdf5 ]
then
echo "Fetching initial conditions file for the Uranus impact example..."
./get_init_cond.sh
fi
# Get the EoS tables if they are not present.
cd ../EoSTables
if [ ! -e HM80_HHe.txt ] || [ ! -e HM80_ice.txt ] || [ ! -e HM80_rock.txt ]
then
echo "Fetching equations of state tables for the Uranus impact example..."
./get_eos_tables.sh
fi
cd ../GiantImpact
# Run SWIFT
../../swift -s -G -t 8 uranus_1e6.yml 2>&1 | tee output.log
# Plot the solution
python3 plot_solution.py
input:
- uranus_1e6.yml
- output_list.txt
output:
- uranus_1e6.pdf
swift_parameters: -s -G
swift_threads: 8
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e33 # M_sun in grams
UnitLength_in_cgs: 3.08567758e18 # parsec in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in cm/s
UnitMass_in_cgs: 1.98841e33 # M_sun in grams
UnitLength_in_cgs: 3.08567758149e18 # parsec in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in cm/s
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
......@@ -23,14 +23,6 @@ Snapshots:
time_first: 0. # Time of the first output (in internal units)
delta_time: 8. # Time difference between consecutive outputs (in internal units)
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.2349 # Target smoothing length in units of the mean inter-particle separation (1.2349 == 48Ngbs with the cubic spline kernel).
delta_neighbours: 1. # The tolerance for the targetted number of neighbours.
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
max_ghost_iterations: 30 # Maximal number of iterations allowed to converge towards the smoothing length.
max_smoothing_length: 40. # Maximal smoothing length allowed (in internal units).
# Parameters related to the initial conditions
InitialConditions:
file_name: Disc-Patch.hdf5 # The file to read
......@@ -40,5 +32,9 @@ InitialConditions:
DiscPatchPotential:
surface_density: 10.
scale_height: 100.
z_disc: 300.
timestep_mult: 0.03
x_disc: 300.
timestep_mult: 0.01
Scheduler:
max_top_level_cells: 8
tasks_per_cell: 5
###############################################################################
# This file is part of SWIFT.
# Copyright (c) 2016 John A. Regan (john.a.regan@durham.ac.uk)
# Tom Theuns (tom.theuns@durham.ac.uk)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# This file is part of SWIFT.
# Copyright (c) 2016 John A. Regan (john.a.regan@durham.ac.uk)
# Tom Theuns (tom.theuns@durham.ac.uk)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import h5py
import sys
import numpy
import sys
import math
import random
# Generates N particles in a box of [0:BoxSize,0:BoxSize,-2scale_height:2scale_height]
# Generates N particles in a box of [-2scale_height:2scale_height, 0:BoxSize, 0:BoxSize]
#
# The potential is long the x-axis.
#
# see Creasey, Theuns & Bower, 2013, for the equations:
# disc parameters are: surface density sigma
# scale height b
# density: rho(z) = (sigma/2b) sech^2(z/b)
# isothermal velocity dispersion = <v_z^2? = b pi G sigma
# density: rho(x) = (sigma/2b) sech^2(x/b)
# isothermal velocity dispersion = <v_x^2? = b pi G sigma
# grad potential = 2 pi G sigma tanh(z/b)
# potential = ln(cosh(z/b)) + const
# potential = ln(cosh(x/b)) + const
# Dynamical time = sqrt(b / (G sigma))
# to obtain the 1/ch^2(z/b) profile from a uniform profile (a glass, say, or a uniform random variable), note that, when integrating in z
# \int 0^z dz/ch^2(z) = tanh(z)-tanh(0) = \int_0^x dx = x (where the last integral refers to a uniform density distribution), so that z = atanh(x)
# usage: python makeIC.py 1000
# to obtain the 1/ch^2(x/b) profile from a uniform profile (a glass, say, or a uniform random variable), note that, when integrating in x
# \int 0^x dx/ch^2(x) = tanh(x)-tanh(0) = \int_0^u du = u (where the last integral refers to a uniform density distribution), so that x = atanh(u)
#
# usage: python3 makeIC.py 1000
# physical constants in cgs
NEWTON_GRAVITY_CGS = 6.67408e-8
SOLAR_MASS_IN_CGS = 1.98848e33
PARSEC_IN_CGS = 3.08567758e18
YEAR_IN_CGS = 3.15569252e7
NEWTON_GRAVITY_CGS = 6.67430e-8
SOLAR_MASS_IN_CGS = 1.98841e33
PARSEC_IN_CGS = 3.08567758149e18
YEAR_IN_CGS = 3.15569251e7
# choice of units
const_unit_length_in_cgs = (PARSEC_IN_CGS)
const_unit_mass_in_cgs = (SOLAR_MASS_IN_CGS)
const_unit_velocity_in_cgs = (1e5)
const_unit_length_in_cgs = PARSEC_IN_CGS
const_unit_mass_in_cgs = SOLAR_MASS_IN_CGS
const_unit_velocity_in_cgs = 1e5
print "UnitMass_in_cgs: ", const_unit_mass_in_cgs
print "UnitLength_in_cgs: ", const_unit_length_in_cgs
print "UnitVelocity_in_cgs: ", const_unit_velocity_in_cgs
print("UnitMass_in_cgs: ", const_unit_mass_in_cgs)
print("UnitLength_in_cgs: ", const_unit_length_in_cgs)
print("UnitVelocity_in_cgs: ", const_unit_velocity_in_cgs)
# parameters of potential
surface_density = 10.
scale_height = 100.
surface_density = 10.0
scale_height = 100.0
# derived units
const_unit_time_in_cgs = (const_unit_length_in_cgs / const_unit_velocity_in_cgs)
const_G = ((NEWTON_GRAVITY_CGS*const_unit_mass_in_cgs*const_unit_time_in_cgs*const_unit_time_in_cgs/(const_unit_length_in_cgs*const_unit_length_in_cgs*const_unit_length_in_cgs)))
print 'G=', const_G
v_disp = numpy.sqrt(scale_height * math.pi * const_G * surface_density)
t_dyn = numpy.sqrt(scale_height / (const_G * surface_density))
print 'dynamical time = ',t_dyn
print ' velocity dispersion = ',v_disp
const_unit_time_in_cgs = const_unit_length_in_cgs / const_unit_velocity_in_cgs
const_G = (
NEWTON_GRAVITY_CGS
* const_unit_mass_in_cgs
* const_unit_time_in_cgs
* const_unit_time_in_cgs
/ (const_unit_length_in_cgs * const_unit_length_in_cgs * const_unit_length_in_cgs)
)
print("G=", const_G)
v_disp = numpy.sqrt(scale_height * math.pi * const_G * surface_density)
t_dyn = numpy.sqrt(scale_height / (const_G * surface_density))
print("dynamical time = ", t_dyn)
print(" velocity dispersion = ", v_disp)
# Parameters
periodic= 1 # 1 For periodic box
boxSize = 600. #
Radius = 100. # maximum radius of particles [kpc]
G = const_G
N = int(sys.argv[1]) # Number of particles
# these are not used but necessary for I/O
rho = 2. # Density
P = 1. # Pressure
gamma = 5./3. # Gas adiabatic index
fileName = "Disc-Patch.hdf5"
#---------------------------------------------------
numPart = N
mass = 1
internalEnergy = P / ((gamma - 1.)*rho)
periodic = 1 # 1 For periodic box
boxSize = 600.0 #
Radius = 100.0 # maximum radius of particles [kpc]
G = const_G
mass = 1
numPart = int(sys.argv[1]) # Number of particles
fileName = "Disc-Patch.hdf5"
#--------------------------------------------------
# --------------------------------------------------
#File
file = h5py.File(fileName, 'w')
# File
file = h5py.File(fileName, "w")
#Units
# Units
grp = file.create_group("/Units")
grp.attrs["Unit length in cgs (U_L)"] = const_unit_length_in_cgs
grp.attrs["Unit mass in cgs (U_M)"] = const_unit_mass_in_cgs
grp.attrs["Unit time in cgs (U_t)"] = const_unit_length_in_cgs / const_unit_velocity_in_cgs
grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
grp.attrs["Unit mass in cgs (U_M)"] = const_unit_mass_in_cgs
grp.attrs["Unit time in cgs (U_t)"] = (
const_unit_length_in_cgs / const_unit_velocity_in_cgs
)
grp.attrs["Unit current in cgs (U_I)"] = 1.0
grp.attrs["Unit temperature in cgs (U_T)"] = 1.0
# Header
grp = file.create_group("/Header")
grp.attrs["BoxSize"] = boxSize
grp.attrs["NumPart_Total"] = [0, numPart, 0, 0, 0, 0]
grp.attrs["NumPart_Total"] = [0, numPart, 0, 0, 0, 0]
grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0]
grp.attrs["NumPart_ThisFile"] = [0, numPart, 0, 0, 0, 0]
grp.attrs["Time"] = 0.0
......@@ -114,42 +114,40 @@ grp.attrs["Dimension"] = 3
# set seed for random number
numpy.random.seed(1234)
#Particle group
#grp0 = file.create_group("/PartType0")
# Particle group
grp1 = file.create_group("/PartType1")
#generate particle positions
r = numpy.zeros((numPart, 3))
r[:,0] = numpy.random.rand(N) * boxSize
r[:,1] = numpy.random.rand(N) * boxSize
z = scale_height * numpy.arctanh(numpy.random.rand(2*N))
gd = z < boxSize / 2
r[:,2] = z[gd][0:N]
random = numpy.random.rand(N) > 0.5
r[random,2] *= -1
r[:,2] += 0.5 * boxSize
# generate particle positions
r = numpy.zeros((numPart, 3))
x = scale_height * numpy.arctanh(numpy.random.rand(2 * numPart))
gd = x < boxSize / 2
r[:, 0] = x[gd][0:numPart]
random = numpy.random.rand(numPart) > 0.5
r[random, 0] *= -1
r[:, 0] += 0.5 * boxSize
#generate particle velocities
v = numpy.zeros((numPart, 3))
v = numpy.zeros(1)
#v[:,2] =
r[:, 1] = numpy.random.rand(numPart) * boxSize
r[:, 2] = numpy.random.rand(numPart) * boxSize
# generate particle velocities
v = numpy.zeros((numPart, 3))
v = numpy.zeros(1)
ds = grp1.create_dataset('Velocities', (numPart, 3), 'f')
ds = grp1.create_dataset("Velocities", (numPart, 3), "f")
ds[()] = v
m = numpy.ones((numPart, ), dtype=numpy.float32) * mass
ds = grp1.create_dataset('Masses', (numPart,), 'f')
m = numpy.ones((numPart,), dtype=numpy.float32) * mass
ds = grp1.create_dataset("Masses", (numPart,), "f")
ds[()] = m
m = numpy.zeros(1)
ids = 1 + numpy.linspace(0, numPart, numPart, endpoint=False)
ds = grp1.create_dataset('ParticleIDs', (numPart, ), 'L')
ds = grp1.create_dataset("ParticleIDs", (numPart,), "L")
ds[()] = ids
ds = grp1.create_dataset('Coordinates', (numPart, 3), 'd')
ds = grp1.create_dataset("Coordinates", (numPart, 3), "d")
ds[()] = r
......
......@@ -4,7 +4,11 @@
if [ ! -e Disc-Patch.hdf5 ]
then
echo "Generating initial conditions for the disc-patch example..."
python makeIC.py 1000
python3 makeIC.py 1000
fi
../../../swift --external-gravity --threads=2 disc-patch.yml
# Run SWIFT
../../../../swift --external-gravity --threads=2 disc-patch.yml
# Verify energy conservation
python3 test.py