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
d27f7fa8
Commit
d27f7fa8
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added comments for suggestions of algorithmic improvements.
parent
51e1c0d3
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!331
Gravity multi dt
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/multipole.h
+11
-3
11 additions, 3 deletions
src/multipole.h
src/runner_doiact_grav.h
+9
-3
9 additions, 3 deletions
src/runner_doiact_grav.h
with
20 additions
and
6 deletions
src/multipole.h
+
11
−
3
View file @
d27f7fa8
...
...
@@ -207,10 +207,18 @@ INLINE static void gravity_reset(struct gravity_tensors *m) {
*/
INLINE
static
void
gravity_drift
(
struct
gravity_tensors
*
m
,
double
dt
)
{
const
double
dx
=
m
->
m_pole
.
vel
[
0
]
*
dt
;
const
double
dy
=
m
->
m_pole
.
vel
[
1
]
*
dt
;
const
double
dz
=
m
->
m_pole
.
vel
[
2
]
*
dt
;
/* Move the whole thing according to bulk motion */
m
->
CoM
[
0
]
+=
m
->
m_pole
.
vel
[
0
]
*
dt
*
0
;
// MATTHIEU
m
->
CoM
[
1
]
+=
m
->
m_pole
.
vel
[
1
]
*
dt
*
0
;
m
->
CoM
[
2
]
+=
m
->
m_pole
.
vel
[
2
]
*
dt
*
0
;
m
->
CoM
[
0
]
+=
dx
;
m
->
CoM
[
1
]
+=
dy
;
m
->
CoM
[
2
]
+=
dz
;
/* Conservative change in maximal radius containing all gpart */
/* MATTHIEU: Use gpart->x_diff here ? */
m
->
r_max
+=
sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_grav.h
+
9
−
3
View file @
d27f7fa8
...
...
@@ -185,6 +185,8 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj) {
}
#endif
/* MATTHIEU: Should we use local DP accumulators ? */
/* Loop over all particles in ci... */
for
(
int
pid
=
0
;
pid
<
gcount_i
;
pid
++
)
{
...
...
@@ -284,6 +286,8 @@ void runner_doself_grav_pp(struct runner *r, struct cell *c) {
}
#endif
/* MATTHIEU: Should we use local DP accumulators ? */
/* Loop over all particles in ci... */
for
(
int
pid
=
0
;
pid
<
gcount
;
pid
++
)
{
...
...
@@ -400,6 +404,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
/* Can we use M-M interactions ? */
if
(
gravity_multipole_accept
(
ci
->
multipole
,
cj
->
multipole
,
theta_crit_inv
))
{
/* MATTHIEU: make a symmetric M-M interaction function ! */
runner_dopair_grav_mm
(
r
,
ci
,
cj
);
runner_dopair_grav_mm
(
r
,
cj
,
ci
);
}
...
...
@@ -426,6 +431,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
}
}
else
if
(
cj
->
split
)
{
/* MATTHIEU: This could maybe be replaced by P-M interactions ? */
/* Loop over cj's children */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
...
...
@@ -434,8 +440,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
}
}
else
{
message
(
"oO"
);
// runner_dpoair_grav_pm(r, ci, cj);
error
(
"Fundamental error in the logic"
);
}
}
else
{
...
...
@@ -449,6 +454,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
}
}
else
if
(
ci
->
split
)
{
/* MATTHIEU: This could maybe be replaced by P-M interactions ? */
/* Loop over ci's children */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
...
...
@@ -457,7 +463,7 @@ void runner_dopair_grav(struct runner *r, struct cell *ci, struct cell *cj,
}
}
else
{
message
(
"oO
"
);
error
(
"Fundamental error in the logic
"
);
}
}
}
...
...
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