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

Apply code formatting script. Remove unnecessary guards in the equation of state file.

parent 0d969cd4
......@@ -158,7 +158,6 @@ void engine_make_gravity_hierarchical_tasks(struct engine *e, struct cell *c,
if (is_with_external_gravity)
c->grav_external = scheduler_addtask(
s, task_type_grav_external, task_subtype_none, 0, 0, c, NULL, 0);
}
}
......
......@@ -40,9 +40,7 @@
/* ------------------------------------------------------------------------- */
#if defined(EOS_IDEAL_GAS)
#if defined(EOS_ISOTHERMAL_GAS)
#error cannot have both!
#endif
/**
* @brief Returns the internal energy given density and entropy
*
......
......@@ -48,12 +48,12 @@
#include "engine.h"
#include "error.h"
#include "gravity.h"
#include "sourceterms.h"
#include "hydro.h"
#include "hydro_properties.h"
#include "kick.h"
#include "minmax.h"
#include "scheduler.h"
#include "sourceterms.h"
#include "space.h"
#include "task.h"
#include "timers.h"
......@@ -127,8 +127,10 @@ void runner_do_sourceterms(struct runner *r, struct cell *c, int timer) {
const double cell_width[3] = {c->width[0], c->width[1], c->width[2]};
const int ti_current = r->e->ti_current;
const struct sourceterms *sourceterms = r->e->sourceterms;
const double location[3] = {sourceterms->supernova.x, sourceterms->supernova.y, sourceterms->supernova.z};
const int dimen=3;
const double location[3] = {sourceterms->supernova.x,
sourceterms->supernova.y,
sourceterms->supernova.z};
const int dimen = 3;
const double timeBase = r->e->timeBase;
TIMER_TIC;
......@@ -141,7 +143,7 @@ void runner_do_sourceterms(struct runner *r, struct cell *c, int timer) {
}
/* does cell contain explosion? */
if(count > 0) {
if (count > 0) {
const int incell = is_in_cell(cell_min, cell_width, location, dimen);
if (incell == 1) {
......@@ -152,7 +154,7 @@ void runner_do_sourceterms(struct runner *r, struct cell *c, int timer) {
/* Get a direct pointer on the part. */
struct part *restrict p = &parts[i];
if(p->id > imax) {
if (p->id > imax) {
imax = p->id;
sn_part = p;
}
......
......@@ -43,6 +43,5 @@ __attribute__((always_inline)) INLINE static void do_supernova_feedback(
const float u_old = hydro_get_internal_energy(p, 0);
const float u_new = u_old + sourceterms->supernova.energy / hydro_get_mass(p);
hydro_set_internal_energy(p, u_new);
};
#endif /* SWIFT_SN_FEEDBACK_H */
Supports Markdown
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