Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge Namespace Reference

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

Namespaces

namespace  cuda
 Tissue Forge GPU acceleration on CUDA-supporting devices.
 
namespace  event
 Tissue Forge event system.
 
namespace  io
 Tissue Forge I/O.
 
namespace  metrics
 Tissue Forge simulation metrics.
 
namespace  models
 Application-specific Tissue Forge models and methods.
 
namespace  py
 Tissue Forge Python language support.
 
namespace  rendering
 Tissue Forge rendering and visualization.
 
namespace  shaders
 Tissue Forge shaders.
 
namespace  state
 Tissue Forge state dynamics modeling features.
 
namespace  types
 Native Tissue Forge type definitions.
 
namespace  util
 Tissue Forge utilities.
 

Classes

struct  Angle
 A bond concerning an angle. More...
 
struct  AngleHandle
 A handle to an angle bond. More...
 
struct  Berendsen
 Berendsen force. More...
 
struct  Bond
 Bonds apply a potential to a particular set of particles. More...
 
struct  BondHandle
 Handle to a bond. More...
 
struct  BoundaryCondition
 A condition on a boundary of the universe. More...
 
struct  BoundaryConditions
 The BoundaryConditions class serves as a container for the six instances of the :class:BoundaryCondition object. More...
 
struct  BoundaryConditionsArgsContainer
 
struct  btree
 
struct  btree_node
 
struct  cellpair
 
struct  celltuple
 
struct  Cluster
 The cluster analogue to :class:Particle. More...
 
struct  ClusterParticleHandle
 The cluster analogue to :class:ParticleHandle. More...
 
struct  ClusterParticleType
 The cluster analogue to :class:ParticleType. More...
 
struct  CustomForce
 A custom force function. More...
 
struct  Dihedral
 
struct  DihedralHandle
 A handle to a dihedral bond. More...
 
struct  DPDPotential
 
struct  engine
 
struct  engine_comm
 
struct  engine_set
 
struct  Error
 
struct  exclusion
 
struct  Flux
 
struct  Fluxes
 A flux is defined between a pair of types, and acts on the state vector between a pair of instances. More...
 
struct  Force
 Force is a metatype, in that Tissue Forge has lots of different instances of force functions, that have different attributes, but only have one base type. More...
 
struct  ForceSum
 
struct  Friction
 Friction force. More...
 
struct  Gaussian
 Random force. More...
 
class  Logger
 
class  LoggingBuffer
 
struct  Pair
 
struct  Particle
 
struct  ParticleHandle
 A handle to a particle. More...
 
struct  ParticleList
 A special list with convenience methods for working with sets of particles. More...
 
struct  ParticleType
 Structure containing information on each particle type. More...
 
struct  ParticleTypeList
 A special list with convenience methods for working with sets of particle types. More...
 
struct  Potential
 A Potential object is a compiled interpolation of a given function. The Universe applies potentials to particles to calculate the net force on them. More...
 
struct  queue
 
struct  rigid
 
struct  runner
 
struct  runner_fifo
 
struct  SecreteUptake
 
struct  Simulator
 The Simulator is the entry point to simulation, this is the very first object that needs to be initialized before any other method can be called. All the methods of the Simulator are static, but the constructor needs to be called first to initialize everything. More...
 
struct  space
 
struct  space_cell
 the space_cell structure More...
 
struct  SubEngine
 A SubEngine is a singleton object that injects dynamics into the Tissue Forge engine. It does not necessarily integrate any object in time, but can also simply add to the dynamics of existing Tissue Forge objects. Tissue Forge supports an arbitrary number of subengines with multi-threading and GPU support. More...
 
struct  task
 
class  ThreadPool
 
struct  TypeIdPair
 
struct  Universe
 The universe is a top level singleton object, and is automatically initialized when the simulator loads. The universe is a representation of the physical universe that we are simulating, and is the repository for all physical object representations. More...
 
struct  UniverseConfig
 Initialize an engine with the given data. More...
 
struct  verlet_entry
 

Typedefs

typedef enum TissueForge::AngleFlags AngleFlags
 
typedef struct TissueForge::Angle Angle
 A bond concerning an angle.
 
typedef enum TissueForge::BondFlags BondFlags
 
typedef std::vector< PairPairList
 
typedef struct TissueForge::Bond Bond
 Bonds apply a potential to a particular set of particles.
 
typedef enum TissueForge::DihedralFlags DihedralFlags
 
typedef struct TissueForge::Dihedral Dihedral
 
typedef struct TissueForge::engine engine
 
typedef struct TissueForge::engine_set engine_set
 
typedef struct TissueForge::engine_comm engine_comm
 
typedef struct TissueForge::exclusion exclusion
 
typedef void(* Force_EvalFcn) (struct Force *, struct Particle *, FPTYPE *)
 
using UserForceFuncType = FVector3(*)(CustomForce*)
 
typedef enum TissueForge::ParticleTypeFlags ParticleTypeFlags
 
typedef enum TissueForge::ParticleDynamics ParticleDynamics
 
typedef enum TissueForge::ParticleFlags ParticleFlags
 
typedef void(* PotentialEval_ByParticle) (struct Potential *p, struct Particle *part_i, FPTYPE *dx, FPTYPE r2, FPTYPE *e, FPTYPE *f)
 Potential function on a particle.
 
typedef void(* PotentialEval_ByParticles) (struct Potential *p, struct Particle *part_i, struct Particle *part_j, FPTYPE *dx, FPTYPE r2, FPTYPE *e, FPTYPE *f)
 Pair potential function.
 
typedef void(* PotentialEval_ByParticles3) (struct Potential *p, struct Particle *part_i, struct Particle *part_j, struct Particle *part_k, FPTYPE ctheta, FPTYPE *e, FPTYPE *fi, FPTYPE *fk)
 Like PotentialEval_ByParticles, but with three particles.
 
typedef void(* PotentialEval_ByParticles4) (struct Potential *p, struct Particle *part_i, struct Particle *part_j, struct Particle *part_k, struct Particle *part_l, FPTYPE cphi, FPTYPE *e, FPTYPE *fi, FPTYPE *fl)
 Like PotentialEval_ByParticles, but with four particles.
 
typedef struct Potential *(* PotentialCreate) (struct Potential *partial_potential, struct ParticleType *a, struct ParticleType *b)
 
typedef void(* PotentialClear) (struct Potential *p)
 Callback issues when potential is cleared.
 
typedef struct TissueForge::queue queue
 
typedef struct TissueForge::rigid rigid
 
typedef struct TissueForge::runner_fifo runner_fifo
 
typedef struct TissueForge::runner runner
 
typedef struct TissueForge::space space
 
typedef struct TissueForge::space_cell space_cell
 the space_cell structure
 
typedef struct TissueForge::task task
 
typedef std::mt19937 RandomType
 
typedef void(* ErrorCallback) (const Error &err)
 
typedef HRESULT(* LoggerCallback) (LogEvent, std::ostream *)
 
typedef types::TVector2< double > dVector2
 
typedef types::TVector3< double > dVector3
 
typedef types::TVector4< double > dVector4
 
typedef types::TVector2< float > fVector2
 
typedef types::TVector3< float > fVector3
 
typedef types::TVector4< float > fVector4
 
typedef types::TVector2< FloatP_t > FVector2
 
typedef types::TVector3< FloatP_t > FVector3
 
typedef types::TVector4< FloatP_t > FVector4
 
typedef types::TVector2< int > iVector2
 
typedef types::TVector3< int > iVector3
 
typedef types::TVector4< int > iVector4
 
typedef types::TVector2< unsigned int > uiVector2
 
typedef types::TVector3< unsigned int > uiVector3
 
typedef types::TVector4< unsigned int > uiVector4
 
typedef types::TMatrix3< double > dMatrix3
 
typedef types::TMatrix4< double > dMatrix4
 
typedef types::TMatrix3< float > fMatrix3
 
typedef types::TMatrix4< float > fMatrix4
 
typedef types::TMatrix3< FloatP_t > FMatrix3
 
typedef types::TMatrix4< FloatP_t > FMatrix4
 
typedef types::TQuaternion< double > dQuaternion
 
typedef types::TQuaternion< float > fQuaternion
 
typedef types::TQuaternion< FloatP_t > FQuaternion
 

Enumerations

enum  MDCErrorCode : int {
  MDCERR_ok = 0 , MDCERR_io , MDCERR_null , MDCERR_malloc ,
  MDCERR_range , MDCERR_space , MDCERR_pthread , MDCERR_runner ,
  MDCERR_cell , MDCERR_domain , MDCERR_nompi , MDCERR_mpi ,
  MDCERR_reader , MDCERR_potential , MDCERR_cuda , MDCERR_nocuda ,
  MDCERR_cudasp , MDCERR_maxparts , MDCERR_queue , MDCERR_rigid ,
  MDCERR_subengine , MDCERR_id , MDCERR_angsspot , MDCERR_dihsspot ,
  MDCERR_engine , MDCERR_spe , MDCERR_mfc , MDCERR_unavail ,
  MDCERR_fifo , MDCERR_verlet_overflow , MDCERR_tasktype , MDCERR_maxpairs ,
  MDCERR_nrtasks , MDCERR_task , MDCERR_taskmaxunlock , MDCERR_notcluster ,
  MDCERR_wrongptype , MDCERR_initorder , MDCERR_bond , MDCERR_angle ,
  MDCERR_dihedral , MDCERR_exclusion , MDCERR_sets , MDCERR_toofast ,
  MDCERR_index , MDCERR_large_state , MDCERR_min_types , MDCERR_bad_el_input ,
  MDCERR_verify , MDCERR_badprop , MDCERR_particle , MDCERR_nyi ,
  MDCERR_ivalsmax , MDCERR_fullqueue , MDCERR_lock , MDCERR_force ,
  MDCERR_LAST
}
 
enum  AngleFlags { ANGLE_NONE = 0 , ANGLE_ACTIVE = 1 << 0 }
 
enum  BondFlags { BOND_NONE = 0 , BOND_ACTIVE = 1 << 0 }
 
enum  BoundaryConditionKind : unsigned int {
  BOUNDARY_VELOCITY = 1 << 0 , BOUNDARY_PERIODIC = 1 << 1 , BOUNDARY_FREESLIP = 1 << 2 , BOUNDARY_POTENTIAL = 1 << 3 ,
  BOUNDARY_NO_SLIP = 1 << 4 , BOUNDARY_RESETTING = 1 << 5 , BOUNDARY_ACTIVE = BOUNDARY_FREESLIP | BOUNDARY_VELOCITY | BOUNDARY_POTENTIAL
}
 
enum  DihedralFlags { DIHEDRAL_NONE = 0 , DIHEDRAL_ACTIVE = 1 << 0 }
 
enum  EngineFlags {
  engine_flag_none = 0 , engine_flag_static = 1 << 0 , engine_flag_localparts = 1 << 1 , engine_flag_cuda = 1 << 2 ,
  engine_flag_explepot = 1 << 3 , engine_flag_verlet = 1 << 4 , engine_flag_verlet_pairwise = 1 << 5 , engine_flag_affinity = 1 << 6 ,
  engine_flag_prefetch = 1 << 7 , engine_flag_verlet_pseudo = 1 << 8 , engine_flag_shake = 1 << 9 , engine_flag_mpi = 1 << 10 ,
  engine_flag_parbonded = 1 << 11 , engine_flag_async = 1 << 12 , engine_flag_sets = 1 << 13 , engine_flag_nullpart = 1 << 14 ,
  engine_flag_initialized = 1 << 15 , engine_flag_velocity_clamp = 1 << 16
}
 
enum  EngineIntegrator { FORWARD_EULER , RUNGE_KUTTA_4 }
 
enum  {
  engine_timer_step = 0 , engine_timer_kinetic , engine_timer_prepare , engine_timer_verlet ,
  engine_timer_exchange1 , engine_timer_nonbond , engine_timer_bonded , engine_timer_bonded_sort ,
  engine_timer_bonds , engine_timer_angles , engine_timer_dihedrals , engine_timer_exclusions ,
  engine_timer_advance , engine_timer_rigid , engine_timer_exchange2 , engine_timer_shuffle ,
  engine_timer_cuda_load , engine_timer_cuda_unload , engine_timer_cuda_dopairs , engine_timer_render ,
  engine_timer_image_data , engine_timer_render_total , engine_timer_total , engine_timer_last
}
 
enum  {
  ENGINE_TIMER_STEP = 1 << 0 , ENGINE_TIMER_PREPARE = 1 << 1 , ENGINE_TIMER_VERLET = 1 << 2 , ENGINE_TIMER_EXCHANGE1 = 1 << 3 ,
  ENGINE_TIMER_NONBOND = 1 << 4 , ENGINE_TIMER_BONDED = 1 << 5 , ENGINE_TIMER_BONDED_SORT = 1 << 6 , ENGINE_TIMER_BONDS = 1 << 7 ,
  ENGINE_TIMER_ANGLES = 1 << 8 , ENGINE_TIMER_DIHEDRALS = 1 << 9 , ENGINE_TIMER_EXCLUSIONS = 1 << 10 , ENGINE_TIMER_ADVANCE = 1 << 11 ,
  ENGINE_TIMER_RIGID = 1 << 12 , ENGINE_TIMER_EXCHANGE2 = 1 << 13 , ENGINE_TIMER_SHUFFLE = 1 << 14 , ENGINE_TIMER_CUDA_LOAD = 1 << 15 ,
  ENGINE_TIMER_CUDA_UNLOAD = 1 << 16 , ENGINE_TIMER_CUDA_DOPAIRS = 1 << 17 , ENGINE_TIMER_RENDER = 1 << 18 , ENGINE_TIMER_LAST = 1 << 19
}
 
