Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
50893d6e
Commit
50893d6e
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Re-organise the cell structure. Make it more light weight.
parent
d4721fbe
No related branches found
No related tags found
1 merge request
!270
No specific counters and leaner cell structure.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cell.h
+132
-73
132 additions, 73 deletions
src/cell.h
with
132 additions
and
73 deletions
src/cell.h
+
132
−
73
View file @
50893d6e
...
...
@@ -79,132 +79,191 @@ struct pcell {
}
SWIFT_STRUCT_ALIGN
;
/* Structure to store the data of a single cell. */
/**
* @brief Cell within the tree structure.
*
* Contains particles, links to tasks, a multipole object and counters.
*/
struct
cell
{
/* The cell location on the grid. */
/*! This cell's multipole. */
struct
multipole
multipole
;
/*! The cell location on the grid. */
double
loc
[
3
];
/* The cell dimensions. */
/*
!
The cell dimensions. */
double
width
[
3
];
/* Max smoothing length in this cell. */
/*
!
Max smoothing length in this cell. */
double
h_max
;
/* Minimum and maximum end of time step in this cell. */
int
ti_end_min
,
ti_end_max
;
/* Last time the cell's content was drifted forward in time. */
int
ti_old
;
/* Minimum dimension, i.e. smallest edge of this cell. */
float
dmin
;
/* Maximum slack allowed for particle movement. */
float
slack
;
/* Maximum particle movement in this cell since last construction. */
float
dx_max
;
/* The depth of this cell in the tree. */
int
depth
,
split
,
maxdepth
;
/* Nr of parts. */
int
count
,
gcount
;
/*! Linking pointer for "memory management". */
struct
cell
*
next
;
/* Pointer
s
to the part
icle
data. */
/*
!
Pointer to the
#
part data. */
struct
part
*
parts
;
/* Pointer
s
to the
extra particle
data. */
/*
!
Pointer to the
#xpart
data. */
struct
xpart
*
xparts
;
/* Pointer
s
to the
gravity particle
data. */
/*
!
Pointer to the
#gpart
data. */
struct
gpart
*
gparts
;
/* Pointer
s
for the sorted indices. */
/*
!
Pointer for the sorted indices. */
struct
entry
*
sort
;
unsigned
int
sorted
;
/* Pointers to the next level of cells. */
/*
!
Pointers to the next level of cells. */
struct
cell
*
progeny
[
8
];
/* Parent cell. */
/*
!
Parent cell. */
struct
cell
*
parent
;
/* Super cell, i.e. the highest-level
super
cell that has pair/self tasks */
/*
!
Super cell, i.e. the highest-level
parent
cell that has pair/self tasks */
struct
cell
*
super
;
/* The task computing this cell's sorts. */
/*
!
The task computing this cell's sorts. */
struct
task
*
sorts
;
int
sortsize
;
/*
T
he tasks computing this cell's density. */
struct
link
*
density
,
*
gradient
,
*
force
,
*
grav
;
/*
! Linked list of t
he tasks computing this cell's
hydro
density. */
struct
link
*
density
;
/*
The hierarchical task
s. */
struct
task
*
extra_ghost
,
*
ghost
,
*
init
,
*
kick
;
/*
Linked list of the tasks computing this cell's hydro gradient
s. */
struct
link
*
gradient
;
#ifdef WITH_MPI
/*! Linked list of the tasks computing this cell's hydro forces. */
struct
link
*
force
;
/*
Task receiving data
. */
struct
task
*
recv_xv
,
*
recv_rho
,
*
recv_gradient
,
*
recv_ti
;
/*
! Linked list of the tasks computing this cell's gravity forces
. */
struct
link
*
grav
;
/* T
ask send data.
*/
struct
link
*
send_xv
,
*
send_rho
,
*
send_gradient
,
*
send_ti
;
/*
!
T
he initialistation task
*/
struct
task
*
init
;
#endif
/*! The ghost task */
struct
task
*
ghost
;
/* Task
s
for
gravity tree.
*/
struct
task
*
grav_up
,
*
grav_down
;
/*
!
T
he extra ghost t
ask for
complex hydro schemes
*/
struct
task
*
extra_ghost
;
/* T
ask for cooling
*/
struct
task
*
cooling
;
/*
!
T
he kick task
*/
struct
task
*
kick
;
/* Task
for source term
s */
struct
task
*
sourceterms
;
/*
!
Task
constructing the multipole from the particle
s */
struct
task
*
grav_up
;
/*
Number of tasks that are associated with this cell.
*/
int
nr_tasks
;
/*
! Task propagating the multipole to the particles
*/
struct
task
*
grav_down
;
/*
Is the data of this cell being used in a sub-cell?
*/
int
hold
,
ghold
;
/*
! Task for cooling
*/
struct
task
*
cooling
;
/*
Spin lock for various uses.
*/
s
wift_lock_type
lock
,
glock
;
/*
! Task for source terms
*/
s
truct
task
*
sourceterms
;
/* ID of the previous owner, e.g. runner. */
int
owner
;
#ifdef WITH_MPI
/*
Momentum of particles in cell
. */
double
mom
[
3
],
ang_mom
[
3
]
;
/*
Task receiving data (positions)
. */
struct
task
*
recv_xv
;
/*
M
as
s, potential, internal and kinetic energy of particles in this cell
. */
double
mass
,
e_pot
,
e_int
,
e_kin
,
e_rad
,
entropy
;
/*
T
as
k receiving data (density)
. */
struct
task
*
recv_rho
;
/*
Number of particles updated in this cell
. */
int
updated
,
g_updated
;
/*
Task receiving data (gradient)
. */
struct
task
*
recv_gradient
;
/*
Linking pointer for "memory management"
. */
struct
cell
*
next
;
/*
Task receiving data (time-step)
. */
struct
task
*
recv_ti
;
/*
This cell's multipole
. */
struct
multipole
multipole
;
/*
Linked list for sending data (positions)
. */
struct
link
*
send_xv
;
/*
ID of the node this cell lives on
. */
int
nodeID
;
/*
Linked list for sending data (density)
. */
struct
link
*
send_rho
;
#ifdef WITH_MPI
/* Linked list for sending data (gradient). */
struct
link
*
send_gradient
;
/* Linked list for sending data (time-step). */
struct
link
*
send_ti
;
/* Bit mask of the proxies this cell is registered with. */
/*
!
Bit mask of the proxies this cell is registered with. */
unsigned
long
long
int
sendto
;
/* Pointer to this cell's packed representation. */
/*
!
Pointer to this cell's packed representation. */
struct
pcell
*
pcell
;
/*! Size of the packed representation */
int
pcell_size
;
/*! MPI tag associated with this cell */
int
tag
;
#endif
/*! Minimum end of (integer) time step in this cell. */
int
ti_end_min
;
/*! Maximum end of (integer) time step in this cell. */
int
ti_end_max
;
/*! Last (integer) time the cell's content was drifted forward in time. */
int
ti_old
;
/*! Minimum dimension, i.e. smallest edge of this cell (min(width)). */
float
dmin
;
/*! Maximum particle movement in this cell since last construction. */
float
dx_max
;
/*! Nr of #part in this cell. */
int
count
;
/*! Nr of #gpart in this cell. */
int
gcount
;
/*! The size of the sort array */
int
sortsize
;
/*! Bit-mask indicating the sorted directions */
unsigned
int
sorted
;
/*! Spin lock for various uses (#part case). */
swift_lock_type
lock
;
/*! Spin lock for various uses (#gpart case). */
swift_lock_type
glock
;
/*! ID of the previous owner, e.g. runner. */
int
owner
;
/*! Number of #part updated in this cell. */
int
updated
;
/*! Number of #gpart updated in this cell. */
int
g_updated
;
/*! ID of the node this cell lives on. */
int
nodeID
;
/*! Number of tasks that are associated with this cell. */
short
int
nr_tasks
;
/*! The depth of this cell in the tree. */
char
depth
;
/*! Is this cell split ? */
char
split
;
/*! The maximal depth of this cell and its progenies */
char
maxdepth
;
/*! Is the #part data of this cell being used in a sub-cell? */
char
hold
;
/*! Is the #gpart data of this cell being used in a sub-cell? */
char
ghold
;
}
SWIFT_STRUCT_ALIGN
;
/* Convert cell location to ID. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment