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
6514213a
Commit
6514213a
authored
Aug 26, 2016
by
Matthieu Schaller
Browse files
Moved the entry structure definition to the top of runner.c where it is actually used.
parent
1d571d39
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
6514213a
...
...
@@ -57,6 +57,18 @@
#include
"timers.h"
#include
"timestep.h"
/**
* @brief Entry in a list of sorted indices.
*/
struct
entry
{
/*! Distance on the axis */
float
d
;
/*! Particle index */
int
i
;
};
/* Orientation of the cell pairs */
const
double
runner_shift
[
13
][
3
]
=
{
{
5.773502691896258e-01
,
5.773502691896258e-01
,
5.773502691896258e-01
},
...
...
src/space.c
View file @
6514213a
...
...
@@ -691,7 +691,7 @@ void space_split(struct space *s, struct cell *cells, int verbose) {
/**
* @brief Sort the particles and condensed particles according to the given
*indices.
*
indices.
*
* @param s The #space.
* @param ind The indices with respect to which the parts are sorted.
...
...
@@ -876,8 +876,7 @@ void space_parts_sort_mapper(void *map_data, int num_elements,
}
/**
* @brief Sort the g-particles and condensed particles according to the given
*indices.
* @brief Sort the g-particles according to the given indices.
*
* @param s The #space.
* @param ind The indices with respect to which the gparts are sorted.
...
...
@@ -1504,7 +1503,6 @@ void space_init_gparts(struct space *s) {
* parts with a cutoff below half the cell width are then split
* recursively.
*/
void
space_init
(
struct
space
*
s
,
const
struct
swift_params
*
params
,
double
dim
[
3
],
struct
part
*
parts
,
struct
gpart
*
gparts
,
size_t
Npart
,
size_t
Ngpart
,
int
periodic
,
int
gravity
,
...
...
src/space.h
View file @
6514213a
...
...
@@ -52,61 +52,62 @@ extern int space_subsize;
/* Map shift vector to sortlist. */
extern
const
int
sortlistID
[
27
];
/* Entry in a list of sorted indices. */
struct
entry
{
float
d
;
int
i
;
};
/**
* @brief The space in which the cells reside.
* @brief The space in which the cells
and particles
reside.
*/
struct
space
{
/*! Spatial extent. */
double
dim
[
3
];
/*! Is the space periodic? */
int
periodic
;
/*! Are we doing gravity? */
int
gravity
;
/*! Width of the top-level cells. */
double
width
[
3
];
/* Inverse of the top-level cell width */
/*
!
Inverse of the top-level cell width */
double
iwidth
[
3
];
/*! The minimum cell width. */
/*! The minimum
top-level
cell width
allowed
. */
double
cell_min
;
/*! Current maximum displacement for particles. */
float
dx_max
;
/*! Number of cells. */
int
nr_cells
,
tot_cells
;
/*! Space dimensions in number of cells. */
/*! Space dimensions in number of top-cells. */
int
cdim
[
3
];
/*! Maximal depth reached by the tree */
int
maxdepth
;
/*! Number of top-level cells. */
int
nr_cells
;
/*! Total number of cells (top- and sub-) */
int
tot_cells
;
/*! The (level 0) cells themselves. */
struct
cell
*
cells_top
;
/*! Buffer of unused cells for the sub-cells. */
struct
cell
*
cells_sub
;
/*! The particle data (cells have pointers to this). */
struct
part
*
parts
;
struct
xpart
*
xparts
;
struct
gpart
*
gparts
;
/*! The total number of parts in the space. */
size_t
nr_parts
,
size_parts
;
size_t
nr_gparts
,
size_gparts
;
/*!
Is t
he
s
pa
ce periodic?
*/
int
periodic
;
/*!
T
he pa
rticle data (cells have pointers to this).
*/
struct
part
*
parts
;
/*! Are we doing gravity? */
int
gravity
;
/*! The extended particle data (cells have pointers to this). */
struct
xpart
*
xparts
;
/*! The g-particle data (cells have pointers to this). */
struct
gpart
*
gparts
;
/*! General-purpose lock for this space. */
swift_lock_type
lock
;
...
...
@@ -122,6 +123,8 @@ struct space {
/*! Buffers for parts that we will receive from foreign cells. */
struct
part
*
parts_foreign
;
size_t
nr_parts_foreign
,
size_parts_foreign
;
/*! Buffers for g-parts that we will receive from foreign cells. */
struct
gpart
*
gparts_foreign
;
size_t
nr_gparts_foreign
,
size_gparts_foreign
;
...
...
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