Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
3476460d
Commit
3476460d
authored
Jun 26, 2019
by
Josh Borrow
Committed by
Matthieu Schaller
Jun 26, 2019
Browse files
Added diffusion reset in hydro when doing feedback and updated function signatures
parent
5c66158b
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/black_holes/EAGLE/black_holes_iact.h
View file @
3476460d
...
...
@@ -208,7 +208,7 @@ runner_iact_nonsym_bh_feedback(const float r2, const float *dx, const float hi,
hydro_set_drifted_physical_internal_energy
(
pj
,
cosmo
,
u_new
);
/* Impose maximal viscosity */
hydro_
set_viscosity_alpha_max
_feedback
(
pj
);
hydro_
diffusive
_feedback
_reset
(
pj
);
/* message( */
/* "We did some AGN heating! id %llu BH id %llu probability " */
...
...
src/feedback/EAGLE/feedback_iact.h
View file @
3476460d
...
...
@@ -301,7 +301,7 @@ runner_iact_nonsym_feedback_apply(const float r2, const float *dx,
hydro_set_drifted_physical_internal_energy
(
pj
,
cosmo
,
u_new
);
/* Impose maximal viscosity */
hydro_
set_viscosity_alpha_max
_feedback
(
pj
);
hydro_
diffusive
_feedback
_reset
(
pj
);
/* message( */
/* "We did some heating! id %llu star id %llu probability %.5e " */
...
...
src/hydro/AnarchyDU/hydro.h
View file @
3476460d
...
...
@@ -423,15 +423,18 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_viscosity_alpha_max_feedback
(
struct
part
*
restrict
p
)
{
hydro_diffusive_feedback_reset
(
struct
part
*
restrict
p
)
{
/* Set the viscosity to the max, and the diffusion to the min */
hydro_set_viscosity_alpha
(
p
,
hydro_props_default_viscosity_alpha_feedback_reset
);
p
->
diffusion
.
alpha
=
hydro_props_default_diffusion_alpha_feedback_reset
;
}
/**
...
...
src/hydro/AnarchyDU/hydro_parameters.h
View file @
3476460d
...
...
@@ -76,6 +76,14 @@
* sets the decay length for the diffusion. */
#define hydro_props_default_viscosity_length 0.25f
/* Diffusion parameters -- FIXED -- MUST BE DEFINED AT COMPILE-TIME */
/*! The diffusion that the particles are reset to after being hit by a
* feedback event. This should be set to the same value as the
* hydro_props_default_diffusion_alpha in fixed schemes, and likely
* to hydro_props_default_diffusion_alpha_min in variable schemes. */
#define hydro_props_default_diffusion_alpha_feedback_reset 0.0f
/* Diffusion parameters -- Defaults; can be changed at run-time */
/*! The "initial" diffusion, or the fixed value for non-variable
...
...
src/hydro/AnarchyPU/hydro.h
View file @
3476460d
...
...
@@ -431,15 +431,18 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_viscosity_alpha_max_feedback
(
struct
part
*
restrict
p
)
{
hydro_diffusive_feedback_reset
(
struct
part
*
restrict
p
)
{
/* Set the viscosity to the max, and the diffusion to the min */
hydro_set_viscosity_alpha
(
p
,
hydro_props_default_viscosity_alpha_feedback_reset
);
p
->
diffusion
.
alpha
=
hydro_props_default_diffusion_alpha_feedback_reset
;
}
/**
...
...
src/hydro/AnarchyPU/hydro_parameters.h
View file @
3476460d
...
...
@@ -76,6 +76,14 @@
* sets the decay length for the diffusion. */
#define hydro_props_default_viscosity_length 0.25f
/* Diffusion parameters -- FIXED -- MUST BE DEFINED AT COMPILE-TIME */
/*! The diffusion that the particles are reset to after being hit by a
* feedback event. This should be set to the same value as the
* hydro_props_default_diffusion_alpha in fixed schemes, and likely
* to hydro_props_default_diffusion_alpha_min in variable schemes. */
#define hydro_props_default_diffusion_alpha_feedback_reset 0.0f
/* Diffusion parameters -- Defaults; can be changed at run-time */
/* The "initial" diffusion, or the fixed value for non-variable
...
...
src/hydro/Default/hydro.h
View file @
3476460d
...
...
@@ -423,13 +423,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
hydro_set_viscosity_alpha
(
p
,
hydro_props_default_viscosity_alpha_feedback_reset
);
}
...
...
src/hydro/Gadget2/hydro.h
View file @
3476460d
...
...
@@ -413,13 +413,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* This scheme has fixed alpha */
}
...
...
src/hydro/GizmoMFM/hydro.h
View file @
3476460d
...
...
@@ -1048,7 +1048,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* Purposefully left empty */
}
...
...
src/hydro/GizmoMFV/hydro.h
View file @
3476460d
...
...
@@ -1119,7 +1119,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* Purposefully left empty */
}
...
...
src/hydro/Minimal/hydro.h
View file @
3476460d
...
...
@@ -408,13 +408,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* This scheme has fixed alpha */
}
...
...
src/hydro/Planetary/hydro.h
View file @
3476460d
...
...
@@ -432,13 +432,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* This scheme has fixed alpha */
}
...
...
src/hydro/PressureEnergy/hydro.h
View file @
3476460d
...
...
@@ -433,13 +433,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* This scheme has fixed alpha */
}
...
...
src/hydro/PressureEnergyMorrisMonaghanAV/hydro.h
View file @
3476460d
...
...
@@ -430,13 +430,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
hydro_set_viscosity_alpha
(
p
,
hydro_props_default_viscosity_alpha_feedback_reset
);
}
...
...
src/hydro/PressureEntropy/hydro.h
View file @
3476460d
...
...
@@ -195,13 +195,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the
viscosity alpha
to the
* @brief Update the value of the
diffusive coefficients
to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* This scheme has fixed alpha */
}
...
...
src/hydro/Shadowswift/hydro.h
View file @
3476460d
...
...
@@ -892,7 +892,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_
set_viscosity_alpha_max
_feedback
(
struct
part
*
restrict
p
)
{
hydro_
diffusive
_feedback
_reset
(
struct
part
*
restrict
p
)
{
/* Purposefully left empty */
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment