Commit 79aa06ea authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Applied code formatting tool

parent 1cc39a75
......@@ -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? */
......
......@@ -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)
......
......@@ -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;
......
This diff is collapsed.
......@@ -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 */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment