Commit 58b5dc4c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'master' into feedback

parents f6734af8 8b25dfc4
......@@ -139,6 +139,8 @@ tests/testEOS
tests/testEOS*.txt
tests/testEOS*.png
tests/testUtilities
tests/testCosmology
tests/testOutputList
tests/testCbrt
tests/testFormat.sh
......
......@@ -496,18 +496,20 @@ AC_CHECK_LIB(pthread, posix_fallocate,
AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [The posix library implements file allocation functions.]),
AC_MSG_WARN(POSIX implementation does not have file allocation functions.))
# Check for METIS. Note AX_LIB_METIS exists, but cannot be configured
# to be default off (i.e. given no option it tries to locate METIS), so we
# don't use that.
# Check for METIS.
have_metis="no"
AC_ARG_WITH([metis],
[AS_HELP_STRING([--with-metis=PATH],
[root directory where metis is installed @<:@yes/no@:>@]
[root directory where METIS is installed @<:@yes/no@:>@]
)],
[with_metis="$withval"],
[with_metis="no"]
)
METIS_LIBS=""
if test "x$with_metis" != "xno"; then
# Check if we have METIS.
if test "x$with_metis" != "xyes" -a "x$with_metis" != "x"; then
METIS_LIBS="-L$with_metis/lib -lmetis"
METIS_INCS="-I$with_metis/include"
......@@ -515,15 +517,67 @@ if test "x$with_metis" != "xno"; then
METIS_LIBS="-lmetis"
METIS_INCS=""
fi
have_metis="yes"
AC_CHECK_LIB([metis],[METIS_PartGraphKway],
AC_DEFINE([HAVE_METIS],1,[The metis library appears to be present.]),
AC_MSG_ERROR(something is wrong with the metis library!),$METIS_LIBS)
AC_CHECK_LIB([metis],[METIS_PartGraphKway], [have_metis="yes"],
[have_metis="no"], $METIS_LIBS)
if test "$have_metis" == "yes"; then
AC_DEFINE([HAVE_METIS],1,[The METIS library is present.])
else
AC_MSG_ERROR("Failed to find a METIS library")
fi
fi
AC_SUBST([METIS_LIBS])
AC_SUBST([METIS_INCS])
AM_CONDITIONAL([HAVEMETIS],[test -n "$METIS_LIBS"])
# Check for ParMETIS note we can have both as ParMETIS uses METIS.
have_parmetis="no"
AC_ARG_WITH([parmetis],
[AS_HELP_STRING([--with-parmetis=PATH],
[root directory where ParMETIS is installed @<:@yes/no@:>@]
)],
[with_parmetis="$withval"],
[with_parmetis="no"]
)
if test "x$with_parmetis" != "xno"; then
# Check if we have ParMETIS.
if test "x$with_parmetis" != "xyes" -a "x$with_parmetis" != "x"; then
PARMETIS_LIBS="-L$with_parmetis/lib -lparmetis"
PARMETIS_INCS="-I$with_parmetis/include"
else
PARMETIS_LIBS="-lparmetis"
PARMETIS_INCS=""
fi
AC_CHECK_LIB([parmetis],[ParMETIS_V3_RefineKway], [have_parmetis="yes"],
[have_parmetis="no"], $PARMETIS_LIBS)
if test "$have_parmetis" == "no"; then
# A build may use an external METIS library, check for that.
if test "x$with_parmetis" != "xyes" -a "x$with_parmetis" != "x"; then
PARMETIS_LIBS="-L$with_parmetis/lib -lparmetis -lmetis"
PARMETIS_INCS="-I$with_parmetis/include"
else
PARMETIS_LIBS="-lparmetis -lmetis"
PARMETIS_INCS=""
fi
AC_CHECK_LIB([parmetis],[ParMETIS_V3_RefineKway], [have_parmetis="yes"],
[have_parmetis="no"], [$METIS_LIBS $PARMETIS_LIBS])
fi
if test "$have_parmetis" == "yes"; then
AC_DEFINE([HAVE_PARMETIS],1,[The ParMETIS library is present.])
else
AC_MSG_ERROR("Failed to find a ParMETIS library")
fi
fi
AC_SUBST([PARMETIS_LIBS])
AC_SUBST([PARMETIS_INCS])
AM_CONDITIONAL([HAVEPARMETIS],[test -n "$PARMETIS_LIBS"])
# METIS fixed width integer printing can require this, so define. Only needed
# for some non C99 compilers, i.e. C++ pre C++11.
AH_VERBATIM([__STDC_FORMAT_MACROS],
......@@ -534,7 +588,8 @@ AH_VERBATIM([__STDC_FORMAT_MACROS],
# Check for FFTW. We test for this in the standard directories by default,
# and only disable if using --with-fftw=no or --without-fftw. When a value
# is given GSL must be found.
# is given FFTW must be found.
# If FFTW is found, we check whether this is the threaded version.
have_fftw="no"
AC_ARG_WITH([fftw],
[AS_HELP_STRING([--with-fftw=PATH],
......@@ -544,6 +599,8 @@ AC_ARG_WITH([fftw],
[with_fftw="test"]
)
if test "x$with_fftw" != "xno"; then
# Was FFTW's location specifically given?
if test "x$with_fftw" != "xyes" -a "x$with_fftw" != "xtest" -a "x$with_fftw" != "x"; then
FFTW_LIBS="-L$with_fftw/lib -lfftw3"
FFTW_INCS="-I$with_fftw/include"
......@@ -551,22 +608,51 @@ if test "x$with_fftw" != "xno"; then
FFTW_LIBS="-lfftw3"
FFTW_INCS=""
fi
# FFTW is not specified, so just check if we have it.
if test "x$with_fftw" = "xtest"; then
AC_CHECK_LIB([fftw3],[fftw_malloc],[have_fftw="yes"],[have_fftw="no"],$FFTW_LIBS)
if test "x$have_fftw" != "xno"; then
AC_DEFINE([HAVE_FFTW],1,[The FFTW library appears to be present.])
fi
# FFTW was specified, check that it was a valid location.
else
AC_CHECK_LIB([fftw3],[fftw_malloc],
AC_DEFINE([HAVE_FFTW],1,[The FFTW library appears to be present.]),
AC_MSG_ERROR(something is wrong with the FFTW library!), $FFTW_LIBS)
have_fftw="yes"
fi
# FFTW was requested not to be used.
if test "$have_fftw" = "no"; then
FFTW_LIBS=""
FFTW_INCS=""
fi
# Now, check whether we have the threaded version of FFTW
if test "x$have_fftw" = "xyes"; then
# Was FFTW's location specifically given?
if test "x$with_fftw" != "xyes" -a "x$with_fftw" != "xtest" -a "x$with_fftw" != "x"; then
FFTW_THREADED_LIBS="-L$with_fftw/lib -lfftw3_threads -lfftw3"
FFTW_THREADED_INCS="-I$with_fftw/include"
else
FFTW_THREADED_LIBS="-lfftw3_threads -lfftw3"
FFTW_THREADED_INCS=""
fi
# Verify that the library is threaded
AC_CHECK_LIB([fftw3],[fftw_init_threads],[have_threaded_fftw="yes"],
[have_threaded_fftw="no"], $FFTW_THREADED_LIBS)
# If found, update things
if test "x$have_threaded_fftw" = "xyes"; then
AC_DEFINE([HAVE_THREADED_FFTW],1,[The threaded FFTW library appears to be present.])
FFTW_LIBS=$FFTW_THREADED_LIBS
FFTW_INCS=$FFTW_THREADED_INCS
have_fftw="yes - threaded"
fi
fi
fi
AC_SUBST([FFTW_LIBS])
AC_SUBST([FFTW_INCS])
......@@ -1485,7 +1571,7 @@ AC_MSG_RESULT([
MPI enabled : $enable_mpi
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
METIS/ParMETIS : $have_metis / $have_parmetis
FFTW3 enabled : $have_fftw
GSL enabled : $have_gsl
libNUMA enabled : $have_numa
......
......@@ -123,7 +123,7 @@ RuntimePars
In the ``/RuntimePars/``, the following attributes are required:
+ ``PeriodicBoundaryConditionsOn``, a flag to tell the code whether or not you
+ ``PeriodicBoundariesOn``, a flag to tell the code whether or not you
have periodic boundaries switched on. Again, this is historical; it should be
set to 1 (default) if you have the code running in periodic mode, or 0 otherwise.
......
......@@ -65,7 +65,7 @@ glass.close()
# Total number of particles
numPart = size(pos)/3
if numPart != numPart_1D**3:
print "Non-matching glass file"
print("Non-matching glass file")
numPart = numPart_1D**3
# Set box size and interparticle distance
......
......@@ -27,8 +27,8 @@ AM_LDFLAGS = $(HDF5_LDFLAGS)
EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(GSL_LIBS)
# MPI libraries.
MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(METIS_INCS)
MPI_LIBS = $(PARMETIS_LIBS) $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(PARMETIS_INCS) $(METIS_INCS)
# Programs.
bin_PROGRAMS = swift
......@@ -82,13 +82,17 @@ EXTRA_DIST = CoolingBox/coolingBox.yml CoolingBox/energy_plot.py CoolingBox/make
Noh_3D/makeIC.py Noh_3D/noh.yml Noh_3D/plotSolution.py Noh_3D/run.sh Noh_3D/getGlass.sh \
PerturbedBox_2D/makeIC.py PerturbedBox_2D/perturbedPlane.yml \
PerturbedBox_3D/makeIC.py PerturbedBox_3D/perturbedBox.yml PerturbedBox_3D/run.sh \
PMillennium-384/p-mill-384.yml \
PMillennium-768/p-mill-768.yml \
SantaBarbara/README SantaBarbara/getIC.sh SantaBarbara/santa_barbara.yml \
SedovBlast_1D/makeIC.py SedovBlast_1D/plotSolution.py SedovBlast_1D/run.sh SedovBlast_1D/sedov.yml \
SedovBlast_2D/getGlass.sh SedovBlast_2D/makeIC.py SedovBlast_2D/plotSolution.py SedovBlast_2D/run.sh SedovBlast_2D/sedov.yml \
SedovBlast_3D/getGlass.sh SedovBlast_3D/makeIC.py SedovBlast_3D/plotSolution.py SedovBlast_3D/run.sh SedovBlast_3D/sedov.yml \
SineWavePotential_1D/makeIC.py SineWavePotential_1D/plotSolution.py SineWavePotential_1D/run.sh SineWavePotential_1D/sineWavePotential.yml \
SineWavePotential_2D/makeIC.py SineWavePotential_2D/plotSolution.py SineWavePotential_2D/run.sh SineWavePotential_2D/sineWavePotential.yml \
SineWavePotential_3D/makeIC.py SineWavePotential_3D/plotSolution.py SineWavePotential_3D/run.sh SineWavePotential_3D/sineWavePotential.yml \
SmallCosmoVolume/README SmallCosmoVolume/getIC.sh SmallCosmoVolume/run.sh SmallCosmoVolume/small_cosmo_volume.yml \
SmallCosmoVolume/README SmallCosmoVolume/getIC.sh SmallCosmoVolume/run.sh SmallCosmoVolume/small_cosmo_volume.yml SmallCosmoVolume/plotTempEvolution.py \
SmallCosmoVolume_DM/README SmallCosmoVolume_DM/getIC.sh SmallCosmoVolume_DM/run.sh SmallCosmoVolume_DM/small_cosmo_volume_dm.yml SmallCosmoVolume_DM/stf_input_6dfof_dmonly_sub.cfg \
SodShock_1D/makeIC.py SodShock_1D/plotSolution.py SodShock_1D/run.sh SodShock_1D/sodShock.yml \
SodShock_2D/getGlass.sh SodShock_2D/makeIC.py SodShock_2D/plotSolution.py SodShock_2D/run.sh SodShock_2D/sodShock.yml \
SodShock_3D/getGlass.sh SodShock_3D/makeIC.py SodShock_3D/plotSolution.py SodShock_3D/run.sh SodShock_3D/sodShock.yml \
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun
UnitLength_in_cgs: 3.08567758e24 # 1 Mpc
UnitVelocity_in_cgs: 1e5 # 1 km/s
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
# Planck-13 cosmology
Cosmology:
h: 0.6777
a_begin: 0.02 # z_ini = 49
a_end: 1.0 # z_end = 0
Omega_m: 0.307
Omega_lambda: 0.693
Omega_b: 0.0455
# Parameters governing the time integration
TimeIntegration:
dt_min: 1e-6
dt_max: 1e-2
Scheduler:
max_top_level_cells: 16
cell_split_size: 100
# Parameters governing the snapshots
Snapshots:
basename: PMill
delta_time: 1.02
scale_factor_first: 0.02
# Parameters governing the conserved quantities statistics
Statistics:
delta_time: 1.02
scale_factor_first: 0.02
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025
theta: 0.5
comoving_softening: 0.08333 # 83.333 kpc = 1/25 mean inter-particle separation
max_physical_softening: 0.08333 # 83.333 kpc = 1/25 mean inter-particle separation
mesh_side_length: 128
# Parameters related to the initial conditions
InitialConditions:
file_name: ics.hdf5
cleanup_h_factors: 1
cleanup_velocity_factors: 1
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun
UnitLength_in_cgs: 3.08567758e24 # 1 Mpc
UnitVelocity_in_cgs: 1e5 # 1 km/s
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
# Planck-13 cosmology
Cosmology:
h: 0.6777
a_begin: 0.02 # z_ini = 49
a_end: 1.0 # z_end = 0
Omega_m: 0.307
Omega_lambda: 0.693
Omega_b: 0.0455
# Parameters governing the time integration
TimeIntegration:
dt_min: 1e-6
dt_max: 1e-2
Scheduler:
max_top_level_cells: 16
cell_split_size: 100
# Parameters governing the snapshots
Snapshots:
basename: PMill
delta_time: 1.02
scale_factor_first: 0.02
# Parameters governing the conserved quantities statistics
Statistics:
delta_time: 1.02
scale_factor_first: 0.02
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025
theta: 0.5
comoving_softening: 0.041666 # 41.6666 kpc = 1/25 mean inter-particle separation
max_physical_softening: 0.041666 # 41.6666 kpc = 1/25 mean inter-particle separation
mesh_side_length: 256
# Parameters related to the initial conditions
InitialConditions:
file_name: ics.hdf5
cleanup_h_factors: 1
cleanup_velocity_factors: 1
......@@ -4,6 +4,11 @@ We use a softening length of 1/25th of the mean inter-particle separation.
The ICs have been generated to run with Gadget-2 so we need to switch
on the options to cancel the h-factors and a-factors at reading time.
We generate gas from the ICs using SWIFT's internal mechanism and set the
temperature to the expected gas temperature at this redshift.
The 'plotTempEvolution.py' plots the temperature evolution of the gas
in the simulated volume.
MD5 checksum of the ICs:
08736c3101fd738e22f5159f78e6022b small_cosmo_volume.hdf5
################################################################################
# This file is part of SWIFT.
# Copyright (c) 2018 Matthieu Schaller (matthieu.schaller@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/>.
#
################################################################################
# Computes the temperature evolution of the gas in a cosmological box
# Physical constants needed for internal energy to temperature conversion
k_in_J_K = 1.38064852e-23
mH_in_kg = 1.6737236e-27
# Number of snapshots generated
n_snapshots = 200
import matplotlib
matplotlib.use("Agg")
from pylab import *
import h5py
import os.path
# Plot parameters
params = {'axes.labelsize': 10,
'axes.titlesize': 10,
'font.size': 9,
'legend.fontsize': 9,
'xtick.labelsize': 10,
'ytick.labelsize': 10,
'text.usetex': True,
'figure.figsize' : (3.15,3.15),
'figure.subplot.left' : 0.14,
'figure.subplot.right' : 0.99,
'figure.subplot.bottom' : 0.12,
'figure.subplot.top' : 0.99,
'figure.subplot.wspace' : 0.15,
'figure.subplot.hspace' : 0.12,
'lines.markersize' : 6,
'lines.linewidth' : 2.,
'text.latex.unicode': True
}
rcParams.update(params)
rc('font',**{'family':'sans-serif','sans-serif':['Times']})
# Read the simulation data
sim = h5py.File("snap_0000.hdf5", "r")
boxSize = sim["/Header"].attrs["BoxSize"][0]
time = sim["/Header"].attrs["Time"][0]
scheme = sim["/HydroScheme"].attrs["Scheme"][0]
kernel = sim["/HydroScheme"].attrs["Kernel function"][0]
neighbours = sim["/HydroScheme"].attrs["Kernel target N_ngb"][0]
eta = sim["/HydroScheme"].attrs["Kernel eta"][0]
alpha = sim["/HydroScheme"].attrs["Alpha viscosity"][0]
H_mass_fraction = sim["/HydroScheme"].attrs["Hydrogen mass fraction"][0]
H_transition_temp = sim["/HydroScheme"].attrs["Hydrogen ionization transition temperature"][0]
T_initial = sim["/HydroScheme"].attrs["Initial temperature"][0]
T_minimal = sim["/HydroScheme"].attrs["Minimal temperature"][0]
git = sim["Code"].attrs["Git Revision"]
# Cosmological parameters
H_0 = sim["/Cosmology"].attrs["H0 [internal units]"][0]
gas_gamma = sim["/HydroScheme"].attrs["Adiabatic index"][0]
unit_length_in_cgs = sim["/Units"].attrs["Unit length in cgs (U_L)"]
unit_mass_in_cgs = sim["/Units"].attrs["Unit mass in cgs (U_M)"]
unit_time_in_cgs = sim["/Units"].attrs["Unit time in cgs (U_t)"]
unit_length_in_si = 0.01 * unit_length_in_cgs
unit_mass_in_si = 0.001 * unit_mass_in_cgs
unit_time_in_si = unit_time_in_cgs
# Primoridal ean molecular weight as a function of temperature
def mu(T, H_frac=H_mass_fraction, T_trans=H_transition_temp):
if T > T_trans:
return 4. / (8. - 5. * (1. - H_frac))
else:
return 4. / (1. + 3. * H_frac)
# Temperature of some primoridal gas with a given internal energy
def T(u, H_frac=H_mass_fraction, T_trans=H_transition_temp):
T_over_mu = (gas_gamma - 1.) * u * mH_in_kg / k_in_J_K
ret = np.ones(np.size(u)) * T_trans
# Enough energy to be ionized?
mask_ionized = (T_over_mu > (T_trans+1) / mu(T_trans+1, H_frac, T_trans))
if np.sum(mask_ionized) > 0:
ret[mask_ionized] = T_over_mu[mask_ionized] * mu(T_trans*10, H_frac, T_trans)
# Neutral gas?
mask_neutral = (T_over_mu < (T_trans-1) / mu((T_trans-1), H_frac, T_trans))
if np.sum(mask_neutral) > 0:
ret[mask_neutral] = T_over_mu[mask_neutral] * mu(0, H_frac, T_trans)
return ret
z = np.zeros(n_snapshots)
a = np.zeros(n_snapshots)
T_mean = np.zeros(n_snapshots)
T_std = np.zeros(n_snapshots)
T_log_mean = np.zeros(n_snapshots)
T_log_std = np.zeros(n_snapshots)
T_median = np.zeros(n_snapshots)
T_min = np.zeros(n_snapshots)
T_max = np.zeros(n_snapshots)
# Loop over all the snapshots
for i in range(n_snapshots):
sim = h5py.File("snap_%04d.hdf5"%i, "r")
z[i] = sim["/Cosmology"].attrs["Redshift"][0]
a[i] = sim["/Cosmology"].attrs["Scale-factor"][0]
u = sim["/PartType0/InternalEnergy"][:]
# Compute the temperature
u *= (unit_length_in_si**2 / unit_time_in_si**2)
u /= a[i]**(3 * (gas_gamma - 1.))
Temp = T(u)
# Gather statistics
T_median[i] = np.median(Temp)
T_mean[i] = Temp.mean()
T_std[i] = Temp.std()
T_log_mean[i] = np.log10(Temp).mean()
T_log_std[i] = np.log10(Temp).std()
T_min[i] = Temp.min()
T_max[i] = Temp.max()
# CMB evolution
a_evol = np.logspace(-3, 0, 60)
T_cmb = (1. / a_evol)**2 * 2.72
# Plot the interesting quantities
figure()
subplot(111, xscale="log", yscale="log")
fill_between(a, T_mean-T_std, T_mean+T_std, color='C0', alpha=0.1)
plot(a, T_max, ls='-.', color='C0', lw=1., label="${\\rm max}~T$")
plot(a, T_min, ls=':', color='C0', lw=1., label="${\\rm min}~T$")
plot(a, T_mean, color='C0', label="${\\rm mean}~T$", lw=1.5)
fill_between(a, 10**(T_log_mean-T_log_std), 10**(T_log_mean+T_log_std), color='C1', alpha=0.1)
plot(a, 10**T_log_mean, color='C1', label="${\\rm mean}~{\\rm log} T$", lw=1.5)
plot(a, T_median, color='C2', label="${\\rm median}~T$", lw=1.5)
legend(loc="upper left", frameon=False, handlelength=1.5)
# Expected lines
plot([1e-10, 1e10], [H_transition_temp, H_transition_temp], 'k--', lw=0.5, alpha=0.7)
text(2.5e-2, H_transition_temp*1.07, "$T_{\\rm HII\\rightarrow HI}$", va="bottom", alpha=0.7, fontsize=8)
plot([1e-10, 1e10], [T_minimal, T_minimal], 'k--', lw=0.5, alpha=0.7)
text(1e-2, T_minimal*0.8, "$T_{\\rm min}$", va="top", alpha=0.7, fontsize=8)
plot(a_evol, T_cmb, 'k--', lw=0.5, alpha=0.7)
text(a_evol[20], T_cmb[20]*0.55, "$(1+z)^2\\times T_{\\rm CMB,0}$", rotation=-34, alpha=0.7, fontsize=8, va="top", bbox=dict(facecolor='w', edgecolor='none', pad=1.0, alpha=0.9))
redshift_ticks = np.array([0., 1., 2., 5., 10., 20., 50., 100.])
redshift_labels = ["$0$", "$1$", "$2$", "$5$", "$10$", "$20$", "$50$", "$100$"]
a_ticks = 1. / (redshift_ticks + 1.)
xticks(a_ticks, redshift_labels)
minorticks_off()
xlabel("${\\rm Redshift}~z$", labelpad=0)
ylabel("${\\rm Temperature}~T~[{\\rm K}]$", labelpad=0)
xlim(9e-3, 1.1)
ylim(20, 2.5e7)
savefig("Temperature_evolution.png", dpi=200)
......@@ -7,5 +7,8 @@ then
./getIC.sh
fi
../swift -c -G -t 8 small_cosmo_volume.yml 2>&1 | tee output.log
# Run SWIFT
../swift -c -s -G -t 8 small_cosmo_volume.yml 2>&1 | tee output.log
# Plot the temperature evolution
python plotTempEvolution.py
......@@ -6,14 +6,6 @@ InternalUnitSystem:
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
# Structure finding options
StructureFinding:
config_file_name: stf_input_6dfof_dmonly_sub.cfg
basename: ./stf
output_time_format: 1
scale_factor_first: 0.02
delta_time: 1.02
Cosmology: # WMAP9 cosmology
Omega_m: 0.276
Omega_lambda: 0.724
......@@ -34,7 +26,14 @@ Gravity:
comoving_softening: 0.0889 # 1/25th of the mean inter-particle separation: 88.9 kpc
max_physical_softening: 0.0889 # 1/25th of the mean inter-particle separation: 88.9 kpc
mesh_side_length: 64
# Parameters of the hydro scheme
SPH:
resolution_eta: 1.2348 # "48 Ngb" with the cubic spline kernel
CFL_condition: 0.1
initial_temperature: 7075. # (1 + z_ini)^2 * 2.72K
minimal_temperature: 100.
# Parameters governing the snapshots
Snapshots:
basename: snap
......@@ -55,3 +54,5 @@ InitialConditions:
file_name: small_cosmo_volume.hdf5
cleanup_h_factors: 1
cleanup_velocity_factors: 1
generate_gas_in_ics: 1 # Generate gas particles from the DM-only ICs
cleanup_smoothing_lengths: 1 # Since we generate gas, make use of the (expensive) cleaning-up procedure.
Small LCDM cosmological simulation generated by C. Power. Cosmology
is WMAP9 and the box is 100Mpc/h in size with 64^3 particles.
We use a softening length of 1/25th of the mean inter-particle separation.
The ICs have been generated to run with Gadget-2 so we need to switch
on the options to cancel the h-factors and a-factors at reading time.
MD5 checksum of the ICs:
08736c3101fd738e22f5159f78e6022b small_cosmo_volume.hdf5
#!/bin/bash
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/ICs/small_cosmo_volume.hdf5
#!/bin/bash
# Generate the initial conditions if they are not present.
if [ ! -e small_cosmo_volume.hdf5 ]
then
echo "Fetching initial conditions for the small cosmological volume example..."
./getIC.sh
fi
# Run SWIFT
../swift -c -G -t 8 small_cosmo_volume_dm.yml 2>&1 | tee output.log
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun