mdcore  0.1.5
Data Structures | Defines | Functions | Variables
/home/pedro/work/mdcore/src/cell.h File Reference

Go to the source code of this file.

Data Structures

struct  cell

Defines

#define cell_err_ok   0
#define cell_err_null   -1
#define cell_err_malloc   -2
#define cell_err_pthread   -3
#define cell_default_size   64
#define cell_incr   10
#define cell_partalign   64
#define cell_flag_none   0
#define cell_flag_ghost   1
#define cell_flag_wait   2
#define cell_flag_waited   4
#define cell_flag_marked   8

Functions

int cell_init (struct cell *c, int *loc, double *origin, double *dim)
 Initialize the given cell.
struct partcell_add (struct cell *c, struct part *p, struct part **partlist)
 Add a particle to a cell.
struct partcell_add_incomming (struct cell *c, struct part *p)
 Add a particle to the incomming array of a cell.
int cell_add_incomming_multiple (struct cell *c, struct part *p, int count)
 Add one or more particles to the incomming array of a cell.
int cell_welcome (struct cell *c, struct part **partlist)
 Move particles from the incomming buffer to the cell.
int cell_load (struct cell *c, struct part *parts, int nr_parts, struct part **partlist, struct cell **celllist)
 Load a block of particles to the cell.
int cell_flush (struct cell *c, struct part **partlist, struct cell **celllist)
 Flush all the parts from a cell.

Variables

const char cell_sortlistID [27]
const FPTYPE cell_shift [13 *3]
const char cell_flip [27]
int cell_err

Define Documentation

#define cell_default_size   64
#define cell_err_malloc   -2
#define cell_err_null   -1
#define cell_err_ok   0
#define cell_err_pthread   -3
#define cell_flag_ghost   1
#define cell_flag_marked   8
#define cell_flag_none   0

Cell flags

#define cell_flag_wait   2
#define cell_flag_waited   4
#define cell_incr   10
#define cell_partalign   64

Alignment when allocating parts.


Function Documentation

struct part* cell_add ( struct cell c,
struct part p,
struct part **  partlist 
) [read]

Add a particle to a cell.

Parameters:
cThe cell to which the particle should be added.
pThe #particle to add to the cell
Returns:
A pointer to the particle data in the cell.

This routine assumes the particle position has already been adjusted to the cell c.

struct part* cell_add_incomming ( struct cell c,
struct part p 
) [read]

Add a particle to the incomming array of a cell.

Parameters:
cThe cell to which the particle should be added.
pThe #particle to add to the cell
Returns:
A pointer to the particle data in the incomming array of the cell.

This routine assumes the particle position has already been adjusted to the cell c.

int cell_add_incomming_multiple ( struct cell c,
struct part p,
int  count 
)

Add one or more particles to the incomming array of a cell.

Parameters:
cThe cell to which the particle should be added.
pThe #particle to add to the cell
Returns:
The number of incomming parts or < 0 on error (see cell_err).

This routine assumes the particle position have already been adjusted to the cell c.

int cell_flush ( struct cell c,
struct part **  partlist,
struct cell **  celllist 
)

Flush all the parts from a cell.

Parameters:
cThe cell to flush.
partlistA pointer to the partlist to set the part indices.
celllistA pointer to the celllist to set the part indices.
Returns:
cell_err_ok or < 0 on error (see cell_err).
int cell_init ( struct cell c,
int *  loc,
double *  origin,
double *  dim 
)

Initialize the given cell.

Parameters:
cThe cell to initialize.
locArray containing the location of this cell in the space.
originThe origin of the cell in global coordinates
dimThe cell dimensions.
Returns:
cell_err_ok or < 0 on error (see cell_err).
int cell_load ( struct cell c,
struct part parts,
int  nr_parts,
struct part **  partlist,
struct cell **  celllist 
)

Load a block of particles to the cell.

Parameters:
cThe cell.
partsPointer to a block of part.
nr_partsThe number of parts to load.
partlistA pointer to the partlist to set the part indices.
celllistA pointer to the celllist to set the part indices.
Returns:
cell_err_ok or < 0 on error (see cell_err).
int cell_welcome ( struct cell c,
struct part **  partlist 
)

Move particles from the incomming buffer to the cell.

Parameters:
cThe cell.
partlistA pointer to the partlist to set the part indices.
Returns:
cell_err_ok or < 0 on error (see cell_err).

Variable Documentation

int cell_err
const char cell_flip[27]
const FPTYPE cell_shift[13 *3]
const char cell_sortlistID[27]
 All Data Structures Files Functions Variables Typedefs Enumerator Defines