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
5ee2948e
Commit
5ee2948e
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Cleaning-up
parent
d806b395
No related branches found
No related tags found
1 merge request
!167
Kick task for fixdt and proper treatment of conserved quantities
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kick.h
+4
-0
4 additions, 0 deletions
src/kick.h
src/runner.c
+8
-8
8 additions, 8 deletions
src/runner.c
with
12 additions
and
8 deletions
src/kick.h
+
4
−
0
View file @
5ee2948e
...
@@ -22,6 +22,10 @@
...
@@ -22,6 +22,10 @@
/* Config parameters. */
/* Config parameters. */
#include
"../config.h"
#include
"../config.h"
/* Local headers. */
#include
"const.h"
#include
"debug.h"
/**
/**
* @brief Perform the 'kick' operation on a #gpart
* @brief Perform the 'kick' operation on a #gpart
*
*
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
8
−
8
View file @
5ee2948e
...
@@ -989,6 +989,10 @@ void runner_do_kick_fixdt(struct runner *r, struct cell *c, int timer) {
...
@@ -989,6 +989,10 @@ void runner_do_kick_fixdt(struct runner *r, struct cell *c, int timer) {
updated
++
;
updated
++
;
if
(
p
->
gpart
!=
NULL
)
g_updated
++
;
if
(
p
->
gpart
!=
NULL
)
g_updated
++
;
/* Minimal time for next end of time-step */
ti_end_min
=
min
(
p
->
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
p
->
ti_end
,
ti_end_max
);
/* Now collect quantities for statistics */
/* Now collect quantities for statistics */
const
double
x
[
3
]
=
{
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
]};
const
double
x
[
3
]
=
{
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
]};
...
@@ -1013,10 +1017,6 @@ void runner_do_kick_fixdt(struct runner *r, struct cell *c, int timer) {
...
@@ -1013,10 +1017,6 @@ void runner_do_kick_fixdt(struct runner *r, struct cell *c, int timer) {
v_full
[
2
]
*
v_full
[
2
]);
v_full
[
2
]
*
v_full
[
2
]);
e_pot
+=
0
.
f
;
/* No gravitational potential thus far */
e_pot
+=
0
.
f
;
/* No gravitational potential thus far */
e_int
+=
hydro_get_internal_energy
(
p
);
e_int
+=
hydro_get_internal_energy
(
p
);
/* Minimal time for next end of time-step */
ti_end_min
=
min
(
p
->
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
p
->
ti_end
,
ti_end_max
);
}
}
}
}
...
@@ -1246,6 +1246,10 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
...
@@ -1246,6 +1246,10 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
if
(
p
->
gpart
!=
NULL
)
g_updated
++
;
if
(
p
->
gpart
!=
NULL
)
g_updated
++
;
}
}
/* Minimal time for next end of time-step */
ti_end_min
=
min
(
p
->
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
p
->
ti_end
,
ti_end_max
);
/* Now collect quantities for statistics */
/* Now collect quantities for statistics */
const
double
x
[
3
]
=
{
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
]};
const
double
x
[
3
]
=
{
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
]};
...
@@ -1270,10 +1274,6 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
...
@@ -1270,10 +1274,6 @@ void runner_do_kick(struct runner *r, struct cell *c, int timer) {
v_full
[
2
]
*
v_full
[
2
]);
v_full
[
2
]
*
v_full
[
2
]);
e_pot
+=
0
.
f
;
/* No gravitational potential thus far */
e_pot
+=
0
.
f
;
/* No gravitational potential thus far */
e_int
+=
hydro_get_internal_energy
(
p
);
e_int
+=
hydro_get_internal_energy
(
p
);
/* Minimal time for next end of time-step */
ti_end_min
=
min
(
p
->
ti_end
,
ti_end_min
);
ti_end_max
=
max
(
p
->
ti_end
,
ti_end_max
);
}
}
}
}
...
...
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