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
4c0ef3ca
Commit
4c0ef3ca
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only recurse in the grav_down task if the daugther cells are active
parent
83175268
No related branches found
No related tags found
1 merge request
!328
Gravity multi dt
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_grav.h
+11
-6
11 additions, 6 deletions
src/runner_doiact_grav.h
with
11 additions
and
6 deletions
src/runner_doiact_grav.h
+
11
−
6
View file @
4c0ef3ca
...
...
@@ -37,20 +37,25 @@ void runner_do_grav_down(struct runner *r, struct cell *c, int timer) {
const
struct
engine
*
e
=
r
->
e
;
const
int
periodic
=
e
->
s
->
periodic
;
struct
gpart
*
gparts
=
c
->
gparts
;
const
int
gcount
=
c
->
gcount
;
TIMER_TIC
;
if
(
c
->
split
)
{
if
(
c
->
split
)
{
/* Node case */
/* Add the field-tensor to all the 8 progenitors */
for
(
int
k
=
0
;
k
<
8
;
++
k
)
{
struct
cell
*
cp
=
c
->
progeny
[
k
];
struct
grav_tensor
temp
;
if
(
cp
!=
NULL
)
{
/* Do we have a progenitor with any active g-particles ? */
if
(
cp
!=
NULL
&&
cell_is_active
(
cp
,
e
))
{
/* Shift the field tensor */
gravity_L2L
(
&
temp
,
&
c
->
multipole
->
pot
,
cp
->
multipole
->
CoM
,
c
->
multipole
->
CoM
,
0
*
periodic
);
/* Add it to this level's tensor */
gravity_field_tensors_add
(
&
cp
->
multipole
->
pot
,
&
temp
);
...
...
@@ -61,13 +66,13 @@ void runner_do_grav_down(struct runner *r, struct cell *c, int timer) {
}
else
{
/* Leaf case */
const
struct
engine
*
e
=
r
->
e
;
struct
gpart
*
gparts
=
c
->
gparts
;
const
int
gcount
=
c
->
gcount
;
/* Apply accelerations to the particles */
for
(
int
i
=
0
;
i
<
gcount
;
++
i
)
{
/* Get a handle on the gpart */
struct
gpart
*
gp
=
&
gparts
[
i
];
/* Update if active */
if
(
gpart_is_active
(
gp
,
e
))
gravity_L2P
(
&
c
->
multipole
->
pot
,
c
->
multipole
->
CoM
,
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