Commit 3aac982c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added the new files to the Makefile. Code formatting.

parent dff26b5e
......@@ -65,11 +65,13 @@ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
kernel_long_gravity.h vector.h cache.h runner_doiact.h runner_doiact_vec.h runner_doiact_grav.h runner_doiact_fft.h \
runner_doiact_nosort.h units.h intrinsics.h minmax.h kick.h timestep.h drift.h adiabatic_index.h io_properties.h \
dimension.h equation_of_state.h part_type.h periodic.h memswap.h dump.h logger.h \
dimension.h part_type.h periodic.h memswap.h dump.h logger.h \
gravity.h gravity_io.h gravity_cache.h \
gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
gravity/Default/gravity_debug.h gravity/Default/gravity_part.h \
sourceterms.h \
equation_of_state.h \
equation_of_state/ideal_gas/equation_of_state.h equation_of_state/isothermal/equation_of_state.h
hydro.h hydro_io.h \
hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
......
......@@ -23,4 +23,3 @@
/* Equation of state for the physics model
* (temporary ugly solution as a global variable) */
struct eos_parameters eos;
......@@ -19,6 +19,13 @@
#ifndef SWIFT_EQUATION_OF_STATE_H
#define SWIFT_EQUATION_OF_STATE_H
/**
* @file equation_of_state.h
* @brief Defines the equation of state of the gas we simulate in the form of
* relations between thermodynamic quantities. These are later used internally
* by all hydro schemes
*/
/* Config parameters. */
#include "../config.h"
......
......@@ -19,16 +19,6 @@
#ifndef SWIFT_IDEAL_GAS_EQUATION_OF_STATE_H
#define SWIFT_IDEAL_GAS_EQUATION_OF_STATE_H
/**
* @file equation_of_state.h
* @brief Defines the equation of state of the gas we simulate in the form of
* relations between thermodynamic quantities. These are later used internally
* by all hydro schemes
*/
/* Config parameters. */
#include "../config.h"
/* Some standard headers. */
#include <math.h>
......@@ -110,8 +100,7 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_entropy_from_internal_energy(
float density, float u) {
gas_entropy_from_internal_energy(float density, float u) {
return hydro_gamma_minus_one * u * pow_minus_gamma_minus_one(density);
}
......@@ -125,8 +114,7 @@ gas_entropy_from_internal_energy(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_pressure_from_internal_energy(
float density, float u) {
gas_pressure_from_internal_energy(float density, float u) {
return hydro_gamma_minus_one * u * density;
}
......@@ -141,8 +129,7 @@ gas_pressure_from_internal_energy(
* @return The internal energy \f$u\f$.
*/
__attribute__((always_inline)) INLINE static float
gas_internal_energy_from_pressure(
float density, float pressure) {
gas_internal_energy_from_pressure(float density, float pressure) {
return hydro_one_over_gamma_minus_one * pressure / density;
}
......@@ -155,8 +142,7 @@ gas_internal_energy_from_pressure(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_soundspeed_from_internal_energy(
float density, float u) {
gas_soundspeed_from_internal_energy(float density, float u) {
return sqrtf(u * hydro_gamma * hydro_gamma_minus_one);
}
......@@ -198,7 +184,6 @@ __attribute__((always_inline)) INLINE static void eos_print(
message("Adiabatic index gamma: %f.", hydro_gamma);
}
#if defined(HAVE_HDF5)
/**
* @brief Write equation of state information to the snapshot
......@@ -207,7 +192,7 @@ __attribute__((always_inline)) INLINE static void eos_print(
* @param e The #eos_parameters
*/
__attribute__((always_inline)) INLINE static void eos_print_snapshot(
hid_t h_grpsph, const struct eos_parameters *e ) {
hid_t h_grpsph, const struct eos_parameters *e) {
io_write_attribute_f(h_grpsph, "Adiabatic index", hydro_gamma);
......
......@@ -19,16 +19,6 @@
#ifndef SWIFT_ISOTHERMAL_EQUATION_OF_STATE_H
#define SWIFT_ISOTHERMAL_EQUATION_OF_STATE_H
/**
* @file equation_of_state.h
* @brief Defines the equation of state of the gas we simulate in the form of
* relations between thermodynamic quantities. These are later used internally
* by all hydro schemes
*/
/* Config parameters. */
#include "../config.h"
/* Some standard headers. */
#include <math.h>
......@@ -92,7 +82,7 @@ __attribute__((always_inline)) INLINE static float gas_entropy_from_pressure(
float density, float pressure) {
return hydro_gamma_minus_one * eos.isothermal_internal_energy *
pow_minus_gamma_minus_one(density);
pow_minus_gamma_minus_one(density);
}
/**
......@@ -122,11 +112,10 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_entropy_from_internal_energy(
float density, float u) {
gas_entropy_from_internal_energy(float density, float u) {
return hydro_gamma_minus_one * eos.isothermal_internal_energy *
pow_minus_gamma_minus_one(density);
pow_minus_gamma_minus_one(density);
}
/**
......@@ -139,8 +128,7 @@ gas_entropy_from_internal_energy(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_pressure_from_internal_energy(
float density, float u) {
gas_pressure_from_internal_energy(float density, float u) {
return hydro_gamma_minus_one * eos.isothermal_internal_energy * density;
}
......@@ -155,8 +143,7 @@ gas_pressure_from_internal_energy(
* @return The internal energy \f$u\f$ (which is constant).
*/
__attribute__((always_inline)) INLINE static float
gas_internal_energy_from_pressure(
float density, float pressure) {
gas_internal_energy_from_pressure(float density, float pressure) {
return eos.isothermal_internal_energy;
}
......@@ -171,8 +158,7 @@ gas_internal_energy_from_pressure(
* @param u The internal energy \f$u\f$
*/
__attribute__((always_inline)) INLINE static float
gas_soundspeed_from_internal_energy(
float density, float u) {
gas_soundspeed_from_internal_energy(float density, float u) {
return sqrtf(eos.isothermal_internal_energy * hydro_gamma *
hydro_gamma_minus_one);
......@@ -207,7 +193,7 @@ __attribute__((always_inline)) INLINE static void eos_init(
struct eos_parameters *e, const struct swift_params *params) {
e->isothermal_internal_energy =
parser_get_param_float(params, "EoS:isothermal_internal_energy");
parser_get_param_float(params, "EoS:isothermal_internal_energy");
}
/**
......@@ -219,9 +205,9 @@ __attribute__((always_inline)) INLINE static void eos_print(
const struct eos_parameters *e) {
message(
"Equation of state: Isothermal with internal energy "
"per unit mass set to %f.",
e->isothermal_internal_energy);
"Equation of state: Isothermal with internal energy "
"per unit mass set to %f.",
e->isothermal_internal_energy);
message("Adiabatic index gamma: %f.", hydro_gamma);
}
......
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