Commit 30c5a76c authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'cosmology' into 'master'

Cosmological time integration

See merge request !509
parents 94969fd6 90463b78
...@@ -48,6 +48,7 @@ tests/swift_dopair_standard.dat ...@@ -48,6 +48,7 @@ tests/swift_dopair_standard.dat
tests/brute_force_perturbed.dat tests/brute_force_perturbed.dat
tests/swift_dopair_perturbed.dat tests/swift_dopair_perturbed.dat
tests/test27cells tests/test27cells
tests/test27cells_subset
tests/testPeriodicBC tests/testPeriodicBC
tests/test125cells tests/test125cells
tests/brute_force_27_standard.dat tests/brute_force_27_standard.dat
...@@ -121,6 +122,7 @@ theory/Multipoles/potential.pdf ...@@ -121,6 +122,7 @@ theory/Multipoles/potential.pdf
theory/Multipoles/potential_long.pdf theory/Multipoles/potential_long.pdf
theory/Multipoles/potential_short.pdf theory/Multipoles/potential_short.pdf
theory/Multipoles/force_short.pdf theory/Multipoles/force_short.pdf
theory/Cosmology/cosmology.pdf
m4/libtool.m4 m4/libtool.m4
m4/ltoptions.m4 m4/ltoptions.m4
......
...@@ -116,6 +116,8 @@ before you can build it. ...@@ -116,6 +116,8 @@ before you can build it.
much like the CC one. Use this when your MPI compiler has a much like the CC one. Use this when your MPI compiler has a
none-standard name. none-standard name.
- GSL: To use cosmological time integration, a version of the GSL
must be available.
- libtool: The build system relies on libtool as well as the other autotools. - libtool: The build system relies on libtool as well as the other autotools.
......
...@@ -407,6 +407,14 @@ AC_HEADER_STDC ...@@ -407,6 +407,14 @@ AC_HEADER_STDC
# Check for the libraries we will need. # Check for the libraries we will need.
AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!)) AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))
# Check for GSL
have_gsl="no"
AC_CHECK_LIB([gslcblas], [cblas_dgemm])
AC_CHECK_LIB([gsl], [gsl_integration_qag])
if test "x$ac_cv_lib_gslcblas_cblas_dgemm" != "x"; then
have_gsl="yes"
fi
# Check for pthreads. # Check for pthreads.
AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC" LDFLAGS="$LDFLAGS $PTHREAD_LIBS $LIBS"], CC="$PTHREAD_CC" LDFLAGS="$LDFLAGS $PTHREAD_LIBS $LIBS"],
...@@ -1054,6 +1062,7 @@ AC_MSG_RESULT([ ...@@ -1054,6 +1062,7 @@ AC_MSG_RESULT([
- parallel : $have_parallel_hdf5 - parallel : $have_parallel_hdf5
Metis enabled : $have_metis Metis enabled : $have_metis
FFTW3 enabled : $have_fftw3 FFTW3 enabled : $have_fftw3
GSL enabled : $have_gsl
libNUMA enabled : $have_numa libNUMA enabled : $have_numa
GRACKLE enabled : $have_grackle GRACKLE enabled : $have_grackle
Using tcmalloc : $have_tcmalloc Using tcmalloc : $have_tcmalloc
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.989e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.085678e24 # Mpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
# UnitMass_in_cgs: 1 # Grams
# UnitLength_in_cgs: 1 # Centimeters
# UnitVelocity_in_cgs: 1 # Centimeters per second
# UnitCurrent_in_cgs: 1 # Amperes
# UnitTemp_in_cgs: 1 # Kelvin
# Parameters governing the time integration
TimeIntegration:
time_begin: 0. # The starting time of the simulation (in internal units).
time_end: 1. # The end time of the simulation (in internal units).
dt_min: 1e-6 # The minimal time-step size of the simulation (in internal units).
dt_max: 1e-2 # The maximal time-step size of the simulation (in internal units).
# Parameters governing the snapshots
Snapshots:
basename: uniformBox # Common part of the name of output files
time_first: 0. # Time of the first output (in internal units)
delta_time: 0.01 # Time difference between consecutive outputs (in internal units)
# Parameters governing the conserved quantities statistics
Statistics:
delta_time: 1e-2 # Time between statistics output
# 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.
# Parameters related to the initial conditions
InitialConditions:
file_name: ./uniformBox.hdf5 # The file to read
Cosmology:
Omega_m: 0.307
Omega_lambda: 0.693
Omega_b: 0.0455
h: 0.6777
a_begin: 0.0078125
a_end: 1.0
###############################################################################
# This file is part of SWIFT.
# Copyright (c) 2013 Pedro Gonnet (pedro.gonnet@durham.ac.uk),
# 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/>.
#
##############################################################################
import h5py
import sys
from numpy import *
# Generates a swift IC file containing a cartesian distribution of particles
# at a constant density and pressure in a cubic box
# Parameters
periodic= 1 # 1 For periodic box
boxSize = 1.
L = int(sys.argv[1]) # Number of particles along one axis
rho = 2. # Density
P = 1. # Pressure
gamma = 5./3. # Gas adiabatic index
eta = 1.2349 # 48 ngbs with cubic spline kernel
fileName = "uniformBox.hdf5"
#---------------------------------------------------
numPart = L**3
mass = boxSize**3 * rho / numPart
internalEnergy = P / ((gamma - 1.)*rho)
#--------------------------------------------------
#File
file = h5py.File(fileName, 'w')
# Header
grp = file.create_group("/Header")
grp.attrs["BoxSize"] = boxSize
grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0]
grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["Time"] = 0.0
grp.attrs["NumFilesPerSnapshot"] = 1
grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = 0
grp.attrs["Dimension"] = 3
#Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
#Units
grp = file.create_group("/Units")
grp.attrs["Unit length in cgs (U_L)"] = 1.
grp.attrs["Unit mass in cgs (U_M)"] = 1.
grp.attrs["Unit time in cgs (U_t)"] = 1.
grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
#Particle group
grp = file.create_group("/PartType0")
v = zeros((numPart, 3))
ds = grp.create_dataset('Velocities', (numPart, 3), 'f')
ds[()] = v
v = zeros(1)
m = full((numPart, 1), mass)
ds = grp.create_dataset('Masses', (numPart,1), 'f')
ds[()] = m
m = zeros(1)
h = full((numPart, 1), eta * boxSize / L)
ds = grp.create_dataset('SmoothingLength', (numPart,1), 'f')
ds[()] = h
h = zeros(1)
u = full((numPart, 1), internalEnergy)
ds = grp.create_dataset('InternalEnergy', (numPart,1), 'f')
ds[()] = u
u = zeros(1)
ids = linspace(0, numPart, numPart, endpoint=False).reshape((numPart,1))
ds = grp.create_dataset('ParticleIDs', (numPart, 1), 'L')
ds[()] = ids + 1
x = ids % L;
y = ((ids - x) / L) % L;
z = (ids - x - L * y) / L**2;
coords = zeros((numPart, 3))
coords[:,0] = z[:,0] * boxSize / L + boxSize / (2*L)
coords[:,1] = y[:,0] * boxSize / L + boxSize / (2*L)
coords[:,2] = x[:,0] * boxSize / L + boxSize / (2*L)
ds = grp.create_dataset('Coordinates', (numPart, 3), 'd')
ds[()] = coords
file.close()
...@@ -13,13 +13,22 @@ TimeIntegration: ...@@ -13,13 +13,22 @@ TimeIntegration:
dt_min: 1e-10 # The minimal time-step size of the simulation (in internal units). dt_min: 1e-10 # The minimal time-step size of the simulation (in internal units).
dt_max: 1e-4 # The maximal time-step size of the simulation (in internal units). dt_max: 1e-4 # The maximal time-step size of the simulation (in internal units).
# Cosmological parameters
Cosmology:
h: 0.6777 # Reduced Hubble constant
a_begin: 0.9090909 # Initial scale-factor of the simulation
a_end: 1.0 # Final scale factor of the simulation
Omega_m: 0.307 # Matter density parameter
Omega_lambda: 0.693 # Dark-energy density parameter
Omega_b: 0.0455 # Baryon density parameter
Scheduler: Scheduler:
max_top_level_cells: 15 max_top_level_cells: 15
# Parameters governing the snapshots # Parameters governing the snapshots
Snapshots: Snapshots:
basename: eagle # Common part of the name of output files basename: eagle # Common part of the name of output files
time_first: 0. # Time of the first output (in internal units) time_first: 1. # Time of the first output (in internal units)
delta_time: 1e-3 # Time difference between consecutive outputs (in internal units) delta_time: 1e-3 # Time difference between consecutive outputs (in internal units)
# Parameters governing the conserved quantities statistics # Parameters governing the conserved quantities statistics
......
...@@ -126,6 +126,7 @@ int main(int argc, char *argv[]) { ...@@ -126,6 +126,7 @@ int main(int argc, char *argv[]) {
* scope. */ * scope. */
struct chemistry_data chemistry; struct chemistry_data chemistry;
struct cooling_function_data cooling_func; struct cooling_function_data cooling_func;
struct cosmology cosmo;
struct external_potential potential; struct external_potential potential;
struct gpart *gparts = NULL; struct gpart *gparts = NULL;
struct gravity_props gravity_properties; struct gravity_props gravity_properties;
...@@ -600,6 +601,13 @@ int main(int argc, char *argv[]) { ...@@ -600,6 +601,13 @@ int main(int argc, char *argv[]) {
phys_const_print(&prog_const); phys_const_print(&prog_const);
} }
/* Initialise the cosmology */
if (with_cosmology)
cosmology_init(params, &us, &prog_const, &cosmo);
else
cosmology_init_no_cosmo(&cosmo);
if (with_cosmology) cosmology_print(&cosmo);
/* Initialise the hydro properties */ /* Initialise the hydro properties */
if (with_hydro) hydro_props_init(&hydro_properties, params); if (with_hydro) hydro_props_init(&hydro_properties, params);
if (with_hydro) eos_init(&eos, params); if (with_hydro) eos_init(&eos, params);
...@@ -767,9 +775,9 @@ int main(int argc, char *argv[]) { ...@@ -767,9 +775,9 @@ int main(int argc, char *argv[]) {
/* Initialize the engine with the space and policies. */ /* Initialize the engine with the space and policies. */
if (myrank == 0) clocks_gettime(&tic); if (myrank == 0) clocks_gettime(&tic);
engine_init(&e, &s, params, N_total[0], N_total[1], engine_policies, engine_init(&e, &s, params, N_total[0], N_total[1], engine_policies,
talking, &reparttype, &us, &prog_const, &hydro_properties, talking, &reparttype, &us, &prog_const, &cosmo,
&gravity_properties, &potential, &cooling_func, &chemistry, &hydro_properties, &gravity_properties, &potential,
&sourceterms); &cooling_func, &chemistry, &sourceterms);
engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff, engine_config(0, &e, params, nr_nodes, myrank, nr_threads, with_aff,
talking, restart_file); talking, restart_file);
if (myrank == 0) { if (myrank == 0) {
...@@ -790,7 +798,7 @@ int main(int argc, char *argv[]) { ...@@ -790,7 +798,7 @@ int main(int argc, char *argv[]) {
"from t=%.3e until t=%.3e with %d threads and %d queues " "from t=%.3e until t=%.3e with %d threads and %d queues "
"(dt_min=%.3e, " "(dt_min=%.3e, "
"dt_max=%.3e)...", "dt_max=%.3e)...",
e.timeBegin, e.timeEnd, e.nr_threads, e.sched.nr_queues, e.dt_min, e.time_begin, e.time_end, e.nr_threads, e.sched.nr_queues, e.dt_min,
e.dt_max); e.dt_max);
fflush(stdout); fflush(stdout);
} }
...@@ -837,9 +845,9 @@ int main(int argc, char *argv[]) { ...@@ -837,9 +845,9 @@ int main(int argc, char *argv[]) {
/* Legend */ /* Legend */
if (myrank == 0) if (myrank == 0)
printf("# %6s %14s %14s %12s %12s %12s %16s [%s] %6s\n", "Step", "Time", printf("# %6s %14s %14s %9s %12s %12s %12s %16s [%s] %6s\n", "Step", "Time",
"Time-step", "Updates", "g-Updates", "s-Updates", "Wall-clock time", "Time-step", "Time-bins", "Updates", "g-Updates", "s-Updates",
clocks_getunit(), "Props"); "Wall-clock time", clocks_getunit(), "Props");
/* File for the timers */ /* File for the timers */
if (with_verbose_timers) timers_open_file(myrank); if (with_verbose_timers) timers_open_file(myrank);
...@@ -865,8 +873,7 @@ int main(int argc, char *argv[]) { ...@@ -865,8 +873,7 @@ int main(int argc, char *argv[]) {
if (with_verbose_timers) timers_print(e.step); if (with_verbose_timers) timers_print(e.step);
/* Every so often allow the user to stop the application and dump the /* Every so often allow the user to stop the application and dump the
* restart * restart files. */
* files. */
if (j % restart_stop_steps == 0) { if (j % restart_stop_steps == 0) {
force_stop = restart_stop_now(restart_dir, 0); force_stop = restart_stop_now(restart_dir, 0);
if (myrank == 0 && force_stop) if (myrank == 0 && force_stop)
...@@ -874,8 +881,7 @@ int main(int argc, char *argv[]) { ...@@ -874,8 +881,7 @@ int main(int argc, char *argv[]) {
} }
/* Also if using nsteps to exit, will not have saved any restarts on exit, /* Also if using nsteps to exit, will not have saved any restarts on exit,
* make * make sure we do that (useful in testing only). */
* sure we do that (useful in testing only). */
if (force_stop || (e.restart_onexit && e.step - 1 == nsteps)) if (force_stop || (e.restart_onexit && e.step - 1 == nsteps))
engine_dump_restarts(&e, 0, 1); engine_dump_restarts(&e, 0, 1);
......
...@@ -10,6 +10,36 @@ InternalUnitSystem: ...@@ -10,6 +10,36 @@ InternalUnitSystem:
PhysicalConstants: PhysicalConstants:
G: 6.67408e-8 # (Optional) Overwrite the value of Newton's constant used internally by the code. G: 6.67408e-8 # (Optional) Overwrite the value of Newton's constant used internally by the code.
# Cosmological parameters
Cosmology:
h: 0.6777 # Reduced Hubble constant
a_begin: 0.0078125 # Initial scale-factor of the simulation
a_end: 1.0 # Final scale factor of the simulation
Omega_m: 0.307 # Matter density parameter
Omega_lambda: 0.693 # Dark-energy density parameter
Omega_b: 0.0455 # Baryon density parameter
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 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.
h_tolerance: 1e-4 # (Optional) Relative accuracy of the Netwon-Raphson scheme for the smoothing lengths.
h_max: 10. # (Optional) Maximal allowed smoothing length in internal units. Defaults to FLT_MAX if unspecified.
max_volume_change: 1.4 # (Optional) Maximal allowed change of kernel volume over one time-step.
max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
epsilon: 0.1 # Softening length (in internal units).
a_smooth: 1.25 # (Optional) Smoothing scale in top-level cell sizes to smooth the long-range forces over (this is the default value).
r_cut_max: 4.5 # (Optional) Cut-off in number of top-level cells beyond which no FMM forces are computed (this is the default value).
r_cut_min: 0.1 # (Optional) Cut-off in number of top-level cells below which no truncation of FMM forces are performed (this is the default value).
# Parameters for the task scheduling # Parameters for the task scheduling
Scheduler: Scheduler:
nr_queues: 0 # (Optional) The number of task queues to use. Use 0 to let the system decide. nr_queues: 0 # (Optional) The number of task queues to use. Use 0 to let the system decide.
...@@ -48,27 +78,6 @@ Statistics: ...@@ -48,27 +78,6 @@ Statistics:
energy_file_name: energy # (Optional) File name for energy output energy_file_name: energy # (Optional) File name for energy output
timestep_file_name: timesteps # (Optional) File name for timing information output. Note: No underscores "_" allowed in file name timestep_file_name: timesteps # (Optional) File name for timing information output. Note: No underscores "_" allowed in file name
# 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.
h_tolerance: 1e-4 # (Optional) Relative accuracy of the Netwon-Raphson scheme for the smoothing lengths.
h_max: 10. # (Optional) Maximal allowed smoothing length in internal units. Defaults to FLT_MAX if unspecified.
max_volume_change: 1.4 # (Optional) Maximal allowed change of kernel volume over one time-step.
max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
EoS:
isothermal_internal_energy: 20.26784 # Thermal energy per unit mass for the case of isothermal equation of state (in internal units).
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
epsilon: 0.1 # Softening length (in internal units).
a_smooth: 1.25 # (Optional) Smoothing scale in top-level cell sizes to smooth the long-range forces over (this is the default value).
r_cut_max: 4.5 # (Optional) Cut-off in number of top-level cells beyond which no FMM forces are computed (this is the default value).
r_cut_min: 0.1 # (Optional) Cut-off in number of top-level cells below which no truncation of FMM forces are performed (this is the default value).
# Parameters related to the initial conditions # Parameters related to the initial conditions
InitialConditions: InitialConditions:
file_name: SedovBlast/sedov.hdf5 # The file to read file_name: SedovBlast/sedov.hdf5 # The file to read
...@@ -108,6 +117,11 @@ DomainDecomposition: ...@@ -108,6 +117,11 @@ DomainDecomposition:
minfrac: 0.9 # (Optional) Fractional of all particles that should be updated in previous step when minfrac: 0.9 # (Optional) Fractional of all particles that should be updated in previous step when
# using CPU time trigger # using CPU time trigger
# Parameters related to the equation of state ------------------------------------------
EoS:
isothermal_internal_energy: 20.26784 # Thermal energy per unit mass for the case of isothermal equation of state (in internal units).
# Parameters related to external potentials -------------------------------------------- # Parameters related to external potentials --------------------------------------------
# Point mass external potentials # Point mass external potentials
......
...@@ -148,8 +148,8 @@ def parse_files(): ...@@ -148,8 +148,8 @@ def parse_files():
# Loop over all files for a given series and load the times # Loop over all files for a given series and load the times
for j in range(0,len(file_list)): for j in range(0,len(file_list)):
times = np.loadtxt(file_list[j],usecols=(6,)) times = np.loadtxt(file_list[j],usecols=(8,))
updates = np.loadtxt(file_list[j],usecols=(3,)) updates = np.loadtxt(file_list[j],usecols=(5,))
totalTime[i].append(np.sum(times)) totalTime[i].append(np.sum(times))
sumTotal.append(np.sum(totalTime[i])) sumTotal.append(np.sum(totalTime[i]))
......
...@@ -149,8 +149,8 @@ def parse_files(): ...@@ -149,8 +149,8 @@ def parse_files():
# Loop over all files for a given series and load the times # Loop over all files for a given series and load the times
for j in range(0,len(file_list)): for j in range(0,len(file_list)):
times = np.loadtxt(file_list[j],usecols=(6,), skiprows=11) times = np.loadtxt(file_list[j],usecols=(8,))
updates = np.loadtxt(file_list[j],usecols=(3,), skiprows=11) updates = np.loadtxt(file_list[j],usecols=(5,))
totalTime[i].append(np.sum(times)) totalTime[i].append(np.sum(times))
sumTotal.append(np.sum(totalTime[i])) sumTotal.append(np.sum(totalTime[i]))
......
...@@ -47,7 +47,7 @@ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \ ...@@ -47,7 +47,7 @@ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \ sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h profiler.h \
dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \ dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \
gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \ gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \
chemistry.h chemistry_io.h chemistry_struct.h restart.h chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h
# Common source files # Common source files
AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
...@@ -59,7 +59,7 @@ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \ ...@@ -59,7 +59,7 @@ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
statistics.c runner_doiact_vec.c profiler.c dump.c logger.c \ statistics.c runner_doiact_vec.c profiler.c dump.c logger.c \
part_type.c xmf.c gravity_properties.c gravity.c \ part_type.c xmf.c gravity_properties.c gravity.c \
collectgroup.c hydro_space.c equation_of_state.c \ collectgroup.c hydro_space.c equation_of_state.c \
chemistry.c restart.c chemistry.c cosmology.c restart.c
# Include files for distribution, not installation. # Include files for distribution, not installation.
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
......
...@@ -42,9 +42,9 @@ __attribute__((always_inline)) INLINE static int cell_are_part_drifted( ...@@ -42,9 +42,9 @@ __attribute__((always_inline)) INLINE static int cell_are_part_drifted(
if (c->ti_old_part > e->ti_current) if (c->ti_old_part > e->ti_current)
error( error(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) " "Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e)", "and e->ti_current=%lld (t=%e, a=%e)",
c->ti_old_part, c->ti_old_part * e->timeBase, e->ti_current, c->ti_old_part, c->ti_old_part * e->time_base, e->ti_current,
e->ti_current * e->timeBase); e->ti_current * e->time_base, e->cosmology->a);
#endif #endif
return (c->ti_old_part == e->ti_current); return (c->ti_old_part == e->ti_current);
...@@ -66,8 +66,8 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted( ...@@ -66,8 +66,8 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
error( error(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) " "Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e)", "and e->ti_current=%lld (t=%e)",
c->ti_old_gpart, c->ti_old_gpart * e->timeBase, e->ti_current, c->ti_old_gpart, c->ti_old_gpart * e->time_base, e->ti_current,
e->ti_current * e->timeBase); e->ti_current * e->time_base);
#endif #endif
return (c->ti_old_gpart == e->ti_current); return (c->ti_old_gpart == e->ti_current);
...@@ -89,9 +89,9 @@ __attribute__((always_inline)) INLINE static int cell_is_active_hydro( ...@@ -89,9 +89,9 @@ __attribute__((always_inline)) INLINE static int cell_is_active_hydro(
if (c->ti_hydro_end_min < e->ti_current) if (c->ti_hydro_end_min < e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and " "cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)", "e->ti_current=%lld (t=%e, a=%e)",
c->ti_hydro_end_min, c->ti_hydro_end_min * e->timeBase, e->ti_current, c->ti_hydro_end_min, c->ti_hydro_end_min * e->time_base, e->ti_current,
e->ti_current * e->timeBase); e->ti_current * e->time_base, e->cosmology->a);
#endif #endif
return (c->ti_hydro_end_min == e->ti_current); return (c->ti_hydro_end_min == e->ti_current);
...@@ -132,9 +132,9 @@ __attribute__((always_inline)) INLINE static int cell_is_active_gravity( ...@@ -132,9 +132,9 @@ __attribute__((always_inline)) INLINE static int cell_is_active_gravity(
if (c->ti_gravity_end_min < e->ti_current) if (c->ti_gravity_end_min < e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and " "cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)", "e->ti_current=%lld (t=%e, a=%e)",
c->ti_gravity_end_min, c->ti_gravity_end_min * e->timeBase, c->ti_gravity_end_min, c->ti_gravity_end_min * e->time_base,
e->ti_current, e->ti_current * e->timeBase); e->ti_current, e->ti_current * e->time_base, e->cosmology->a);
#endif #endif
return (c->ti_gravity_end_min == e->ti_current); return (c->ti_gravity_end_min == e->ti_current);
...@@ -265,9 +265,9 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_hydro( ...@@ -265,9 +265,9 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_hydro(
if (c->ti_hydro_beg_max > e->ti_current) if (c->ti_hydro_beg_max > e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and " "cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)", "e->ti_current=%lld (t=%e, a=%e)",
c->ti_hydro_beg_max, c->ti_hydro_beg_max * e->timeBase, e->ti_current, c->ti_hydro_beg_max, c->ti_hydro_beg_max * e->time_base, e->ti_current,
e->ti_current * e->timeBase); e->ti_current * e->time_base, e->cosmology->a);
#endif #endif
return (c->ti_hydro_beg_max == e->ti_current); return (c->ti_hydro_beg_max == e->ti_current);
...@@ -287,9 +287,9 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_gravity( ...@@ -287,9 +287,9 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_gravity(
if (c->ti_gravity_beg_max > e->ti_current)