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
a443708f
Commit
a443708f
authored
Feb 20, 2017
by
Matthieu Schaller
Browse files
Code refactoring: cell_drift() ---> cell_drift_particles()
parent
7bd06f71
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
a443708f
...
...
@@ -1246,7 +1246,7 @@ void cell_set_super(struct cell *c, struct cell *super) {
* @param c The #cell.
* @param e The #engine (to get ti_current).
*/
void
cell_drift
(
struct
cell
*
c
,
const
struct
engine
*
e
)
{
void
cell_drift
_particles
(
struct
cell
*
c
,
const
struct
engine
*
e
)
{
const
double
timeBase
=
e
->
timeBase
;
const
integertime_t
ti_old
=
c
->
ti_old
;
...
...
@@ -1270,7 +1270,7 @@ void cell_drift(struct cell *c, const struct engine *e) {
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
struct
cell
*
cp
=
c
->
progeny
[
k
];
cell_drift
(
cp
,
e
);
cell_drift
_particles
(
cp
,
e
);
dx_max
=
max
(
dx_max
,
cp
->
dx_max
);
h_max
=
max
(
h_max
,
cp
->
h_max
);
}
...
...
src/cell.h
View file @
a443708f
...
...
@@ -331,7 +331,7 @@ void cell_check_drift_point(struct cell *c, void *data);
int
cell_is_drift_needed
(
struct
cell
*
c
,
const
struct
engine
*
e
);
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_set_super
(
struct
cell
*
c
,
struct
cell
*
super
);
void
cell_drift
(
struct
cell
*
c
,
const
struct
engine
*
e
);
void
cell_drift
_particles
(
struct
cell
*
c
,
const
struct
engine
*
e
);
void
cell_check_timesteps
(
struct
cell
*
c
);
#endif
/* SWIFT_CELL_H */
src/common_io.c
View file @
a443708f
...
...
@@ -134,7 +134,7 @@ int io_is_double_precision(enum IO_DATA_TYPE type) {
*
* @param grp The group from which to read.
* @param name The name of the attribute to read.
* @param type The #DATA_TYPE of the attribute.
* @param type The #
IO_
DATA_TYPE of the attribute.
* @param data (output) The attribute read from the HDF5 group.
*
* Calls #error() if an error occurs.
...
...
@@ -161,7 +161,7 @@ void io_read_attribute(hid_t grp, char* name, enum IO_DATA_TYPE type,
*
* @param grp The group in which to write.
* @param name The name of the attribute to write.
* @param type The #DATA_TYPE of the attribute.
* @param type The #
IO_
DATA_TYPE of the attribute.
* @param data The attribute to write.
* @param num The number of elements to write
*
...
...
src/runner.c
View file @
a443708f
...
...
@@ -810,11 +810,11 @@ void runner_do_unskip_mapper(void *map_data, int num_elements,
* @param c The cell.
* @param timer Are we timing this ?
*/
void
runner_do_drift
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
void
runner_do_drift
_particles
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
TIMER_TIC
;
cell_drift
(
c
,
r
->
e
);
cell_drift
_particles
(
c
,
r
->
e
);
if
(
timer
)
TIMER_TOC
(
timer_drift
);
}
...
...
@@ -834,7 +834,7 @@ void runner_do_drift_mapper(void *map_data, int num_elements,
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
struct
cell
*
c
=
&
cells
[
ind
];
if
(
c
!=
NULL
&&
c
->
nodeID
==
e
->
nodeID
)
cell_drift
(
c
,
e
);
if
(
c
!=
NULL
&&
c
->
nodeID
==
e
->
nodeID
)
cell_drift
_particles
(
c
,
e
);
}
}
...
...
@@ -1700,7 +1700,7 @@ void *runner_main(void *data) {
break
;
#endif
case
task_type_drift
:
runner_do_drift
(
r
,
ci
,
1
);
runner_do_drift
_particles
(
r
,
ci
,
1
);
break
;
case
task_type_kick1
:
runner_do_kick1
(
r
,
ci
,
1
);
...
...
src/runner_doiact.h
View file @
a443708f
...
...
@@ -746,8 +746,8 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) {
/* Anything to do here? */
if
(
!
cell_is_active
(
ci
,
e
)
&&
!
cell_is_active
(
cj
,
e
))
return
;
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
(
cj
,
e
);
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
_particles
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
_particles
(
cj
,
e
);
/* Get the sort ID. */
double
shift
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
...
...
@@ -1397,7 +1397,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
if
(
!
cell_is_active
(
c
,
e
))
return
;
if
(
!
cell_is_drifted
(
c
,
e
))
cell_drift
(
c
,
e
);
if
(
!
cell_is_drifted
(
c
,
e
))
cell_drift
_particles
(
c
,
e
);
struct
part
*
restrict
parts
=
c
->
parts
;
const
int
count
=
c
->
count
;
...
...
src/runner_doiact_nosort.h
View file @
a443708f
...
...
@@ -15,8 +15,8 @@ void DOPAIR1_NOSORT(struct runner *r, struct cell *ci, struct cell *cj) {
/* Anything to do here? */
if
(
!
cell_is_active
(
ci
,
e
)
&&
!
cell_is_active
(
cj
,
e
))
return
;
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
(
cj
,
e
);
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
_particles
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
_particles
(
cj
,
e
);
/* Get the relative distance between the pairs, wrapping. */
double
shift
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
...
...
@@ -140,8 +140,8 @@ void DOPAIR2_NOSORT(struct runner *r, struct cell *ci, struct cell *cj) {
/* Anything to do here? */
if
(
!
cell_is_active
(
ci
,
e
)
&&
!
cell_is_active
(
cj
,
e
))
return
;
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
(
cj
,
e
);
if
(
!
cell_is_drifted
(
ci
,
e
))
cell_drift
_particles
(
ci
,
e
);
if
(
!
cell_is_drifted
(
cj
,
e
))
cell_drift
_particles
(
cj
,
e
);
/* Get the relative distance between the pairs, wrapping. */
double
shift
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
...
...
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