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

Go to the source code of this file.

Data Structures

struct  engine
struct  engine_set
struct  engine_comm

Defines

#define engine_err_ok   0
#define engine_err_null   -1
#define engine_err_malloc   -2
#define engine_err_space   -3
#define engine_err_pthread   -4
#define engine_err_runner   -5
#define engine_err_range   -6
#define engine_err_cell   -7
#define engine_err_domain   -8
#define engine_err_nompi   -9
#define engine_err_mpi   -10
#define engine_err_bond   -11
#define engine_err_angle   -12
#define engine_err_reader   -13
#define engine_err_psf   -14
#define engine_err_pdb   -15
#define engine_err_cpf   -16
#define engine_err_potential   -17
#define engine_err_exclusion   -18
#define engine_err_sets   -19
#define engine_err_dihedral   -20
#define engine_err_cuda   -21
#define engine_err_nocuda   -22
#define engine_err_cudasp   -23
#define engine_err_maxparts   -24
#define engine_err_queue   -25
#define engine_flag_none   0
#define engine_flag_tuples   1
#define engine_flag_static   2
#define engine_flag_localparts   4
#define engine_flag_cuda   8
#define engine_flag_explepot   16
#define engine_flag_verlet   32
#define engine_flag_verlet_pairwise   64
#define engine_flag_affinity   128
#define engine_flag_prefetch   256
#define engine_flag_verlet_pseudo   512
#define engine_flag_unsorted   2048
#define engine_flag_mpi   4096
#define engine_flag_parbonded   8192
#define engine_flag_async   16384
#define engine_flag_sets   32768
#define engine_flag_nullpart   65536
#define engine_flag_dispatch   131072
#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_bonded_maxnrthreads   16
#define engine_bonded_nrthreads   ((omp_get_num_threads()<engine_bonded_maxnrthreads)?omp_get_num_threads():engine_bonded_maxnrthreads)

Enumerations

enum  {
  engine_timer_step = 0, 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_last
}

Functions

int engine_addpot (struct engine *e, struct potential *p, int i, int j)
 Add an interaction potential.
int engine_addtype (struct engine *e, double mass, double charge, char *name, char *name2)
 Add a type definition.
int engine_advance (struct engine *e)
 Update the particle velocities and positions, re-shuffle if appropriate.
int engine_angle_addpot (struct engine *e, struct potential *p)
 Add a angle potential.
int engine_angle_add (struct engine *e, int i, int j, int k, int pid)
 Add a angle interaction to the engine.
int engine_angle_eval (struct engine *e)
 Compute the angled interactions stored in this engine.
int engine_barrier (struct engine *e)
 Barrier routine to hold the runners back.
int engine_bond_addpot (struct engine *e, struct potential *p, int i, int j)
 Add a bond potential.
int engine_bond_add (struct engine *e, int i, int j)
 Add a bonded interaction to the engine.
int engine_bond_eval (struct engine *e)
 Compute the bonded interactions stored in this engine.
int engine_bonded_eval (struct engine *e)
 Compute all bonded interactions stored in this engine.
int engine_bonded_eval_sets (struct engine *e)
 Compute all bonded interactions stored in this engine.
int engine_bonded_sets (struct engine *e, int max_sets)
 Assemble non-conflicting sets of bonded interactions.
int engine_dihedral_add (struct engine *e, int i, int j, int k, int l, int pid)
 Add a dihedral interaction to the engine.
int engine_dihedral_addpot (struct engine *e, struct potential *p)
 Add a dihedral potential.
int engine_dihedral_eval (struct engine *e)
 Compute the dihedral interactions stored in this engine.
int engine_dump_PSF (struct engine *e, FILE *psf, FILE *pdb, char *excl[], int nr_excl)
 Dump the contents of the enginge to a PSF and PDB file.
int engine_exclusion_add (struct engine *e, int i, int j)
 Add a exclusioned interaction to the engine.
int engine_exclusion_eval (struct engine *e)
 Correct for the excluded interactions stored in this engine.
int engine_exclusion_shrink (struct engine *e)
 Remove duplicate exclusions.
int engine_finalize (struct engine *e)
 Initialize an engine with the given data and MPI enabled.
int engine_flush_ghosts (struct engine *e)
 Clear all particles from this engine's ghost cells.
int 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_init (struct engine *e, const double *origin, const double *dim, double *L, double cutoff, unsigned int period, int max_type, unsigned int flags)
 Initialize an engine with the given data.
int engine_load_ghosts (struct engine *e, double *x, double *v, int *type, int *pid, int *vid, double *q, unsigned int *flags, int N)
 Load a set of particle data as ghosts.
