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
  • CubeTest
  • GPU_swift
  • TangoSIDM
  • active_h_max_optimization
  • arm_vec
  • c11
  • c11_atomics_copy
  • comm_tasks_are_special
  • cuda_test
  • domain_zoom_nometis
  • drift_flag_debug_check
  • driven_turbulence
  • engineering
  • evrard_disc
  • expand_fof
  • fix_sink_timestep
  • fixed_hSIDM
  • fof_snapshots
  • gear_metal_diffusion
  • generic_cache
  • genetic_partitioning2
  • gizmo
  • gizmo_entropy_switch
  • gizmo_mfv_entropy
  • hashmap_mesh
  • isotropic_feedback
  • ivanova-testing
  • jsw/6dfof
  • kahip
  • lean_gparts
  • load-balance-testing
  • locked_hydro
  • logger_read_history
  • logger_read_history2
  • logger_write_hdf5
  • mass_dependent_h_max
  • master
  • mpi-one-thread
  • mpi-packed-parts
  • mpi-send-subparts
  • mpi-send-subparts-vector
  • mpi-subparts-vector-grav
  • mpi-testsome
  • mpi-threads
  • mpi_force_checks
  • numa_awareness
  • onesided-mpi-rdma
  • onesided-mpi-recv-cache
  • onesided-mpi-recv-window
  • onesided-mpi-single-recv-window
  • origin-master
  • parallel_exchange_cells
  • paranoid
  • phantom
  • planetary
  • planetary_boundary
  • queue-timers
  • queue-timers-clean
  • rdma-only
  • rdma-only-multiple-sends
  • rdma-only-subcopies
  • rdma-only-subparts
  • rdma-only-subparts-update
  • rdma-only-subparts-update-flamingo
  • rdma-only-subparts-update-flamingo-cellids
  • rdma-only-subparts-update-keep
  • rdma-only-subparts-update-keep-update
  • rdma-only-subsends
  • reweight-fitted-costs
  • reweight-scaled-costs
  • rgb-engineering
  • rt-gas-interactions
  • rt-ghost2-and-thermochemistry
  • scheduler_determinism
  • search-window-tests
  • signal-handler-dump
  • simba-stellar-feedback
  • sink_formation2
  • sink_merger
  • sink_merger2
  • skeleton
  • smarter_sends
  • snipes_data
  • spiral_potential
  • subgrid_SF_threshold
  • subsends
  • swift-rdma
  • swift_zoom_support
  • sync-send
  • thread-dump-extract-waiters
  • threadpool_rmapper
  • traphic
  • variable_hSIDM
  • whe-nu-bg-cosmo
  • when_to_proxy
  • yb-bhdev
  • yb-sndev
  • yb-sndev-dev
  • yb-varsndt-isotropic
  • yb-vi-gastrack
  • 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
