Commit f38e3714 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Selection of the different modules is now done in the configure script.

parent 3652fec1
......@@ -184,6 +184,18 @@ if test "$enable_task_debugging" = "yes"; then
AC_DEFINE([SWIFT_DEBUG_TASKS],1,[Enable task debugging])
fi
# Check if expensive debugging is on.
AC_ARG_ENABLE([debugging-checks],
[AS_HELP_STRING([--enable-debugging-checks],
[Activate expensive consistency checks @<:@yes/no@:>@]
)],
[enable_debugging_checks="$enableval"],
[enable_debugging_checks="no"]
)
if test "$enable_debugging_checks" = "yes"; then
AC_DEFINE([SWIFT_DEBUG_CHECKS],1,[Enable expensive debugging])
fi
# Define HAVE_POSIX_MEMALIGN if it works.
AX_FUNC_POSIX_MEMALIGN
......@@ -520,20 +532,20 @@ fi
# Hydro scheme.
AC_ARG_WITH([hydro],
[AS_HELP_STRING([--with-hydro=<scheme>],
[Hydro dynamics to use @<:@gadget2,minimal,hopkins,default,gizmo default gadget2@:>@]
[Hydro dynamics to use @<:@gadget2, minimal, hopkins, default, gizmo default: gadget2@:>@]
)],
[with_hydro="$withval"],
[with_hydro="gadget2"]
)
case "$with_hydro" in
gadget2)
AC_DEFINE([GADGET2_SPH], [1], [Gadget2 SPH])
AC_DEFINE([GADGET2_SPH], [1], [Gadget-2 SPH])
;;
minimal)
AC_DEFINE([MINIMAL_SPH], [1], [Minimal SPH])
;;
hopkins)
AC_DEFINE([HOPKINS_PE_SPH], [1], [Hopkins Pressure-Entropy SPH])
AC_DEFINE([HOPKINS_PE_SPH], [1], [Pressure-Entropy SPH])
;;
default)
AC_DEFINE([DEFAULT_SPH], [1], [Default SPH])
......@@ -543,16 +555,48 @@ case "$with_hydro" in
;;
*)
AC_MSG_ERROR([unknown hydrodynamics scheme: $with_hydro])
AC_MSG_ERROR([Unknown hydrodynamics scheme: $with_hydro])
;;
esac
# SPH Kernel function
AC_ARG_WITH([kernel],
[AS_HELP_STRING([--with-kernel=<kernel>],
[Kernel function to use @<:@cubic-spline, quartic-spline, quintic-spline, wendland-C2, wendland-C4, wendland-C6 default: cubic-spline@:>@]
)],
[with_kernel="$withval"],
[with_kernel="cubic-spline"]
)
case "$with_kernel" in
cubic-spline)
AC_DEFINE([CUBIC_SPLINE_KERNEL], [1], [Cubic spline kernel])
;;
quartic-spline)
AC_DEFINE([QUARTIC_SPLINE_KERNEL], [1], [Quartic spline kernel])
;;
quintic-spline)
AC_DEFINE([QUINTIC_SPLINE_KERNEL], [1], [Quintic spline kernel])
;;
wendland-C2)
AC_DEFINE([WENDLAND_C2_KERNEL], [1], [Wendland-C2 kernel])
;;
wendland-C4)
AC_DEFINE([WENDLAND_C4_KERNEL], [1], [Wendland-C4 kernel])
;;
wendland-C6)
AC_DEFINE([WENDLAND_C6_KERNEL], [1], [Wendland-C6 kernel])
;;
*)
AC_MSG_ERROR([Unknown kernel function: $with_kernel])
;;
esac
# Dimensionality of the hydro scheme.
AC_ARG_WITH([hydro-dimension],
[AS_HELP_STRING([--with-hydro-dimension=3, 2 or 1],
[dimensionality of problem @<:@3/2/1 default 3@:>@]
[AS_HELP_STRING([--with-hydro-dimension=<dim>],
[dimensionality of problem @<:@3/2/1 default: 3@:>@]
)],
[with_dimension="$withval"],
[with_dimension="3"]
......@@ -562,16 +606,116 @@ case "$with_dimension" in
AC_DEFINE([HYDRO_DIMENSION_1D], [1], [1D analysis])
;;
2)
AC_DEFINE([HYDRO_DIMENSION_2D], [1], [2D analysis])
AC_DEFINE([HYDRO_DIMENSION_2D], [2], [2D analysis])
;;
3)
AC_DEFINE([HYDRO_DIMENSION_3D], [1], [3D analysis])
AC_DEFINE([HYDRO_DIMENSION_3D], [3], [3D analysis])
;;
*)
AC_MSG_ERROR([Dimensionality must be 1, 2 or 3])
;;
esac
# Equation of state
AC_ARG_WITH([equation-of-state],
[AS_HELP_STRING([--with-equation-of-state=<EoS>],
[equation of state @<:@ideal-gas, isothermal-gas default: ideal-gas@:>@]
)],
[with_eos="$withval"],
[with_eos="ideal-gas"]
)
case "$with_eos" in
ideal-gas)
AC_DEFINE([EOS_IDEAL_GAS], [1], [Ideal gas equation of state])
;;
isothermal-gas)
AC_DEFINE([EOS_ISOTHERMAL_GAS], [1], [Isothermal gas equation of state])
;;
*)
AC_MSG_ERROR([Unknown equation of state: $with_eos])
;;
esac
# Adiabatic index
AC_ARG_WITH([adiabatic-index],
[AS_HELP_STRING([--with-adiabatic-index=<gamma>],
[adiabatic index @<:@5/3, 7/5, 4/3, 2 default: 5/3@:>@]
)],
[with_gamma="$withval"],
[with_gamma="5/3"]
)
case "$with_gamma" in
5/3)
AC_DEFINE([HYDRO_GAMMA_5_3], [5./3.], [Adiabatic index is 5/3])
;;
7/5)
AC_DEFINE([HYDRO_GAMMA_7_5], [7./5.], [Adiabatic index is 7/5])
;;
4/3)
AC_DEFINE([HYDRO_GAMMA_4_3], [4./3.], [Adiabatic index is 4/3])
;;
2)
AC_DEFINE([HYDRO_GAMMA_2_1], [2.], [Adiabatic index is 2])
;;
*)
AC_MSG_ERROR([Unknown adiabatic index: $with_gamma])
;;
esac
# Cooling function
AC_ARG_WITH([cooling],
[AS_HELP_STRING([--with-cooling=<function>],
[cooling function @<:@none, const-du, const-lambda, grackle default: none@:>@]
)],
[with_cooling="$withval"],
[with_cooling="none"]
)
case "$with_cooling" in
none)
AC_DEFINE([COOLING_NONE], [1], [No cooling function])
;;
const-du)
AC_DEFINE([COOLING_CONST_DU], [1], [Const du/dt cooling function])
;;
const-lambda)
AC_DEFINE([COOLING_CONST_LAMBDA], [1], [Const Lambda cooling function])
;;
grackle)
AC_DEFINE([COOLING_GRACKLE], [1], [Cooling via the grackle library])
;;
*)
AC_MSG_ERROR([Unknown cooling function: $with_cooling])
;;
esac
# External potential
AC_ARG_WITH([ext-potential],
[AS_HELP_STRING([--with-ext-potential=<pot>],
[external potential @<:@none, point-mass, isothermal, softened-isothermal, disc-patch default: none@:>@]
)],
[with_potential="$withval"],
[with_potential="none"]
)
case "$with_potential" in
none)
AC_DEFINE([EXTERNAL_POTENTIAL_NONE], [1], [No external potential])
;;
point-mass)
AC_DEFINE([EXTERNAL_POTENTIAL_POINTMASS], [1], [Point-mass external potential])
;;
isothermal)
AC_DEFINE([EXTERNAL_POTENTIAL_ISOTHERMAL], [1], [Isothermal external potential])
;;
softened-isothermal)
AC_DEFINE([EXTERNAL_POTENTIAL_SOFTENED_ISOTHERMAL], [1], [Softened isothermal external potential])
;;
disc-patch)
AC_DEFINE([EXTERNAL_POTENTIAL_DISC_PATCH], [1], [Disc-patch external potential])
;;
*)
AC_MSG_ERROR([Unknown external potential: $with_potential])
;;
esac
......@@ -610,9 +754,16 @@ AC_MSG_RESULT([
libNUMA enabled : $have_numa
Using tcmalloc : $have_tcmalloc
CPU profiler : $have_profiler
Hydro scheme : $with_hydro
Dimensionality : $with_dimension
Task debugging : $enable_task_debugging
Hydro scheme : $with_hydro
Dimensionality : $with_dimension
Kernel function : $with_kernel
Equation of state : $with_eos
Adiabatic index : $with_gamma
Cooling function : $with_cooling
External potential : $with_potential
Task debugging : $enable_task_debugging
Debugging checks : $enable_debugging_checks
])
# Generate output.
......
......@@ -24,7 +24,6 @@
/* Local includes. */
#include "cell.h"
#include "const.h"
#include "engine.h"
#include "part.h"
......
......@@ -33,7 +33,6 @@
#include <math.h>
/* Local headers. */
#include "const.h"
#include "debug.h"
#include "error.h"
#include "inline.h"
......
......@@ -39,35 +39,11 @@
/* Thermal energy per unit mass used as a constant for the isothermal EoS */
#define const_isothermal_internal_energy 20.2615290634f
/* Dimensionality of the problem */
//#define HYDRO_DIMENSION_3D
//#define HYDRO_DIMENSION_2D
//#define HYDRO_DIMENSION_1D
/* Hydrodynamical adiabatic index. */
#define HYDRO_GAMMA_5_3
//#define HYDRO_GAMMA_7_5
//#define HYDRO_GAMMA_4_3
//#define HYDRO_GAMMA_2_1
/* Equation of state choice */
#define EOS_IDEAL_GAS
//#define EOS_ISOTHERMAL_GAS
/* Kernel function to use */
#define CUBIC_SPLINE_KERNEL
//#define QUARTIC_SPLINE_KERNEL
//#define QUINTIC_SPLINE_KERNEL
//#define WENDLAND_C2_KERNEL
//#define WENDLAND_C4_KERNEL
//#define WENDLAND_C6_KERNEL
/* SPH variant to use */
//#define MINIMAL_SPH
//#define GADGET2_SPH
//#define HOPKINS_PE_SPH
//#define DEFAULT_SPH
//#define GIZMO_SPH
/* Self gravity stuff. */
#define const_gravity_multipole_order 1
#define const_gravity_a_smooth 1.25f
#define const_gravity_r_cut 4.5f
#define const_gravity_eta 0.025f
/* Riemann solver to use (GIZMO_SPH only) */
#define RIEMANN_SOLVER_EXACT
......@@ -84,30 +60,8 @@
#define SLOPE_LIMITER_PER_FACE
#define SLOPE_LIMITER_CELL_WIDE
/* Self gravity stuff. */
#define const_gravity_multipole_order 1
#define const_gravity_a_smooth 1.25f
#define const_gravity_r_cut 4.5f
#define const_gravity_eta 0.025f
/* External gravity properties */
#define EXTERNAL_POTENTIAL_NONE
//#define EXTERNAL_POTENTIAL_POINTMASS
//#define EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
//#define EXTERNAL_POTENTIAL_SOFTENED_ISOTHERMAL_POTENTIAL
//#define EXTERNAL_POTENTIAL_DISC_PATCH
/* Source terms */
#define SOURCETERMS_NONE
//#define SOURCETERMS_SN_FEEDBACK
/* Cooling properties */
#define COOLING_NONE
//#define COOLING_CONST_DU
//#define COOLING_CONST_LAMBDA
//#define COOLING_GRACKLE
/* Are we debugging ? */
//#define SWIFT_DEBUG_CHECKS
#endif /* SWIFT_CONST_H */
......@@ -27,9 +27,6 @@
/* Config parameters. */
#include "../config.h"
/* Local headers. */
#include "const.h"
/* Import the right cooling definition */
#if defined(COOLING_NONE)
#include "./cooling/none/cooling.h"
......
......@@ -29,7 +29,6 @@
#include "../config.h"
/* Local headers. */
#include "const.h"
#include "inline.h"
#include "vector.h"
......
......@@ -34,7 +34,6 @@
/* Local headers. */
#include "adiabatic_index.h"
#include "const.h"
#include "debug.h"
#include "inline.h"
......
......@@ -20,7 +20,6 @@
#define SWIFT_HYDRO_H
/* Includes. */
#include "const.h"
#include "hydro_properties.h"
#include "kernel_hydro.h"
#include "part.h"
......
......@@ -35,7 +35,6 @@
#include <math.h>
/* Local headers. */
#include "const.h"
#include "dimension.h"
#include "error.h"
#include "inline.h"
......
......@@ -32,7 +32,6 @@
/* Local headers. */
#include "align.h"
#include "const.h"
/* Some constants. */
#define part_align 128
......
......@@ -27,17 +27,14 @@
/* Config parameters. */
#include "../config.h"
/* Local includes. */
#include "const.h"
/* Import the right external potential definition */
#if defined(EXTERNAL_POTENTIAL_NONE)
#include "./potential/none/potential.h"
#elif defined(EXTERNAL_POTENTIAL_POINTMASS)
#include "./potential/point_mass/potential.h"
#elif defined(EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL)
#elif defined(EXTERNAL_POTENTIAL_ISOTHERMAL)
#include "./potential/isothermal/potential.h"
#elif defined(EXTERNAL_POTENTIAL_SOFTENED_ISOTHERMAL_POTENTIAL)
#elif defined(EXTERNAL_POTENTIAL_SOFTENED_ISOTHERMAL)
#include "./potential/softened_isothermal/potential.h"
#elif defined(EXTERNAL_POTENTIAL_DISC_PATCH)
#include "./potential/disc_patch/potential.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment