Line |
Branch |
Exec |
Source |
1 |
|
|
#pragma once |
2 |
|
|
|
3 |
|
|
#include "potentials.hpp" |
4 |
|
|
#include "types.hpp" |
5 |
|
|
#include <vector> |
6 |
|
|
|
7 |
|
|
class System; |
8 |
|
|
struct Particle; |
9 |
|
|
|
10 |
|
✗ |
class Clusterer : public PairFunction { |
11 |
|
|
public: |
12 |
|
|
std::vector<Particle> &particles; |
13 |
|
|
Vec L; |
14 |
|
|
double cutoff; |
15 |
|
|
double cutoffsq; |
16 |
|
|
std::vector<int> &particle2Coordination; |
17 |
|
|
std::vector<int> &particle2Cluster; |
18 |
|
|
std::map<int, std::list<int>> &cluster2Particles; |
19 |
|
|
|
20 |
|
|
Clusterer(std::vector<Particle> &particles, const Vec &L, double cutoff, |
21 |
|
|
std::vector<int> &particle2Coordination, std::vector<int> &particle2Cluster, |
22 |
|
|
std::map<int, std::list<int>> &cluster2Particles); |
23 |
|
|
void reset(); |
24 |
|
|
double operator()(Particle &p1, Particle &p2); |
25 |
|
|
}; |
26 |
|
|
|
27 |
|
|
class Percolation { |
28 |
|
|
public: |
29 |
|
|
System *system; |
30 |
|
|
double tLast; |
31 |
|
|
int numClusters; |
32 |
|
|
std::vector<int> coordinationCount; |
33 |
|
|
std::vector<int> clusterSizeCount; |
34 |
|
|
std::vector<int> particle2Coordination; |
35 |
|
|
std::vector<int> particle2Cluster; |
36 |
|
|
std::map<int, std::list<int>> cluster2Particles; |
37 |
|
|
|
38 |
|
|
Percolation(System *system); |
39 |
|
|
void update(); |
40 |
|
|
}; |
41 |
|
|
|