116 results
Show changes
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
if [ ! -e perturbedBox.hdf5 ] if [ ! -e perturbedBox.hdf5 ]
then then
echo "Generating initial conditions for the perturbed box example..." echo "Generating initial conditions for the perturbed box example..."
python makeIC.py 50 python3 makeIC.py 50
fi fi
../../swift --hydro --threads=16 perturbedBox.yml 2>&1 | tee output.log ../../../swift --hydro --threads=16 perturbedBox.yml 2>&1 | tee output.log
...@@ -26,12 +26,12 @@ from scipy.optimize import bisect ...@@ -26,12 +26,12 @@ from scipy.optimize import bisect
# Parameters # Parameters
N = [128, 192] # Particles along one edge N = [128, 192] # Particles along one edge
gamma = 7./5. # Gas adiabatic index gamma = 7.0 / 5.0 # Gas adiabatic index
dv = 0.025 # velocity perturbation dv = 0.025 # velocity perturbation
rho_h = 2 # high density region rho_h = 2 # high density region
rho_l = 1 # Low density region rho_l = 1 # Low density region
g = -0.5 # gravitational acceleration g = -0.5 # gravitational acceleration
box_size = [1., 1.5] # size of the box box_size = [1.0, 1.5] # size of the box
fixed = [0.1, 1.4] # y-range of non fixed particles fixed = [0.1, 1.4] # y-range of non fixed particles
perturbation_box = [0.3, 1.2] # y-range for the velocity perturbation perturbation_box = [0.3, 1.2] # y-range for the velocity perturbation
...@@ -40,7 +40,7 @@ fileOutputName = "rayleigh_taylor.hdf5" ...@@ -40,7 +40,7 @@ fileOutputName = "rayleigh_taylor.hdf5"
# --------------------------------------------------- # ---------------------------------------------------
if (N[0] / box_size[0] != N[1] / box_size[1]): if N[0] / box_size[0] != N[1] / box_size[1]:
raise Exception("Suppose the same ratio for each directions") raise Exception("Suppose the same ratio for each directions")
...@@ -53,11 +53,11 @@ def density(y): ...@@ -53,11 +53,11 @@ def density(y):
ind = y < 0.5 * box_size[1] ind = y < 0.5 * box_size[1]
rho = np.zeros(y.shape) rho = np.zeros(y.shape)
tmp = (gamma - 1.) * g / (gamma * P0) tmp = (gamma - 1.0) * g / (gamma * P0)
alpha = 1. / (gamma - 1.) alpha = 1.0 / (gamma - 1.0)
rho[ind] = rho_l * (1 + rho_l * tmp * (y[ind] - 0.5 * box_size[1]))**alpha rho[ind] = rho_l * (1 + rho_l * tmp * (y[ind] - 0.5 * box_size[1])) ** alpha
rho[~ind] = rho_h * (1 + rho_h * tmp * (y[~ind] - 0.5 * box_size[1]))**alpha rho[~ind] = rho_h * (1 + rho_h * tmp * (y[~ind] - 0.5 * box_size[1])) ** alpha
return rho return rho
...@@ -72,14 +72,14 @@ def mass(y): ...@@ -72,14 +72,14 @@ def mass(y):
ind = y < 0.5 * box_size[1] ind = y < 0.5 * box_size[1]
m = np.zeros(y.shape) m = np.zeros(y.shape)
B = (gamma - 1.) * g / (gamma * P0) B = (gamma - 1.0) * g / (gamma * P0)
alpha = 1. / (gamma - 1.) alpha = 1.0 / (gamma - 1.0)
m[ind] = (1 + B * rho_l * (y[ind] - 0.5 * box_size[1]))**(alpha + 1) m[ind] = (1 + B * rho_l * (y[ind] - 0.5 * box_size[1])) ** (alpha + 1)
m[~ind] = (1 + B * rho_h * (y[~ind] - 0.5 * box_size[1]))**(alpha + 1) m[~ind] = (1 + B * rho_h * (y[~ind] - 0.5 * box_size[1])) ** (alpha + 1)
m -= (1 - 0.5 * B * box_size[1] * rho_l)**(alpha + 1) m -= (1 - 0.5 * B * box_size[1] * rho_l) ** (alpha + 1)
return box_size[0] * m / (B * (alpha + 1)) return box_size[0] * m / (B * (alpha + 1))
...@@ -115,8 +115,8 @@ def entropy(y): ...@@ -115,8 +115,8 @@ def entropy(y):
ind = y < 0.5 * box_size[1] ind = y < 0.5 * box_size[1]
a = np.zeros(y.shape) a = np.zeros(y.shape)
a[ind] = P0 * rho_l**(-gamma) a[ind] = P0 * rho_l ** (-gamma)
a[~ind] = P0 * rho_h**(-gamma) a[~ind] = P0 * rho_h ** (-gamma)
return a return a
...@@ -132,11 +132,11 @@ def growth_rate(): ...@@ -132,11 +132,11 @@ def growth_rate():
Compute the growth rate of the instability. Compute the growth rate of the instability.
Assumes a wavelength equal to the boxsize. Assumes a wavelength equal to the boxsize.
""" """
ymin = 0. ymin = 0.0
ymax = box_size[1] ymax = box_size[1]
A = density(ymax) - density(ymin) A = density(ymax) - density(ymin)
A /= density(ymax) + density(ymin) A /= density(ymax) + density(ymin)
return np.sqrt(A * np.abs(g) * ymax / (2. * np.pi)) return np.sqrt(A * np.abs(g) * ymax / (2.0 * np.pi))
def vy(x, y): def vy(x, y):
...@@ -186,20 +186,21 @@ if __name__ == "__main__": ...@@ -186,20 +186,21 @@ if __name__ == "__main__":
coords[index, 0] = x coords[index, 0] = x
coords[index, 1] = y_j coords[index, 1] = y_j
if (y_j < fixed[0] or y_j > fixed[1]): if y_j < fixed[0] or y_j > fixed[1]:
ids[index] = uni_id ids[index] = uni_id
uni_id += 1 uni_id += 1
print("You need to compile the code with " print(
"--enable-boundary-particles=%i" % uni_id) "You need to compile the code with " "--enable-boundary-particles=%i" % uni_id
ids[ids == 0] = np.linspace(uni_id, numPart, numPart-uni_id+1) )
ids[ids == 0] = np.linspace(uni_id, numPart, numPart - uni_id + 1)
# density # density
rho = density(coords[:, 1]) rho = density(coords[:, 1])
# internal energy # internal energy
a = entropy(coords[:, 1]) a = entropy(coords[:, 1])
u = a * rho**(gamma-1) / (gamma - 1.) u = a * rho ** (gamma - 1) / (gamma - 1.0)
# smoothing length # smoothing length
h = smoothing_length(rho, m) h = smoothing_length(rho, m)
...@@ -208,7 +209,7 @@ if __name__ == "__main__": ...@@ -208,7 +209,7 @@ if __name__ == "__main__":
vel[:, 1] = vy(coords[:, 0], coords[:, 1]) vel[:, 1] = vy(coords[:, 0], coords[:, 1])
# File # File
fileOutput = h5py.File(fileOutputName, 'w') fileOutput = h5py.File(fileOutputName, "w")
# Header # Header
grp = fileOutput.create_group("/Header") grp = fileOutput.create_group("/Header")
...@@ -224,27 +225,27 @@ if __name__ == "__main__": ...@@ -224,27 +225,27 @@ if __name__ == "__main__":
# Units # Units
grp = fileOutput.create_group("/Units") grp = fileOutput.create_group("/Units")
grp.attrs["Unit length in cgs (U_L)"] = 1. grp.attrs["Unit length in cgs (U_L)"] = 1.0
grp.attrs["Unit mass in cgs (U_M)"] = 1. grp.attrs["Unit mass in cgs (U_M)"] = 1.0
grp.attrs["Unit time in cgs (U_t)"] = 1. grp.attrs["Unit time in cgs (U_t)"] = 1.0
grp.attrs["Unit current in cgs (U_I)"] = 1. grp.attrs["Unit current in cgs (U_I)"] = 1.0
grp.attrs["Unit temperature in cgs (U_T)"] = 1. grp.attrs["Unit temperature in cgs (U_T)"] = 1.0
# Particle group # Particle group
grp = fileOutput.create_group("/PartType0") grp = fileOutput.create_group("/PartType0")
ds = grp.create_dataset('Coordinates', (numPart, 3), 'd') ds = grp.create_dataset("Coordinates", (numPart, 3), "d")
ds[()] = coords ds[()] = coords
ds = grp.create_dataset('Velocities', (numPart, 3), 'f') ds = grp.create_dataset("Velocities", (numPart, 3), "f")
ds[()] = vel ds[()] = vel
ds = grp.create_dataset('Masses', (numPart, 1), 'f') ds = grp.create_dataset("Masses", (numPart, 1), "f")
ds[()] = m.reshape((numPart, 1)) ds[()] = m.reshape((numPart, 1))
ds = grp.create_dataset('SmoothingLength', (numPart, 1), 'f') ds = grp.create_dataset("SmoothingLength", (numPart, 1), "f")
ds[()] = h.reshape((numPart, 1)) ds[()] = h.reshape((numPart, 1))
ds = grp.create_dataset('InternalEnergy', (numPart, 1), 'f') ds = grp.create_dataset("InternalEnergy", (numPart, 1), "f")
ds[()] = u.reshape((numPart, 1)) ds[()] = u.reshape((numPart, 1))
ds = grp.create_dataset('ParticleIDs', (numPart, 1), 'L') ds = grp.create_dataset("ParticleIDs", (numPart, 1), "L")
ds[()] = ids.reshape((numPart, 1)) ds[()] = ids.reshape((numPart, 1))
ds = grp.create_dataset('Density', (numPart, 1), 'f') ds = grp.create_dataset("Density", (numPart, 1), "f")
ds[()] = rho.reshape((numPart, 1)) ds[()] = rho.reshape((numPart, 1))
fileOutput.close() fileOutput.close()
...@@ -45,6 +45,7 @@ class Metadata(object): ...@@ -45,6 +45,7 @@ class Metadata(object):
""" """
Copy the useful data in order to decrease the memory usage Copy the useful data in order to decrease the memory usage
""" """
def __init__(self, data): def __init__(self, data):
metadata = data.metadata metadata = data.metadata
self.t = metadata.t self.t = metadata.t
...@@ -91,7 +92,7 @@ def load_and_make_image(filename, res, property): ...@@ -91,7 +92,7 @@ def load_and_make_image(filename, res, property):
border = int(0.2 * m_res) border = int(0.2 * m_res)
# first part of the image # first part of the image
ylim = np.array([0., 1.]) ylim = np.array([0.0, 1.0])
data = load(filename) data = load(filename)
image[:m_res, :m_res] = project(data, m_res, property, ylim) image[:m_res, :m_res] = project(data, m_res, property, ylim)
...@@ -144,27 +145,36 @@ def create_movie(filename, start, stop, resolution, property, output_filename): ...@@ -144,27 +145,36 @@ def create_movie(filename, start, stop, resolution, property, output_filename):
norm = LogNorm(vmin=vmin, vmax=vmax, clip="black") norm = LogNorm(vmin=vmin, vmax=vmax, clip="black")
image = ax.imshow(np.zeros_like(frames[0]), origin="lower", image = ax.imshow(np.zeros_like(frames[0]), origin="lower", norm=norm)
norm=norm)
description_text = ax.text( description_text = ax.text(
0.5, 0.5, 0.5,
0.5,
get_simulation_information(metadata[0]), get_simulation_information(metadata[0]),
va="center", ha="center", va="center",
**text_args, transform=ax.transAxes, ha="center",
**text_args,
transform=ax.transAxes,
) )
time_text = ax.text( time_text = ax.text(
(1 - 0.025 * 0.25), 0.975, (1 - 0.025 * 0.25),
0.975,
time_formatter(metadata[0]), time_formatter(metadata[0]),
**text_args, **text_args,
va="top", ha="right", va="top",
ha="right",
transform=ax.transAxes, transform=ax.transAxes,
) )
ax.text( ax.text(
0.025 * 0.25, 0.975, name, **text_args, va="top", ha="left", 0.025 * 0.25,
transform=ax.transAxes 0.975,
name,
**text_args,
va="top",
ha="left",
transform=ax.transAxes,
) )
def frame(n): def frame(n):
...@@ -174,19 +184,19 @@ def create_movie(filename, start, stop, resolution, property, output_filename): ...@@ -174,19 +184,19 @@ def create_movie(filename, start, stop, resolution, property, output_filename):
time_text.set_text(time_formatter(metadata[n])) time_text.set_text(time_formatter(metadata[n]))
if generate_png: if generate_png:
name = filename + "_{:04d}".format(n+info_frames) name = filename + "_{:04d}".format(n + info_frames)
fig.savefig(name + ".png") fig.savefig(name + ".png")
else: else:
return (image,) return (image,)
if generate_png: if generate_png:
for i in range(-info_frames, stop-start): for i in range(-info_frames, stop - start):
frame(i) frame(i)
else: else:
animation = FuncAnimation(fig, frame, animation = FuncAnimation(
range(-info_frames, stop-start), fig, frame, range(-info_frames, stop - start), interval=40
interval=40) )
animation.save(output_filename) animation.save(output_filename)
...@@ -232,13 +242,11 @@ if __name__ == "__main__": ...@@ -232,13 +242,11 @@ if __name__ == "__main__":
) )
parser.add_argument( parser.add_argument(
"-i", "--initial", help="Initial snapshot. Default: 0", "-i", "--initial", help="Initial snapshot. Default: 0", type=int, default=0
type=int, default=0
) )
parser.add_argument( parser.add_argument(
"-f", "--final", help="Final snapshot. Default: 40", "-f", "--final", help="Final snapshot. Default: 40", type=int, default=40
type=int, default=40
) )
parser.add_argument( parser.add_argument(
......
...@@ -6,10 +6,10 @@ set -e ...@@ -6,10 +6,10 @@ set -e
if [ ! -e rayleigh_taylor.hdf5 ] if [ ! -e rayleigh_taylor.hdf5 ]
then then
echo "Generating initial conditions for the Rayleigh Taylor example..." echo "Generating initial conditions for the Rayleigh Taylor example..."
python makeIC.py python3 makeIC.py
fi fi
# Run SWIFT # Run SWIFT
../../swift --hydro --external-gravity --threads=8 rayleigh_taylor.yml 2>&1 | tee output.log ../../../swift --hydro --external-gravity --threads=8 rayleigh_taylor.yml 2>&1 | tee output.log
python makeMovie.py -i 0 -f 1001 python3 makeMovie.py -i 0 -f 1001