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
Sten Delos
Gadget4
Commits
8935b955
Commit
8935b955
authored
Nov 15, 2020
by
Volker Springel
Browse files
small fix in potential energy for external Hernquist potential
parent
95a4b613
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gravity/grav_external.cc
View file @
8935b955
...
...
@@ -56,7 +56,7 @@ void sim::gravity_external(void)
Sp
.
P
[
target
].
GravAccel
+=
(
-
All
.
G
*
m
/
(
r
*
r
*
r
))
*
pos
;
#if defined(EVALPOTENTIAL) || defined(OUTPUT_POTENTIAL)
Sp
.
P
[
target
].
ExtPotential
+=
(
-
All
.
G
*
m
/
(
r
+
All
.
A_StaticHQHalo
));
Sp
.
P
[
target
].
ExtPotential
+=
(
-
All
.
G
*
All
.
Mass_StaticHQHalo
/
(
r
+
All
.
A_StaticHQHalo
));
#endif
}
#endif
...
...
src/logs/logs.cc
View file @
8935b955
...
...
@@ -584,13 +584,7 @@ void logs::compute_global_quantities_of_system(void)
#endif
#if defined(EXTERNALGRAVITY) && defined(EVALPOTENTIAL)
#if defined(SELFGRAVITY)
sys
.
EnergyPotComp
[
P
[
i
].
getType
()]
+=
0.5
*
P
[
i
].
getMass
()
*
P
[
i
].
ExtPotential
;
// note: ExtPotential already included on P[].p.Potential, that's why only 0.5 is
// needed here to recover the rest
#else
sys
.
EnergyPotComp
[
P
[
i
].
getType
()]
+=
1.0
*
P
[
i
].
getMass
()
*
P
[
i
].
ExtPotential
;
#endif
sys
.
EnergyPotComp
[
P
[
i
].
getType
()]
+=
P
[
i
].
getMass
()
*
P
[
i
].
ExtPotential
;
#endif
double
vel
[
3
]
=
{
0
,
0
,
0
};
...
...
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