Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
SWIFTsim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
68
Issues
68
List
Boards
Labels
Milestones
Merge Requests
11
Merge Requests
11
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SWIFT
SWIFTsim
Commits
89d490fa
Commit
89d490fa
authored
Sep 18, 2020
by
Mladen Ivkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved rt data struct from xparts to parts struct
parent
ac9ccd2d
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
60 additions
and
58 deletions
+60
-58
src/cell.c
src/cell.c
+1
-1
src/distributed_io.c
src/distributed_io.c
+2
-2
src/hydro/Gadget2/hydro_part.h
src/hydro/Gadget2/hydro_part.h
+3
-3
src/line_of_sight.c
src/line_of_sight.c
+1
-1
src/parallel_io.c
src/parallel_io.c
+3
-3
src/rt/M1closure/rt.h
src/rt/M1closure/rt.h
+4
-4
src/rt/M1closure/rt_iact.h
src/rt/M1closure/rt_iact.h
+1
-1
src/rt/M1closure/rt_io.h
src/rt/M1closure/rt_io.h
+1
-1
src/rt/M1closure/rt_struct.h
src/rt/M1closure/rt_struct.h
+3
-1
src/rt/debug/rt.h
src/rt/debug/rt.h
+13
-13
src/rt/debug/rt_iact.h
src/rt/debug/rt_iact.h
+2
-2
src/rt/debug/rt_io.h
src/rt/debug/rt_io.h
+6
-6
src/rt/debug/rt_struct.h
src/rt/debug/rt_struct.h
+3
-1
src/rt/none/rt.h
src/rt/none/rt.h
+4
-4
src/rt/none/rt_iact.h
src/rt/none/rt_iact.h
+1
-1
src/rt/none/rt_io.h
src/rt/none/rt_io.h
+1
-1
src/rt/none/rt_struct.h
src/rt/none/rt_struct.h
+3
-1
src/runner_doiact_functions_rt.h
src/runner_doiact_functions_rt.h
+2
-6
src/serial_io.c
src/serial_io.c
+2
-2
src/single_io.c
src/single_io.c
+2
-2
src/space.c
src/space.c
+2
-2
No files found.
src/cell.c
View file @
89d490fa
...
...
@@ -5282,7 +5282,7 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
tracers_after_init
(
p
,
xp
,
e
->
internal_units
,
e
->
physical_constants
,
with_cosmology
,
e
->
cosmology
,
e
->
hydro_properties
,
e
->
cooling_func
,
e
->
time
);
rt_init_
xpart
(
x
p
);
rt_init_
part
(
p
);
}
}
...
...
src/distributed_io.c
View file @
89d490fa
...
...
@@ -518,7 +518,7 @@ void write_output_distributed(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts
,
xparts
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
}
else
{
...
...
@@ -563,7 +563,7 @@ void write_output_distributed(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts_written
,
xparts_written
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts_written
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts_written
,
list
+
num_fields
);
}
}
}
break
;
...
...
src/hydro/Gadget2/hydro_part.h
View file @
89d490fa
...
...
@@ -72,9 +72,6 @@ struct xpart {
/* Additional data used by the feedback */
struct
feedback_part_data
feedback_data
;
/* Additional Radiative Transfer Data */
struct
rt_xpart_data
rt_data
;
#ifdef WITH_LOGGER
/* Additional data for the particle logger */
struct
logger_part_data
logger_data
;
...
...
@@ -171,6 +168,9 @@ struct part {
/*! Additional data used by the pressure floor */
struct
pressure_floor_part_data
pressure_floor_data
;
/* Additional Radiative Transfer Data */
struct
rt_part_data
rt_data
;
/*! Time-step length */
timebin_t
time_bin
;
...
...
src/line_of_sight.c
View file @
89d490fa
...
...
@@ -457,7 +457,7 @@ void write_los_hdf5_datasets(hid_t grp, const int j, const size_t N,
num_fields
+=
star_formation_write_particles
(
parts
,
xparts
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
/* Loop over each output field */
...
...
src/parallel_io.c
View file @
89d490fa
...
...
@@ -1271,7 +1271,7 @@ void prepare_file(struct engine* e, const char* fileName,
velociraptor_write_parts
(
parts
,
xparts
,
list
+
num_fields
);
}
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
break
;
...
...
@@ -1651,7 +1651,7 @@ void write_output_parallel(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts
,
xparts
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
}
else
{
...
...
@@ -1696,7 +1696,7 @@ void write_output_parallel(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts_written
,
xparts_written
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts_written
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts_written
,
list
+
num_fields
);
}
}
}
break
;
...
...
src/rt/M1closure/rt.h
View file @
89d490fa
...
...
@@ -27,14 +27,14 @@
/**
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{}
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_part
(
struct
part
*
restrict
p
)
{}
/**
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{}
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_part
(
struct
part
*
restrict
p
)
{}
/**
* @brief First initialisation of the RT extra star particle data.
...
...
src/rt/M1closure/rt_iact.h
View file @
89d490fa
...
...
@@ -37,6 +37,6 @@
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_rt_inject
(
const
float
r2
,
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
spart
*
restrict
si
,
struct
xpart
*
restrict
x
pj
)
{}
struct
spart
*
restrict
si
,
struct
part
*
restrict
pj
)
{}
#endif
/* SWIFT_RT_IACT_M1CLOSURE_H */
src/rt/M1closure/rt_io.h
View file @
89d490fa
...
...
@@ -30,7 +30,7 @@
* @brief Creates additional output fields for the radiative
* transfer data of hydro particles.
*/
INLINE
static
int
rt_write_particles
(
const
struct
xpart
*
x
parts
,
INLINE
static
int
rt_write_particles
(
const
struct
part
*
parts
,
struct
io_props
*
list
)
{
return
0
;
}
...
...
src/rt/M1closure/rt_struct.h
View file @
89d490fa
...
...
@@ -24,8 +24,10 @@
* @brief Main header file for no radiative transfer struct.
*/
struct
rt_xpart_data
{};
/* Additional RT data in hydro particle struct */
struct
rt_part_data
{};
/* Additional RT data in star particle struct */
struct
rt_spart_data
{};
#endif
/* SWIFT_RT_STRUCT_M1CLOSURE_H */
src/rt/debug/rt.h
View file @
89d490fa
...
...
@@ -27,26 +27,26 @@
/**
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_part
(
struct
part
*
restrict
p
)
{
x
p
->
rt_data
.
iact_stars
=
0
;
x
p
->
rt_data
.
calls_tot
=
0
;
x
p
->
rt_data
.
calls_per_step
=
0
;
x
p
->
rt_data
.
calls_self
=
0
;
x
p
->
rt_data
.
calls_pair
=
0
;
p
->
rt_data
.
iact_stars
=
0
;
p
->
rt_data
.
calls_tot
=
0
;
p
->
rt_data
.
calls_per_step
=
0
;
p
->
rt_data
.
calls_self
=
0
;
p
->
rt_data
.
calls_pair
=
0
;
}
/**
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_part
(
struct
part
*
restrict
p
)
{
x
p
->
rt_data
.
iact_stars
=
0
;
x
p
->
rt_data
.
calls_per_step
=
0
;
x
p
->
rt_data
.
calls_self
=
0
;
x
p
->
rt_data
.
calls_pair
=
0
;
p
->
rt_data
.
iact_stars
=
0
;
p
->
rt_data
.
calls_per_step
=
0
;
p
->
rt_data
.
calls_self
=
0
;
p
->
rt_data
.
calls_pair
=
0
;
}
/**
...
...
src/rt/debug/rt_iact.h
View file @
89d490fa
...
...
@@ -37,10 +37,10 @@
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_rt_inject
(
const
float
r2
,
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
spart
*
restrict
si
,
struct
xpart
*
restrict
x
pj
)
{
struct
spart
*
restrict
si
,
struct
part
*
restrict
pj
)
{
struct
rt_spart_data
*
restrict
sd
=
&
(
si
->
rt_data
);
struct
rt_
xpart_data
*
restrict
pd
=
&
(
x
pj
->
rt_data
);
struct
rt_
part_data
*
restrict
pd
=
&
(
pj
->
rt_data
);
sd
->
iact_hydro
+=
1
;
sd
->
calls_tot
+=
1
;
...
...
src/rt/debug/rt_io.h
View file @
89d490fa
...
...
@@ -30,25 +30,25 @@
* @brief Creates additional output fields for the radiative
* transfer data of hydro particles.
*/
INLINE
static
int
rt_write_particles
(
const
struct
xpart
*
x
parts
,
INLINE
static
int
rt_write_particles
(
const
struct
part
*
parts
,
struct
io_props
*
list
)
{
list
[
0
]
=
io_make_output_field
(
"RTStarIact"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
x
parts
,
rt_data
.
iact_stars
,
parts
,
rt_data
.
iact_stars
,
"number of interactions between this hydro "
"particle and any star particle"
);
list
[
1
]
=
io_make_output_field
(
"RTTotalCalls"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
x
parts
,
rt_data
.
calls_tot
,
"RTTotalCalls"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
parts
,
rt_data
.
calls_tot
,
"total number of calls to this particle during the run"
);
list
[
2
]
=
io_make_output_field
(
"RTCallsThisStep"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
x
parts
,
"RTCallsThisStep"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
parts
,
rt_data
.
calls_per_step
,
"number of calls to this particle during one time step"
);
list
[
3
]
=
io_make_output_field
(
"RTCallsSelf"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
x
parts
,
rt_data
.
calls_self
,
"RTCallsSelf"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
parts
,
rt_data
.
calls_self
,
"number of calls to this particle during one time step in self task"
);
list
[
4
]
=
io_make_output_field
(
"RTCallsPair"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
x
parts
,
rt_data
.
calls_pair
,
"RTCallsPair"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
0
,
parts
,
rt_data
.
calls_pair
,
"number of calls to this particle during one time step in self task"
);
return
5
;
...
...
src/rt/debug/rt_struct.h
View file @
89d490fa
...
...
@@ -24,7 +24,8 @@
* @brief Main header file for the debug radiative transfer struct.
*/
struct
rt_xpart_data
{
/* Additional RT data in hydro particle struct */
struct
rt_part_data
{
int
iact_stars
;
/* how many stars this particle interacted with */
int
calls_tot
;
/* total number of calls to this particle during entire run */
int
calls_per_step
;
/* calls per time step to this particle */
...
...
@@ -32,6 +33,7 @@ struct rt_xpart_data {
int
calls_pair
;
};
/* Additional RT data in star particle struct */
struct
rt_spart_data
{
int
iact_hydro
;
/* how many hydro particles this particle interacted with */
int
calls_tot
;
/* total number of calls to this particle during entire run */
...
...
src/rt/none/rt.h
View file @
89d490fa
...
...
@@ -27,14 +27,14 @@
/**
* @brief First initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{}
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_part
(
struct
part
*
restrict
p
)
{}
/**
* @brief Initialisation of the RT extra hydro particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_
x
part
(
struct
xpart
*
restrict
x
p
)
{}
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_part
(
struct
part
*
restrict
p
)
{}
/**
* @brief First initialisation of the RT extra star particle data.
...
...
src/rt/none/rt_iact.h
View file @
89d490fa
...
...
@@ -37,6 +37,6 @@
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_rt_inject
(
const
float
r2
,
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
spart
*
restrict
si
,
struct
xpart
*
restrict
x
pj
)
{}
struct
spart
*
restrict
si
,
struct
part
*
restrict
pj
)
{}
#endif
/* SWIFT_RT_IACT_NONE_H */
src/rt/none/rt_io.h
View file @
89d490fa
...
...
@@ -30,7 +30,7 @@
* @brief Creates additional output fields for the radiative
* transfer data of hydro particles.
*/
INLINE
static
int
rt_write_particles
(
const
struct
xpart
*
x
parts
,
INLINE
static
int
rt_write_particles
(
const
struct
part
*
parts
,
struct
io_props
*
list
)
{
return
0
;
}
...
...
src/rt/none/rt_struct.h
View file @
89d490fa
...
...
@@ -24,8 +24,10 @@
* @brief Main header file for no radiative transfer struct.
*/
struct
rt_xpart_data
{};
/* Additional RT data in hydro particle struct */
struct
rt_part_data
{};
/* Additional RT data in star particle struct */
struct
rt_spart_data
{};
#endif
/* SWIFT_RT_STRUCT_NONE_H */
src/runner_doiact_functions_rt.h
View file @
89d490fa
...
...
@@ -45,7 +45,6 @@ void DOSELF1_RT(struct runner *r, struct cell *c, int timer) {
struct
spart
*
restrict
sparts
=
c
->
stars
.
parts
;
struct
part
*
restrict
parts
=
c
->
hydro
.
parts
;
struct
xpart
*
restrict
xparts
=
c
->
hydro
.
xparts
;
const
int
scount
=
c
->
stars
.
count
;
const
int
count
=
c
->
hydro
.
count
;
...
...
@@ -65,7 +64,6 @@ void DOSELF1_RT(struct runner *r, struct cell *c, int timer) {
/* Loop over the (x)parts in cell */
for
(
int
pid
=
0
;
pid
<
count
;
pid
++
)
{
struct
xpart
*
restrict
xpj
=
&
xparts
[
pid
];
struct
part
*
restrict
pj
=
&
parts
[
pid
];
/* Skip inhibited particles. */
...
...
@@ -81,7 +79,7 @@ void DOSELF1_RT(struct runner *r, struct cell *c, int timer) {
float
dx
[
3
]
=
{
six
[
0
]
-
pjx
[
0
],
six
[
1
]
-
pjx
[
1
],
six
[
2
]
-
pjx
[
2
]};
const
float
r2
=
dx
[
0
]
*
dx
[
0
]
+
dx
[
1
]
*
dx
[
1
]
+
dx
[
2
]
*
dx
[
2
];
if
(
r2
<
hjg2
)
IACT_RT
(
r2
,
dx
,
hi
,
hj
,
si
,
x
pj
);
if
(
r2
<
hjg2
)
IACT_RT
(
r2
,
dx
,
hi
,
hj
,
si
,
pj
);
}
}
...
...
@@ -106,7 +104,6 @@ void DOPAIR1_NONSYM_RT(struct runner *r, struct cell *ci, struct cell *cj) {
const
int
count_j
=
cj
->
hydro
.
count
;
struct
spart
*
restrict
sparts_i
=
ci
->
stars
.
parts
;
struct
part
*
restrict
parts_j
=
cj
->
hydro
.
parts
;
struct
xpart
*
restrict
xparts_j
=
cj
->
hydro
.
xparts
;
/* Get the relative distance between the pairs, wrapping. */
double
shift
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
...
...
@@ -136,7 +133,6 @@ void DOPAIR1_NONSYM_RT(struct runner *r, struct cell *ci, struct cell *cj) {
/* Get a pointer to the jth particle. */
struct
part
*
restrict
pj
=
&
parts_j
[
pjd
];
struct
xpart
*
restrict
xpj
=
&
xparts_j
[
pjd
];
const
float
hj
=
pj
->
h
;
const
float
hjg2
=
hj
*
hj
*
kernel_gamma2
;
...
...
@@ -150,7 +146,7 @@ void DOPAIR1_NONSYM_RT(struct runner *r, struct cell *ci, struct cell *cj) {
float
dx
[
3
]
=
{
six
[
0
]
-
pjx
[
0
],
six
[
1
]
-
pjx
[
1
],
six
[
2
]
-
pjx
[
2
]};
const
float
r2
=
dx
[
0
]
*
dx
[
0
]
+
dx
[
1
]
*
dx
[
1
]
+
dx
[
2
]
*
dx
[
2
];
if
(
r2
<
hjg2
)
IACT_RT
(
r2
,
dx
,
hi
,
hj
,
si
,
x
pj
);
if
(
r2
<
hjg2
)
IACT_RT
(
r2
,
dx
,
hi
,
hj
,
si
,
pj
);
}
/* loop over the parts in cj. */
}
/* loop over the parts in ci. */
...
...
src/serial_io.c
View file @
89d490fa
...
...
@@ -1227,7 +1227,7 @@ void write_output_serial(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts
,
xparts
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
}
else
{
...
...
@@ -1275,7 +1275,7 @@ void write_output_serial(struct engine* e,
parts_written
,
xparts_written
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts_written
,
list
+
num_fields
);
rt_write_particles
(
parts_written
,
list
+
num_fields
);
}
}
}
break
;
...
...
src/single_io.c
View file @
89d490fa
...
...
@@ -1019,7 +1019,7 @@ void write_output_single(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts
,
xparts
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts
,
list
+
num_fields
);
}
}
else
{
...
...
@@ -1064,7 +1064,7 @@ void write_output_single(struct engine* e,
num_fields
+=
star_formation_write_particles
(
parts_written
,
xparts_written
,
list
+
num_fields
);
if
(
with_rt
)
{
num_fields
+=
rt_write_particles
(
x
parts_written
,
list
+
num_fields
);
num_fields
+=
rt_write_particles
(
parts_written
,
list
+
num_fields
);
}
}
}
break
;
...
...
src/space.c
View file @
89d490fa
...
...
@@ -4926,7 +4926,7 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
black_holes_mark_part_as_not_swallowed
(
&
p
[
k
].
black_holes_data
);
/* And the radiative transfer */
rt_first_init_
xpart
(
&
x
p
[
k
]);
rt_first_init_
part
(
&
p
[
k
]);
#ifdef SWIFT_DEBUG_CHECKS
/* Check part->gpart->part linkeage. */
...
...
@@ -5283,7 +5283,7 @@ void space_init_parts_mapper(void *restrict map_data, int count,
black_holes_init_potential
(
&
parts
[
k
].
black_holes_data
);
chemistry_init_part
(
&
parts
[
k
],
e
->
chemistry
);
pressure_floor_init_part
(
&
parts
[
k
],
&
xparts
[
k
]);
rt_init_
xpart
(
&
x
parts
[
k
]);
rt_init_
part
(
&
parts
[
k
]);
star_formation_init_part
(
&
parts
[
k
],
e
->
star_formation
);
tracers_after_init
(
&
parts
[
k
],
&
xparts
[
k
],
e
->
internal_units
,
e
->
physical_constants
,
with_cosmology
,
e
->
cosmology
,
...
...
Write
Preview
Markdown
is supported
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