enum  { INTEGRATOR_UPDATE_PERSISTENTFORCE = 1 << 0 , INTEGRATOR_FLUX_SUBSTEP = 1 << 1 }
 
enum  FluxKind { FLUX_FICK = 0 , FLUX_SECRETE = 1 , FLUX_UPTAKE = 2 }
 
enum  FORCE_KIND { FORCE_ONEBODY , FORCE_PAIRWISE }
 
enum  FORCE_TYPE {
  FORCE_FORCE = 0 , FORCE_BERENDSEN = 1 << 0 , FORCE_GAUSSIAN = 1 << 1 , FORCE_FRICTION = 1 << 2 ,
  FORCE_SUM = 1 << 3 , FORCE_CUSTOM = 1 << 4
}
 
enum  ParticleTypeFlags { PARTICLE_TYPE_NONE = 0 , PARTICLE_TYPE_INERTIAL = 1 << 0 , PARTICLE_TYPE_DISSAPATIVE = 1 << 1 }
 
enum  ParticleDynamics { PARTICLE_NEWTONIAN = 0 , PARTICLE_OVERDAMPED = 1 }
 
enum  ParticleFlags {
  PARTICLE_NONE = 0 , PARTICLE_GHOST = 1 << 0 , PARTICLE_CLUSTER = 1 << 1 , PARTICLE_BOUND = 1 << 2 ,
  PARTICLE_FROZEN_X = 1 << 3 , PARTICLE_FROZEN_Y = 1 << 4 , PARTICLE_FROZEN_Z = 1 << 5 , PARTICLE_FROZEN = PARTICLE_FROZEN_X | PARTICLE_FROZEN_Y | PARTICLE_FROZEN_Z ,
  PARTICLE_LARGE = 1 << 6
}
 
enum  ParticleListFlags { PARTICLELIST_OWNDATA = 1 << 0 , PARTICLELIST_MUTABLE = 1 << 1 }
 
enum  PotentialFlags {
  POTENTIAL_NONE = 0 , POTENTIAL_LJ126 = 1 << 0 , POTENTIAL_EWALD = 1 << 1 , POTENTIAL_COULOMB = 1 << 2 ,
  POTENTIAL_SINGLE = 1 << 3 , POTENTIAL_R2 = 1 << 4 , POTENTIAL_R = 1 << 5 , POTENTIAL_ANGLE = 1 << 6 ,
  POTENTIAL_HARMONIC = 1 << 7 , POTENTIAL_DIHEDRAL = 1 << 8 , POTENTIAL_SWITCH = 1 << 9 , POTENTIAL_REACTIVE = 1 << 10 ,
  POTENTIAL_SCALED = 1 << 11 , POTENTIAL_SHIFTED = 1 << 12 , POTENTIAL_BOUND = 1 << 13 , POTENTIAL_SUM = 1 << 14 ,
  POTENTIAL_PERIODIC = 1 << 15 , POTENTIAL_COULOMBR = 1 << 16
}
 
enum  PotentialKind { POTENTIAL_KIND_POTENTIAL , POTENTIAL_KIND_DPD , POTENTIAL_KIND_BYPARTICLES , POTENTIAL_KIND_COMBINATION }
 
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)
}
 
enum  CellFlags {
  cell_flag_none = 0 , cell_flag_ghost = 1 << 0 , cell_flag_wait = 1 << 1 , cell_flag_waited = 1 << 2 ,
  cell_flag_marked = 1 << 3 , cell_flag_large = 1 << 4 , cell_active_top = 1 << 5 , cell_active_bottom = 1 << 6 ,
  cell_active_left = 1 << 7 , cell_active_right = 1 << 8 , cell_active_front = 1 << 9 , cell_active_back = 1 << 10 ,
  cell_periodic_top = 1 << 11 , cell_periodic_bottom = 1 << 12 , cell_periodic_left = 1 << 13 , cell_periodic_right = 1 << 14 ,
  cell_periodic_front = 1 << 15 , cell_periodic_back = 1 << 16 , cell_periodic_x = cell_periodic_left | cell_periodic_right , cell_periodic_y = cell_periodic_front | cell_periodic_back ,
  cell_periodic_z = cell_periodic_top | cell_periodic_bottom , cell_active_x = cell_active_left | cell_active_right , cell_active_y = cell_active_front | cell_active_back , cell_active_z = cell_active_top | cell_active_bottom ,
  cell_active_any
}
 
enum class  PointsType : unsigned int {
  Sphere , SolidSphere , Disk , SolidCube ,
  Cube , Ring
}
 
enum  LogLevel {
  LOG_CURRENT = 0 , LOG_FATAL = 1 , LOG_CRITICAL , LOG_ERROR ,
  LOG_WARNING , LOG_NOTICE , LOG_INFORMATION , LOG_DEBUG ,
  LOG_TRACE
}
 
enum  LogEvent { LOG_OUTPUTSTREAM_CHANGED , LOG_LEVEL_CHANGED , LOG_CALLBACK_SET }
 
enum  StyleFlags { STYLE_VISIBLE = 1 << 0 , STYLE_STACKALLOC = 1 << 1 }
 

Functions

template<>
Magnum::Vector2 cast (PyObject *obj)
 
template<>
Magnum::Vector3 cast (PyObject *obj)
 
template<>
Magnum::Vector4 cast (PyObject *obj)
 
template<>
Magnum::Vector2i cast (PyObject *obj)
 
template<>
Magnum::Vector3i cast (PyObject *obj)
 
template<>
fVector2 cast (PyObject *obj)
 
template<>
fVector3 cast (PyObject *obj)
 
template<>
fVector4 cast (PyObject *obj)
 
template<>
dVector2 cast (PyObject *obj)
 
template<>
dVector3 cast (PyObject *obj)
 
template<>
dVector4 cast (PyObject *obj)
 
template<>
iVector2 cast (PyObject *obj)
 
template<>
iVector3 cast (PyObject *obj)
 
template<>
PyObject * cast< int16_t, PyObject * > (const int16_t &i)
 
template<>
PyObject * cast< uint16_t, PyObject * > (const uint16_t &i)
 
template<>
PyObject * cast< uint32_t, PyObject * > (const uint32_t &i)
 
template<>
PyObject * cast< uint64_t, PyObject * > (const uint64_t &i)
 
template<>
PyObject * cast< float, PyObject * > (const float &f)
 
template<>
PyObject * cast< double, PyObject * > (const double &f)
 
template<>
float cast (PyObject *obj)
 
template<>
double cast (PyObject *obj)
 
template<>
PyObject * cast< bool, PyObject * > (const bool &f)
 
template<>
bool cast (PyObject *obj)
 
template<>
PyObject * cast< int, PyObject * > (const int &i)
 
template<>
int cast (PyObject *obj)
 
template<>
PyObject * cast< std::string, PyObject * > (const std::string &s)
 
template<>
std::string cast (PyObject *o)
 
template<>
int16_t cast (PyObject *o)
 
template<>
uint16_t cast (PyObject *o)
 
template<>
uint32_t cast (PyObject *o)
 
template<>
uint64_t cast (PyObject *o)
 
FPTYPE fptype_r2 (FPTYPE *x1, FPTYPE *x2, FPTYPE *dx)
 Inlined function to compute the distance^2 between two vectors.
 
HRESULT Angle_Destroy (Angle *a)
 Destroys an angle.
 
HRESULT Angle_DestroyAll ()
 Destroys all angles in the universe.
 
HRESULT angle_eval (struct Angle *a, int N, struct engine *e, FPTYPE *epot_out)
 Evaluate a list of angleed interactions.
 
HRESULT angle_evalf (struct Angle *a, int N, struct engine *e, FPTYPE *f, FPTYPE *epot_out)
 Evaluate a list of angleed interactions.
 
std::vector< int32_t > Angle_IdsForParticle (int32_t pid)
 
