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
5a69314f
Commit
5a69314f
authored
Jan 29, 2016
by
Matthieu Schaller
Browse files
Compile with clang
parent
17cf7788
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
5a69314f
...
...
@@ -568,3 +568,18 @@ void cell_init_parts(struct cell *c, void *data) {
c
->
t_end_min
=
0
.;
}
/**
* @brief Cleans the links in a given cell.
*
* @param c Cell to act upon
* @param data Unused parameter
*/
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
)
{
c
->
density
=
NULL
;
c
->
nr_density
=
0
;
c
->
force
=
NULL
;
c
->
nr_force
=
0
;
}
src/cell.h
View file @
5a69314f
...
...
@@ -178,5 +178,6 @@ int cell_unpack(struct pcell *pc, struct cell *c, struct space *s);
int
cell_getsize
(
struct
cell
*
c
);
int
cell_link
(
struct
cell
*
c
,
struct
part
*
parts
);
void
cell_init_parts
(
struct
cell
*
c
,
void
*
data
);
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
);
#endif
/* SWIFT_CELL_H */
src/space.c
View file @
5a69314f
...
...
@@ -1237,13 +1237,7 @@ void space_init(struct space *s, double dim[3], struct part *parts, int N,
*/
void
space_link_cleanup
(
struct
space
*
s
)
{
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
)
{
c
->
density
=
NULL
;
c
->
nr_density
=
0
;
c
->
force
=
NULL
;
c
->
nr_force
=
0
;
}
/* Recursively apply the cell link cleaning routine */
space_map_cells_pre
(
s
,
1
,
cell_clean_links
,
NULL
);
}
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