int engine_load (struct engine *e, double *x, double *v, int *type, int *pid, int *vid, double *charge, unsigned int *flags, int N)
 Load a set of particle data.
int engine_nonbond_eval (struct engine *e)
 Compute the nonbonded interactions in the current step.
int engine_read_cpf (struct engine *e, FILE *cpf, double kappa, double tol, int rigidH)
 Read the potentials from a CHARMM parameter file.
int engine_read_psf (struct engine *e, FILE *psf, FILE *pdb)
 Read the simulation setup from a PSF and PDB file pair.
int engine_read_xplor (struct engine *e, FILE *xplor, double kappa, double tol, int rigidH)
 Read the potentials from a XPLOR parameter file.
int engine_rigid_add (struct engine *e, int pid, int pjd, double d)
 Add a rigid constraint to the engine.
int engine_rigid_eval (struct engine *e)
 Resolve the constraints.
int engine_rigid_sort (struct engine *e)
 Split the rigids into local, semilocal and non-local.
int engine_rigid_unsort (struct engine *e)
 Shuffle the rigid constraints randomly.
int engine_setexplepot (struct engine *e, struct potential *ep)
 Set the explicit electrostatic potential.
int engine_shuffle (struct engine *e)
 Re-shuffle the particles in the engine.
int engine_split_bisect (struct engine *e, int N)
 Split the computational domain over a number of nodes using bisection.
int engine_split (struct engine *e)
 Set-up the engine for distributed-memory parallel operation.
int engine_start_SPU (struct engine *e, int nr_runners)
 Start the SPU-associated runners in the given engine.
int engine_start (struct engine *e, int nr_runners, int nr_queues)
 Start the runners in the given engine.
int engine_step (struct engine *e)
 Run the engine for a single time step.
int engine_timers_reset (struct engine *e)
 Set all the engine timers to 0.
int engine_unload_marked (struct engine *e, double *x, double *v, int *type, int *pid, int *vid, double *q, unsigned int *flags, double *epot, int N)
 Unload a set of particle data from the marked cells of an engine.
int engine_unload_strays (struct engine *e, double *x, double *v, int *type, int *pid, int *vid, double *q, unsigned int *flags, double *epot, int N)
 Unload real particles that may have wandered into a ghost cell.
int engine_unload (struct engine *e, double *x, double *v, int *type, int *pid, int *vid, double *charge, unsigned int *flags, double *epot, int N)
 Unload a set of particle data from the engine.
int engine_verlet_update (struct engine *e)
 Check if the Verlet-list needs to be updated.

Variables

int engine_err
char * engine_err_msg []

Define Documentation

#define engine_angles_chunk   100
#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_bonds_chunk   100
#define engine_dihedrals_chunk   100
#define engine_err_angle   -12
#define engine_err_bond   -11
#define engine_err_cell   -7
#define engine_err_cpf   -16
#define engine_err_cuda   -21
#define engine_err_cudasp   -23
#define engine_err_dihedral   -20
#define engine_err_domain   -8
#define engine_err_exclusion   -18
#define engine_err_malloc   -2
#define engine_err_maxparts   -24
#define engine_err_mpi   -10
#define engine_err_nocuda   -22
#define engine_err_nompi   -9
#define engine_err_null   -1
#define engine_err_ok   0
#define engine_err_pdb   -15
#define engine_err_potential   -17
#define engine_err_psf   -14
#define engine_err_pthread   -4
#define engine_err_queue   -25
#define engine_err_range   -6
#define engine_err_reader   -13
#define engine_err_runner   -5
#define engine_err_sets   -19
#define engine_err_space   -3
#define engine_exclusions_chunk   100
#define engine_flag_affinity   128
#define engine_flag_async   16384
#define engine_flag_cuda   8
#define engine_flag_dispatch   131072
#define engine_flag_explepot   16
#define engine_flag_localparts   4
#define engine_flag_mpi   4096
#define engine_flag_none   0
#define engine_flag_nullpart   65536
#define engine_flag_parbonded   8192
#define engine_flag_prefetch   256
#define engine_flag_sets   32768
#define engine_flag_static   2
#define engine_flag_tuples   1
#define engine_flag_unsorted   2048
#define engine_flag_verlet   32
#define engine_flag_verlet_pairwise   64
#define engine_flag_verlet_pseudo   512
#define engine_rigids_chunk   50

Enumeration Type Documentation

anonymous enum

Timer IDs.

Enumerator:
engine_timer_step 
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_last 

Function Documentation

