particles_util
Short description
Particles
- class pyrid.molecules.particles_util.Particles(*args, **kwargs)[source]
The Particles class stored all data for the particles in the simulation. Particles are the ‘atoms’ in PyRID. Molecules can be constructed from combining several particles to a rigid bead model. Particles can interact with each other via energy potentials and react with each other by user defined bimolecular reactions.
- Attributes
- nint64
length of the particles array
- Dataarray_like
Numpy structured array containing all data that define a particle state. dtype: np.dtype([(‘next’, np.int64), (‘pos’, (np.float64, (3,))), (‘pos_local’, (np.float64, (3,))), (‘coord_local’, (np.float64, (3,))), (‘force’, (np.float64, (3,))), (‘rb_id’, np.int64), (‘type’, ‘U20’), (‘type_id’, np.int64), (‘radius’, np.float64), (‘number_reactions’, np.int64), (‘reactions_head’, np.int64 , (2,)), (‘bound’, bool), (‘bound_with’, np.int64), (‘cutoff’, np.float64), (‘h’, np.int64), (‘next_transition’, np.float64),], align=True)
Methods
add_particle(System, type_name)
Adds a new particle to the array
next_up_reaction(System, i)
Calculates the time point of the next uni-particle reaction.
set_pos(k, x,y,z)
Sets the position of particle i given x,y,z
increase_pos(i, dx,dy,dz)
Incerases the particle position by dx,dy,dz
set_pos_local(i, xl,yl,zl)
Sets the position of particle i in the local coordinate frame
increase_pos_local(i, dxl,dyl,dzl)
Increases the position of particle i in the local coordinate frame
set_force(i, fx, fy, fz)
Sets the force vector of particle i
clear_force(i)
Resets the force vector of particle i to [0,0,0]
increase_force(i, dfx, dfy, dfz)
Increases the force vector of particle i by dfx, dfy, dfz
set_coord(i, xc,yc, zc)
Sets the coordinates of particle i in the local reference frame
set_rb_id(i, rb_id)
Sets the id of the rigid bead molecule that particle i is part of
set_type(i, particle_type, System)
Sets the type name and id of particle i
increase_number_reactions(i)
Increases the number of reactions particle i partakes in by 1
decrease_number_reactions(i)
Decreases the number of reactions particle i partakes in by 1
clear_number_reactions(i)
Sets the number of reactions particle i partakes in to zero
- add_particle(System, type_name)[source]
Adds a new particle to the array
- Parameters
- Systemobject
Instance of System class
- type_namestring
Name of particle type
- clear_force(i)[source]
Resets the force vector of particle i to [0,0,0]
- Parameters
- iint64
Particle index
- clear_number_reactions(i)[source]
Sets the number of reactions particle i partakes in to zero
- Parameters
- iint64
Particle index
- decrease_number_reactions(i)[source]
Decreases the number of reactions particle i partakes in by 1
- Parameters
- iint64
Particle index
- increase_force(i, dfx, dfy, dfz)[source]
Increases the force vector of particle i by dfx, dfy, dfz
- Parameters
- iint64
Particle index
- dfxfloat64
Particle force differental along x axis
- dfyfloat64
Particle force differental along y axis
- dfzfloat64
Particle force differental along z axis
- increase_number_reactions(i)[source]
Increases the number of reactions particle i partakes in by 1
- Parameters
- iint64
Particle index
- increase_pos(i, dx, dy, dz)[source]
Incerases the particle position by dx,dy,dz
- Parameters
- iint64
Particle index
- dxfloat64
Particle position differental along x axis
- dyfloat64
Particle position differental along y axis
- dzfloat64
Particle position differental along z axis
- increase_pos_local(i, dxl, dyl, dzl)[source]
Increases the position of particle i in the local coordinate frame
- Parameters
- iint64
Particle index
- dxlfloat64
Particle position differental along x axis in local frame
- dylfloat64
Particle position differental along y axis in local frame
- dzlfloat64
Particle position differental along z axis in local frame
- next_up_reaction(System, i)[source]
Calculates the time point of the next uni-particle reaction.
- Parameters
- Systemobject
Instance of System class
- iint64
Particle index
- set_coord(i, xc, yc, zc)[source]
Sets the coordinates of particle i in the local reference frame
- Parameters
- iint64
Particle index
- xcfloat64
Particle x coordinate in local frame
- ycfloat64
Particle y coordinate in local frame
- zcfloat64
Particle z coordinate in local frame
- set_force(i, fx, fy, fz)[source]
Sets the force vector of particle i
- Parameters
- iint64
Particle index
- fxfloat64
Particle force along x axis
- fyfloat64
Particle force along y axis
- fzfloat64
Particle force along z axis
- set_pos(i, x, y, z)[source]
Sets the position of particle i given x,y,z
- Parameters
- iint64
Particle index
- xfloat64
Particle position x value
- yfloat64
Particle position y value
- zfloat64
Particle position z value
- set_pos_local(i, xl, yl, zl)[source]
Sets the position of particle i in the local coordinate frame
- Parameters
- iint64
Particle index
- xlfloat64
Particle x position in local frame
- ylfloat64
Particle y position in local frame
- zlfloat64
Particle z position in local frame