ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ClusterAnalysis::Cluster Class Reference

Represents a single cluster of particles. More...

#include <Cluster.hpp>

+ Collaboration diagram for ClusterAnalysis::Cluster:

Public Member Functions

 Cluster (std::weak_ptr< BoxGeometry const > const &box_geo)
 
void add_particle (const Particle &p)
 add a particle to the cluster
 
Utils::Vector3d center_of_mass_subcluster (std::vector< int > const &particle_ids)
 Calculate the center of mass of the cluster.
 
Utils::Vector3d center_of_mass ()
 
double longest_distance ()
 Longest distance between any combination of two particles.
 
double radius_of_gyration ()
 Calculate radius of gyration of the cluster.
 
double radius_of_gyration_subcluster (std::vector< int > const &particle_ids)
 
std::pair< double, double > fractal_dimension (double dr)
 Calculate the fractal dimension N(r) via r^d, where N(r) counts the number of particles in a sphere of radius n, and d denotes the fractal dimension.
 

Public Attributes

std::vector< int > particles
 Ids of the particles in the cluster.
 

Detailed Description

Represents a single cluster of particles.

Definition at line 36 of file core/cluster_analysis/Cluster.hpp.

Constructor & Destructor Documentation

◆ Cluster()

ClusterAnalysis::Cluster::Cluster ( std::weak_ptr< BoxGeometry const > const &  box_geo)
inlineexplicit

Definition at line 38 of file core/cluster_analysis/Cluster.hpp.

Member Function Documentation

◆ add_particle()

void ClusterAnalysis::Cluster::add_particle ( const Particle p)
inline

add a particle to the cluster

Definition at line 43 of file core/cluster_analysis/Cluster.hpp.

References Particle::id(), and particles.

◆ center_of_mass()

Utils::Vector3d ClusterAnalysis::Cluster::center_of_mass ( )

Definition at line 46 of file Cluster.cpp.

References center_of_mass_subcluster(), and particles.

Referenced by fractal_dimension().

◆ center_of_mass_subcluster()

Utils::Vector3d ClusterAnalysis::Cluster::center_of_mass_subcluster ( std::vector< int > const &  particle_ids)

Calculate the center of mass of the cluster.

Definition at line 52 of file Cluster.cpp.

References get_particle_data(), Particle::mass(), particles, and Particle::pos().

Referenced by center_of_mass(), and radius_of_gyration_subcluster().

◆ fractal_dimension()

std::pair< double, double > ClusterAnalysis::Cluster::fractal_dimension ( double  dr)

Calculate the fractal dimension N(r) via r^d, where N(r) counts the number of particles in a sphere of radius n, and d denotes the fractal dimension.

The fitting is done by the Gnu Scientific Library.

Parameters
drincrement for when constructing the discrete version of N(r)
Returns
fractal dimension, rms error of the fit

Definition at line 138 of file Cluster.cpp.

References center_of_mass(), get_particle_data(), particles, radius_of_gyration_subcluster(), runtimeErrorMsg, and ClusterAnalysis::sort_indices().

◆ longest_distance()

double ClusterAnalysis::Cluster::longest_distance ( )

Longest distance between any combination of two particles.

Definition at line 84 of file Cluster.cpp.

References get_particle_data(), particles, and Particle::pos().

◆ radius_of_gyration()

double ClusterAnalysis::Cluster::radius_of_gyration ( )

Calculate radius of gyration of the cluster.

Definition at line 104 of file Cluster.cpp.

References particles, and radius_of_gyration_subcluster().

◆ radius_of_gyration_subcluster()

double ClusterAnalysis::Cluster::radius_of_gyration_subcluster ( std::vector< int > const &  particle_ids)

Member Data Documentation

◆ particles

std::vector<int> ClusterAnalysis::Cluster::particles

The documentation for this class was generated from the following files: