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
79aa06ea
Commit
79aa06ea
authored
May 16, 2020
by
Matthieu Schaller
Browse files
Applied code formatting tool
parent
1cc39a75
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
79aa06ea
...
...
@@ -4523,7 +4523,9 @@ void cell_drift_part(struct cell *c, const struct engine *e, int force) {
if
(
c
->
nodeID
!=
engine_rank
)
error
(
"Drifting a foreign cell is nope."
);
/* Check that we are actually going to move forward. */
if
(
ti_current
<
ti_old_part
)
error
(
"Attempt to drift to the past ti_current=%lld < ti_old_part=%lld"
,
ti_current
,
ti_old_part
);
if
(
ti_current
<
ti_old_part
)
error
(
"Attempt to drift to the past ti_current=%lld < ti_old_part=%lld"
,
ti_current
,
ti_old_part
);
#endif
/* Early abort? */
...
...
src/engine.c
View file @
79aa06ea
...
...
@@ -3848,7 +3848,8 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
struct
cooling_function_data
*
cooling_func
,
const
struct
star_formation
*
starform
,
const
struct
chemistry_global_data
*
chemistry
,
struct
fof_props
*
fof_properties
,
struct
los_props
*
los_properties
)
{
struct
fof_props
*
fof_properties
,
struct
los_props
*
los_properties
)
{
/* Clean-up everything */
bzero
(
e
,
sizeof
(
struct
engine
));
...
...
@@ -5150,8 +5151,8 @@ void engine_init_output_lists(struct engine *e, struct swift_params *params) {
/* Deal with line of sight */
double
los_time_first
;
e
->
output_list_los
=
NULL
;
output_list_init
(
&
e
->
output_list_los
,
e
,
"LineOfSight"
,
&
e
->
delta_time_los
,
&
los_time_first
);
output_list_init
(
&
e
->
output_list_los
,
e
,
"LineOfSight"
,
&
e
->
delta_time_los
,
&
los_time_first
);
if
(
e
->
output_list_los
)
{
if
(
e
->
policy
&
engine_policy_cosmology
)
...
...
src/engine.h
View file @
79aa06ea
...
...
@@ -489,7 +489,7 @@ struct engine {
char
stf_this_timestep
;
/* Line of sight properties. */
struct
los_props
*
los_properties
;
struct
los_props
*
los_properties
;
/* Line of sight outputs information. */
struct
output_list
*
output_list_los
;
...
...
src/line_of_sight.c
View file @
79aa06ea
This diff is collapsed.
Click to expand it.
src/line_of_sight.h
View file @
79aa06ea
...
...
@@ -26,20 +26,20 @@
#include
"engine.h"
#include
"io_properties.h"
/*
/*
* Maps the LOS axis geometry to the simulation axis geometry.
*
* Sigtlines will always shoot down the los_direction_z,
* Sigtlines will always shoot down the los_direction_z,
* which can map to x,y or z of the simulation geometry.
*
* The remainng two axes, los_direction_x/y, then create
* the plane orthogonal to the LOS direction. The random
* sightline positions are created on this plane.
*/
enum
los_direction
{
simulation_x_axis
=
0
,
simulation_y_axis
=
1
,
simulation_z_axis
=
2
enum
los_direction
{
simulation_x_axis
=
0
,
simulation_y_axis
=
1
,
simulation_z_axis
=
2
};
struct
line_of_sight
{
...
...
@@ -84,13 +84,16 @@ struct los_props {
/* Total number of sightlines. */
int
num_tot
;
/* The min--max range along the simulation x axis random sightlines are allowed. */
/* The min--max range along the simulation x axis random sightlines are
* allowed. */
double
xmin
,
xmax
;
/* The min--max range along the simulation y axis random sightlines are allowed. */
/* The min--max range along the simulation y axis random sightlines are
* allowed. */
double
ymin
,
ymax
;
/* The min--max range along the simulation z axis random sightlines are allowed. */
/* The min--max range along the simulation z axis random sightlines are
* allowed. */
double
zmin
,
zmax
;
/* Basename for line of sight HDF5 files. */
...
...
@@ -99,29 +102,32 @@ struct los_props {
double
los_periodic
(
double
x
,
double
dim
);
void
generate_sightlines
(
struct
line_of_sight
*
Los
,
const
struct
los_props
*
params
,
const
int
periodic
,
const
double
dim
[
3
]);
const
struct
los_props
*
params
,
const
int
periodic
,
const
double
dim
[
3
]);
void
print_los_info
(
const
struct
line_of_sight
*
Los
,
const
int
i
);
void
do_line_of_sight
(
struct
engine
*
e
);
void
los_init
(
double
dim
[
3
],
struct
los_props
*
los_params
,
struct
swift_params
*
params
);
void
write_los_hdf5_datasets
(
hid_t
grp
,
int
j
,
size_t
N
,
const
struct
part
*
parts
,
struct
engine
*
e
,
const
struct
xpart
*
xparts
);
void
write_los_hdf5_dataset
(
const
struct
io_props
p
,
size_t
N
,
int
j
,
struct
engine
*
e
,
hid_t
grp
);
void
write_hdf5_header
(
hid_t
h_file
,
const
struct
engine
*
e
,
const
struct
los_props
*
LOS_params
,
const
size_t
total_num_parts_in_los
);
struct
swift_params
*
params
);
void
write_los_hdf5_datasets
(
hid_t
grp
,
int
j
,
size_t
N
,
const
struct
part
*
parts
,
struct
engine
*
e
,
const
struct
xpart
*
xparts
);
void
write_los_hdf5_dataset
(
const
struct
io_props
p
,
size_t
N
,
int
j
,
struct
engine
*
e
,
hid_t
grp
);
void
write_hdf5_header
(
hid_t
h_file
,
const
struct
engine
*
e
,
const
struct
los_props
*
LOS_params
,
const
size_t
total_num_parts_in_los
);
void
create_sightline
(
const
double
Xpos
,
const
double
Ypos
,
enum
los_direction
xaxis
,
enum
los_direction
yaxis
,
enum
los_direction
zaxis
,
const
int
periodic
,
const
double
dim
[
3
],
struct
line_of_sight
*
los
);
void
los_struct_dump
(
const
struct
los_props
*
internal_los
,
FILE
*
stream
);
void
los_struct_restore
(
const
struct
los_props
*
internal_los
,
FILE
*
stream
);
enum
los_direction
xaxis
,
enum
los_direction
yaxis
,
enum
los_direction
zaxis
,
const
int
periodic
,
const
double
dim
[
3
],
struct
line_of_sight
*
los
);
void
los_struct_dump
(
const
struct
los_props
*
internal_los
,
FILE
*
stream
);
void
los_struct_restore
(
const
struct
los_props
*
internal_los
,
FILE
*
stream
);
int
does_los_intersect
(
const
struct
cell
*
c
,
const
struct
line_of_sight
*
los
);
void
find_intersecting_top_level_cells
(
const
struct
engine
*
e
,
struct
line_of_sight
*
los
,
int
*
los_cells_top
,
const
struct
cell
*
cells
,
const
int
*
local_cells_with_particles
,
const
int
nr_local_cells_with_particles
);
struct
line_of_sight
*
los
,
int
*
los_cells_top
,
const
struct
cell
*
cells
,
const
int
*
local_cells_with_particles
,
const
int
nr_local_cells_with_particles
);
#endif
/* SWIFT_LOS_H */
#endif
/* SWIFT_LOS_H */
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