Skip to content
GitLab
Menu
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
aaa1618b
Commit
aaa1618b
authored
Mar 10, 2016
by
Matthieu Schaller
Browse files
Code formatting
parent
dde8809a
Changes
5
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
aaa1618b
...
...
@@ -380,9 +380,9 @@ int main(int argc, char *argv[]) {
N_total
[
0
]
=
Ngas
;
N_total
[
1
]
=
Ngpart
-
Ngas
;
#endif
if
(
myrank
==
0
)
message
(
"Read %lld gas particles and %lld DM particles from the ICs"
,
N_total
[
0
],
N_total
[
1
]);
if
(
myrank
==
0
)
message
(
"Read %lld gas particles and %lld DM particles from the ICs"
,
N_total
[
0
],
N_total
[
1
]);
/* Apply h scaling */
if
(
scaling
!=
1
.
0
)
...
...
src/common_io.c
View file @
aaa1618b
...
...
@@ -489,8 +489,8 @@ void prepare_dm_gparts(struct gpart* gparts, int Ndm) {
for
(
int
i
=
0
;
i
<
Ndm
;
++
i
)
{
/* 0 ir negative ids are not allowed */
if
(
gparts
[
i
].
id
<=
0
)
error
(
"0 or negative ID for DM particle"
);
if
(
gparts
[
i
].
id
<=
0
)
error
(
"0 or negative ID for DM particle"
);
gparts
[
i
].
id
=
-
gparts
[
i
].
id
;
}
}
...
...
src/engine.c
View file @
aaa1618b
...
...
@@ -797,11 +797,13 @@ void engine_maketasks(struct engine *e) {
/* /\* Add the gravity mm tasks. *\/ */
/* for (int i = 0; i < nr_cells; i++) */
/* if (cells[i].gcount > 0) { */
/* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */
/* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0,
*/
/* &cells[i], NULL, 0); */
/* for (int j = i + 1; j < nr_cells; j++) */
/* if (cells[j].gcount > 0) */
/* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1, 0, */
/* scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, -1,
* 0, */
/* &cells[i], &cells[j], 0); */
/* } */
...
...
@@ -817,16 +819,19 @@ void engine_maketasks(struct engine *e) {
error
(
"Failed to allocate cell-task links."
);
e
->
nr_links
=
0
;
/* /\* Add the gravity up/down tasks at the top-level cells and push them down. *\/ */
/* /\* Add the gravity up/down tasks at the top-level cells and push them
* down. *\/ */
/* for (int k = 0; k < nr_cells; k++) */
/* if (cells[k].nodeID == nodeID && cells[k].gcount > 0) { */
/* /\* Create tasks at top level. *\/ */
/* struct task *up = */
/* scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0, 0, */
/* scheduler_addtask(sched, task_type_grav_up, task_subtype_none, 0,
* 0, */
/* &cells[k], NULL, 0); */
/* struct task *down = */
/* scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0, 0, */
/* scheduler_addtask(sched, task_type_grav_down, task_subtype_none, 0,
* 0, */
/* &cells[k], NULL, 0); */
/* /\* Push tasks down the cell hierarchy. *\/ */
...
...
src/map.c
View file @
aaa1618b
...
...
@@ -121,14 +121,14 @@ void map_cellcheck(struct cell *c, void *data) {
p
->
x
[
0
]
>
c
->
loc
[
0
]
+
c
->
h
[
0
]
||
p
->
x
[
1
]
>
c
->
loc
[
1
]
+
c
->
h
[
1
]
||
p
->
x
[
2
]
>
c
->
loc
[
2
]
+
c
->
h
[
2
])
{
printf
(
"map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell [ "
"map_cellcheck: g-particle at [ %.16e %.16e %.16e ] outside of cell "
"[ "
"%.16e %.16e %.16e ] - [ %.16e %.16e %.16e ].
\n
"
,
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
],
c
->
loc
[
0
],
c
->
loc
[
1
],
c
->
loc
[
2
],
c
->
loc
[
0
]
+
c
->
h
[
0
],
c
->
loc
[
1
]
+
c
->
h
[
1
],
c
->
loc
[
2
]
+
c
->
h
[
2
]);
error
(
"g-particle out of bounds!"
);
}
}
}
/**
...
...
src/space.c
View file @
aaa1618b
...
...
@@ -456,13 +456,12 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
/* Exchange the strays, note that this potentially re-allocates
the parts arrays. */
//s->nr_gparts =
//
s->nr_gparts =
// nr_gparts + engine_exchange_strays(s->e, nr_gparts, &ind[nr_gparts],
// s->nr_gparts - nr_gparts);
if
(
nr_gparts
>
0
)
if
(
nr_gparts
>
0
)
error
(
"Need to implement the exchange of strays for the gparts"
);
/* Re-allocate the index array if needed.. */
if
(
s
->
nr_gparts
>
gind_size
)
{
size_t
*
gind_new
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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