Skip to content
Snippets Groups Projects

Slimming down of foreign gpart + reduced comm size

Open Matthieu Schaller requested to merge pack_foreign_gpart into master
Compare and
30 files
+ 1112
233
Compare changes
  • Side-by-side
  • Inline
Files
30
@@ -29,6 +29,27 @@
#include "kernel_gravity.h"
#include "minmax.h"
/**
* @brief Copy the content of a #gpart into a #gpart_foreign.
*/
__attribute__((always_inline)) INLINE static void gravity_foreign_copy(
struct gpart_foreign* packed, const struct gpart* full) {
packed->x[0] = full->x[0];
packed->x[1] = full->x[1];
packed->x[2] = full->x[2];
packed->mass = full->mass;
packed->time_bin = full->time_bin;
packed->type = full->type;
#ifdef SWIFT_DEBUG_CHECKS
packed->ti_drift = full->ti_drift;
#endif
}
/**
* @brief Returns the mass of a particle
*
@@ -55,6 +76,22 @@ __attribute__((always_inline)) INLINE static float gravity_get_softening(
return grav_props->epsilon_DM_cur;
}
/**
* @brief Returns the current co-moving softening of a foreign particle
*
* Note that in this basic gravity scheme, all particles have
* the same softening length.
*
* @param gp The particle of interest
* @param grav_props The global gravity properties.
*/
__attribute__((always_inline)) INLINE static float
gravity_get_softening_foreign(const struct gpart_foreign* gp,
const struct gravity_props* restrict grav_props) {
return grav_props->epsilon_DM_cur;
}
/**
* @brief Add a contribution to this particle's potential from the tree.
*
Loading