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

Also pass the cosmological model to the chemistry_end_density() function

parent 78eeaf95
......@@ -72,9 +72,11 @@ __attribute__((always_inline)) INLINE static void chemistry_init_part(
*
* @param p The particle to act upon.
* @param cd #chemistry_data containing chemistry informations.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void chemistry_end_density(
struct part* restrict p, const struct chemistry_data* cd) {}
struct part* restrict p, const struct chemistry_data* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets the chemistry properties of the (x-)particles to a valid start
......
......@@ -30,6 +30,7 @@
/* Local includes. */
#include "chemistry_struct.h"
#include "cosmology.h"
#include "error.h"
#include "hydro.h"
#include "parser.h"
......@@ -77,9 +78,11 @@ static INLINE void chemistry_print_backend(const struct chemistry_data* data) {
*
* @param p The particle to act upon
* @param cd The global chemistry information.
* @param cosmo The current cosmological model.
*/
__attribute__((always_inline)) INLINE static void chemistry_end_density(
struct part* restrict p, const struct chemistry_data* cd) {}
struct part* restrict p, const struct chemistry_data* cd,
const struct cosmology* cosmo) {}
/**
* @brief Sets the chemistry properties of the (x-)particles to a valid start
......
......@@ -656,6 +656,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
const struct space *s = e->s;
const struct hydro_space *hs = &s->hs;
const struct cosmology *cosmo = e->cosmology;
const struct chemistry_data *chemistry = e->chemistry;
const float hydro_h_max = e->hydro_properties->h_max;
const float eps = e->hydro_properties->h_tolerance;
const float hydro_eta_dim =
......@@ -717,7 +718,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
/* Finish the density calculation */
hydro_end_density(p, cosmo);
chemistry_end_density(p, e->chemistry);
chemistry_end_density(p, chemistry, cosmo);
/* Compute one step of the Newton-Raphson scheme */
const float n_sum = p->density.wcount * h_old_dim;
......
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