#include <RadialDistributionFunctionInterceptor.h>
◆ RadialDistributionFunctionInterceptor()
RadialDistributionFunctionInterceptor::RadialDistributionFunctionInterceptor |
( |
double |
bin_width, |
|
|
double |
sample_every_x_percent |
|
) |
| |
|
inline |
◆ calculateLocalDensity()
double RadialDistributionFunctionInterceptor::calculateLocalDensity |
( |
size_t |
N, |
|
|
size_t |
bin_index |
|
) |
| const |
◆ logSummary()
void RadialDistributionFunctionInterceptor::logSummary |
( |
int |
depth | ) |
const |
|
overridevirtual |
Logs the summary of the radial distribution function.
Implements SimulationInterceptor.
Definition at line 31 of file RadialDistributionFunctionInterceptor.cpp.
32 std::string indent = std::string(depth * 2,
' ');
const std::string ansi_end
const std::string ansi_orange_bold
static std::shared_ptr< spdlog::logger > logger
Publically accessible shared pointer to the logger.
◆ onSimulationEnd()
void RadialDistributionFunctionInterceptor::onSimulationEnd |
( |
size_t |
iteration, |
|
|
Simulation & |
simulation |
|
) |
| |
|
overridevirtual |
This function is empty as the thermostat doesnt need to do anything at the end of the simulation.
- Parameters
-
iteration | The current iteration |
simulation | The simulation object |
Implements SimulationInterceptor.
Definition at line 27 of file RadialDistributionFunctionInterceptor.cpp.
void saveCurrentRadialDistribution(size_t iteration, Simulation &simulation)
◆ onSimulationStart()
void RadialDistributionFunctionInterceptor::onSimulationStart |
( |
Simulation & |
simulation | ) |
|
|
overridevirtual |
This function is sets the particle_updates to 0 and initializes the start time of the simulation.
- Parameters
-
simulation | The simulation object |
Implements SimulationInterceptor.
Definition at line 8 of file RadialDistributionFunctionInterceptor.cpp.
std::unique_ptr< CSVWriter > csv_writer
size_t every_nth_iteration
double delta_t
Time step of a single simulation iteration.
std::filesystem::path output_dir_path
Path to the directory in which to save the simulation output.
size_t start_iteration
Start iteration of the simulation.
double end_time
End time of the simulation.
const SimulationParams & params
Reference to the simulation parameters object.
std::string to_string(const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"})
◆ operator std::string()
RadialDistributionFunctionInterceptor::operator std::string |
( |
| ) |
const |
|
explicitoverridevirtual |
◆ operator()()
void RadialDistributionFunctionInterceptor::operator() |
( |
size_t |
iteration, |
|
|
Simulation & |
simulation |
|
) |
| |
|
overridevirtual |
◆ saveCurrentRadialDistribution()
void RadialDistributionFunctionInterceptor::saveCurrentRadialDistribution |
( |
size_t |
iteration, |
|
|
Simulation & |
simulation |
|
) |
| |
|
private |
Definition at line 52 of file RadialDistributionFunctionInterceptor.cpp.
53 std::map<size_t, size_t> samples_per_bin_index;
56 auto& particle = *it1;
58 auto& other_particle = *it2;
60 if (particle == other_particle)
continue;
64 size_t bin_index = std::floor(distance /
bin_width);
65 samples_per_bin_index[bin_index]++;
69 if (samples_per_bin_index.rbegin() != samples_per_bin_index.rend()) {
70 for (
size_t i = 0; i <= samples_per_bin_index.rbegin()->first; i++) {
71 if (samples_per_bin_index.find(i) == samples_per_bin_index.end()) {
72 samples_per_bin_index[i] = 0;
77 for (
auto& [bin_index, samples] : samples_per_bin_index) {
double calculateLocalDensity(size_t N, size_t bin_index) const
std::unique_ptr< ParticleContainer > particle_container
Reference to the ParticleContainer on whose content the simulation is performed.
auto L2Norm(const Container &c)
◆ bin_width
double RadialDistributionFunctionInterceptor::bin_width |
|
private |
◆ csv_writer
std::unique_ptr<CSVWriter> RadialDistributionFunctionInterceptor::csv_writer |
|
private |
◆ sample_every_x_percent
double RadialDistributionFunctionInterceptor::sample_every_x_percent |
|
private |
The documentation for this class was generated from the following files: