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
aaa1618b
Commit
aaa1618b
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting
parent
dde8809a
No related branches found
No related tags found
2 merge requests
!136
Master
,
!116
Basic implementation of gparts
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
examples/main.c
+3
-3
3 additions, 3 deletions
examples/main.c
src/common_io.c
+2
-2
2 additions, 2 deletions
src/common_io.c
src/engine.c
+10
-5
10 additions, 5 deletions
src/engine.c
src/map.c
+2
-2
2 additions, 2 deletions
src/map.c
src/space.c
+2
-3
2 additions, 3 deletions
src/space.c
with
19 additions
and
15 deletions
examples/main.c
+
3
−
3
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
)
...
...
This diff is collapsed.
Click to expand it.
src/common_io.c
+
2
−
2
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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
10
−
5
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. *\/ */
...
...
This diff is collapsed.
Click to expand it.
src/map.c
+
2
−
2
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!"
);
}
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
2
−
3
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
;
...
...
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