Particle-related classes¶
A simulation particle. |
|
A set of particles. |
|
A single configuration. |
-
class
baggianalysis.core.
Particle
(*args, **kwargs)¶ Bases:
pybind11_builtins.pybind11_object
A simulation particle.
Overloaded function.
__init__(self: baggianalysis.core.Particle, index: int) -> None
Build a new particle by specifying its index.
- Parameters
index (int) – The index of the particle. Note that this value cannot be changed later on.
__init__(self: baggianalysis.core.Particle, index: int, type: str) -> None
Build a new particle by specifying its index and type.
- Parameters
__init__(self: baggianalysis.core.Particle, index: int, type: str, position: glm::tvec3<scalar, P>) -> None
Build a new particle by specifying its index, type and position.
- Parameters
index (int) – The index of the particle. Note that this value cannot be changed later on.
type (str) – The type of the particle.
position (numpy.ndarray) – The position of the particle
__init__(self: baggianalysis.core.Particle, index: int, type: str, position: glm::tvec3<scalar, P>, velocity: glm::tvec3<scalar, P>) -> None
Build a new particle by specifying its index, type, position and velocity.
- Parameters
index (int) – The index of the particle. Note that this value cannot be changed later on.
type (str) – The type of the particle.
position (numpy.ndarray) – The position of the particle.
velocity (numpy.ndarray) – The velocity of the particle.
-
add_bonded_angle
(*args, **kwargs)¶ Overloaded function.
add_bonded_angle(self: baggianalysis.core.Particle, type: str, p1: baggianalysis.core.Particle, p2: baggianalysis.core.Particle, p3: baggianalysis.core.Particle) -> None
Add an angle of the given type (defined by three particles) this particle is involved in. Note that the current particle must be one of the three particles given as parameters.
- Parameters
add_bonded_angle(self: baggianalysis.core.Particle, p1: baggianalysis.core.Particle, p2: baggianalysis.core.Particle, p3: baggianalysis.core.Particle) -> None
Add an angle of the default type (defined by three particles) this particle is involved in. Note that the current particle must be one of the three particles given as parameters.
-
add_bonded_dihedral
(*args, **kwargs)¶ Overloaded function.
add_bonded_dihedral(self: baggianalysis.core.Particle, type: str, p1: baggianalysis.core.Particle, p2: baggianalysis.core.Particle, p3: baggianalysis.core.Particle, p4: baggianalysis.core.Particle) -> None
Add a dihedral of the given type (defined by four particles) this particle is involved in. Note that the current particle must be one of the four particles given as parameters.
- Parameters
type (str) – The type of the dihedral.
p1 (
Particle
) – The first particle participating in the dihedral.p2 (
Particle
) – The second particle participating in the dihedral.p3 (
Particle
) – The third particle participating in the dihedral.p4 (
Particle
) – The fourth particle participating in the dihedral.
add_bonded_dihedral(self: baggianalysis.core.Particle, p1: baggianalysis.core.Particle, p2: baggianalysis.core.Particle, p3: baggianalysis.core.Particle, p4: baggianalysis.core.Particle) -> None
Add a dihedral of the default type (defined by four particles) this particle is involved in. Note that the current particle must be one of the four particles given as parameters.
-
add_bonded_neighbour
(*args, **kwargs)¶ Overloaded function.
add_bonded_neighbour(self: baggianalysis.core.Particle, type: str, q: baggianalysis.core.Particle) -> None
Add a bond of the given type between the current particle and
q
.- Parameters
add_bonded_neighbour(self: baggianalysis.core.Particle, q: baggianalysis.core.Particle) -> None
Add a bond of the default type between the current particle and
q
.- Parameters
q (
Particle
) – The new bonded neighbour.
-
add_neighbour
(*args, **kwargs)¶ Overloaded function.
add_neighbour(self: baggianalysis.core.Particle, type: str, q: baggianalysis.core.Particle) -> None
Add particle
q
as a bond of the given type to the list of this particle’s neighbours. Contrary toadd_bonded_neighbour()
, the current particle is not added to the list ofq
’s neighbours.- Parameters
add_neighbour(self: baggianalysis.core.Particle, q: baggianalysis.core.Particle) -> None
Add particle
q
as a bond of the default type to the list of this particle’s neighbours. Contrary toadd_bonded_neighbour()
, the current particle is not added to the list ofq
’s neighbours.- Parameters
q (
Particle
) – The new neighbour.
-
add_orientation_vector
(self: baggianalysis.core.Particle, v: glm::tvec3<scalar, P>) → None¶ The molecule to which this particle belongs.
- Parameters
v (numpy.ndarray) – The new orientation vector.
-
property
bonded_angles
¶ A list of
ParticleSet
s storing the angles (i.e. triplets of particles) this particle is involved in.- Type
Set(
ParticleSet
)
-
property
bonded_dihedrals
¶ A list of
ParticleSet
s storing the dihedrals (i.e. list of four particles) this particle is involved in.- Type
Set(
ParticleSet
)
-
has_bonded_neighbour
(self: baggianalysis.core.Particle, q: baggianalysis.core.Particle) → bool¶ Check whether
q
is a bonded neighbour.
-
has_neighbour
(self: baggianalysis.core.Particle, q: baggianalysis.core.Particle) → bool¶ Check whether
q
is a neighbour.
-
property
index
¶ The particle’s index. This is a read-only property because changing the index of the particle should be done with the methods provided by
ParticleSet
andSystem
only.- type
int
-
make_copy
(self: baggianalysis.core.Particle, index: int) → baggianalysis.core.Particle¶ Return a copy of this particle with the given index. Note that neighbours and bonded neighbours, angles and dihedrals are not copied.
- Parameters
index (int) – The index of the new particle.
-
property
molecule
¶ The molecule to which this particle belongs.
- Type
-
property
orientation_vectors
¶ A list of vectors related to the particle’s orientation. Depending on the specific model it may contain the list of interaction centres or the components of the orientation matrix.
- type
List(numpy.ndarray)
-
property
position
¶ The particle’s position.
- Type
-
property
type
¶ The particle’s type.
- Type
string
-
property
velocity
¶ The particle’s velocity.
- Type
-
class
baggianalysis.core.
ParticleSet
(self: baggianalysis.core.ParticleSet) → None¶ Bases:
pybind11_builtins.pybind11_object
A set of particles.
-
N
(self: baggianalysis.core.ParticleSet) → int¶
-
add_particle
(self: baggianalysis.core.ParticleSet, arg0: baggianalysis.core.Particle) → None¶
-
average_velocity
(self: baggianalysis.core.ParticleSet) → glm::tvec3<scalar, P>¶
-
charge
(self: baggianalysis.core.ParticleSet) → float¶
-
charges
(self: baggianalysis.core.ParticleSet) → List[float]¶
-
com
(self: baggianalysis.core.ParticleSet) → glm::tvec3<scalar, P>¶
-
id_exists
(self: baggianalysis.core.ParticleSet, arg0: int) → bool¶
-
indexes
(self: baggianalysis.core.ParticleSet) → List[int]¶
-
mass
(self: baggianalysis.core.ParticleSet) → float¶
-
masses
(self: baggianalysis.core.ParticleSet) → List[float]¶
-
property
name
¶
-
particle_by_id
(self: baggianalysis.core.ParticleSet, arg0: int) → baggianalysis.core.Particle¶
-
particles
(self: baggianalysis.core.ParticleSet) → List[baggianalysis.core.Particle]¶
-
positions
(self: baggianalysis.core.ParticleSet) → List[glm::tvec3<scalar, P>]¶
-
remove_particle
(self: baggianalysis.core.ParticleSet, arg0: baggianalysis.core.Particle) → None¶
-
remove_particle_by_id
(self: baggianalysis.core.ParticleSet, arg0: int) → None¶
-
sort_particles_by_id
(self: baggianalysis.core.ParticleSet) → None¶
-
types
(self: baggianalysis.core.ParticleSet) → List[str]¶
-
velocities
(self: baggianalysis.core.ParticleSet) → List[glm::tvec3<scalar, P>]¶
-
-
class
baggianalysis.core.
System
(self: baggianalysis.core.System) → None¶ Bases:
baggianalysis.core.ParticleSet
A single configuration.
The constructor takes no arguments.
-
available_index
(self: baggianalysis.core.System) → int¶ Return a particle index that can be used in the context of this system (that is, that is not used by any of the particles already present in the system).
- Returns
A number that can be used as a valid index for a new particle.
- Return type
-
property
box
¶
-
bring_particles_in_box
(self: baggianalysis.core.System, shift_by_half_box: bool = False) → None¶ Bring the particles back into the box.
- Parameters
shift_by_half_box (bool) – If False (the default value) particles will have coordinates ranging from 0 to the length of the box side. If True, the coordinates will range between -box/2 and +box/2.
-
empty_copy
(self: baggianalysis.core.System) → baggianalysis.core.System¶ Return a copy of this system (same time and box, no particles).
-
molecules
(self: baggianalysis.core.System) → List[baggianalysis.core.ParticleSet]¶ Return all the molecules contained in the system in the form of a list of
ParticleSet
.- Returns
The list of molecules contained in the system.
- Return type
list(
ParticleSet
)
-
normalise_molecules
(self: baggianalysis.core.System) → None¶ Use periodic boundary conditions to shift particle positions so that bonded neighbours are always as close as possible to each other and not separated by distances that are multiple of box sides.
-
reindex_particles
(self: baggianalysis.core.System, base_idx: int) → None¶ Sort the particles by index and assign them new indexes so that the first and last ones are
base_index
andbase_index + N() - 1
, respectively.- Parameters
base_index (int) – The starting index that should be used.
-
rescale_lengths
(self: baggianalysis.core.System, factor: float) → None¶ Rescale all lengths (positions, velocities, box sides, etc.) by the given factor.
- Parameters
factor (float) – The rescaling factor.
-
property
time
¶
-