int 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.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_addtype ( struct engine e,
double  mass,
double  charge,
char *  name,
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 (see engine_err).

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

int engine_advance ( struct engine e)

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

Parameters:
eThe engine on which to run.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_angle_add ( struct engine e,
int  i,
int  j,
int  k,
int  pid 
)

Add a angle interaction to the engine.

Parameters:
eThe engine.
iThe ID of the first part.
jThe ID of the second part.
kThe ID of the third part.
pidIndex of the potential for this bond.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_angle_addpot ( struct engine e,
struct potential p 
)

Add a angle potential.

Parameters:
eThe engine.
pThe potential to add to the engine.
Returns:
The ID of the added angle potential or < 0 on error (see engine_err).
int engine_angle_eval ( struct engine e)

Compute the angled interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_barrier ( struct engine e)

Barrier routine to hold the runners back.

Parameters:
eThe engine to wait on.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_bond_add ( struct engine e,
int  i,
int  j 
)

Add a bonded interaction to the engine.

Parameters:
eThe engine.
iThe ID of the first part.
jThe ID of the second part.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_bond_addpot ( struct engine e,
struct potential p,
int  i,
int  j 
)

Add a bond 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.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_bond_eval ( struct engine e)

Compute the bonded interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_bonded_eval ( struct engine e)

Compute all bonded interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_bonded_eval_sets ( struct engine e)

Compute all bonded interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_bonded_sets ( struct engine e,
int  max_sets 
)

Assemble non-conflicting sets of bonded interactions.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_dihedral_add ( struct engine e,
int  i,
int  j,
int  k,
int  l,
int  pid 
)

Add a dihedral interaction to the engine.

Parameters:
eThe engine.
iThe ID of the first part.
jThe ID of the second part.
kThe ID of the third part.
lThe ID of the fourth part.
pidIndex of the potential for this bond.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_dihedral_addpot ( struct engine e,
struct potential p 
)

Add a dihedral potential.

Parameters:
eThe engine.
pThe potential to add to the engine.
Returns:
The ID of the added dihedral potential or < 0 on error (see engine_err).
int engine_dihedral_eval ( struct engine e)

Compute the dihedral interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_dump_PSF ( struct engine e,
FILE *  psf,
FILE *  pdb,
char *  excl[],
int  nr_excl 
)

Dump the contents of the enginge to a PSF and PDB file.

Parameters:
eThe engine.
psfA pointer to FILE to which to write the PSF file.
pdbA pointer to FILE to which to write the PDB file.

If any of psf or pdb are NULL, the respective output will not be generated.

Returns:
engine_err_ok or < 0 on error (see engine_err).
int 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.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_exclusion_eval ( struct engine e)

Correct for the excluded interactions stored in this engine.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_exclusion_shrink ( struct engine e)

Remove duplicate exclusions.

Parameters:
eThe engine.
Returns:
The number of unique exclusions or < 0 on error (see engine_err).
int engine_finalize ( struct engine e)

Initialize an engine with the given data and MPI enabled.

Parameters:
eThe engine to initialize.
originAn array of three doubles containing the cartesian origin of the space.
dimAn array of three doubles containing the size of the space.
LThe minimum cell edge length, should be at least cutoff.
cutoffThe maximum interaction cutoff to use.
periodA bitmask describing the periodicity of the domain (see space_periodic_full).
max_typeThe maximum number of particle types that will be used by this engine.
flagsBit-mask containing the flags for this engine.
commThe MPI comm to use.
rankThe ID of this node.
Returns:
engine_err_ok or < 0 on error (see engine_err). Kill all runners and de-allocate the data of an engine.
Parameters:
ethe engine to finalize.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_flush ( struct engine e)

Clear all particles from this engine.

Parameters:
eThe engine to flush.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_flush_ghosts ( struct engine e)

Clear all particles from this engine's ghost cells.

Parameters:
eThe engine to flush.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int 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 (see engine_err).
int 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 (see engine_err).
int engine_init ( struct engine e,
const double *  origin,
const double *  dim,
double *  L,
double  cutoff,
unsigned int  period,
int  max_type,
unsigned int  flags 
)

Initialize an engine with the given data.

Parameters:
eThe engine to initialize.
originAn array of three doubles containing the cartesian origin of the space.
dimAn array of three doubles containing the size of the space.
LThe minimum cell edge length in each dimension.
cutoffThe maximum interaction cutoff to use.
periodA bitmask describing the periodicity of the domain (see space_periodic_full).
max_typeThe maximum number of particle types that will be used by this engine.
flagsBit-mask containing the flags for this engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_load ( struct engine e,
double *  x,
double *  v,
int *  type,
int *  pid,
int *  vid,
double *  q,
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.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_load_ghosts ( struct engine e,
double *  x,
double *  v,
int *  type,
int *  pid,
int *  vid,
double *  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.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_nonbond_eval ( struct engine e)

Compute the nonbonded interactions in the current step.

Parameters:
eThe engine on which to run.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_read_cpf ( struct engine e,
FILE *  cpf,
double  kappa,
double  tol,
int  rigidH 
)

Read the potentials from a CHARMM parameter file.

Parameters:
eThe engine.
cpfThe open CHARMM parameter file.
kappaThe PME screening width.
tolThe absolute tolerance for interpolation.
rigidHConvert all bonds over a type starting with 'H' to a rigid constraint.

If kappa is zero, truncated Coulomb electrostatic interactions are assumed. If kappa is less than zero, no electrostatic interactions are computed.

Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_read_psf ( struct engine e,
FILE *  psf,
FILE *  pdb 
)

Read the simulation setup from a PSF and PDB file pair.

Parameters:
eThe engine.
psfThe open PSF file.
pdbThe open PDB file.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_read_xplor ( struct engine e,
FILE *  xplor,
double  kappa,
double  tol,
int  rigidH 
)

Read the potentials from a XPLOR parameter file.

Parameters:
eThe engine.
xplorThe open XPLOR parameter file.
kappaThe PME screening width.
tolThe absolute tolerance for interpolation.
rigidHConvert all bonds over a type starting with 'H' to a rigid constraint.

If kappa is zero, truncated Coulomb electrostatic interactions are assumed. If kappa is less than zero, no electrostatic interactions are computed.

Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_rigid_add ( struct engine e,
int  pid,
int  pjd,
double  d 
)

Add a rigid constraint to the engine.

Parameters:
eThe engine.
pidThe ID of the first part.
pjdThe ID of the second part.
Returns:
The index of the rigid constraint or < 0 on error (see engine_err).

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

int engine_rigid_eval ( struct engine e)

Resolve the constraints.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_rigid_sort ( struct engine e)

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

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_rigid_unsort ( struct engine e)

Shuffle the rigid constraints randomly.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_setexplepot ( struct engine e,
struct potential ep 
)

Set the explicit electrostatic potential.

Parameters:
eThe engine.
epThe electrostatic potential.
Returns:
engine_err_ok or < 0 on error (see engine_err).

If ep is not NULL, the flag engine_flag_explepot is set, otherwise it is cleared.

int engine_shuffle ( struct engine e)

Re-shuffle the particles in the engine.

Parameters:
eThe engine on which to run.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_split ( struct engine e)

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

Parameters:
eThe engine to set-up.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_split_bisect ( struct engine e,
int  N 
)

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

Parameters:
eThe engine to split up.
NThe number of computational nodes.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int 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.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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

int engine_start_SPU ( struct engine e,
int  nr_runners 
)

Start the SPU-associated runners in the given engine.

Parameters:
eThe engine to start.
nr_runnersThe number of runners start.
Returns:
engine_err_ok or < 0 on error (see engine_err).

Allocates and starts the specified number of runner.

int engine_step ( struct engine e)

Run the engine for a single time step.

Parameters:
eThe engine on which to run.
Returns:
engine_err_ok or < 0 on error (see engine_err).

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.

int engine_timers_reset ( struct engine e)

Set all the engine timers to 0.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).
int engine_unload ( struct engine e,
double *  x,
double *  v,
int *  type,
int *  pid,
int *  vid,
double *  q,
unsigned int *  flags,
double *  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 #double in which to store the total potential energy.
Nthe maximum number of particles.
Returns:
The number of particles unloaded or < 0 on error (see engine_err).

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

int engine_unload_marked ( struct engine e,
double *  x,
double *  v,
int *  type,
int *  pid,
int *  vid,
double *  q,
unsigned int *  flags,
double *  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 #double in which to store the total potential energy.
Nthe maximum number of particles.
Returns:
The number of particles unloaded or < 0 on error (see engine_err).

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

int engine_unload_strays ( struct engine e,
double *  x,
double *  v,
int *  type,
int *  pid,
int *  vid,
double *  q,
unsigned int *  flags,
double *  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 #double in which to store the total potential energy.
Nthe maximum number of particles.
Returns:
The number of particles unloaded or < 0 on error (see engine_err).

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

int engine_verlet_update ( struct engine e)

Check if the Verlet-list needs to be updated.

Parameters:
eThe engine.
Returns:
engine_err_ok or < 0 on error (see engine_err).

Variable Documentation

ID of the last error.

char* engine_err_msg[]

List of error messages.

 All Data Structures Files Functions Variables Typedefs Enumerator Defines