27#ifndef _MDCORE_INCLUDE_TFSPACE_H_
28#define _MDCORE_INCLUDE_TFSPACE_H_
29#include <mdcore_config.h>
35#define space_partlist_incr 100
38#define space_maxtuples 4
41#define space_verlet_maxpairs 800
46#define space_cellid(s,i,j,k) ( ((i)*(s)->cdim[1] + (j)) * (s)->cdim[2] + (k) )
47#define celldims_cellid(cdim,i,j,k) ( ((i)*cdim[1] + (j)) * cdim[2] + (k) )
50#define space_pairind(i,j) ( space_maxtuples*(i) - (i)*((i)+1)/2 + (j) )
58 space_periodic_none = 0,
59 space_periodic_x = 1 << 0,
60 space_periodic_y = 1 << 1,
61 space_periodic_z = 1 << 2,
62 space_periodic_full = (1 << 0) | (1 << 1) | (1 << 2),
63 space_periodic_ghost_x = 1 << 3,
64 space_periodic_ghost_y = 1 << 4,
65 space_periodic_ghost_z = 1 << 5,
66 space_periodic_ghost_full = (1 << 3) | (1 << 4) | (1 << 5),
67 SPACE_FREESLIP_X = 1 << 6,
68 SPACE_FREESLIP_Y = 1 << 7,
69 SPACE_FREESLIP_Z = 1 << 8,
70 SPACE_FREESLIP_FULL = (1 << 6) | (1 << 7) | (1 << 8),
154 int nr_real, nr_ghost, nr_marked;
167 pthread_cond_t tasks_avail;
198 int nr_visible_large_parts;
207 FPTYPE
epot, epot_nonbond, epot_bond, epot_angle, epot_dihedral, epot_exclusion;
211 FPTYPE *verlet_oldx, verlet_maxdx;
213 int verlet_size, verlet_next;
214 pthread_mutex_t verlet_force_mutex;
267 const FPTYPE *origin,
344 CAPI_FUNC(
HRESULT) space_addparts(
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
HRESULT space_prepare(struct space *s)
Prepare the space before a time step.
int space_get_cellids_for_pos(struct space *s, FPTYPE *x, int *cellids)
HRESULT space_prepare_tasks(struct space *s)
Prepare the tasks before a time step.
int space_verlet_force(struct space *s, FPTYPE *f, FPTYPE epot)
Collect forces and potential energies.
struct task * space_addtask(struct space *s, int type, int subtype, int flags, int i, int j)
Add a task to the given space.
HRESULT space_addpart(struct space *s, struct Particle *p, FPTYPE *x, struct Particle **result)
Add a #part to a space at the given coordinates. The given particle p is only used for the attributes...
HRESULT space_shuffle(struct space *s)
Run through the cells of a space and make sure every particle is in its place.
HRESULT space_flush_ghosts(struct space *s)
Clear all particles from the ghost cells in this space.
HRESULT space_setpos(struct space *s, int id, FPTYPE *x)
Set the absolute position of a particle.
HRESULT space_releasepair(struct space *s, int ci, int cj)
Free the cells involved in the current pair.
HRESULT space_getpos(struct space *s, int id, FPTYPE *x)
Get the absolute position of a particle.
HRESULT space_init(struct space *s, const FPTYPE *origin, const FPTYPE *dim, FPTYPE *L, FPTYPE cutoff, const struct BoundaryConditions *bc)
Initialize the space with the given dimensions.
HRESULT space_update_style(struct space *s)
int space_getcell(struct space *s, struct space_cell **out)
Get the next unprocessed cell from the spaece.
HRESULT space_del_particle(struct space *s, int pid)
HRESULT space_verlet_init(struct space *s, int list_global)
Initialize the Verlet-list data structures.
HRESULT space_shuffle_local(struct space *s)
Run through the non-ghost cells of a space and make sure every particle is in its place.
HRESULT space_flush(struct space *s)
Clear all particles from this space.
struct TissueForge::space space
int space_gettuple(struct space *s, struct celltuple **out, int wait)
Get the next free celltuple from the space.
int space_getsid(struct space *s, struct space_cell **ci, struct space_cell **cj, FPTYPE *shift)
Get the sort-ID and flip the cells if necessary.
HRESULT space_growparts(struct space *s, unsigned int size_incr)
Grow the parts allocated to a space.
The BoundaryConditions class serves as a container for the six instances of the :class:BoundaryCondit...
Definition tfBoundaryConditions.h:117
Definition tfParticle.h:101
A Potential object is a compiled interpolation of a given function. The Universe applies potentials t...
Definition tfPotential.h:213
FPTYPE shift[3]
Definition tfSpace.h:95
struct cellpair * next
Definition tfSpace.h:103
int i
Definition tfSpace.h:92
int size
Definition tfSpace.h:98
int cellid[4]
Definition tfSpace.h:111
int pairid[4 *(4+1)/2]
Definition tfSpace.h:117
int n
Definition tfSpace.h:114
the space_cell structure
Definition tfSpace_cell.h:103
pthread_mutex_t cellpairs_mutex
Definition tfSpace.h:235
FPTYPE dim[3]
Definition tfSpace.h:129
struct celltuple * tuples
Definition tfSpace.h:226
struct verlet_entry * verlet_list
Definition tfSpace.h:210
int span[3]
Definition tfSpace.h:138
int * cid_real
Definition tfSpace.h:153
int next_pair
Definition tfSpace.h:223
int nr_cells
Definition tfSpace.h:150
struct space_cell * cells
Definition tfSpace.h:157
char * cells_owner
Definition tfSpace.h:173
FPTYPE epot
Definition tfSpace.h:207
FPTYPE cutoff
Definition tfSpace.h:144
struct task * tasks
Definition tfSpace.h:163
char * cells_taboo
Definition tfSpace.h:170
FPTYPE origin[3]
Definition tfSpace.h:132
pthread_cond_t cellpairs_avail
Definition tfSpace.h:241
struct space_cell ** celllist
Definition tfSpace.h:185
FPTYPE maxdx
Definition tfSpace.h:204
pthread_mutex_t tasks_mutex
Definition tfSpace.h:166
int nr_parts
Definition tfSpace.h:188
unsigned int period
Definition tfSpace.h:147
struct cellpair * pairs
Definition tfSpace.h:220
int next_tuple
Definition tfSpace.h:232
FPTYPE h[3]
Definition tfSpace.h:141
int nr_visible_parts
Definition tfSpace.h:197
int nr_pairs
Definition tfSpace.h:217
int nr_tasks
Definition tfSpace.h:160
int nr_swaps
Definition tfSpace.h:176
int nr_tuples
Definition tfSpace.h:229
int verlet_rebuild
Definition tfSpace.h:201
struct Particle ** partlist
Definition tfSpace.h:179
int cdim[3]
Definition tfSpace.h:135
space_cell largeparts
Definition tfSpace.h:182
struct Particle * p
Definition tfSpace.h:78
struct Potential * pot
Definition tfSpace.h:81
signed char shift[3]
Definition tfSpace.h:84
int32_t HRESULT
Definition tf_port.h:255
#define space_maxtuples
Definition tfSpace.h:38