Class to compute the number of (coarse-grained) particles in a subregion of the simulation box.
>>> subregionparticles_instance = espressopp.analysis.NPartSubregion(system, parttype=1, span=0.75, geometry=1, center=[Lx/2, Ly/2, Lz/2]) >>> # creates instance of the class for calculating number of particles of type 1 in a subregion centered in the simulation box and bounded within +-0.75 in x-direction from the center
>>> number_of_particles = subregionparticles_instance.compute() >>> # computes the number of particles in subregion of the simulation box
NPartSubregion(system, parttype, span, geometry, center)¶
Constructs the NPartSubregion object.
- system (shared_ptr<System>) – system object
- parttype (int) – particle type to be considered for particle number calculation
- span (real) – radius of the subregion to be considered
- geometry (str in ['spherical', 'bounded-x', 'bounded-y', 'bounded-z']) – geometry of the subregion. Can only be in [‘spherical’, ‘bounded-x’, ‘bounded-y’, ‘bounded-z’]
- center (list of 3 reals (x,y,z coordinates of center)) – center of the subregion
Calculates the number of particles in defined subregion.
Return type: int
NPartSubregionLocal(system, parttype, span, geometry, center)¶
The (local) class for computing the number of particles in a subregion of the system.