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
c3480fcb
Commit
c3480fcb
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added a few more checks that no inhibited particles are going through the calculations.
parent
ec104141
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!632
Add functions to permanently remove particles from a simulation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/multipole.h
+5
-0
5 additions, 0 deletions
src/multipole.h
src/runner.c
+2
-2
2 additions, 2 deletions
src/runner.c
src/space.c
+12
-0
12 additions, 0 deletions
src/space.c
with
19 additions
and
2 deletions
src/multipole.h
+
5
−
0
View file @
c3480fcb
...
...
@@ -1028,6 +1028,11 @@ INLINE static void gravity_P2M(struct gravity_tensors *multi,
for
(
int
k
=
0
;
k
<
gcount
;
k
++
)
{
const
double
m
=
gparts
[
k
].
mass
;
#ifdef SWIFT_DEBUG_CHECKS
if
(
gparts
[
k
].
time_bin
==
time_bin_inhibited
)
error
(
"Inhibited particle in P2M. Should have been remvoed earlier."
);
#endif
mass
+=
m
;
com
[
0
]
+=
gparts
[
k
].
x
[
0
]
*
m
;
com
[
1
]
+=
gparts
[
k
].
x
[
1
]
*
m
;
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
2
−
2
View file @
c3480fcb
...
...
@@ -2013,7 +2013,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
const
int
gcount
=
c
->
grav
.
count
;
const
int
scount
=
c
->
stars
.
count
;
struct
part
*
restrict
parts
=
c
->
hydro
.
parts
;
struct
xpart
*
restrict
xparts
=
c
->
hydro
.
xparts
;
//
struct xpart *restrict xparts = c->hydro.xparts;
struct
gpart
*
restrict
gparts
=
c
->
grav
.
parts
;
struct
spart
*
restrict
sparts
=
c
->
stars
.
parts
;
const
int
periodic
=
s
->
periodic
;
...
...
@@ -2043,7 +2043,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
/* Get a handle on the part. */
struct
part
*
restrict
p
=
&
parts
[
k
];
struct
xpart
*
restrict
xp
=
&
xparts
[
k
];
//
struct xpart *restrict xp = &xparts[k];
if
(
part_is_active
(
p
,
e
))
{
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
12
−
0
View file @
c3480fcb
...
...
@@ -1924,6 +1924,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof
(
struct
cell_buff
)
*
count
)
!=
0
)
error
(
"Failed to allocate temporary indices."
);
for
(
int
k
=
0
;
k
<
count
;
k
++
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
parts
[
k
].
time_bin
==
time_bin_inhibited
)
error
(
"Inhibited particle present in space_split()"
);
#endif
buff
[
k
].
x
[
0
]
=
parts
[
k
].
x
[
0
];
buff
[
k
].
x
[
1
]
=
parts
[
k
].
x
[
1
];
buff
[
k
].
x
[
2
]
=
parts
[
k
].
x
[
2
];
...
...
@@ -1934,6 +1938,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof
(
struct
cell_buff
)
*
gcount
)
!=
0
)
error
(
"Failed to allocate temporary indices."
);
for
(
int
k
=
0
;
k
<
gcount
;
k
++
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
gparts
[
k
].
time_bin
==
time_bin_inhibited
)
error
(
"Inhibited particle present in space_split()"
);
#endif
gbuff
[
k
].
x
[
0
]
=
gparts
[
k
].
x
[
0
];
gbuff
[
k
].
x
[
1
]
=
gparts
[
k
].
x
[
1
];
gbuff
[
k
].
x
[
2
]
=
gparts
[
k
].
x
[
2
];
...
...
@@ -1944,6 +1952,10 @@ void space_split_recursive(struct space *s, struct cell *c,
sizeof
(
struct
cell_buff
)
*
scount
)
!=
0
)
error
(
"Failed to allocate temporary indices."
);
for
(
int
k
=
0
;
k
<
scount
;
k
++
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
sparts
[
k
].
time_bin
==
time_bin_inhibited
)
error
(
"Inhibited particle present in space_split()"
);
#endif
sbuff
[
k
].
x
[
0
]
=
sparts
[
k
].
x
[
0
];
sbuff
[
k
].
x
[
1
]
=
sparts
[
k
].
x
[
1
];
sbuff
[
k
].
x
[
2
]
=
sparts
[
k
].
x
[
2
];
...
...
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