Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfEngine.h File Reference
#include "tf_platform.h"
#include <pthread.h>
#include "tfSpace.h"
#include "tf_cycle.h"
#include "tfBoundaryConditions.h"
#include <tfSubEngine.h>
#include <mutex>
#include <thread>
#include <set>
#include "tfParticle.h"
Include dependency graph for tfEngine.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TissueForge::engine
 
struct  TissueForge::engine_set
 
struct  TissueForge::engine_comm
 

Namespaces

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

Macros

#define engine_bonds_chunk   100
 
#define engine_angles_chunk   100
 
#define engine_rigids_chunk   50
 
#define engine_dihedrals_chunk   100
 
#define engine_exclusions_chunk   100
 
#define engine_readbuff   16384
 
#define engine_maxgpu   10
 
#define engine_pshake_steps   20
 
#define engine_maxKcutoff   2
 
#define engine_split_MPI   1
 
#define engine_split_GPU   2
 
#define engine_bonded_maxnrthreads   16
 
#define engine_bonded_nrthreads   ((omp_get_num_threads()<engine_bonded_maxnrthreads)?omp_get_num_threads():engine_bonded_maxnrthreads)
 
#define engine_maxnrtypes   128
 
#define ENGINE_DUMP(msg)   {std::cout<<msg<<std::endl; engine_dump();}
 

Typedefs

typedef struct TissueForge::engine TissueForge::engine
 
typedef struct TissueForge::engine_set TissueForge::engine_set
 
typedef struct TissueForge::engine_comm TissueForge::engine_comm
 

Enumerations

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 }
 

Functions

HRESULT TissueForge::engine_addpot (struct engine *e, struct Potential *p, int i, int j)
 Add an interaction potential.
 
HRESULT TissueForge::engine_addfluxes (struct engine *e, struct Fluxes *f, int i, int j)
 Add fluxes to a particle of particle types.
 
FluxesTissueForge::engine_getfluxes (struct engine *e, int i, int j)
 Get a fluxes between two particles.
 
HRESULT TissueForge::engine_add_singlebody_force (struct engine *e, struct Force *p, int typeId)
 
int TissueForge::engine_angle_alloc (struct engine *e, Angle **out)
 
HRESULT TissueForge::engine_angle_eval (struct engine *e)
 Compute the angled interactions stored in this engine.
 
HRESULT TissueForge::engine_barrier (struct engine *e)
 Barrier routine to hold the runners back.
 
HRESULT TissueForge::engine_bond_eval (struct engine *e)
 Compute the bonded interactions stored in this engine.
 
HRESULT TissueForge::engine_bonded_eval (struct engine *e)
 Compute all bonded interactions stored in this engine.
 
HRESULT TissueForge::engine_bonded_eval_sets (struct engine *e)
 Compute all bonded interactions stored in this engine.
 
HRESULT TissueForge::engine_bonded_sets (struct engine *e, int max_sets)
 Assemble non-conflicting sets of bonded interactions.
 
int TissueForge::engine_dihedral_alloc (struct engine *e, Dihedral **out)
 
HRESULT TissueForge::engine_dihedral_eval (struct engine *e)
 Compute the dihedral interactions stored in this engine.
 
HRESULT TissueForge::engine_exclusion_add (struct engine *e, int i, int j)
 Add a exclusioned interaction to the engine.
 
HRESULT TissueForge::engine_exclusion_eval (struct engine *e)
 Compute the exclusioned interactions stored in this engine.
 
HRESULT TissueForge::engine_exclusion_shrink (struct engine *e)
 Remove duplicate exclusions.
 
HRESULT TissueForge::engine_finalize (struct engine *e)
 Kill all runners and de-allocate the data of an engine.
 
HRESULT TissueForge::engine_flush_ghosts (struct engine *e)
 Clear all particles from this #engine's ghost cells.
 
HRESULT TissueForge::engine_flush (struct engine *e)
 Clear all particles from this #engine.
 
int TissueForge::engine_gettype (struct engine *e, char *name)
 Look for a given type by name.
 
int TissueForge::engine_gettype2 (struct engine *e, char *name2)
 Look for a given type by its second name.
 
int TissueForge::engine_bond_alloc (struct engine *e, struct Bond **result)
 
struct ParticleTypeTissueForge::engine_type (int id)
 
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.
 
HRESULT TissueForge::engine_addparts (struct engine *e, int nr_parts, struct Particle **parts, FPTYPE **x)
 Add parts to space at given coordinates.
 
int TissueForge::engine_addtype (struct engine *e, FPTYPE mass, FPTYPE charge, const char *name, const char *name2)
 Add a type definition.
 
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.
 
HRESULT TissueForge::engine_reset (struct engine *e)
 
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.
 
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.
 
HRESULT TissueForge::engine_nonbond_eval (struct engine *e)
 Compute the nonbonded interactions in the current step.
 
HRESULT TissueForge::engine_fluxonly_eval (struct engine *e)
 Compute the flux interaction only in the current step.
 
HRESULT TissueForge::engine_rigid_add (struct engine *e, int pid, int pjd, FPTYPE d)
 Add a rigid constraint to the engine.
 
HRESULT TissueForge::engine_rigid_eval (struct engine *e)
 Resolve the constraints.
 
HRESULT TissueForge::engine_rigid_sort (struct engine *e)
 Split the rigids into local, semilocal and non-local.
 
HRESULT TissueForge::engine_rigid_unsort (struct engine *e)
 Shuffle the rigid constraints randomly.
 
HRESULT TissueForge::engine_shuffle (struct engine *e)
 Re-shuffle the particles in the engine.
 
HRESULT TissueForge::engine_split_bisect (struct engine *e, int N, int particle_flags)
 Split the computational domain over a number of nodes using bisection.
 
HRESULT TissueForge::engine_split (struct engine *e)
 Set-up the engine for distributed-memory parallel operation.
 
HRESULT TissueForge::engine_start (struct engine *e, int nr_runners, int nr_queues)
 Start the runners in the given #engine.
 
HRESULT TissueForge::engine_step (struct engine *e)
 Run the engine for a single time step.
 
HRESULT TissueForge::engine_timers_reset (struct engine *e)
 Set all the engine timers to 0.
 
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.
 
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.
 
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.
 
HRESULT TissueForge::engine_verlet_update (struct engine *e)
 Check if the Verlet-list needs to be updated.
 
int TissueForge::engine_next_partid (struct engine *e)
 
HRESULT TissueForge::engine_next_partids (struct engine *e, int nr_ids, int *ids)
 
HRESULT TissueForge::engine_force_prep (struct engine *e)
 
HRESULT TissueForge::engine_force (struct engine *e)
 
HRESULT TissueForge::engine_del_particle (struct engine *e, int pid)
 
FPTYPE TissueForge::engine_steps_per_second ()
 
void TissueForge::engine_dump ()
 
FPTYPE TissueForge::engine_kinetic_energy (struct engine *e)
 
FPTYPE TissueForge::engine_temperature (struct engine *e)
 
FVector3 TissueForge::engine_origin ()
 
FVector3 TissueForge::engine_dimensions ()
 
FVector3 TissueForge::engine_center ()
 
struct engineTissueForge::engine_get ()
 
ParticleTissueForge::Particle_FromId (int id)
 

Variables

engine TissueForge::_Engine