Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfSpace.h File Reference
#include <mdcore_config.h>
#include "tfSpace_cell.h"
#include <vector>
Include dependency graph for tfSpace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TissueForge::verlet_entry
 
struct  TissueForge::cellpair
 
struct  TissueForge::celltuple
 
struct  TissueForge::space
 

Namespaces

namespace  TissueForge
 Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
 

Macros

#define space_partlist_incr   100
 
#define space_maxtuples   4
 
#define space_verlet_maxpairs   800
 
#define space_cellid(s, i, j, k)   ( ((i)*(s)->cdim[1] + (j)) * (s)->cdim[2] + (k) )
 
#define celldims_cellid(cdim, i, j, k)   ( ((i)*cdim[1] + (j)) * cdim[2] + (k) )
 
#define space_pairind(i, j)   ( space_maxtuples*(i) - (i)*((i)+1)/2 + (j) )
 

Typedefs

typedef struct TissueForge::space TissueForge::space
 

Enumerations

enum  PeriodicFlags {
  space_periodic_none = 0 , space_periodic_x = 1 << 0 , space_periodic_y = 1 << 1 , space_periodic_z = 1 << 2 ,
  space_periodic_full = (1 << 0) | (1 << 1) | (1 << 2) , space_periodic_ghost_x = 1 << 3 , space_periodic_ghost_y = 1 << 4 , space_periodic_ghost_z = 1 << 5 ,
  space_periodic_ghost_full = (1 << 3) | (1 << 4) | (1 << 5) , SPACE_FREESLIP_X = 1 << 6 , SPACE_FREESLIP_Y = 1 << 7 , SPACE_FREESLIP_Z = 1 << 8 ,
  SPACE_FREESLIP_FULL = (1 << 6) | (1 << 7) | (1 << 8)
}
 

Functions

HRESULT TissueForge::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.
 
int TissueForge::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 TissueForge::space_shuffle (struct space *s)
 Run through the cells of a #space and make sure every particle is in its place.
 
HRESULT TissueForge::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 TissueForge::space_growparts (struct space *s, unsigned int size_incr)
 Grow the parts allocated to a #space.
 
HRESULT TissueForge::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, it itself is not added, rather a new memory block is allocated, and the contents of p get copied in there.
 
HRESULT TissueForge::space_addparts (struct space *s, int nr_parts, struct Particle **parts, FPTYPE **xparts)
 
int TissueForge::space_get_cellids_for_pos (struct space *s, FPTYPE *x, int *cellids)
 
HRESULT TissueForge::space_del_particle (struct space *s, int pid)
 
HRESULT TissueForge::space_update_style (struct space *s)
 
HRESULT TissueForge::space_prepare_tasks (struct space *s)
 Prepare the tasks before a time step.
 
HRESULT TissueForge::space_prepare (struct space *s)
 Prepare the space before a time step.
 
HRESULT TissueForge::space_getpos (struct space *s, int id, FPTYPE *x)
 Get the absolute position of a particle.
 
HRESULT TissueForge::space_setpos (struct space *s, int id, FPTYPE *x)
 Set the absolute position of a particle.
 
HRESULT TissueForge::space_flush (struct space *s)
 Clear all particles from this #space.
 
HRESULT TissueForge::space_flush_ghosts (struct space *s)
 Clear all particles from the ghost cells in this #space.
 
struct taskTissueForge::space_addtask (struct space *s, int type, int subtype, int flags, int i, int j)
 Add a task to the given space.
 
HRESULT TissueForge::space_verlet_init (struct space *s, int list_global)
 Initialize the Verlet-list data structures.
 
int TissueForge::space_gettuple (struct space *s, struct celltuple **out, int wait)
 Get the next free #celltuple from the space.
 
int TissueForge::space_getcell (struct space *s, struct space_cell **out)
 Get the next unprocessed cell from the spaece.
 
int TissueForge::space_verlet_force (struct space *s, FPTYPE *f, FPTYPE epot)
 Collect forces and potential energies.
 
HRESULT TissueForge::space_releasepair (struct space *s, int ci, int cj)
 Free the cells involved in the current pair.
 

Macro Definition Documentation

◆ space_cellid

#define space_cellid ( s,
i,
j,
k )   ( ((i)*(s)->cdim[1] + (j)) * (s)->cdim[2] + (k) )

Converts the index triplet (i, j, k) to the cell id in the #space s.

◆ space_maxtuples

#define space_maxtuples   4

Maximum number of cells per tuple.

◆ space_pairind

#define space_pairind ( i,
j )   ( space_maxtuples*(i) - (i)*((i)+1)/2 + (j) )

Convert tuple ids into the pairid index.

◆ space_verlet_maxpairs

#define space_verlet_maxpairs   800

Maximum number of interactions per particle in the Verlet list.