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
SWIFT
SWIFTsim
Commits
d27f7fa8
Commit
d27f7fa8
authored
Apr 18, 2017
by
Matthieu Schaller
Browse files
Added comments for suggestions of algorithmic improvements.
parent
51e1c0d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multipole.h
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
);
}
/**
...
...
src/runner_doiact_grav.h
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
"
);
}
}
}
...
...
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