Skip to content
Snippets Groups Projects

Drift on demand

Merged Matthieu Schaller requested to merge drift_on_demand into master
+ 291
189
Compare changes
  • Side-by-side
  • Inline
Files
+ 8
11
@@ -30,13 +30,11 @@
@@ -30,13 +30,11 @@
/**
/**
* @brief Check that a cell been drifted to the current time.
* @brief Check that a cell been drifted to the current time.
*
*
* Only used for debugging. Calls error() if the cell has not
* been drifted. Does nothing if SWIFT_DEBUG_CHECKS is not defined.
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
 
* @return 1 if the #cell has been drifted to the current time, 0 otherwise.
*/
*/
__attribute__((always_inline)) INLINE static void cell_is_drifted(
__attribute__((always_inline)) INLINE static int cell_is_drifted(
const struct cell *c, const struct engine *e) {
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
@@ -45,14 +43,9 @@ __attribute__((always_inline)) INLINE static void cell_is_drifted(
@@ -45,14 +43,9 @@ __attribute__((always_inline)) INLINE static void cell_is_drifted(
"Cell has been drifted too far forward in time! c->ti_old=%d "
"Cell has been drifted too far forward in time! c->ti_old=%d "
"e->ti_current=%d",
"e->ti_current=%d",
c->ti_old, e->ti_current);
c->ti_old, e->ti_current);
if (c->ti_old != e->ti_current) {
error(
"Cell has not been drifted to the current time c->ti_old=%d, "
"e->ti_current=%d",
c->ti_old, e->ti_current);
}
#endif
#endif
 
 
return (c->ti_old == e->ti_current);
}
}
/**
/**
@@ -60,6 +53,7 @@ __attribute__((always_inline)) INLINE static void cell_is_drifted(
@@ -60,6 +53,7 @@ __attribute__((always_inline)) INLINE static void cell_is_drifted(
*
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
 
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
*/
__attribute__((always_inline)) INLINE static int cell_is_active(
__attribute__((always_inline)) INLINE static int cell_is_active(
const struct cell *c, const struct engine *e) {
const struct cell *c, const struct engine *e) {
@@ -78,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
@@ -78,6 +72,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
*
*
* @param c The #cell.
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
 
* @return 1 if all particles in a #cell are active, 0 otherwise.
*/
*/
__attribute__((always_inline)) INLINE static int cell_is_all_active(
__attribute__((always_inline)) INLINE static int cell_is_all_active(
const struct cell *c, const struct engine *e) {
const struct cell *c, const struct engine *e) {
@@ -96,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active(
@@ -96,6 +91,7 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active(
*
*
* @param p The #part.
* @param p The #part.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
 
* @return 1 if the #part is active, 0 otherwise.
*/
*/
__attribute__((always_inline)) INLINE static int part_is_active(
__attribute__((always_inline)) INLINE static int part_is_active(
const struct part *p, const struct engine *e) {
const struct part *p, const struct engine *e) {
@@ -114,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active(
@@ -114,6 +110,7 @@ __attribute__((always_inline)) INLINE static int part_is_active(
*
*
* @param gp The #gpart.
* @param gp The #gpart.
* @param e The #engine containing information about the current time.
* @param e The #engine containing information about the current time.
 
* @return 1 if the #gpart is active, 0 otherwise.
*/
*/
__attribute__((always_inline)) INLINE static int gpart_is_active(
__attribute__((always_inline)) INLINE static int gpart_is_active(
const struct gpart *gp, const struct engine *e) {
const struct gpart *gp, const struct engine *e) {
Loading