Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
b7869d73
Commit
b7869d73
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
New interface for kick_extra
parent
cefdb664
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!90
Improved multi-timestep SPH
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/hydro/Default/hydro.h
+3
-2
3 additions, 2 deletions
src/hydro/Default/hydro.h
src/hydro/Gadget2/hydro.h
+6
-1
6 additions, 1 deletion
src/hydro/Gadget2/hydro.h
src/hydro/Minimal/hydro.h
+11
-1
11 additions, 1 deletion
src/hydro/Minimal/hydro.h
src/runner.c
+1
-1
1 addition, 1 deletion
src/runner.c
with
21 additions
and
5 deletions
src/hydro/Default/hydro.h
+
3
−
2
View file @
b7869d73
...
...
@@ -194,14 +194,15 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_end_force
(
struct
part
*
p
)
{}
/**
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param dt The time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
/**
* @brief Converts hydro quantity of a particle
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gadget2/hydro.h
+
6
−
1
View file @
b7869d73
...
...
@@ -190,13 +190,18 @@ __attribute__((always_inline))
(
const_hydro_gamma
-
1
.
f
)
*
powf
(
p
->
rho
,
-
(
const_hydro_gamma
-
1
.
f
));
}
/**
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param xp The particle extended data to act upon
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
/* Do not decrease the entropy (temperature) by more than a factor of 2*/
const
float
entropy_change
=
p
->
entropy_dt
*
dt
;
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Minimal/hydro.h
+
11
−
1
View file @
b7869d73
...
...
@@ -156,10 +156,20 @@ __attribute__((always_inline))
* @brief Kick the additional variables
*
* @param p The particle to act upon
* @param xp The particle extended data to act upon
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
float
dt
)
{}
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
/* Kick in momentum space */
xp
->
u_full
+=
p
->
u_dt
*
dt
;
/* Get the predicted internal energy */
p
->
u
=
xp
->
u_full
-
half_dt
*
p
->
u_dt
;
}
/**
* @brief Converts hydro quantity of a particle
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
1
−
1
View file @
b7869d73
...
...
@@ -930,7 +930,7 @@ void runner_dokick(struct runner *r, struct cell *c, int timer) {
/* p->v[2]); */
/* Extra kick work */
hydro_kick_extra
(
p
,
dt
);
hydro_kick_extra
(
p
,
xp
,
dt
,
half_
dt
);
}
/* Now collect quantities for statistics */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment