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
d1587b38
Commit
d1587b38
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Do not resinitialse the old accelerations to 0 in gravity_init()....
parent
07df10c8
No related branches found
No related tags found
1 merge request
!1077
Improved multipole acceptance criterion (MAC)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gravity/MultiSoftening/gravity.h
+5
-1
5 additions, 1 deletion
src/gravity/MultiSoftening/gravity.h
with
5 additions
and
1 deletion
src/gravity/MultiSoftening/gravity.h
+
5
−
1
View file @
d1587b38
...
@@ -160,7 +160,6 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
...
@@ -160,7 +160,6 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
gp
->
a_grav
[
1
]
=
0
.
f
;
gp
->
a_grav
[
1
]
=
0
.
f
;
gp
->
a_grav
[
2
]
=
0
.
f
;
gp
->
a_grav
[
2
]
=
0
.
f
;
gp
->
potential
=
0
.
f
;
gp
->
potential
=
0
.
f
;
gp
->
old_a_grav_norm
=
0
.
f
;
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
gp
->
potential_PM
=
0
.
f
;
gp
->
potential_PM
=
0
.
f
;
...
@@ -215,6 +214,10 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
...
@@ -215,6 +214,10 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
gp
->
old_a_grav_norm
=
sqrtf
(
gp
->
old_a_grav_norm
);
gp
->
old_a_grav_norm
=
sqrtf
(
gp
->
old_a_grav_norm
);
#ifdef SWIFT_DEBUG_CHECKS
if
(
gp
->
old_a_grav_norm
==
0
.
f
)
error
(
"Old acceleration is 0!"
);
#endif
/* Let's get physical... */
/* Let's get physical... */
gp
->
a_grav
[
0
]
*=
const_G
;
gp
->
a_grav
[
0
]
*=
const_G
;
gp
->
a_grav
[
1
]
*=
const_G
;
gp
->
a_grav
[
1
]
*=
const_G
;
...
@@ -267,6 +270,7 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart(
...
@@ -267,6 +270,7 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart(
struct
gpart
*
gp
,
const
struct
gravity_props
*
grav_props
)
{
struct
gpart
*
gp
,
const
struct
gravity_props
*
grav_props
)
{
gp
->
time_bin
=
0
;
gp
->
time_bin
=
0
;
gp
->
old_a_grav_norm
=
0
.
f
;
gravity_init_gpart
(
gp
);
gravity_init_gpart
(
gp
);
}
}
...
...
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