add namespaces and cmakelists for sub-dirs

This commit is contained in:
Dominik Demuth
2024-12-13 14:03:33 +01:00
parent e90c4c9543
commit e6331749b2
32 changed files with 604 additions and 440 deletions

View File

@ -4,34 +4,35 @@
#include <iostream>
namespace motions {
SmallAngle::SmallAngle(const double delta, const double eta, const double chi, std::mt19937_64 &rng) :
BaseMotion(std::string("IsotropicAngle"), delta, eta, rng), m_chi(chi * M_PI / 180.0) {};
SmallAngle::SmallAngle(std::mt19937_64 &rng) : BaseMotion(std::string("IsotropicAngle"), rng) {}
SmallAngle::SmallAngle(const double delta, const double eta, const double chi, std::mt19937_64 &rng) :
Motion(std::string("IsotropicAngle"), delta, eta, rng), m_chi(chi * M_PI / 180.0) {};
SmallAngle::SmallAngle(std::mt19937_64 &rng) : Motion(std::string("IsotropicAngle"), rng) {}
void SmallAngle::initialize() {
m_prev_pos = draw_position();
m_initial_omega = omega_q(m_prev_pos);
};
void SmallAngle::initialize() {
m_prev_pos = draw_position();
m_initial_omega = omega_q(m_prev_pos);
};
double SmallAngle::jump() {
const double gamma{2 * M_PI * m_uni_dist(m_rng)};
m_prev_pos = coordinates::rotate(m_prev_pos, m_chi, gamma);
double SmallAngle::jump() {
const double gamma{2 * M_PI * m_uni_dist(m_rng)};
m_prev_pos = rotate(m_prev_pos, m_chi, gamma);
return omega_q(m_prev_pos);
}
return omega_q(m_prev_pos);
}
void SmallAngle::setParameters(const std::unordered_map<std::string, double> &parameters) {
m_chi = parameters.at("angle") * M_PI / 180.0;
Motion::setParameters(parameters);
}
std::unordered_map<std::string, double> SmallAngle::getParameters() const {
auto parameter = Motion::getParameters();
parameter["angle"] = m_chi * 180 / M_PI;
return parameter;
}
std::string SmallAngle::toString() const {
return std::string{"IsotropicAngle/angle=" + std::to_string(m_chi * 180 / M_PI)};
void SmallAngle::setParameters(const std::unordered_map<std::string, double> &parameters) {
m_chi = parameters.at("angle") * M_PI / 180.0;
BaseMotion::setParameters(parameters);
}
std::unordered_map<std::string, double> SmallAngle::getParameters() const {
auto parameter = BaseMotion::getParameters();
parameter["angle"] = m_chi * 180 / M_PI;
return parameter;
}
std::string SmallAngle::toString() const {
return std::string{"IsotropicAngle/angle=" + std::to_string(m_chi * 180 / M_PI)};
}
}