bool operator< (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool operator> (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool operator<= (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool operator>= (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool operator== (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool operator!= (const TissueForge::AngleHandle &lhs, const TissueForge::AngleHandle &rhs)
 
bool contains_bond (const std::vector< BondHandle > &bonds, int a, int b)
 
HRESULT Bond_Destroy (Bond *b)
 
HRESULT Bond_DestroyAll ()
 Deletes all bonds in the universe.
 
HRESULT Bond_Energy (Bond *b, FPTYPE *epot_out)
 
HRESULT bond_eval (Bond *b, int N, struct engine *e, FPTYPE *epot_out)
 Evaluate a list of bonded interactions.
 
HRESULT bond_evalf (Bond *b, int N, struct engine *e, FPTYPE *f, FPTYPE *epot_out)
 Evaluate a list of bonded interactions.
 
std::vector< int32_t > Bond_IdsForParticle (int32_t pid)
 
int insert_bond (std::vector< BondHandle > &bonds, int a, int b, Potential *pot, ParticleList *parts)
 
bool operator< (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
bool operator> (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
bool operator<= (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
bool operator>= (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
bool operator== (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
bool operator!= (const TissueForge::BondHandle &lhs, const TissueForge::BondHandle &rhs)
 
void apply_boundary_particle_crossing (struct Particle *p, const int *delta, const struct space_cell *source_cell, const struct space_cell *dest_cell)
 
HRESULT Cluster_AddParticle (struct Cluster *cluster, struct Particle *part)
 
HRESULT Cluster_ComputeAggregateQuantities (struct Cluster *cluster)
 
ParticleCluster_CreateParticle (Cluster *cluster, ParticleType *particleType, FVector3 *position=NULL, FVector3 *velocity=NULL)
 
ClusterParticleTypeClusterParticleType_FindFromName (const char *name)
 Get a registered cluster type by type name.
 
HRESULT _Cluster_init ()
 
ClusterCluster_fromString (const std::string &str)
 Create a cluster from a JSON string representation.
 
ClusterParticleTypeClusterParticleType_fromString (const std::string &str)
 Create a cluster type from a JSON string representation.
 
HRESULT Dihedral_Destroy (Dihedral *d)
 Destroys a dihedral.
 
HRESULT Dihedral_DestroyAll ()
 Destroys all dihedrals in the universe.
 
HRESULT dihedral_eval (struct Dihedral *d, int N, struct engine *e, FPTYPE *epot_out)
 Evaluate a list of dihedraled interactions.
 
HRESULT dihedral_evalf (struct Dihedral *d, int N, struct engine *e, FPTYPE *f, FPTYPE *epot_out)
 Evaluate a list of dihedraled interactions.
 
std::vector< int32_t > Dihedral_IdsForParticle (int32_t pid)
 
bool operator< (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
bool operator> (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
bool operator<= (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
bool operator>= (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
bool operator== (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
bool operator!= (const TissueForge::DihedralHandle &lhs, const TissueForge::DihedralHandle &rhs)
 
DPDPotentialDPDPotential_fromStr (const std::string &str)
 
HRESULT engine_addpot (struct engine *e, struct Potential *p, int i, int j)
 Add an interaction potential.
 
HRESULT engine_addfluxes (struct engine *e, struct Fluxes *f, int i, int j)
 Add fluxes to a particle of particle types.
 
Fluxesengine_getfluxes (struct engine *e, int i, int j)
 Get a fluxes between two particles.
 
HRESULT engine_add_singlebody_force (struct engine *e, struct Force *p, int typeId)
 
int engine_angle_alloc (struct engine *e, Angle **out)
 
HRESULT engine_angle_eval (struct engine *e)
 Compute the angled interactions stored in this engine.
 
HRESULT engine_barrier (struct engine *e)
 Barrier routine to hold the runners back.
 
HRESULT engine_bond_eval (struct engine *e)
 Compute the bonded interactions stored in this engine.
 
HRESULT engine_bonded_eval (struct engine *e)
 Compute all bonded interactions stored in this engine.
 
HRESULT engine_bonded_eval_sets (struct engine *e)
 Compute all bonded interactions stored in this engine.
 
HRESULT engine_bonded_sets (struct engine *e, int max_sets)
 Assemble non-conflicting sets of bonded interactions.
 
int engine_dihedral_alloc (struct engine *e, Dihedral **out)
 
HRESULT engine_dihedral_eval (struct engine *e)
 Compute the dihedral interactions stored in this engine.
 
HRESULT engine_exclusion_add (struct engine *e, int i, int j)
 Add a exclusioned interaction to the engine.
 
HRESULT engine_exclusion_eval (struct engine *e)
 Compute the exclusioned interactions stored in this engine.
 
HRESULT engine_exclusion_shrink (struct engine *e)
 Remove duplicate exclusions.
 
HRESULT engine_finalize (struct engine *e)
 Kill all runners and de-allocate the data of an engine.
 
HRESULT engine_flush_ghosts (struct engine *e)
 Clear all particles from this engine's ghost cells.
 
HRESULT engine_flush (struct engine *e)
 Clear all particles from this engine.
 
int engine_gettype (struct engine *e, char *name)
 Look for a given type by name.
 
int engine_gettype2 (struct engine *e, char *name2)
 Look for a given type by its second name.
 
int engine_bond_alloc (struct engine *e, struct Bond **result)
 
struct ParticleTypeengine_type (int id)
 
HRESULT engine_addpart (struct engine *e, 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 engine_addparts (struct engine *e, int nr_parts, struct Particle **parts, FPTYPE **x)
 Add parts to space at given coordinates.
 
int engine_addtype (struct engine *e, FPTYPE mass, FPTYPE charge, const char *name, const char *name2)
 Add a type definition.
 
HRESULT engine_init (struct engine *e, const FPTYPE *origin, const FPTYPE *dim, int *cells, FPTYPE cutoff, BoundaryConditionsArgsContainer *boundaryConditions, int max_type, unsigned int flags, unsigned int nr_fluxsteps)
 Initialize an engine with the given data.
 
HRESULT engine_reset (struct engine *e)
 
HRESULT engine_load_ghosts (struct engine *e, FPTYPE *x, FPTYPE *v, int *type, int *pid, int *vid, FPTYPE *q, unsigned int *flags, int N)
 Load a set of particle data as ghosts.
 
HRESULT engine_load (struct engine *e, FPTYPE *x, FPTYPE *v, int *type, int *pid, int *vid, FPTYPE *charge, unsigned int *flags, int N)
 Load a set of particle data.
 
HRESULT engine_nonbond_eval (struct engine *e)
 Compute the nonbonded interactions in the current step.
 
HRESULT engine_fluxonly_eval (struct engine *e)
 Compute the flux interaction only in the current step.
 
HRESULT engine_rigid_add (struct engine *e, int pid, int pjd, FPTYPE d)
 Add a rigid constraint to the engine.
 
HRESULT engine_rigid_eval (struct engine *e)
 Resolve the constraints.
 
HRESULT engine_rigid_sort (struct engine *e)
 Split the rigids into local, semilocal and non-local.
 
HRESULT engine_rigid_unsort (struct engine *e)
 Shuffle the rigid constraints randomly.
 
HRESULT engine_shuffle (struct engine *e)
 Re-shuffle the particles in the engine.
 
HRESULT engine_split_bisect (struct engine *e, int N, int particle_flags)
 Split the computational domain over a number of nodes using bisection.
 
HRESULT engine_split (struct engine *e)
 Set-up the engine for distributed-memory parallel operation.
 
HRESULT engine_start (struct engine *e, int nr_runners, int nr_queues)
 Start the runners in the given engine.
 
HRESULT engine_step (struct engine *e)
 Run the engine for a single time step.
 
HRESULT engine_timers_reset (struct engine *e)
 Set all the engine timers to 0.
 
int engine_unload_marked (struct engine *e, FPTYPE *x, FPTYPE *v, int *type, int *pid, int *vid, FPTYPE *q, unsigned int *flags, FPTYPE *epot, int N)
 Unload a set of particle data from the marked cells of an engine.
 
int engine_unload_strays (struct engine *e, FPTYPE *x, FPTYPE *v, int *type, int *pid, int *vid, FPTYPE *q, unsigned int *flags, FPTYPE *epot, int N)
 Unload real particles that may have wandered into a ghost cell.
 
int engine_unload (struct engine *e, FPTYPE *x, FPTYPE *v, int *type, int *pid, int *vid, FPTYPE *charge, unsigned int *flags, FPTYPE *epot, int N)
 Unload a set of particle data from the engine.
 
HRESULT engine_verlet_update (struct engine *e)
 Check if the Verlet-list needs to be updated.
 
int engine_next_partid (struct engine *e)
 
HRESULT engine_next_partids (struct engine *e, int nr_ids, int *ids)
 
HRESULT engine_force_prep (struct engine *e)
 
HRESULT engine_force (struct engine *e)
 
HRESULT engine_del_particle (struct engine *e, int pid)
 
FPTYPE engine_steps_per_second ()
 
void engine_dump ()
 
FPTYPE engine_kinetic_energy (struct engine *e)
 
FPTYPE engine_temperature (struct engine *e)
 
FVector3 engine_origin ()
 
FVector3 engine_dimensions ()
 
FVector3 engine_center ()
 
struct engineengine_get ()
 
ParticleParticle_FromId (int id)
 
HRESULT exclusion_eval (struct exclusion *b, int N, struct engine *e, FPTYPE *epot_out)
 Evaluate a list of exclusioned interactions.
 
HRESULT exclusion_evalf (struct exclusion *b, int N, struct engine *e, FPTYPE *f, FPTYPE *epot_out)
 Evaluate a list of exclusioned interactions.
 
HRESULT Fluxes_integrate (space_cell *cell, FPTYPE dt=-1.0)
 
HRESULT Fluxes_integrate (int cellId)
 
ForceForce_add (Force *f1, Force *f2)
 
ForceSumForceSum_fromStr (const std::string &str)
 
BerendsenBerendsen_fromStr (const std::string &str)
 
GaussianGaussian_fromStr (const std::string &str)
 
FrictionFriction_fromStr (const std::string &str)
 
HRESULT Particle_Verify ()
 
ParticleTypeParticle_GetType ()
 
ParticleTypeCluster_GetType ()
 
ParticleTypeParticleType_ForEngine (struct engine *e, FPTYPE mass, FPTYPE charge, const char *name, const char *name2)
 
ParticleTypeParticleType_New (const char *_name)
 
ParticleTypeParticleType_FindFromName (const char *name)
 Get a registered particle type by type name.
 
ParticleParticle_Get (ParticleHandle *pypart)
 
ParticleHandleParticle_split (Particle *self, const FVector3 &childDirection, const FPTYPE &childRatio, const std::vector< FPTYPE > *speciesRatios=NULL, ParticleType *parentType=NULL, ParticleType *childType=NULL)
 
ParticleHandleParticle_New (ParticleType *type, FVector3 *positn=NULL, FVector3 *velocity=NULL, int *clusterId=NULL)
 
std::vector< int > Particles_New (std::vector< ParticleType * > types, std::vector< FVector3 > *positions=NULL, std::vector< FVector3 > *velocities=NULL, std::vector< int > *clusterIds=NULL)
 
std::vector< int > Particles_New (ParticleType *type, unsigned int nr_parts=0, std::vector< FVector3 > *positions=NULL, std::vector< FVector3 > *velocities=NULL, std::vector< int > *clusterIds=NULL)
 
HRESULT Particle_Become (Particle *part, ParticleType *type)
 
bool ParticleType_checkRegistered (ParticleType *type)
 
HRESULT _Particle_init ()
 
bool operator< (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator> (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator<= (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator>= (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator== (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator!= (const TissueForge::ParticleHandle &lhs, const TissueForge::ParticleHandle &rhs)
 
bool operator< (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
bool operator> (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
bool operator<= (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
bool operator>= (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
bool operator== (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
bool operator!= (const TissueForge::ParticleType &lhs, const TissueForge::ParticleType &rhs)
 
void potential_clear (struct Potential *p)
 Free the memory associated with the given potential.
 
HRESULT potential_init (struct Potential *p, FPTYPE(*f)(FPTYPE), FPTYPE(*fp)(FPTYPE), FPTYPE(*f6p)(FPTYPE), FPTYPE a, FPTYPE b, FPTYPE tol)
 Construct a #potential from the given function.
 
HRESULT potential_getcoeffs (FPTYPE(*f)(FPTYPE), FPTYPE(*fp)(FPTYPE), FPTYPE *xi, int n, FPTYPE *c, FPTYPE *err)
 
FPTYPE potential_getalpha (FPTYPE(*f6p)(FPTYPE), FPTYPE a, FPTYPE b)
 
HRESULT queue_init (struct queue *q, int size, struct space *s, struct task *tasks)
 Initialize a task queue.
 
void queue_reset (struct queue *q)
 Reset the queue.
 
int queue_insert (struct queue *q, struct task *t)
 Add an index to the given queue.
 
struct taskqueue_get (struct queue *q, int rid, int keep)
 Get a task from the queue.
 
HRESULT rigid_eval_shake (struct rigid *r, int N, struct engine *e)
 Evaluate (SHAKE) a list of rigid constraints.
 
HRESULT rigid_eval_pshake (struct rigid *r, int N, struct engine *e, int a_update)
 Evaluate (P-SHAKE) a list of rigid constraints.
 
HRESULT runner_init (struct runner *r, struct engine *e, int id)
 Initialize the runner associated to the given engine.
 
HRESULT runner_run (struct runner *r)
 
void runner_sort_ascending (unsigned int *parts, int N)
 Sort the particles in ascending order using QuickSort.
 
void runner_sort_descending (unsigned int *parts, int N)
 Sort the particles in descending order using QuickSort.
 
HRESULT runner_verlet_eval (struct runner *r, struct space_cell *c, FPTYPE *f_out)
 Compute the interactions between the particles in the given space_cell using the verlet list.
 
HRESULT runner_verlet_fill (struct runner *r, struct space_cell *cell_i, struct space_cell *cell_j, FPTYPE *pshift)
 Fill in the Verlet list entries for the given space_cell pair.
 
HRESULT runner_dosort (struct runner *r, struct space_cell *c, int flags)
 Fill in the pairwise Verlet list entries for the given cell pair if needed and compute the interactions.
 
HRESULT runner_dopair (struct runner *r, struct space_cell *cell_i, struct space_cell *cell_j, int sid)
 Compute the pairwise interactions for the given pair.
 
HRESULT runner_dopair_fluxonly (struct runner *r, struct space_cell *cell_i, struct space_cell *cell_j, int sid)
 Compute the pairwise fluxes for the given pair.
 
HRESULT runner_doself (struct runner *r, struct space_cell *cell_i)
 Compute the self-interactions for the given cell.
 
HRESULT runner_doself_fluxonly (struct runner *r, struct space_cell *cell_i)
 Compute the self-fluxes for the given cell.
 
HRESULT Secrete_AmountToParticles (struct state::SpeciesValue *species, FPTYPE amount, uint16_t nr_parts, int32_t *parts, FPTYPE *secreted)
 
HRESULT Secrete_AmountWithinDistance (struct state::SpeciesValue *species, FPTYPE amount, FPTYPE radius, const std::set< short int > *typeIds, FPTYPE *secreted)
 
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.
 
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_shuffle (struct space *s)
 Run through the cells of a space and make sure every particle is in its place.
 
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_growparts (struct space *s, unsigned int size_incr)
 Grow the parts allocated to a 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, it itself is not added, rather a new memory block is allocated, and the contents of p get copied in there.
 
HRESULT space_addparts (struct space *s, int nr_parts, struct Particle **parts, FPTYPE **xparts)
 
int space_get_cellids_for_pos (struct space *s, FPTYPE *x, int *cellids)
 
HRESULT space_del_particle (struct space *s, int pid)
 
HRESULT space_update_style (struct space *s)
 
HRESULT space_prepare_tasks (struct space *s)
 Prepare the tasks before a time step.
 
HRESULT space_prepare (struct space *s)
 Prepare the space before a time step.
 
HRESULT space_getpos (struct space *s, int id, FPTYPE *x)
 Get the absolute position of a particle.
 
HRESULT space_setpos (struct space *s, int id, FPTYPE *x)
 Set the absolute position of a particle.
 
HRESULT space_flush (struct space *s)
 Clear all particles from this space.
 
HRESULT space_flush_ghosts (struct space *s)
 Clear all particles from the ghost cells in this space.
 
struct taskspace_addtask (struct space *s, int type, int subtype, int flags, int i, int j)
 Add a task to the given space.
 
HRESULT space_verlet_init (struct space *s, int list_global)
 Initialize the Verlet-list data structures.
 
int space_gettuple (struct space *s, struct celltuple **out, int wait)
 Get the next free celltuple from the space.
 
int space_getcell (struct space *s, struct space_cell **out)
 Get the next unprocessed cell from the spaece.
 
int space_verlet_force (struct space *s, FPTYPE *f, FPTYPE epot)
 Collect forces and potential energies.
 
HRESULT space_releasepair (struct space *s, int ci, int cj)
 Free the cells involved in the current pair.
 
HRESULT space_cell_init (struct space_cell *c, int *loc, FPTYPE *origin, FPTYPE *dim)
 Initialize the given cell.
 
struct Particlespace_cell_add (struct space_cell *c, struct Particle *p, struct Particle **partlist)
 Add a particle to a cell.
 
HRESULT space_cell_remove (struct space_cell *c, struct Particle *p, struct Particle **partlist)
 Remove a particle from a cell.
 
struct Particlespace_cell_add_incomming (struct space_cell *c, struct Particle *p)
 Add a particle to the incomming array of a cell.
 
int space_cell_add_incomming_multiple (struct space_cell *c, struct Particle *p, int count)
 Add one or more particles to the incomming array of a cell.
 
HRESULT space_cell_welcome (struct space_cell *c, struct Particle **partlist)
 Move particles from the incomming buffer to the cell.
 
HRESULT space_cell_load (struct space_cell *c, struct Particle *parts, int nr_parts, struct Particle **partlist, struct space_cell **celllist)
 Load a block of particles to the cell.
 
FPTYPE space_cell_gaussian (int cell_id)
 
HRESULT space_cell_flush (struct space_cell *c, struct Particle **partlist, struct space_cell **celllist)
 Flush all the parts from a #cell.
 
HRESULT task_addunlock (struct task *ta, struct task *tb)
 Add a task dependency.
 
bool apply_update_pos_vel (Particle *p, space_cell *c, const FPTYPE *h, int *delta)
 
bool boundary_potential_eval_ex (const struct space_cell *cell, Potential *pot, Particle *part, BoundaryCondition *bc, FPTYPE *dx, FPTYPE r2, FPTYPE *epot)
 
bool boundary_eval (BoundaryConditions *bc, const struct space_cell *cell, Particle *part, FPTYPE *epot)
 
TF_ALWAYS_INLINE bool dpd_eval (DPDPotential *p, FPTYPE gaussian, Particle *pi, Particle *pj, FPTYPE *dx, FPTYPE r2, FPTYPE *energy)
 
TF_ALWAYS_INLINE bool dpd_boundary_eval (DPDPotential *p, FPTYPE gaussian, Particle *pi, FPTYPE &rj, const FPTYPE *velocity, const FPTYPE *dx, FPTYPE r2, FPTYPE *energy)
 
HRESULT engine_advance (struct engine *e)
 Update the particle velocities and positions, re-shuffle if appropriate.
 
FPTYPE flux_fick (Flux *flux, int i, FPTYPE si, FPTYPE sj)
 
FPTYPE flux_secrete (Flux *flux, int i, FPTYPE si, FPTYPE sj)
 
FPTYPE flux_uptake (Flux *flux, int i, FPTYPE si, FPTYPE sj)
 
void flux_eval_ex (struct Fluxes *f, FPTYPE r2, Particle *part_i, Particle *part_j)
 
Fluxesget_fluxes (const Particle *a, const Particle *b)
 
TF_ALWAYS_INLINE FPTYPE potential_eval_adjust_distance (struct Potential *p, FPTYPE ri, FPTYPE rj, FPTYPE r)
 
TF_ALWAYS_INLINE FPTYPE potential_eval_adjust_distance2 (struct Potential *p, FPTYPE ri, FPTYPE rj, FPTYPE r2)
 
TF_ALWAYS_INLINE void potential_eval (struct Potential *p, FPTYPE r2, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at the given point (interpolated).
 
TF_ALWAYS_INLINE bool potential_eval_ex (struct Potential *p, FPTYPE ri, FPTYPE rj, FPTYPE r2, FPTYPE *e, FPTYPE *f)
 
TF_ALWAYS_INLINE void potential_eval_r (struct Potential *p, FPTYPE r, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at the given point (interpolated).
 
TF_ALWAYS_INLINE bool potential_eval_super_ex (const space_cell *cell, Potential *pot, Particle *part_i, Particle *part_j, FPTYPE *dx, FPTYPE r2, FPTYPE *epot)
 
TF_ALWAYS_INLINE void potential_eval_expl (struct Potential *p, FPTYPE r2, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at the given radius explicitly.
 
TF_ALWAYS_INLINE void potential_eval_vec_4single (struct Potential *p[4], float *r2, float *e, float *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_4single_old (struct Potential *p[4], float *r2, float *e, float *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_4single_r (struct Potential *p[4], float *r_in, float *e, float *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_8single (struct Potential *p[8], float *r2, float *e, float *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_8single_r (struct Potential *p[8], float *r2, float *e, float *f)
 
TF_ALWAYS_INLINE void potential_eval_vec_2double (struct Potential *p[2], FPTYPE *r2, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_4double (struct Potential *p[4], FPTYPE *r2, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE void potential_eval_vec_4double_r (struct Potential *p[4], FPTYPE *r_in, FPTYPE *e, FPTYPE *f)
 Evaluates the given potential at a set of points (interpolated).
 
TF_ALWAYS_INLINE Potentialget_potential (const Particle *a, const Particle *b)
 
TF_ALWAYS_INLINE FPTYPE w_cubic_spline (FPTYPE r2, FPTYPE h)
 
TF_ALWAYS_INLINE FPTYPE grad_w_cubic_spline (FPTYPE r2, FPTYPE h)
 
TF_ALWAYS_INLINE FPTYPE W (FPTYPE r2, FPTYPE h)
 
TF_ALWAYS_INLINE FPTYPE grad_W (FPTYPE r2, FPTYPE h)
 
int btree_init (struct btree *b)
 
struct btree_nodebtree_getnode (struct btree *b)
 
int btree_insert (struct btree *b, int key, void *data)
 
int btree_map (struct btree *b, int(*func)(void *, void *), void *data)
 
int btree_find (struct btree *b, int key, void **res)
 
int btree_releasenode (struct btree *b, struct btree_node *n)
 
int btree_delete (struct btree *b, int key, void **res)
 
std::vector< fVector4parsePlaneEquation (const std::vector< std::tuple< fVector3, fVector3 > > &clipPlanes)
 
RandomType & randomEngine ()
 
unsigned int getSeed ()
 Get the current seed for the pseudo-random number generator.
 
HRESULT setSeed (const unsigned int *_seed=0)
 Set the current seed for the pseudo-random number generator.
 
std::vector< std::string > color3Names ()
 Get the names of all available colors.
 
FVector4 planeEquation (const FVector3 &normal, const FVector3 &point)
 Get the coefficients of a plane equation for a normal vector and point.
 
std::tuple< FVector3 FVector3planeEquation (const FVector4 &planeEq)
 Get the plane normal and a plane point from the coefficients of a plane equation.
 
FVector3 randomPoint (const PointsType &kind, const FloatP_t &dr=0, const FloatP_t &phi0=0, const FloatP_t &phi1=M_PI)
 Get the coordinates of a random point in a kind of shape.
 
std::vector< FVector3randomPoints (const PointsType &kind, const int &n=1, const FloatP_t &dr=0, const FloatP_t &phi0=0, const FloatP_t &phi1=M_PI)
 Get the coordinates of random points in a kind of shape.
 
std::vector< FVector3points (const PointsType &kind, const unsigned int &n=1)
 Get the coordinates of uniform points in a kind of shape.
 
std::vector< FVector3filledCubeUniform (const FVector3 &corner1, const FVector3 &corner2, const unsigned int &nParticlesX=2, const unsigned int &nParticlesY=2, const unsigned int &nParticlesZ=2)
 Get the coordinates of a uniformly filled cube.
 
std::vector< FVector3filledCubeRandom (const FVector3 &corner1, const FVector3 &corner2, const int &nParticles)
 Get the coordinates of a randomly filled cube.
 
HRESULT icosphere (const int subdivisions, FloatP_t phi0, FloatP_t phi1, std::vector< FVector3 > &verts, std::vector< int32_t > &inds)
 Get the coordinates of an icosphere.
 
FVector3 randomVector (FloatP_t mean, FloatP_t std)
 Generates a randomly oriented vector with random magnitude with given mean and standard deviation according to a normal distribution.
 
FVector3 randomUnitVector ()
 Generates a randomly oriented unit vector.
 
template<class T>
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type almost_equal (T x, T y, int ulp=2)
 
void * aligned_Malloc (size_t size, size_t alignment)
 
void aligned_Free (void *mem)
 
unsigned int addErrorCallback (ErrorCallback &cb)
 Register an error callback.
 
HRESULT removeErrorCallback (const unsigned int &cb_id)
 Remove an error callback from the registry.
 
HRESULT clearErrorCallbacks ()
 Remove all error callbacks from the registry.
 
HRESULT errSet (HRESULT code, const char *msg, int line, const char *file, const char *func)
 
HRESULT expSet (const std::exception &, const char *msg, int line, const char *file, const char *func)
 
bool errOccurred ()
 
void errClear ()
 
std::string errStr (const Error &err)
 
std::vector< ErrorerrGetAll ()
 
Error errGetFirst ()
 
void errClearFirst ()
 
Error errPopFirst ()
 
bool isTerminalInteractiveShell ()
 Test whether running interactively.
 
HRESULT setIsTerminalInteractiveShell (const bool &_interactive)
 Set whether running interactively.
 
HRESULT Simulator_init (const std::vector< std::string > &argv)
 
HRESULT Simulator_init (Simulator::Config &conf, const std::vector< std::string > &appArgv=std::vector< std::string >())
 
HRESULT initSimConfigFromFile (Simulator::Config &conf)
 
HRESULT universe_init (const UniverseConfig &conf)
 
HRESULT modules_init ()
 
template<class IndexType, class Function>
void parallel_for (IndexType endIdx, Function &&func)
 
HRESULT Universe_Step (FloatP_t until, FloatP_t dt)
 
int Universe_Flag (Universe::Flags flag)
 
HRESULT Universe_SetFlag (Universe::Flags flag, int value)
 
UniversegetUniverse ()
 
template<typename T, typename S>
cast (const T &)
 
template<typename T, typename S>
cast (T *)
 
template<>
std::string cast (const int &t)
 
template<>
std::string cast (const long &t)
 
template<>
std::string cast (const long long &t)
 
template<>
std::string cast (const unsigned int &t)
 
template<>
std::string cast (const unsigned long &t)
 
template<>
std::string cast (const unsigned long long &t)
 
template<>
std::string cast (const bool &t)
 
template<>
std::string cast (const float &t)
 
template<>
std::string cast (const double &t)
 
template<>
std::string cast (const long double &t)
 
template<>
int cast (const std::string &s)
 
template<>
long cast (const std::string &s)
 
template<>
long long cast (const std::string &s)
 
template<>
unsigned int cast (const std::string &s)
 
template<>
unsigned long cast (const std::string &s)
 
template<>
unsigned long long cast (const std::string &s)
 
template<>
bool cast (const std::string &s)
 
template<>
float cast (const std::string &s)
 
template<>
double cast (const std::string &s)
 
template<>
long double cast (const std::string &s)
 
template<typename T, typename S>
bool check (const T &)
 
template<typename T>
bool check (const std::string &)
 
template<>
bool check< int > (const std::string &s)
 
template<>
bool check< long > (const std::string &s)
 
template<>
bool check< long long > (const std::string &s)
 
template<>
bool check< unsigned int > (const std::string &s)
 
template<>
bool check< unsigned long > (const std::string &s)
 
template<>
bool check< unsigned long long > (const std::string &s)
 
template<>
bool check< bool > (const std::string &s)
 
template<>
bool check< float > (const std::string &s)
 
template<>
bool check< double > (const std::string &s)
 
template<>
bool check< long double > (const std::string &s)
 
template<>
Magnum::GL::Version cast (const std::int32_t &)
 
template<>
std::int32_t cast (const Magnum::GL::Version &)
 
std::string version_str ()
 Installation version.
 
std::string systemNameStr ()
 System name.
 
std::string systemVersionStr ()
 System version.
 
std::string compilerIdStr ()
 Compiler id.
 
std::string compilerVersionStr ()
 Compiler version.
 
std::string buildDate ()
 Build data.
 
std::string buildTime ()
 Build time.
 
bool hasCuda ()
 Flag for whether the installation supports CUDA.
 
HRESULT initialize (int args)
 Initialization method that may be a mandatory first call, depending on the runtime scenario.
 
HRESULT close ()
 Closes the main window, while the application / simulation continues to run.
 
HRESULT show ()
 Shows any windows that were specified in the config. Does not start the universe time propagation unlike run.
 
HRESULT init (const std::vector< std::string > &argv)
 
HRESULT init (Simulator::Config &conf, const std::vector< std::string > &appArgv=std::vector< std::string >())
 
HRESULT step (const FloatP_t &until=0, const FloatP_t &dt=0)
 Performs a single time step dt of the universe if no arguments are given. Optionally runs until until, and can use a different timestep of dt.
 
HRESULT stop ()
 Stops the universe time evolution. This essentially freezes the universe, everything remains the same, except time no longer moves forward.
 
HRESULT start ()
 Starts the universe time evolution, and advanced the universe forward by timesteps in dt. All methods to build and manipulate universe objects are valid whether the universe time evolution is running or stopped.
 
HRESULT run (FloatP_t et=-1)
 Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.
 

Variables

engine _Engine
 
unsigned int * Particle_Colors
 
struct Potential potential_null
 
ticks runner_timers []
 
const char cell_sortlistID [27]
 
const FPTYPE cell_shift [13 *3]
 
const char cell_flip [27]
 
int btree_err
 
Universe _Universe
 

Detailed Description

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

The root Tissue Forge namespace.

Typedef Documentation

◆ Angle

typedef struct TissueForge::Angle TissueForge::Angle

A bond concerning an angle.

If you're building a model, you should probably instead be working with a AngleHandle.

◆ Bond

typedef struct TissueForge::Bond TissueForge::Bond

Bonds apply a potential to a particular set of particles.

If you're building a model, you should probably instead be working with a BondHandle.

◆ Dihedral

typedef struct TissueForge::Dihedral TissueForge::Dihedral

The dihedral structure

◆ engine

typedef struct TissueForge::engine TissueForge::engine

The engine structure.

◆ engine_comm

typedef struct TissueForge::engine_comm TissueForge::engine_comm

Structure storing which cells to send/receive to/from another node.

◆ engine_set

typedef struct TissueForge::engine_set TissueForge::engine_set

Structure storing grouped sets of bonded interactions.

◆ ErrorCallback

typedef void(* TissueForge::ErrorCallback) (const Error &err)

Called on every occurrence of an error

◆ exclusion

typedef struct TissueForge::exclusion TissueForge::exclusion

The exclusion structure

◆ Force_EvalFcn

typedef void(* TissueForge::Force_EvalFcn) (struct Force *, struct Particle *, FPTYPE *)

single body force function.

◆ PotentialEval_ByParticle

typedef void(* TissueForge::PotentialEval_ByParticle) (struct Potential *p, struct Particle *part_i, FPTYPE *dx, FPTYPE r2, FPTYPE *e, FPTYPE *f)

Potential function on a particle.

Includes pre-computed relative position and distance of an arbitrary point w.r.t. ith particle.

Computes the potential and force in global frame on the ith particle.

◆ PotentialEval_ByParticles

typedef void(* TissueForge::PotentialEval_ByParticles) (struct Potential *p, struct Particle *part_i, struct Particle *part_j, FPTYPE *dx, FPTYPE r2, FPTYPE *e, FPTYPE *f)

Pair potential function.

Includes pre-computed relative position and distance of jth particle w.r.t. ith particle.

Computes the potential and force in global frame on the ith particle.

◆ queue

typedef struct TissueForge::queue TissueForge::queue

The queue structure

◆ rigid

typedef struct TissueForge::rigid TissueForge::rigid

The rigid structure

◆ space

typedef struct TissueForge::space TissueForge::space

The space structure

◆ space_cell

typedef struct TissueForge::space_cell TissueForge::space_cell

the space_cell structure

The space_cell represents a rectangular region of space, and physically stores all particle data. A set of cells form a uniform rectangular grid.

Simulation box divided into cells with size equal to or slightly larger than the largest non-bonded force cutoff distance. Each particle only interacts with others in its own cell or adjacent cells

◆ task

typedef struct TissueForge::task TissueForge::task

The task structure

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Timmer IDs.

◆ anonymous enum

anonymous enum

Timmer IDs.

◆ CellFlags

Cell flags

◆ LogLevel

Enumerator
LOG_CURRENT 

Use the current level – don't change the level from what it is.

LOG_FATAL 

A fatal error. The application will most likely terminate. This is the highest priority.

LOG_CRITICAL 

A critical error. The application might not be able to continue running successfully.

LOG_ERROR 

An error. An operation did not complete successfully, but the application as a whole is not affected.

LOG_WARNING 

A warning. An operation completed with an unexpected result.

LOG_NOTICE 

A notice, which is an information with just a higher priority.

LOG_INFORMATION 

An informational message, usually denoting the successful completion of an operation.

LOG_DEBUG 

A debugging message.

LOG_TRACE 

A tracing message. This is the lowest priority.

◆ PotentialFlags

Enumerator
POTENTIAL_R2 

flag defined for r^2 input

POTENTIAL_R 

potential defined for r input (no sqrt)

POTENTIAL_ANGLE 

potential defined for angle

POTENTIAL_HARMONIC 

potential defined for harmonic

POTENTIAL_SWITCH 

potential defined for switch

POTENTIAL_SCALED 

Scaled functions take a (r0/r)^2 argument instead of an r^2, they include the rest length r0, such that r0/r yields a force = 0.

POTENTIAL_SHIFTED 

potential shifted by x value,

POTENTIAL_BOUND 

potential is valid for bound particles, if un-set, potential is for free particles.

POTENTIAL_PERIODIC 

unbound potential with long-range periodicity

Function Documentation

◆ _Cluster_init()

HRESULT TissueForge::_Cluster_init ( )

internal function to initalize the particle and particle types

◆ _Particle_init()

HRESULT TissueForge::_Particle_init ( )

mandatory internal function to initalize the particle and particle types

sets the engine.types[0] particle.

The engine.types array is assumed to be allocated, but not initialized.

◆ addErrorCallback()

unsigned int TissueForge::addErrorCallback ( ErrorCallback & cb)

Register an error callback.

Parameters
cbcallback to register
Returns
id of callback in registry

◆ Angle_Destroy()

HRESULT TissueForge::Angle_Destroy ( Angle * a)

Destroys an angle.

Parameters
aangle to destroy

◆ Angle_DestroyAll()

HRESULT TissueForge::Angle_DestroyAll ( )

Destroys all angles in the universe.

Automatically updates when running on a CUDA device.

◆ angle_eval()

HRESULT TissueForge::angle_eval ( struct Angle * a,
int N,
struct engine * e,
FPTYPE * epot_out )

Evaluate a list of angleed interactions.

Parameters
aPointer to an array of #angle.
NNr of angles in b.
ePointer to the engine in which these angles are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ angle_evalf()

HRESULT TissueForge::angle_evalf ( struct Angle * a,
int N,
struct engine * e,
FPTYPE * f,
FPTYPE * epot_out )

Evaluate a list of angleed interactions.

Parameters
aPointer to an array of #angle.
NNr of angles in b.
ePointer to the engine in which these angles are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

This function differs from angle_eval in that the forces are added to the array f instead of directly in the particle data.

◆ Angle_IdsForParticle()

std::vector< int32_t > TissueForge::Angle_IdsForParticle ( int32_t pid)

find all the angles that interact with the given particle id

◆ apply_boundary_particle_crossing()

void TissueForge::apply_boundary_particle_crossing ( struct Particle * p,
const int * delta,
const struct space_cell * source_cell,
const struct space_cell * dest_cell )

a particle moved from one cell to another, this checks if its a periodic crossing, and adjusts any particle state values if the boundaries say so.

◆ Bond_Destroy()

HRESULT TissueForge::Bond_Destroy ( Bond * b)

deletes, marks a bond ready for deleteion, removes the potential, other vars, clears the bond, and makes is ready to be over-written.

Automatically updates when running on a CUDA device.

◆ Bond_DestroyAll()

HRESULT TissueForge::Bond_DestroyAll ( )

Deletes all bonds in the universe.

Automatically updates when running on a CUDA device.

◆ bond_eval()

HRESULT TissueForge::bond_eval ( Bond * b,
int N,
struct engine * e,
FPTYPE * epot_out )

Evaluate a list of bonded interactions.

Parameters
bPointer to an array of #bond.
NNr of bonds in b.
ePointer to the engine in which these bonds are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ bond_evalf()

HRESULT TissueForge::bond_evalf ( Bond * b,
int N,
struct engine * e,
FPTYPE * f,
FPTYPE * epot_out )

Evaluate a list of bonded interactions.

Parameters
bondsPointer to an array of #bond.
NNr of bonds in b.
ePointer to the engine in which these bonds are evaluated.
forcesAn array of FPTYPE in which to aggregate the resulting forces.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

This function differs from bond_eval in that the forces are added to the array f instead of directly in the particle data.

◆ Bond_IdsForParticle()

std::vector< int32_t > TissueForge::Bond_IdsForParticle ( int32_t pid)

find all the bonds that interact with the given particle id

◆ buildDate()

std::string TissueForge::buildDate ( )

Build data.

Returns
std::string

◆ buildTime()

std::string TissueForge::buildTime ( )

Build time.

Returns
std::string

◆ Cluster_AddParticle()

HRESULT TissueForge::Cluster_AddParticle ( struct Cluster * cluster,
struct Particle * part )

adds an existing particle to the cluster.

◆ Cluster_ComputeAggregateQuantities()

HRESULT TissueForge::Cluster_ComputeAggregateQuantities ( struct Cluster * cluster)

Computes the aggregate quanties such as total mass, position, acceleration, etc... from the contained particles.

◆ Cluster_CreateParticle()

Particle * TissueForge::Cluster_CreateParticle ( Cluster * cluster,
ParticleType * particleType,
FVector3 * position = NULL,
FVector3 * velocity = NULL )

creates a new particle, and adds it to the cluster.

◆ Cluster_fromString()

Cluster * TissueForge::Cluster_fromString ( const std::string & str)

Create a cluster from a JSON string representation.

Parameters
str
Returns
Cluster*

◆ ClusterParticleType_FindFromName()

ClusterParticleType * TissueForge::ClusterParticleType_FindFromName ( const char * name)

Get a registered cluster type by type name.

Parameters
namename of cluster type
Returns
ClusterParticleType*

◆ ClusterParticleType_fromString()

ClusterParticleType * TissueForge::ClusterParticleType_fromString ( const std::string & str)

Create a cluster type from a JSON string representation.

Parameters
str
Returns
ClusterParticleType*

◆ color3Names()

std::vector< std::string > TissueForge::color3Names ( )

Get the names of all available colors.

Returns
std::vector<std::string>

◆ compilerIdStr()

std::string TissueForge::compilerIdStr ( )

Compiler id.

Returns
std::string

◆ compilerVersionStr()

std::string TissueForge::compilerVersionStr ( )

Compiler version.

Returns
std::string

◆ Dihedral_Destroy()

HRESULT TissueForge::Dihedral_Destroy ( Dihedral * d)

Destroys a dihedral.

Parameters
ddihedral to destroy

◆ dihedral_eval()

HRESULT TissueForge::dihedral_eval ( struct Dihedral * d,
int N,
struct engine * e,
FPTYPE * epot_out )

Evaluate a list of dihedraled interactions.

Parameters
bPointer to an array of #dihedral.
NNr of dihedrals in b.
ePointer to the engine in which these dihedrals are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ dihedral_evalf()

HRESULT TissueForge::dihedral_evalf ( struct Dihedral * d,
int N,
struct engine * e,
FPTYPE * f,
FPTYPE * epot_out )

Evaluate a list of dihedraled interactions.

Parameters
bPointer to an array of #dihedral.
NNr of dihedrals in b.
ePointer to the engine in which these dihedrals are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

This function differs from dihedral_eval in that the forces are added to the array f instead of directly in the particle data.

◆ Dihedral_IdsForParticle()

std::vector< int32_t > TissueForge::Dihedral_IdsForParticle ( int32_t pid)

find all the dihedrals that interact with the given particle id

◆ engine_add_singlebody_force()

HRESULT TissueForge::engine_add_singlebody_force ( struct engine * e,
struct Force * p,
int typeId )

Add a single body force to the engine.

◆ engine_addfluxes()

HRESULT TissueForge::engine_addfluxes ( struct engine * e,
struct Fluxes * f,
int i,
int j )

Add fluxes to a particle of particle types.

Parameters
eThe engine.
fThe #flux
iID of particle type for this interaction.
jID of second particle type for this interaction.

◆ engine_addpart()

HRESULT TissueForge::engine_addpart ( struct engine * e,
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.

Parameters
eThe engine.
pThe #part to be added.
xA pointer to an array of three FPTYPEs containing the particle position.
resultpointer to the newly allocated particle.

Inserts a #part p into the space s at the position x. Note that since particle positions in #part are relative to the cell, that data in p is overwritten and x is used.

This is the single, central function that actually allocates particle space, and inserts a new particle into the engine.

◆ engine_addparts()

HRESULT TissueForge::engine_addparts ( struct engine * e,
int nr_parts,
struct Particle ** parts,
FPTYPE ** x )

Add parts to space at given coordinates.

Parameters
eThe engine.
nr_partsNumber of parts to add
partspointers to newly allocated particles
xpositions

◆ engine_addpot()

HRESULT TissueForge::engine_addpot ( struct engine * e,
struct Potential * p,
int i,
int j )

Add an interaction potential.

Parameters
eThe engine.
pThe #potential to add to the engine.
iID of particle type for this interaction.
jID of second particle type for this interaction.

Adds the given potential for pairs of particles of type i and j, where i and j may be the same type ID.

◆ engine_addtype()

int TissueForge::engine_addtype ( struct engine * e,
FPTYPE mass,
FPTYPE charge,
const char * name,
const char * name2 )

Add a type definition.

Parameters
eThe engine.
massThe particle type mass.
chargeThe particle type charge.
nameParticle name, can be NULL.
name2Particle second name, can be NULL.
Returns
The type ID or < 0 on error.

The particle type ID must be an integer greater or equal to 0 and less than the value max_type specified in engine_init.

◆ engine_advance()

HRESULT TissueForge::engine_advance ( struct engine * e)

Update the particle velocities and positions, re-shuffle if appropriate.

Parameters
eThe engine on which to run.

◆ engine_angle_alloc()

int TissueForge::engine_angle_alloc ( struct engine * e,
Angle ** out )

allocates a new angle, returns its id.

◆ engine_angle_eval()

HRESULT TissueForge::engine_angle_eval ( struct engine * e)

Compute the angled interactions stored in this engine.

Parameters
eThe engine.

◆ engine_barrier()

HRESULT TissueForge::engine_barrier ( struct engine * e)

Barrier routine to hold the runners back.

Parameters
eThe engine to wait on.

After being initialized, and after every timestep, every runner calls this routine which blocks until all the runners have returned and the engine signals the next timestep.

◆ engine_bond_alloc()

int TissueForge::engine_bond_alloc ( struct engine * e,
struct Bond ** result )

allocates a new bond, returns a pointer to it. returns index of new object.

◆ engine_bond_eval()

HRESULT TissueForge::engine_bond_eval ( struct engine * e)

Compute the bonded interactions stored in this engine.

Parameters
eThe engine.

◆ engine_bonded_eval()

HRESULT TissueForge::engine_bonded_eval ( struct engine * e)

Compute all bonded interactions stored in this engine.

Parameters
eThe engine.

Does the same as engine_bond_eval, engine_angle_eval and #engine_dihedral eval, yet all in one go to avoid excessive updates of the particle forces.

◆ engine_bonded_eval_sets()

HRESULT TissueForge::engine_bonded_eval_sets ( struct engine * e)

Compute all bonded interactions stored in this engine.

Parameters
eThe engine.

Does the same as engine_bond_eval, engine_angle_eval and #engine_dihedral eval, yet all in one go to avoid excessive updates of the particle forces.

◆ engine_bonded_sets()

HRESULT TissueForge::engine_bonded_sets ( struct engine * e,
int max_sets )

Assemble non-conflicting sets of bonded interactions.

Parameters
eThe engine.

◆ engine_del_particle()

HRESULT TissueForge::engine_del_particle ( struct engine * e,
int pid )

Deletes a particle from the engine based on particle id.

Afterwards, the particle id will point to a null entry in the partlist.

Note, the next newly created particle will re-use this ID (assuming the engine_next_partid is used to determine the next id.)

◆ engine_dihedral_alloc()

int TissueForge::engine_dihedral_alloc ( struct engine * e,
Dihedral ** out )

allocates a new dihedral, returns its id.

◆ engine_dihedral_eval()

HRESULT TissueForge::engine_dihedral_eval ( struct engine * e)

Compute the dihedral interactions stored in this engine.

Parameters
eThe engine.

◆ engine_exclusion_add()

HRESULT TissueForge::engine_exclusion_add ( struct engine * e,
int i,
int j )

Add a exclusioned interaction to the engine.

Parameters
eThe engine.
iThe ID of the first #part.
jThe ID of the second #part.

◆ engine_exclusion_eval()

HRESULT TissueForge::engine_exclusion_eval ( struct engine * e)

Compute the exclusioned interactions stored in this engine.

Parameters
eThe engine.

◆ engine_exclusion_shrink()

HRESULT TissueForge::engine_exclusion_shrink ( struct engine * e)

Remove duplicate exclusions.

Parameters
eThe engine.

◆ engine_finalize()

HRESULT TissueForge::engine_finalize ( struct engine * e)

Kill all runners and de-allocate the data of an engine.

Parameters
ethe engine to finalize.

◆ engine_flush()

HRESULT TissueForge::engine_flush ( struct engine * e)

Clear all particles from this engine.

Parameters
eThe engine to flush.

◆ engine_flush_ghosts()

HRESULT TissueForge::engine_flush_ghosts ( struct engine * e)

Clear all particles from this engine's ghost cells.

Parameters
eThe engine to flush.

◆ engine_fluxonly_eval()

HRESULT TissueForge::engine_fluxonly_eval ( struct engine * e)

Compute the flux interaction only in the current step.

Parameters
eThe engine on which to run.

This routine sets the integrator flag for flux-only calculations, releases the runner's associated with the engine and waits for them to finish.

◆ engine_force()

HRESULT TissueForge::engine_force ( struct engine * e)

internal method to calculate forces on all objects

◆ engine_force_prep()

HRESULT TissueForge::engine_force_prep ( struct engine * e)

internal method to clear data before calculating forces on all objects

◆ engine_getfluxes()

Fluxes * TissueForge::engine_getfluxes ( struct engine * e,
int i,
int j )

Get a fluxes between two particles.

Parameters
eThe engine.
iID of particle type of the flux.
jID of second particle type of the flux.

◆ engine_gettype()

int TissueForge::engine_gettype ( struct engine * e,
char * name )

Look for a given type by name.

Parameters
eThe engine.
nameThe type name.
Returns
The type ID or < 0 on error.

◆ engine_gettype2()

int TissueForge::engine_gettype2 ( struct engine * e,
char * name2 )

Look for a given type by its second name.

Parameters
eThe engine.
name2The type name2.
Returns
The type ID or < 0 on error.

◆ engine_init()

HRESULT TissueForge::engine_init ( struct engine * e,
const FPTYPE * origin,
const FPTYPE * dim,
int * cells,
FPTYPE cutoff,
BoundaryConditionsArgsContainer * boundaryConditions,
int max_type,
unsigned int flags,
unsigned int nr_fluxsteps )

Initialize an engine with the given data.

The number of spatial cells in each cartesion dimension is floor( dim[i] / L[i] ), or the physical size of the space in that dimension divided by the minimum size size of each cell.

Parameters
eThe engine to initialize.
originAn array of three FPTYPEs containing the cartesian origin of the space.
dimAn array of three FPTYPEs containing the size of the space.
cellslength 3 integer vector of number of cells in each direction.
cutoffThe maximum interaction cutoff to use.
boundaryConditionsboundary conditions argument container
max_typeThe maximum number of particle types that will be used by this engine.
flagsBit-mask containing the flags for this engine.
nr_fluxstepsNumber of flux steps

◆ engine_load()

HRESULT TissueForge::engine_load ( struct engine * e,
FPTYPE * x,
FPTYPE * v,
int * type,
int * pid,
int * vid,
FPTYPE * charge,
unsigned int * flags,
int N )

Load a set of particle data.

Parameters
eThe engine.
xAn N times 3 array of the particle positions.
vAn N times 3 array of the particle velocities.
typeA vector of length N of the particle type IDs.
pidA vector of length N of the particle IDs.
vidA vector of length N of the particle virtual IDs.
qA vector of length N of the individual particle charges.
flagsA vector of length N of the particle flags.
Nthe number of particles to load.

If the parameters v, flags, vid or q are NULL, then these values are set to zero.

◆ engine_load_ghosts()

HRESULT TissueForge::engine_load_ghosts ( struct engine * e,
FPTYPE * x,
FPTYPE * v,
int * type,
int * pid,
int * vid,
FPTYPE * q,
unsigned int * flags,
int N )

Load a set of particle data as ghosts.

Parameters
eThe engine.
xAn N times 3 array of the particle positions.
vAn N times 3 array of the particle velocities.
typeA vector of length N of the particle type IDs.
pidA vector of length N of the particle IDs.
vidA vector of length N of the particle virtual IDs.
qA vector of length N of the individual particle charges.
flagsA vector of length N of the particle flags.
Nthe number of particles to load.

If the parameters v, flags, vid or q are NULL, then these values are set to zero.

◆ engine_next_partid()

int TissueForge::engine_next_partid ( struct engine * e)

gets the next available particle id to use when creating a new particle.

◆ engine_next_partids()

HRESULT TissueForge::engine_next_partids ( struct engine * e,
int nr_ids,
int * ids )

gets the next available particle ids to use when creating a new particle.

◆ engine_nonbond_eval()

HRESULT TissueForge::engine_nonbond_eval ( struct engine * e)

Compute the nonbonded interactions in the current step.

Parameters
eThe engine on which to run.

This routine advances the timestep counter by one, prepares the space for a timestep, releases the runner's associated with the engine and waits for them to finnish.

◆ engine_reset()

HRESULT TissueForge::engine_reset ( struct engine * e)

clears all the uaer allocated objects, resets to state when created.

◆ engine_rigid_add()

HRESULT TissueForge::engine_rigid_add ( struct engine * e,
int pid,
int pjd,
FPTYPE d )

Add a rigid constraint to the engine.

Parameters
eThe engine.
pidThe ID of the first #part.
pjdThe ID of the second #part.

Beware that currently all particles have to have been inserted before the rigid constraints are added!

◆ engine_rigid_eval()

HRESULT TissueForge::engine_rigid_eval ( struct engine * e)

Resolve the constraints.

Parameters
eThe engine.

Note that if in parallel, engine_rigid_sort should be called before this routine.

◆ engine_rigid_sort()

HRESULT TissueForge::engine_rigid_sort ( struct engine * e)

Split the rigids into local, semilocal and non-local.

Parameters
eThe engine.

◆ engine_rigid_unsort()

HRESULT TissueForge::engine_rigid_unsort ( struct engine * e)

Shuffle the rigid constraints randomly.

Parameters
eThe engine.

◆ engine_shuffle()

HRESULT TissueForge::engine_shuffle ( struct engine * e)

Re-shuffle the particles in the engine.

Parameters
eThe engine on which to run.

◆ engine_split()

HRESULT TissueForge::engine_split ( struct engine * e)

Set-up the engine for distributed-memory parallel operation.

Parameters
eThe engine to set-up.

This function assumes that engine_split_bisect or some similar function has already been called and that #nodeID, #nr_nodes as well as the #cell nodeIDs have been set.

◆ engine_split_bisect()

HRESULT TissueForge::engine_split_bisect ( struct engine * e,
int N,
int particle_flags )

Split the computational domain over a number of nodes using bisection.

Parameters
eThe engine to split up.
NThe number of computational nodes.

◆ engine_start()

HRESULT TissueForge::engine_start ( struct engine * e,
int nr_runners,
int nr_queues )

Start the runners in the given engine.

Parameters
eThe engine to start.
nr_runnersThe number of runners start.

Allocates and starts the specified number of runner. Also initializes the Verlet lists.

◆ engine_step()

HRESULT TissueForge::engine_step ( struct engine * e)

Run the engine for a single time step.

Parameters
eThe engine on which to run.

This routine advances the timestep counter by one, prepares the space for a timestep, releases the runner's associated with the engine and waits for them to finnish.

Once all the runner's are done, the particle velocities and positions are updated and the particles are re-sorted in the space.

◆ engine_timers_reset()

HRESULT TissueForge::engine_timers_reset ( struct engine * e)

Set all the engine timers to 0.

Parameters
eThe engine.

◆ engine_type()

struct ParticleType * TissueForge::engine_type ( int id)

External C apps should call this to get a particle type ptr.

◆ engine_unload()

int TissueForge::engine_unload ( struct engine * e,
FPTYPE * x,
FPTYPE * v,
int * type,
int * pid,
int * vid,
FPTYPE * charge,
unsigned int * flags,
FPTYPE * epot,
int N )

Unload a set of particle data from the engine.

Parameters
eThe engine.
xAn N times 3 array of the particle positions.
vAn N times 3 array of the particle velocities.
typeA vector of length N of the particle type IDs.
pidA vector of length N of the particle IDs.
vidA vector of length N of the particle virtual IDs.
qA vector of length N of the individual particle charges.
flagsA vector of length N of the particle flags.
epotA pointer to a #FPTYPE in which to store the total potential energy.
Nthe maximum number of particles.
Returns
The number of particles unloaded or < 0 on error.

The fields x, v, type, pid, vid, q, epot and/or flags may be NULL.

◆ engine_unload_marked()

int TissueForge::engine_unload_marked ( struct engine * e,
FPTYPE * x,
FPTYPE * v,
int * type,
int * pid,
int * vid,
FPTYPE * q,
unsigned int * flags,
FPTYPE * epot,
int N )

Unload a set of particle data from the marked cells of an engine.

Parameters
eThe engine.
xAn N times 3 array of the particle positions.
vAn N times 3 array of the particle velocities.
typeA vector of length N of the particle type IDs.
pidA vector of length N of the particle IDs.
vidA vector of length N of the particle virtual IDs.
qA vector of length N of the individual particle charges.
flagsA vector of length N of the particle flags.
epotA pointer to a #FPTYPE in which to store the total potential energy.
Nthe maximum number of particles.
Returns
The number of particles unloaded or < 0 on error.

The fields x, v, type, pid, vid, q, epot and/or flags may be NULL.

◆ engine_unload_strays()

int TissueForge::engine_unload_strays ( struct engine * e,
FPTYPE * x,
FPTYPE * v,
int * type,
int * pid,
int * vid,
FPTYPE * q,
unsigned int * flags,
FPTYPE * epot,
int N )

Unload real particles that may have wandered into a ghost cell.

Parameters
eThe engine.
xAn N times 3 array of the particle positions.
vAn N times 3 array of the particle velocities.
typeA vector of length N of the particle type IDs.
pidA vector of length N of the particle IDs.
vidA vector of length N of the particle virtual IDs.
qA vector of length N of the individual particle charges.
flagsA vector of length N of the particle flags.
epotA pointer to a #FPTYPE in which to store the total potential energy.
Nthe maximum number of particles.
Returns
The number of particles unloaded or < 0 on error.

The fields x, v, type, vid, pid, q, epot and/or flags may be NULL.

◆ engine_verlet_update()

HRESULT TissueForge::engine_verlet_update ( struct engine * e)

Check if the Verlet-list needs to be updated.

Parameters
eThe engine.

◆ errClear()

void TissueForge::errClear ( )

Clear the error indicators. If no error indicator is set, there is no effect.

◆ errClearFirst()

void TissueForge::errClearFirst ( )

Clear the first error

◆ errGetAll()

std::vector< Error > TissueForge::errGetAll ( )

Get all error indicators

◆ errGetFirst()

Error TissueForge::errGetFirst ( )

Get the first error

◆ errOccurred()

bool TissueForge::errOccurred ( )

Check whether there is an error indicator.

◆ errPopFirst()

Error TissueForge::errPopFirst ( )

Get and clear the first error

◆ errSet()

HRESULT TissueForge::errSet ( HRESULT code,
const char * msg,
int line,
const char * file,
const char * func )

Set the error indicator. If there is a previous error indicator, then the previous indicator is moved down the stack.

◆ errStr()

std::string TissueForge::errStr ( const Error & err)

Get a string representation of an error.

◆ exclusion_eval()

HRESULT TissueForge::exclusion_eval ( struct exclusion * b,
int N,
struct engine * e,
FPTYPE * epot_out )

Evaluate a list of exclusioned interactions.

Parameters
bPointer to an array of exclusion.
NNr of exclusions in b.
ePointer to the engine in which these exclusions are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ exclusion_evalf()

HRESULT TissueForge::exclusion_evalf ( struct exclusion * b,
int N,
struct engine * e,
FPTYPE * f,
FPTYPE * epot_out )

Evaluate a list of exclusioned interactions.

Parameters
bPointer to an array of exclusion.
NNr of exclusions in b.
ePointer to the engine in which these exclusions are evaluated.
fArray in which to aggregate the force.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ expSet()

HRESULT TissueForge::expSet ( const std::exception & ,
const char * msg,
int line,
const char * file,
const char * func )

Set the error indicator. If there is a previous error indicator, then the previous indicator is moved down the stack.

◆ filledCubeRandom()

std::vector< FVector3 > TissueForge::filledCubeRandom ( const FVector3 & corner1,
const FVector3 & corner2,
const int & nParticles )

Get the coordinates of a randomly filled cube.

Parameters
corner1first corner of cube
corner2second corner of cube
nParticlesnumber of points in the cube
Returns
std::vector<FVector3>

◆ filledCubeUniform()

std::vector< FVector3 > TissueForge::filledCubeUniform ( const FVector3 & corner1,
const FVector3 & corner2,
const unsigned int & nParticlesX = 2,
const unsigned int & nParticlesY = 2,
const unsigned int & nParticlesZ = 2 )

Get the coordinates of a uniformly filled cube.

Parameters
corner1first corner of cube
corner2second corner of cube
nParticlesXnumber of particles along x-direction of filling axes (>=2)
nParticlesYnumber of particles along y-direction of filling axes (>=2)
nParticlesZnumber of particles along z-direction of filling axes (>=2)
Returns
std::vector<FVector3>

◆ Fluxes_integrate() [1/2]

HRESULT TissueForge::Fluxes_integrate ( int cellId)

integrate all of the fluxes for a space cell.

◆ Fluxes_integrate() [2/2]

HRESULT TissueForge::Fluxes_integrate ( space_cell * cell,
FPTYPE dt = -1.0 )

integrate all of the fluxes for a space cell.

◆ fptype_r2()

FPTYPE TissueForge::fptype_r2 ( FPTYPE * x1,
FPTYPE * x2,
FPTYPE * dx )
inline

Inlined function to compute the distance^2 between two vectors.

Parameters
x1The first vector.
x2The second vector.
dxAn array in which x1 - x2 will be stored.
Returns
The Euclidian distance squared between x1 and x2.

Depending on the processor features, this function will use SSE registers and horizontal adds.

◆ getUniverse()

Universe * TissueForge::getUniverse ( )

Universe instance accessor

◆ hasCuda()

bool TissueForge::hasCuda ( )

Flag for whether the installation supports CUDA.

Returns
bool

◆ icosphere()

HRESULT TissueForge::icosphere ( const int subdivisions,
FloatP_t phi0,
FloatP_t phi1,
std::vector< FVector3 > & verts,
std::vector< int32_t > & inds )

Get the coordinates of an icosphere.

Parameters
subdivisionsnumber of subdivisions
phi0angle lower bound
phi1angle upper bound
vertsreturned vertices
indsreturned indices
Returns
HRESULT

◆ init() [1/2]

HRESULT TissueForge::init ( const std::vector< std::string > & argv)

main simulator init method

◆ init() [2/2]

HRESULT TissueForge::init ( Simulator::Config & conf,
const std::vector< std::string > & appArgv = std::vector< std::string >() )

main simulator init method

◆ Particle_Become()

HRESULT TissueForge::Particle_Become ( Particle * part,
ParticleType * type )

Change the type of one particle to another.

removes the particle from it's current type's list of objects, and adds it to the new types list.

changes the type pointer in the C Particle, and also changes the type pointer in the Python PyParticle handle.

◆ Particle_Get()

Particle * TissueForge::Particle_Get ( ParticleHandle * pypart)

checks if a python object is a particle, and returns the corresponding particle pointer, NULL otherwise

◆ Particle_Verify()

HRESULT TissueForge::Particle_Verify ( )

iterates over all parts and does a verify

◆ ParticleType_FindFromName()

ParticleType * TissueForge::ParticleType_FindFromName ( const char * name)

Get a registered particle type by type name.

Parameters
namename of particle type
Returns
particle type, if found

◆ ParticleType_ForEngine()

ParticleType * TissueForge::ParticleType_ForEngine ( struct engine * e,
FPTYPE mass,
FPTYPE charge,
const char * name,
const char * name2 )

Creates a new ParticleType for the given particle data pointer.

This creates a matching python type for an existing particle data, and is usually called when new types are created from C.

◆ ParticleType_New()

ParticleType * TissueForge::ParticleType_New ( const char * _name)

Creates and initializes a new particle type, adds it to the global engine

creates both a new type, and a new data entry in the engine.

◆ planeEquation() [1/2]

FVector4 TissueForge::planeEquation ( const FVector3 & normal,
const FVector3 & point )

Get the coefficients of a plane equation for a normal vector and point.

Parameters
normalplane normal
pointplane point
Returns
coefficients of a plane equation

◆ planeEquation() [2/2]

std::tuple< FVector3 FVector3 > TissueForge::planeEquation ( const FVector4 & planeEq)

Get the plane normal and a plane point from the coefficients of a plane equation.

Parameters
planeEqcoefficients of a plane equation
Returns
normal and point

◆ points()

std::vector< FVector3 > TissueForge::points ( const PointsType & kind,
const unsigned int & n = 1 )

Get the coordinates of uniform points in a kind of shape.

Currently supports ring and sphere.

Parameters
kindkind of shape
nnumber of points
Returns
std::vector<FVector3>

◆ potential_clear()

void TissueForge::potential_clear ( struct Potential * p)

Free the memory associated with the given potential.

Parameters
pPointer to the #potential to clear.

◆ potential_eval()

TF_ALWAYS_INLINE void TissueForge::potential_eval ( struct Potential * p,
FPTYPE r2,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at the given point (interpolated).

Parameters
pThe #potential to be evaluated.
r2The radius at which it is to be evaluated, squared.
ePointer to a floating-point value in which to store the interaction energy.
fPointer to a floating-point value in which to store the magnitude of the interaction force divided by r.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

◆ potential_eval_expl()

TF_ALWAYS_INLINE void TissueForge::potential_eval_expl ( struct Potential * p,
FPTYPE r2,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at the given radius explicitly.

Parameters
pThe #potential to be evaluated.
r2The radius squared.
eA pointer to a floating point value in which to store the interaction energy.
fA pointer to a floating point value in which to store the magnitude of the interaction force

Assumes that the parameters for the potential forms given in the value flags of the #potential p are stored in the array alpha of p.

This way of evaluating a potential is not extremely efficient and is intended for comparison and debugging purposes.

Note that for performance reasons, this function does not check its input arguments for NULL.

◆ potential_eval_r()

TF_ALWAYS_INLINE void TissueForge::potential_eval_r ( struct Potential * p,
FPTYPE r,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at the given point (interpolated).

Parameters
pThe #potential to be evaluated.
rThe radius at which it is to be evaluated.
ePointer to a floating-point value in which to store the interaction energy.
fPointer to a floating-point value in which to store the magnitude of the interaction force.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

◆ potential_eval_vec_2double()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_2double ( struct Potential * p[2],
FPTYPE * r2,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r2Pointer to an array of the radii at which the potentials are to be evaluated, squared.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes two double-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE2 and double precision! If mdcore was not compiled with SSE2 enabled, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_4double()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_4double ( struct Potential * p[4],
FPTYPE * r2,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r2Pointer to an array of the radii at which the potentials are to be evaluated, squared.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes four double-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE2 and double precision! If mdcore was not compiled with SSE2 enabled, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_4double_r()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_4double_r ( struct Potential * p[4],
FPTYPE * r_in,
FPTYPE * e,
FPTYPE * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r_inPointer to an array of the radii at which the potentials are to be evaluated.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes four double-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE2 and double precision! If mdcore was not compiled with SSE2 enabled, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_4single()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_4single ( struct Potential * p[4],
float * r2,
float * e,
float * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r2Pointer to an array of the radii at which the potentials are to be evaluated, squared.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes four single-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE or AltiVec and single precision! If mdcore was not compiled with SSE or AltiVec, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_4single_old()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_4single_old ( struct Potential * p[4],
float * r2,
float * e,
float * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r2Pointer to an array of the radii at which the potentials are to be evaluated, squared.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes four single-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE or AltiVec and single precision! If mdcore was not compiled with SSE or AltiVec, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_4single_r()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_4single_r ( struct Potential * p[4],
float * r_in,
float * e,
float * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r_inPointer to an array of the radii at which the potentials are to be evaluated.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes four single-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE or AltiVec and single precision! If mdcore was not compiled with SSE or AltiVec, this function simply calls potential_eval on each entry.

◆ potential_eval_vec_8single()

TF_ALWAYS_INLINE void TissueForge::potential_eval_vec_8single ( struct Potential * p[8],
float * r2,
float * e,
float * f )

Evaluates the given potential at a set of points (interpolated).

Parameters
pPointer to an array of pointers to the #potentials to be evaluated.
r2Pointer to an array of the radii at which the potentials are to be evaluated, squared.
ePointer to an array of floating-point values in which to store the interaction energies.
fPointer to an array of floating-point values in which to store the magnitude of the interaction forces.

Note that for efficiency reasons, this function does not check if any of the parameters are NULL or if sqrt(r2) is within the interval of the #potential p.

Computes eight single-precision interactions simultaneously using vectorized instructions.

This function is only available if mdcore was compiled with SSE or AltiVec and single precision! If mdcore was not compiled with SSE or AltiVec, this function simply calls potential_eval on each entry.

◆ potential_init()

HRESULT TissueForge::potential_init ( struct Potential * p,
FPTYPE(* )(FPTYPE),
FPTYPE(* fp )(FPTYPE),
FPTYPE(* f6p )(FPTYPE),
FPTYPE a,
FPTYPE b,
FPTYPE tol )

Construct a #potential from the given function.

Parameters
pA pointer to an empty #potential.
fA pointer to the potential function to be interpolated.
fpA pointer to the first derivative of f.
f6pA pointer to the sixth derivative of f.
aThe smallest radius for which the potential will be constructed.
bThe largest radius for which the potential will be constructed.
tolThe absolute tolerance to which the interpolation should match the exact potential.

Computes an interpolated potential function from f in [a,b] to the locally relative tolerance tol.

The sixth derivative f6p is used to compute the optimal node distribution. If f6p is NULL, the derivative is approximated numerically.

The zeroth interval contains a linear extension of f for values < a.

◆ queue_get()

struct task * TissueForge::queue_get ( struct queue * q,
int rid,
int keep )

Get a task from the queue.

Parameters
qThe queue.
ridrunner ID for ownership issues.
keepIf true, remove the returned index from the queue.
Returns
A task with no unresolved dependencies or conflicts or NULL if none could be found.

◆ queue_init()

HRESULT TissueForge::queue_init ( struct queue * q,
int size,
struct space * s,
struct task * tasks )

Initialize a task queue.

Parameters
qThe queue to initialize.
sizeThe maximum number of cellpairs in this queue.
sThe space with which this queue is associated.
tasksAn array containing the task to which the queue indices will refer to.

Initializes a queue of the maximum given size. The initial queue is empty and can be filled with pair ids.

See also
#queue_tuples_init

◆ queue_insert()

int TissueForge::queue_insert ( struct queue * q,
struct task * t )

Add an index to the given queue.

Parameters
qThe queue.
thingThe thing to be inserted.

Inserts a task into the queue at the location of the next pointer and moves all remaining tasks up by one. Thus, if the queue is executing, the inserted task is considered to already have been taken.

Returns
1 on success, 0 if the queue is full and <0 on error (see #queue_err).

◆ queue_reset()

void TissueForge::queue_reset ( struct queue * q)

Reset the queue.

Parameters
qThe queue.

◆ randomPoint()

FVector3 TissueForge::randomPoint ( const PointsType & kind,
const FloatP_t & dr = 0,
const FloatP_t & phi0 = 0,
const FloatP_t & phi1 = M_PI )

Get the coordinates of a random point in a kind of shape.

Currently supports sphere, disk, solid cube and solid sphere.

Parameters
kindkind of shape
drthickness parameter; only applicable to solid sphere kind
phi0angle lower bound; only applicable to solid sphere kind
phi1angle upper bound; only applicable to solid sphere kind
Returns
FVector3

◆ randomPoints()

std::vector< FVector3 > TissueForge::randomPoints ( const PointsType & kind,
const int & n = 1,
const FloatP_t & dr = 0,
const FloatP_t & phi0 = 0,
const FloatP_t & phi1 = M_PI )

Get the coordinates of random points in a kind of shape.

Currently supports sphere, disk, solid cube and solid sphere.

Parameters
kindkind of shape
nnumber of points
drthickness parameter; only applicable to solid sphere kind
phi0angle lower bound; only applicable to solid sphere kind
phi1angle upper bound; only applicable to solid sphere kind
Returns
std::vector<FVector3>

◆ randomUnitVector()

FVector3 TissueForge::randomUnitVector ( )

Generates a randomly oriented unit vector.

Returns
FVector3

◆ randomVector()

FVector3 TissueForge::randomVector ( FloatP_t mean,
FloatP_t std )

Generates a randomly oriented vector with random magnitude with given mean and standard deviation according to a normal distribution.

Parameters
meanmagnitude mean
stdmagnitude standard deviation
Returns
FVector3

◆ removeErrorCallback()

HRESULT TissueForge::removeErrorCallback ( const unsigned int & cb_id)

Remove an error callback from the registry.

Parameters
cb_idid of registered callback

◆ rigid_eval_pshake()

HRESULT TissueForge::rigid_eval_pshake ( struct rigid * r,
int N,
struct engine * e,
int a_update )

Evaluate (P-SHAKE) a list of rigid constraints.

Parameters
rsPointer to an array of rigid.
NNr of rigids in r.
ePointer to the engine in which these rigids are evaluated.
a_updateflag whether to force updates of the constraint coeffs.

◆ rigid_eval_shake()

HRESULT TissueForge::rigid_eval_shake ( struct rigid * r,
int N,
struct engine * e )

Evaluate (SHAKE) a list of rigid constraints.

Parameters
rsPointer to an array of rigid.
NNr of rigids in r.
ePointer to the engine in which these rigids are evaluated.
epot_outPointer to a FPTYPE in which to aggregate the potential energy.

◆ run()

HRESULT TissueForge::run ( FloatP_t et = -1)

Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.

Parameters
etperiod to execute, in units of simulation time; a negative number runs infinitely

◆ runner_dopair()

HRESULT TissueForge::runner_dopair ( struct runner * r,
struct space_cell * cell_i,
struct space_cell * cell_j,
int sid )

Compute the pairwise interactions for the given pair.

Parameters
rThe runner computing the pair.
cell_iThe first cell.
cell_jThe second cell.
shiftA pointer to an array of three floating point values containing the vector separating the centers of cell_i and cell_j.

Computes the interactions between all the particles in cell_i and all the particles in cell_j. cell_i and cell_j may be the same cell.

See also
#runner_sortedpair.

◆ runner_dopair_fluxonly()

HRESULT TissueForge::runner_dopair_fluxonly ( struct runner * r,
struct space_cell * cell_i,
struct space_cell * cell_j,
int sid )

Compute the pairwise fluxes for the given pair.

Parameters
rThe runner computing the pair.
cell_iThe first cell.
cell_jThe second cell.
shiftA pointer to an array of three floating point values containing the vector separating the centers of cell_i and cell_j.

Computes the fluxes between all the particles in cell_i and all the particles in cell_j. cell_i and cell_j may be the same cell.

See also
#runner_sortedpair.

◆ runner_doself()

HRESULT TissueForge::runner_doself ( struct runner * r,
struct space_cell * cell_i )

Compute the self-interactions for the given cell.

Parameters
rThe runner computing the pair.
cell_iThe first cell.

◆ runner_doself_fluxonly()

HRESULT TissueForge::runner_doself_fluxonly ( struct runner * r,
struct space_cell * cell_i )

Compute the self-fluxes for the given cell.

Parameters
rThe runner computing the pair.
cell_iThe first cell.

◆ runner_dosort()

HRESULT TissueForge::runner_dosort ( struct runner * r,
struct space_cell * c,
int flags )

Fill in the pairwise Verlet list entries for the given cell pair if needed and compute the interactions.

Parameters
rThe runner computing the pair.
cThe cell.
flagsBitmask for the sorting directions.

This routine differs from #runner_dopair_verlet in that instead of storing a Verlet table, the sorted particle ids are stored. This requires only (size_i + size_j) entries as opposed to size_i*size_j for the Verlet table, yet may be less efficient since particles within the skin along the cell-pair axis are inspected, as opposed to particles simply within the skin of each other.

◆ runner_init()

HRESULT TissueForge::runner_init ( struct runner * r,
struct engine * e,
int id )

Initialize the runner associated to the given engine.

Parameters
rThe runner to be initialized.
eThe engine with which it is associated.
idThe ID of this runner.

◆ runner_run()

HRESULT TissueForge::runner_run ( struct runner * r)

Run a runner

◆ runner_sort_ascending()

void TissueForge::runner_sort_ascending ( unsigned int * parts,
int N )

Sort the particles in ascending order using QuickSort.

Parameters
partsThe particle IDs and distances in compact form
NThe number of particles.

The particle data is assumed to contain the distance in the lower 16 bits and the particle ID in the upper 16 bits.

◆ runner_sort_descending()

void TissueForge::runner_sort_descending ( unsigned int * parts,
int N )

Sort the particles in descending order using QuickSort.

Parameters
partsThe particle IDs and distances in compact form
NThe number of particles.

The particle data is assumed to contain the distance in the lower 16 bits and the particle ID in the upper 16 bits.

◆ runner_verlet_eval()

HRESULT TissueForge::runner_verlet_eval ( struct runner * r,
struct space_cell * c,
FPTYPE * f_out )

Compute the interactions between the particles in the given space_cell using the verlet list.

Parameters
rThe runner.
cThe #cell containing the particles to traverse.
fA pointer to an array of #FPTYPE in which to aggregate the interaction forces.

◆ runner_verlet_fill()

HRESULT TissueForge::runner_verlet_fill ( struct runner * r,
struct space_cell * cell_i,
struct space_cell * cell_j,
FPTYPE * pshift )

Fill in the Verlet list entries for the given space_cell pair.

Parameters
rThe runner computing the pair.
cell_iThe first cell.
cell_jThe second cell.
pshiftA pointer to an array of three floating point values containing the vector separating the centers of cell_i and cell_j.

◆ setSeed()

HRESULT TissueForge::setSeed ( const unsigned int * _seed = 0)

Set the current seed for the pseudo-random number generator.

Parameters
_seed
Returns
HRESULT

◆ Simulator_init() [1/2]

HRESULT TissueForge::Simulator_init ( const std::vector< std::string > & argv)

main simulator init method

◆ Simulator_init() [2/2]

HRESULT TissueForge::Simulator_init ( Simulator::Config & conf,
const std::vector< std::string > & appArgv = std::vector< std::string >() )

main simulator init method

◆ space_addpart()

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.

Parameters
sThe space to which p should be added.
pThe #part to be added.
xA pointer to an array of three FPTYPEs containing the particle position.
resultpointer to the newly allocated particle.

Inserts a #part p into the space s at the position x. Note that since particle positions in #part are relative to the cell, that data in p is overwritten and x is used.

This is a PRIVATE function, literally only the engine should call this. Does NOT manage ref count on particle types in the engine.

◆ space_addtask()

struct task * TissueForge::space_addtask ( struct space * s,
int type,
int subtype,
int flags,
int i,
int j )

Add a task to the given space.

Parameters
sThe space.
typeThe task type.
subtypeThe task subtype.
flagsThe task flags.
iIndex of the first cell/domain.
jIndex of the second cell/domain.
Returns
A pointer to the newly added task or NULL if anything went wrong.

◆ space_cell_add()

struct Particle * TissueForge::space_cell_add ( struct space_cell * c,
struct Particle * p,
struct Particle ** partlist )

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.

◆ space_cell_add_incomming()

struct Particle * TissueForge::space_cell_add_incomming ( struct space_cell * c,
struct Particle * p )

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.

◆ space_cell_add_incomming_multiple()

int TissueForge::space_cell_add_incomming_multiple ( struct space_cell * c,
struct Particle * 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.

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

◆ space_cell_flush()

HRESULT TissueForge::space_cell_flush ( struct space_cell * c,
struct Particle ** partlist,
struct space_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.

◆ space_cell_gaussian()

FPTYPE TissueForge::space_cell_gaussian ( int cell_id)

only one thead at a time can access a cell, so create a big list of random generators that are access by the cell id.

◆ space_cell_init()

HRESULT TissueForge::space_cell_init ( struct space_cell * c,
int * loc,
FPTYPE * origin,
FPTYPE * 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.

◆ space_cell_load()

HRESULT TissueForge::space_cell_load ( struct space_cell * c,
struct Particle * parts,
int nr_parts,
struct Particle ** partlist,
struct space_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.

◆ space_cell_remove()

HRESULT TissueForge::space_cell_remove ( struct space_cell * c,
struct Particle * p,
struct Particle ** partlist )

Remove a particle from a cell.

Parameters
cThe #cell from which the particle should be removed.
pThe #particle to remove from the cell.
partlistOptional #particle array to update.

◆ space_cell_welcome()

HRESULT TissueForge::space_cell_welcome ( struct space_cell * c,
struct Particle ** partlist )

Move particles from the incomming buffer to the cell.

Parameters
cThe #cell.
partlistA pointer to the partlist to set the part indices.

◆ space_del_particle()

HRESULT TissueForge::space_del_particle ( struct space * s,
int pid )

Deletes a particle from the space, and sets the partlist[pid] to null.

this will decrement the python pointer in p, and overwrite the memeory pointed to by p. Any pointer to this will no longer be valid.

Note, pid is the global particle id, and is the index in partlist of the particle.

◆ space_flush()

HRESULT TissueForge::space_flush ( struct space * s)

Clear all particles from this space.

Parameters
sThe space to flush.

◆ space_flush_ghosts()

HRESULT TissueForge::space_flush_ghosts ( struct space * s)

Clear all particles from the ghost cells in this space.

Parameters
sThe space to flush.

◆ space_get_cellids_for_pos()

int TissueForge::space_get_cellids_for_pos ( struct space * s,
FPTYPE * x,
int * cellids )

get the cell id for a position, negative on failure

Parameters
sthe space
xthe position
cellids[optional] get the (i,j,k) indices of the space cell. returns the absolute cell id (index into array).

◆ space_getcell()

int TissueForge::space_getcell ( struct space * s,
struct space_cell ** out )

Get the next unprocessed cell from the spaece.

Parameters
sThe space.
outPointer to a pointer to #cell in which to store the results.
Returns
1 if a cell was found, 0 if the list is empty or < 0 on error.

◆ space_getpos()

HRESULT TissueForge::space_getpos ( struct space * s,
int id,
FPTYPE * x )

Get the absolute position of a particle.

Parameters
sThe space in which the particle resides.
idThe local id of the #part.
xA pointer to a vector of at least three FPTYPEs in which to store the particle position.

◆ space_getsid()

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.

Parameters
sThe space.
ciFPTYPE pointer to the first #cell.
cjFPTYPE pointer to the second #cell.

◆ space_gettuple()

int TissueForge::space_gettuple ( struct space * s,
struct celltuple ** out,
int wait )

Get the next free celltuple from the space.

Parameters
sThe space in which to look for tuples.
outA pointer to a celltuple in which to copy the result.
waitA boolean value specifying if to wait for free tuples or not.
Returns
The number of celltuple found or 0 if the list is empty and < 0 on error.

◆ space_growparts()

HRESULT TissueForge::space_growparts ( struct space * s,
unsigned int size_incr )

Grow the parts allocated to a space.

Parameters
sThe space on which to operate.
size_incrThe increment in size.

◆ space_init()

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.

Parameters
sThe space to initialize.
originPointer to an array of three FPTYPEs specifying the origin of the rectangular domain.
dimPointer to an array of three FPTYPEs specifying the length of the rectangular domain along each dimension.
LThe minimum cell edge length, in each dimension.
cutoffA FPTYPE-precision value containing the maximum cutoff lenght that will be used in the potentials.
periodUnsigned integer containing the flags space_periodic_x, space_periodic_y and/or space_periodic_z or space_periodic_full.

This routine initializes the fields of the space s, creates the cells and generates the cell-pair list.

◆ space_prepare()

HRESULT TissueForge::space_prepare ( struct space * s)

Prepare the space before a time step.

Parameters
sA pointer to the space to prepare.

Initializes a space for a single time step. This routine runs through the particles and sets their forces to zero.

◆ space_prepare_tasks()

HRESULT TissueForge::space_prepare_tasks ( struct space * s)

Prepare the tasks before a time step.

Parameters
sA pointer to the space to prepare.

Initializes the tasks of a space for a single time step.

◆ space_releasepair()

HRESULT TissueForge::space_releasepair ( struct space * s,
int ci,
int cj )

Free the cells involved in the current pair.

Parameters
sThe space to operate on.
ciID of the first cell.
cjID of the second cell.

Decreases the taboo-counter of the cells involved in the pair and signals any runner that might be waiting. Note that only a single waiting runner is released per released cell and therefore, if two different cells become free, the condition cellpairs_avail is signaled twice.

◆ space_setpos()

HRESULT TissueForge::space_setpos ( struct space * s,
int id,
FPTYPE * x )

Set the absolute position of a particle.

Parameters
sThe space in which the particle resides.
idThe local id of the #part.
xA pointer to a vector of at least three FPTYPEs in which to store the particle position.

◆ space_shuffle()

HRESULT TissueForge::space_shuffle ( struct space * s)

Run through the cells of a space and make sure every particle is in its place.

Parameters
sThe space on which to operate.

Runs through the cells of s and if a particle has stepped outside the cell bounds, moves it to the correct cell.

◆ space_shuffle_local()

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.

Parameters
sThe space on which to operate.

Runs through the cells of s and if a particle has stepped outside the cell bounds, moves it to the correct cell.

◆ space_update_style()

HRESULT TissueForge::space_update_style ( struct space * s)

A style was changed, so need to update any counts the space object has.

◆ space_verlet_force()

int TissueForge::space_verlet_force ( struct space * s,
FPTYPE * f,
FPTYPE epot )

Collect forces and potential energies.

Parameters
sThe space.
maxcountThe maximum number of entries.
fromPointer to an integer which will contain the index to the first entry on success.
toPointer to an integer which will contain the index to the last entry on success.
Returns
The number of entries returned or < 0 on error.

◆ space_verlet_init()

HRESULT TissueForge::space_verlet_init ( struct space * s,
int list_global )

Initialize the Verlet-list data structures.

Parameters
sThe space.

◆ step()

HRESULT TissueForge::step ( const FloatP_t & until = 0,
const FloatP_t & dt = 0 )

Performs a single time step dt of the universe if no arguments are given. Optionally runs until until, and can use a different timestep of dt.

Parameters
untilperiod to execute, in units of simulation time (default executes one time step).
dtoverrides the existing time step, and uses this value for time stepping; currently not supported.

◆ systemNameStr()

std::string TissueForge::systemNameStr ( )

System name.

Returns
std::string

◆ systemVersionStr()

std::string TissueForge::systemVersionStr ( )

System version.

Returns
std::string

◆ task_addunlock()

HRESULT TissueForge::task_addunlock ( struct task * ta,
struct task * tb )

Add a task dependency.

Parameters
taThe unlocking task.
tbThe unlocked task.

◆ Universe_Flag()

int TissueForge::Universe_Flag ( Universe::Flags flag)

get a flag value

◆ Universe_SetFlag()

HRESULT TissueForge::Universe_SetFlag ( Universe::Flags flag,
int value )

sets / clears a flag value

◆ Universe_Step()

HRESULT TissueForge::Universe_Step ( FloatP_t until,
FloatP_t dt )

runs the universe a pre-determined period of time, until. can use micro time steps of 'dt' which override the saved universe dt.

if until is 0, it is ignored and the universe.dt is used. if dt is 0, it is ignored, and the universe.dt is used as a single time step.

◆ version_str()

std::string TissueForge::version_str ( )

Installation version.

Returns
std::string

Variable Documentation

◆ _Engine

engine TissueForge::_Engine
extern

Single static instance of the md engine per process.

Even for MPI enabled, as each MPI process will initialize the engine with different comm and rank.

◆ _Universe

Universe TissueForge::_Universe
extern

The single global instance of the universe

◆ btree_err

int TissueForge::btree_err
extern

ID of the last error

◆ Particle_Colors

unsigned int* TissueForge::Particle_Colors

The the particle type type

◆ potential_null

struct Potential TissueForge::potential_null

Fictitious null potential.