From adf60bac61bb6ea7d6076f3bbf5ed7c0bf8b875c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Fri, 9 Jun 2017 15:55:34 -0400 Subject: [PATCH 01/75] Adds history_interaction_test, which tests the interaction between two dots. It currently simulates the interaction using Quest, but needs analytic values to compare with. --- test/CMakeLists.txt | 3 ++- test/history_interaction_test.cpp | 36 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 test/history_interaction_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7249794f..ff1b8235 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,8 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/history_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/greens_function_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" - ) + ) target_link_libraries(qtest PUBLIC libquest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp new file mode 100644 index 00000000..b78b556f --- /dev/null +++ b/test/history_interaction_test.cpp @@ -0,0 +1,36 @@ +#include "../src/interactions/history_interaction.h" +#include +#include + +BOOST_AUTO_TEST_SUITE(history_interaction) + +BOOST_AUTO_TEST_CASE(greens_function_coefficients) +{ + Eigen::Vector3d pos1(0, 0, 0); + Eigen::Vector3d pos2(1, 1, 1); + const std::pair damping(1, 1); + const double freq = 2278.9013; + const Eigen::Vector3d dip(1, 2, 3); + + QuantumDot qd1(pos1, freq, damping, dip); + QuantumDot qd2(pos2, freq, damping, dip); + + DotVector dots_vec = {qd1,qd2}; + auto dots = std::make_shared(dots_vec); + + auto history(History::make_shared_history(2, 22, 1)); + for(int dot_idx=0; dot_idx<2; ++dot_idx) { + for(int time_idx=-22; time_idx<=0; ++time_idx) { + (*history)[dot_idx][time_idx][0] = History::soltype(1, 0); + } + } + + auto dyadic(std::make_shared( + GreenFunction::Dyadic(1, 2, 1))); + auto hist_inter = HistoryInteraction(dots, history, dyadic, 1, 1, 1); + + auto result = hist_inter.evaluate(1); + std::cout << result << std::endl; +} + +BOOST_AUTO_TEST_SUITE_END() From 49ebd2d5b294acd52b5814f20cb5347d54eb4da2 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Mon, 12 Jun 2017 15:31:13 -0400 Subject: [PATCH 02/75] changed name of the test in history-interaction_test to history_interaction --- test/history_interaction_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index b78b556f..d6a1fae2 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -4,7 +4,7 @@ BOOST_AUTO_TEST_SUITE(history_interaction) -BOOST_AUTO_TEST_CASE(greens_function_coefficients) +BOOST_AUTO_TEST_CASE(history_interaction) { Eigen::Vector3d pos1(0, 0, 0); Eigen::Vector3d pos2(1, 1, 1); From f30792a4ae9d5d0222488ad8aa02e7523b08c274 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 14 Jun 2017 16:19:53 -0400 Subject: [PATCH 03/75] added analytic values to history_interaction_test and used boost to compare them to sim results. Changed a path in CMakelists in test dir. --- test/CMakeLists.txt | 2 +- test/history_interaction_test.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff1b8235..36056e0f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,7 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/history_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/greens_function_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/history_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" ) target_link_libraries(qtest PUBLIC libquest ${Boost_LIBRARIES}) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index d6a1fae2..24748b25 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -1,6 +1,5 @@ #include "../src/interactions/history_interaction.h" #include -#include BOOST_AUTO_TEST_SUITE(history_interaction) @@ -21,7 +20,7 @@ BOOST_AUTO_TEST_CASE(history_interaction) auto history(History::make_shared_history(2, 22, 1)); for(int dot_idx=0; dot_idx<2; ++dot_idx) { for(int time_idx=-22; time_idx<=0; ++time_idx) { - (*history)[dot_idx][time_idx][0] = History::soltype(1, 0); + (*history)[dot_idx][time_idx][0] = History::soltype(1, 1); } } @@ -30,7 +29,10 @@ BOOST_AUTO_TEST_CASE(history_interaction) auto hist_inter = HistoryInteraction(dots, history, dyadic, 1, 1, 1); auto result = hist_inter.evaluate(1); - std::cout << result << std::endl; + const std::vector compare_array = {-2.6953857109, -2.6953857109}; + + BOOST_CHECK_CLOSE(result(0).real(),compare_array.at(0),1e-6); + BOOST_CHECK_CLOSE(result(1).real(),compare_array.at(1),1e-6); } BOOST_AUTO_TEST_SUITE_END() From 1145078a19f83d5a11a168b068367cd88dfa052c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 14 Jun 2017 16:30:33 -0400 Subject: [PATCH 04/75] Revert "Merge pull request #1 from jackhamel16/development" From 012ed44f8271682d67e1649cb8c3773568037a02 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 15 Jun 2017 16:15:23 -0400 Subject: [PATCH 05/75] Ran Clang-format on history_interaction_test.cpp. --- test/history_interaction_test.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index 24748b25..f3c8e6af 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -14,25 +14,25 @@ BOOST_AUTO_TEST_CASE(history_interaction) QuantumDot qd1(pos1, freq, damping, dip); QuantumDot qd2(pos2, freq, damping, dip); - DotVector dots_vec = {qd1,qd2}; + DotVector dots_vec = {qd1, qd2}; auto dots = std::make_shared(dots_vec); auto history(History::make_shared_history(2, 22, 1)); - for(int dot_idx=0; dot_idx<2; ++dot_idx) { - for(int time_idx=-22; time_idx<=0; ++time_idx) { + for(int dot_idx = 0; dot_idx < 2; ++dot_idx) { + for(int time_idx = -22; time_idx <= 0; ++time_idx) { (*history)[dot_idx][time_idx][0] = History::soltype(1, 1); } } - auto dyadic(std::make_shared( - GreenFunction::Dyadic(1, 2, 1))); + auto dyadic( + std::make_shared(GreenFunction::Dyadic(1, 2, 1))); auto hist_inter = HistoryInteraction(dots, history, dyadic, 1, 1, 1); auto result = hist_inter.evaluate(1); const std::vector compare_array = {-2.6953857109, -2.6953857109}; - BOOST_CHECK_CLOSE(result(0).real(),compare_array.at(0),1e-6); - BOOST_CHECK_CLOSE(result(1).real(),compare_array.at(1),1e-6); + BOOST_CHECK_CLOSE(result(0).real(), compare_array.at(0), 1e-6); + BOOST_CHECK_CLOSE(result(1).real(), compare_array.at(1), 1e-6); } BOOST_AUTO_TEST_SUITE_END() From ffcb612acde47bd46310a3eb96afb03673534492 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 10:13:48 -0400 Subject: [PATCH 06/75] Move integrator stuff to separate dir --- src/CMakeLists.txt | 3 +-- src/integrator/CMakeLists.txt | 5 +++++ src/{ => integrator}/integrator.cpp | 0 src/{ => integrator}/integrator.h | 6 +++--- src/main.cpp | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 src/integrator/CMakeLists.txt rename src/{ => integrator}/integrator.cpp (100%) rename src/{ => integrator}/integrator.h (93%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38fb83be..ae08db61 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/interactions/CMakeLists.txt") +include("${CMAKE_CURRENT_LIST_DIR}/integrator/CMakeLists.txt") target_sources(quest PRIVATE @@ -7,8 +8,6 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/configuration.h" "${CMAKE_CURRENT_LIST_DIR}/history.cpp" "${CMAKE_CURRENT_LIST_DIR}/history.h" - "${CMAKE_CURRENT_LIST_DIR}/integrator.cpp" - "${CMAKE_CURRENT_LIST_DIR}/integrator.h" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set.h" "${CMAKE_CURRENT_LIST_DIR}/math_utils.cpp" diff --git a/src/integrator/CMakeLists.txt b/src/integrator/CMakeLists.txt new file mode 100644 index 00000000..397a4741 --- /dev/null +++ b/src/integrator/CMakeLists.txt @@ -0,0 +1,5 @@ +target_sources(quest + PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/integrator.cpp" + "${CMAKE_CURRENT_LIST_DIR}/integrator.h" +) diff --git a/src/integrator.cpp b/src/integrator/integrator.cpp similarity index 100% rename from src/integrator.cpp rename to src/integrator/integrator.cpp diff --git a/src/integrator.h b/src/integrator/integrator.h similarity index 93% rename from src/integrator.h rename to src/integrator/integrator.h index 028b4680..4096c3b7 100644 --- a/src/integrator.h +++ b/src/integrator/integrator.h @@ -8,9 +8,9 @@ #include #include -#include "history.h" -#include "interactions/pulse_interaction.h" -#include "math_utils.h" +#include "../history.h" +#include "../interactions/pulse_interaction.h" +#include "../math_utils.h" namespace PredictorCorrector { class Weights; diff --git a/src/main.cpp b/src/main.cpp index e6325545..6b4cb3a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,7 +7,7 @@ #include "configuration.h" #include "history.h" -#include "integrator.h" +#include "integrator/integrator.h" #include "interactions/history_interaction.h" #include "interactions/pulse_interaction.h" #include "interactions/rotating_green_function.h" From 48022b301578f1cbd1223356a533435bb4852311 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 10:49:00 -0400 Subject: [PATCH 07/75] Flesh out RHS 'interface' --- src/integrator/RHS/ode_rhs.h | 25 +++++++++++++++++++++++++ src/integrator/RHS/rhs.h | 19 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/integrator/RHS/ode_rhs.h create mode 100644 src/integrator/RHS/rhs.h diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h new file mode 100644 index 00000000..b9a83a4a --- /dev/null +++ b/src/integrator/RHS/ode_rhs.h @@ -0,0 +1,25 @@ +#ifndef ODE_RHS_H +#define ODE_RHS_H + +#include +#include "rhs.h" + +namespace Integrator { + class ODE_RHS; +} + +class Integrator::ODE_RHS : public RHS { + public: + ODE_RHS(double dt) : RHS(dt){}; + double operator()(const double &, const int) const; + + private: +}; + +double Integrator::ODE_RHS::operator()(const double &f, const int n) const +{ + const double time = n * dt; + return 1 / (1 + std::exp(-(time - 10))) + f; +} + +#endif diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h new file mode 100644 index 00000000..5fd42a3f --- /dev/null +++ b/src/integrator/RHS/rhs.h @@ -0,0 +1,19 @@ +#ifndef RHS_H +#define RHS_H + +namespace Integrator { + template + class RHS; +} + +template +class Integrator::RHS { + public: + RHS(const double dt) : dt(dt) {}; + virtual soltype operator()(const soltype &, const int) const = 0; + + protected: + double dt; +}; + +#endif From e3165b1a0bae5fdac509d962999a1eb8abd47393 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 11:22:54 -0400 Subject: [PATCH 08/75] (WIP) Begin templating integrator --- src/integrator/integrator.cpp | 216 --------------------------------- src/integrator/integrator.h | 218 +++++++++++++++++++++++++++++++++- 2 files changed, 216 insertions(+), 218 deletions(-) delete mode 100644 src/integrator/integrator.cpp diff --git a/src/integrator/integrator.cpp b/src/integrator/integrator.cpp deleted file mode 100644 index 64681a0c..00000000 --- a/src/integrator/integrator.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include "integrator.h" - -constexpr int NUM_CORRECTOR_STEPS = 10; - -std::complex semidisk(const double t) -{ - const std::complex iu(0, 1); - - if(0 <= t && t < 1) return iu * t; - if(1 <= t && t < M_PI + 1) return std::exp(iu * (t + M_PI_2 - 1)); - if(M_PI + 1 <= t && t < M_PI + 2) return iu * (t - (M_PI + 2)); - - return 0; -} - -class WeightsBuilder { - public: - WeightsBuilder(const int, const int, const double); - - Eigen::VectorXd predictors() { return compute_coeff(predictor_matrix()); } - Eigen::VectorXd correctors() { return compute_coeff(corrector_matrix()); } - private: - Eigen::VectorXcd lambdas; - Eigen::VectorXd times; - double timestep, future_time; - - Eigen::MatrixXcd predictor_matrix() const; - Eigen::MatrixXcd corrector_matrix() const; - Eigen::VectorXcd rhs_vector() const; - - Eigen::VectorXd compute_coeff(const Eigen::MatrixXcd &) const; -}; - -WeightsBuilder::WeightsBuilder(const int n_lambda, const int n_time, - const double radius) - : lambdas(n_lambda), - times(Eigen::VectorXd::LinSpaced(n_time, -1, 1)), - timestep(2.0 / (n_time - 1)), - future_time(1 + timestep) -{ - Eigen::VectorXd xs(Eigen::VectorXd::LinSpaced(n_lambda + 1, 0, M_PI + 2)); - for(int i = 0; i < n_lambda; ++i) lambdas[i] = radius * semidisk(xs[i]); -} - -Eigen::MatrixXcd WeightsBuilder::predictor_matrix() const -{ - Eigen::MatrixXcd result(lambdas.size(), 2 * times.size()); - - const Eigen::ArrayXXcd b((lambdas * times.transpose()).array().exp()); - - result.block(0, 0, lambdas.size(), times.size()) = b; - result.block(0, times.size(), lambdas.size(), times.size()) = - b.colwise() * lambdas.array(); - - return result; -} - -Eigen::MatrixXcd WeightsBuilder::corrector_matrix() const -{ - Eigen::MatrixXcd result(lambdas.size(), 2 * times.size() + 1); - - result.block(0, 0, lambdas.size(), 2 * times.size()) = predictor_matrix(); - result.block(0, 2 * times.size(), lambdas.size(), 1) = - lambdas.array() * rhs_vector().array(); - - return result; -} - -Eigen::VectorXcd WeightsBuilder::rhs_vector() const -{ - Eigen::ArrayXcd b(lambdas * future_time); - return b.exp(); -} - -Eigen::VectorXd WeightsBuilder::compute_coeff(const Eigen::MatrixXcd &mat) const -{ - Eigen::JacobiSVD decomp = - mat.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV); - - Eigen::VectorXcd b(rhs_vector()), least_squares(decomp.solve(b)); - - return least_squares.real(); -} - -PredictorCorrector::Weights::Weights(const int n_lambda, const int n_time, - const double radius) - : n_time(n_time) -{ - const double step_factor = (n_time - 1) / 2.0; - WeightsBuilder builder(n_lambda, n_time, radius); - - Eigen::VectorXd predictors(builder.predictors()); - Eigen::VectorXd correctors(builder.correctors()); - - // Eigen defaults to column major, hence the (n_time x 2) ordering - ps = Eigen::Map(predictors.data(), n_time, 2).transpose(); - cs = Eigen::Map(correctors.data(), n_time, 2).transpose(); - - ps.row(1) *= step_factor; - cs.row(1) *= step_factor; - future_coef = correctors(2 * n_time) * step_factor; -} - -PredictorCorrector::Integrator::Integrator( - const double dt, const int n_lambda, const int n_time, const double radius, - const std::shared_ptr &history, - const std::vector &rhs_funcs, - std::vector> interactions) - : num_solutions(rhs_funcs.size()), - time_idx_ubound(history->index_bases()[1] + history->shape()[1]), - dt(dt), - weights(n_lambda, n_time, radius), - history(history), - rhs_funcs(rhs_funcs), - interactions(std::move(interactions)) -{ - assert(rhs_funcs.size() == history->shape()[0]); -} - -void PredictorCorrector::Integrator::solve() const -{ - for(int step = 0; step < time_idx_ubound; ++step) { - solve_step(step); - log_percentage_complete(step); - throw_if_unbounded_solution(step); - } -} - -void PredictorCorrector::Integrator::solve_step(const int step) const -{ - assert(0 <= step && step < time_idx_ubound); - - predictor(step); - evaluator(step); - - for(int m = 0; m < NUM_CORRECTOR_STEPS; ++m) { - corrector(step); - evaluator(step); - } -} - -void PredictorCorrector::Integrator::predictor(const int step) const -{ - const int start = step - weights.width(); - - for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - (*history)[sol_idx][step][0].setZero(); - for(int h = 0; h < static_cast(weights.width()); ++h) { - (*history)[sol_idx][step][0] += - (*history)[sol_idx][start + h][0] * weights.ps(0, h) + - (*history)[sol_idx][start + h][1] * weights.ps(1, h) * dt; - } - } -} - -void PredictorCorrector::Integrator::corrector(const int step) const -{ - const int start = step - weights.width(); - - for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - (*history)[sol_idx][step][0] = - weights.future_coef * (*history)[sol_idx][step][1] * dt; - for(int h = 0; h < static_cast(weights.width()); ++h) { - (*history)[sol_idx][step][0] += - (*history)[sol_idx][start + h][0] * weights.cs(0, h) + - (*history)[sol_idx][start + h][1] * weights.cs(1, h) * dt; - } - } -} - -void PredictorCorrector::Integrator::evaluator(const int step) const -{ - auto projected_efields = - std::accumulate(interactions.begin(), interactions.end(), - Interaction::ResultArray::Zero(num_solutions, 1).eval(), - [step](const Interaction::ResultArray &r, - const std::shared_ptr &interaction) { - return r + interaction->evaluate(step); - }); - - for(int solution = 0; solution < num_solutions; ++solution) { - (*history)[solution][step][1] = rhs_funcs[solution]( - (*history)[solution][step][0], projected_efields[solution]); - } -} - -bool PredictorCorrector::Integrator::all_finite(const int step) const -{ - for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - History::soltype &sol = (*history)[sol_idx][step][0]; - History::soltype &dsol = (*history)[sol_idx][step][1]; - - if(!History::isfinite(sol) || !History::isfinite(dsol)) { - return false; - } - } - return true; -} - -void PredictorCorrector::Integrator::throw_if_unbounded_solution( - const int step) const -{ - if(!all_finite(step)) { - const std::string msg = "unbounded history values at or before step "; - throw std::domain_error(msg + std::to_string(step)); - } -} - -void PredictorCorrector::Integrator::log_percentage_complete( - const int step) const -{ - if(step % (time_idx_ubound / 10) == 0) { - std::cout << "\t" << static_cast(step) / time_idx_ubound - << std::endl; - } -} diff --git a/src/integrator/integrator.h b/src/integrator/integrator.h index 4096c3b7..4b4b04f9 100644 --- a/src/integrator/integrator.h +++ b/src/integrator/integrator.h @@ -16,8 +16,7 @@ namespace PredictorCorrector { class Weights; class Integrator; - typedef std::function - rhs_func; + typedef std::function rhs_func; } class PredictorCorrector::Weights { @@ -58,4 +57,219 @@ class PredictorCorrector::Integrator { void log_percentage_complete(const int) const; }; +constexpr int NUM_CORRECTOR_STEPS = 10; + +std::complex semidisk(const double t) +{ + const std::complex iu(0, 1); + + if(0 <= t && t < 1) return iu * t; + if(1 <= t && t < M_PI + 1) return std::exp(iu * (t + M_PI_2 - 1)); + if(M_PI + 1 <= t && t < M_PI + 2) return iu * (t - (M_PI + 2)); + + return 0; +} + +class WeightsBuilder { + public: + WeightsBuilder(const int, const int, const double); + + Eigen::VectorXd predictors() { return compute_coeff(predictor_matrix()); } + Eigen::VectorXd correctors() { return compute_coeff(corrector_matrix()); } + private: + Eigen::VectorXcd lambdas; + Eigen::VectorXd times; + double timestep, future_time; + + Eigen::MatrixXcd predictor_matrix() const; + Eigen::MatrixXcd corrector_matrix() const; + Eigen::VectorXcd rhs_vector() const; + + Eigen::VectorXd compute_coeff(const Eigen::MatrixXcd &) const; +}; + +WeightsBuilder::WeightsBuilder(const int n_lambda, const int n_time, + const double radius) + : lambdas(n_lambda), + times(Eigen::VectorXd::LinSpaced(n_time, -1, 1)), + timestep(2.0 / (n_time - 1)), + future_time(1 + timestep) +{ + Eigen::VectorXd xs(Eigen::VectorXd::LinSpaced(n_lambda + 1, 0, M_PI + 2)); + for(int i = 0; i < n_lambda; ++i) lambdas[i] = radius * semidisk(xs[i]); +} + +Eigen::MatrixXcd WeightsBuilder::predictor_matrix() const +{ + Eigen::MatrixXcd result(lambdas.size(), 2 * times.size()); + + const Eigen::ArrayXXcd b((lambdas * times.transpose()).array().exp()); + + result.block(0, 0, lambdas.size(), times.size()) = b; + result.block(0, times.size(), lambdas.size(), times.size()) = + b.colwise() * lambdas.array(); + + return result; +} + +Eigen::MatrixXcd WeightsBuilder::corrector_matrix() const +{ + Eigen::MatrixXcd result(lambdas.size(), 2 * times.size() + 1); + + result.block(0, 0, lambdas.size(), 2 * times.size()) = predictor_matrix(); + result.block(0, 2 * times.size(), lambdas.size(), 1) = + lambdas.array() * rhs_vector().array(); + + return result; +} + +Eigen::VectorXcd WeightsBuilder::rhs_vector() const +{ + Eigen::ArrayXcd b(lambdas * future_time); + return b.exp(); +} + +Eigen::VectorXd WeightsBuilder::compute_coeff(const Eigen::MatrixXcd &mat) const +{ + Eigen::JacobiSVD decomp = + mat.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV); + + Eigen::VectorXcd b(rhs_vector()), least_squares(decomp.solve(b)); + + return least_squares.real(); +} + +PredictorCorrector::Weights::Weights(const int n_lambda, const int n_time, + const double radius) + : n_time(n_time) +{ + const double step_factor = (n_time - 1) / 2.0; + WeightsBuilder builder(n_lambda, n_time, radius); + + Eigen::VectorXd predictors(builder.predictors()); + Eigen::VectorXd correctors(builder.correctors()); + + // Eigen defaults to column major, hence the (n_time x 2) ordering + ps = Eigen::Map(predictors.data(), n_time, 2).transpose(); + cs = Eigen::Map(correctors.data(), n_time, 2).transpose(); + + ps.row(1) *= step_factor; + cs.row(1) *= step_factor; + future_coef = correctors(2 * n_time) * step_factor; +} + +PredictorCorrector::Integrator::Integrator( + const double dt, const int n_lambda, const int n_time, const double radius, + const std::shared_ptr &history, + const std::vector &rhs_funcs, + std::vector> interactions) + : num_solutions(rhs_funcs.size()), + time_idx_ubound(history->index_bases()[1] + history->shape()[1]), + dt(dt), + weights(n_lambda, n_time, radius), + history(history), + rhs_funcs(rhs_funcs), + interactions(std::move(interactions)) +{ + assert(rhs_funcs.size() == history->shape()[0]); +} + +void PredictorCorrector::Integrator::solve() const +{ + for(int step = 0; step < time_idx_ubound; ++step) { + solve_step(step); + log_percentage_complete(step); + throw_if_unbounded_solution(step); + } +} + +void PredictorCorrector::Integrator::solve_step(const int step) const +{ + assert(0 <= step && step < time_idx_ubound); + + predictor(step); + evaluator(step); + + for(int m = 0; m < NUM_CORRECTOR_STEPS; ++m) { + corrector(step); + evaluator(step); + } +} + +void PredictorCorrector::Integrator::predictor(const int step) const +{ + const int start = step - weights.width(); + + for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { + (*history)[sol_idx][step][0].setZero(); + for(int h = 0; h < static_cast(weights.width()); ++h) { + (*history)[sol_idx][step][0] += + (*history)[sol_idx][start + h][0] * weights.ps(0, h) + + (*history)[sol_idx][start + h][1] * weights.ps(1, h) * dt; + } + } +} + +void PredictorCorrector::Integrator::corrector(const int step) const +{ + const int start = step - weights.width(); + + for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { + (*history)[sol_idx][step][0] = + weights.future_coef * (*history)[sol_idx][step][1] * dt; + for(int h = 0; h < static_cast(weights.width()); ++h) { + (*history)[sol_idx][step][0] += + (*history)[sol_idx][start + h][0] * weights.cs(0, h) + + (*history)[sol_idx][start + h][1] * weights.cs(1, h) * dt; + } + } +} + +void PredictorCorrector::Integrator::evaluator(const int step) const +{ + auto projected_efields = + std::accumulate(interactions.begin(), interactions.end(), + Interaction::ResultArray::Zero(num_solutions, 1).eval(), + [step](const Interaction::ResultArray &r, + const std::shared_ptr &interaction) { + return r + interaction->evaluate(step); + }); + + for(int solution = 0; solution < num_solutions; ++solution) { + (*history)[solution][step][1] = rhs_funcs[solution]( + (*history)[solution][step][0], projected_efields[solution]); + } +} + +bool PredictorCorrector::Integrator::all_finite(const int step) const +{ + for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { + History::soltype &sol = (*history)[sol_idx][step][0]; + History::soltype &dsol = (*history)[sol_idx][step][1]; + + if(!History::isfinite(sol) || !History::isfinite(dsol)) { + return false; + } + } + return true; +} + +void PredictorCorrector::Integrator::throw_if_unbounded_solution( + const int step) const +{ + if(!all_finite(step)) { + const std::string msg = "unbounded history values at or before step "; + throw std::domain_error(msg + std::to_string(step)); + } +} + +void PredictorCorrector::Integrator::log_percentage_complete( + const int step) const +{ + if(step % (time_idx_ubound / 10) == 0) { + std::cout << "\t" << static_cast(step) / time_idx_ubound + << std::endl; + } +} + #endif From 9d3fd6c5aee184870ac551ecd06579f3eccd6baa Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 12:12:04 -0400 Subject: [PATCH 09/75] (WIP) Rejigger RHS to use history array --- src/integrator/RHS/ode_rhs.h | 13 +++++++++---- src/integrator/RHS/rhs.h | 8 ++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h index b9a83a4a..dbd05b34 100644 --- a/src/integrator/RHS/ode_rhs.h +++ b/src/integrator/RHS/ode_rhs.h @@ -10,16 +10,21 @@ namespace Integrator { class Integrator::ODE_RHS : public RHS { public: - ODE_RHS(double dt) : RHS(dt){}; - double operator()(const double &, const int) const; + ODE_RHS(const double dt, + const std::shared_ptr &history) + : RHS(dt, history){}; + virtual void evaluate(const int); private: }; -double Integrator::ODE_RHS::operator()(const double &f, const int n) const +void Integrator::ODE_RHS::evaluate(const int n) const { const double time = n * dt; - return 1 / (1 + std::exp(-(time - 10))) + f; + for(int i = 0; i < history->shape()[0]; ++i) { + (*history)[i][n][1] = + 1 / (1 + std::exp(-(time - 10))) + (*history)[i][n][0]; + } } #endif diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index 5fd42a3f..2e8ce2f6 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -1,6 +1,8 @@ #ifndef RHS_H #define RHS_H +#include + namespace Integrator { template class RHS; @@ -9,11 +11,13 @@ namespace Integrator { template class Integrator::RHS { public: - RHS(const double dt) : dt(dt) {}; - virtual soltype operator()(const soltype &, const int) const = 0; + RHS(const double dt, const std::shared_ptr &history) + : dt(dt), history(history){}; + virtual void evaluate(const int) = 0; protected: double dt; + std::shared_ptr history; }; #endif From a14211630b9391801702ada07f0bf752b4769974 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 12:13:19 -0400 Subject: [PATCH 10/75] Move History stuff to integrator The integrator kind of defines the history and everything Integrator is built to use a history, so it makes sense to put it together. Moreover the History will shortly become templated (and will thus have to match the other Integrator stuff) --- src/{ => integrator}/history.cpp | 0 src/{ => integrator}/history.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => integrator}/history.cpp (100%) rename src/{ => integrator}/history.h (100%) diff --git a/src/history.cpp b/src/integrator/history.cpp similarity index 100% rename from src/history.cpp rename to src/integrator/history.cpp diff --git a/src/history.h b/src/integrator/history.h similarity index 100% rename from src/history.h rename to src/integrator/history.h From 0a50779cb0085cd3108fc0916516fea2968f4623 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 12:15:31 -0400 Subject: [PATCH 11/75] Move history code into .h file (due to imminent template) --- src/integrator/history.cpp | 34 ---------------------------------- src/integrator/history.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 src/integrator/history.cpp diff --git a/src/integrator/history.cpp b/src/integrator/history.cpp deleted file mode 100644 index 0b3bc625..00000000 --- a/src/integrator/history.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "history.h" - -std::shared_ptr History::make_shared_history( - const int num_particles, const int window, const int num_timesteps) -{ - const History::HistoryArray::extent_range time_range(-window, num_timesteps); - return std::make_shared( - boost::extents[num_particles][time_range][2]); -} - -bool History::isfinite(const soltype &sol) -{ - return std::isfinite(sol[0].real()) && std::isfinite(sol[0].imag()) && - std::isfinite(sol[1].real()) && std::isfinite(sol[1].imag()); -} - -void History::write_history( - const std::shared_ptr &history, - const std::string &filename, const int n /* = 0 */) -{ - std::ofstream output(filename); - output << std::setprecision(12) << std::scientific; - - const int max_t = - (n != 0) ? n : history->shape()[1] + history->index_bases()[1]; - - for(int t = 0; t < max_t; ++t) { - for(int sol_idx = 0; sol_idx < static_cast(history->shape()[0]); - ++sol_idx) { - output << (*history)[sol_idx][t][0].transpose() << " "; - } - output << std::endl; - } -} diff --git a/src/integrator/history.h b/src/integrator/history.h index b4676eaf..938a975e 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -21,3 +21,37 @@ namespace History { } #endif +#include "history.h" + +std::shared_ptr History::make_shared_history( + const int num_particles, const int window, const int num_timesteps) +{ + const History::HistoryArray::extent_range time_range(-window, num_timesteps); + return std::make_shared( + boost::extents[num_particles][time_range][2]); +} + +bool History::isfinite(const soltype &sol) +{ + return std::isfinite(sol[0].real()) && std::isfinite(sol[0].imag()) && + std::isfinite(sol[1].real()) && std::isfinite(sol[1].imag()); +} + +void History::write_history( + const std::shared_ptr &history, + const std::string &filename, const int n /* = 0 */) +{ + std::ofstream output(filename); + output << std::setprecision(12) << std::scientific; + + const int max_t = + (n != 0) ? n : history->shape()[1] + history->index_bases()[1]; + + for(int t = 0; t < max_t; ++t) { + for(int sol_idx = 0; sol_idx < static_cast(history->shape()[0]); + ++sol_idx) { + output << (*history)[sol_idx][t][0].transpose() << " "; + } + output << std::endl; + } +} From 8f09b65796f7d2b122c93d9b7b5dcb42dd07e575 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 12:37:52 -0400 Subject: [PATCH 12/75] Correctly template History stuff --- src/integrator/history.h | 83 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/src/integrator/history.h b/src/integrator/history.h index 938a975e..f04c8175 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -1,57 +1,58 @@ #ifndef HISTORY_H #define HISTORY_H -#include #include -#include -#include #include +#include #include #include -namespace History { - typedef Eigen::Vector2cd soltype; - typedef boost::multi_array HistoryArray; +namespace Integrator { + template + class History; - std::shared_ptr make_shared_history(const int, const int, - const int); - bool isfinite(const soltype &); - void write_history(const std::shared_ptr &, - const std::string &, const int = 0); + template + using soltype_array = boost::multi_array; } -#endif -#include "history.h" +template +class Integrator::History { + public: + History(const int, const int, const int); + soltype_array history; -std::shared_ptr History::make_shared_history( - const int num_particles, const int window, const int num_timesteps) -{ - const History::HistoryArray::extent_range time_range(-window, num_timesteps); - return std::make_shared( - boost::extents[num_particles][time_range][2]); -} + private: +}; -bool History::isfinite(const soltype &sol) -{ - return std::isfinite(sol[0].real()) && std::isfinite(sol[0].imag()) && - std::isfinite(sol[1].real()) && std::isfinite(sol[1].imag()); -} +template +Integrator::History::History(const int num_particles, const int window, + const int num_timesteps) + : history( + boost::extents[num_particles] + [typename soltype_array::extent_range(-window, num_timesteps)] + [2]) -void History::write_history( - const std::shared_ptr &history, - const std::string &filename, const int n /* = 0 */) { - std::ofstream output(filename); - output << std::setprecision(12) << std::scientific; - - const int max_t = - (n != 0) ? n : history->shape()[1] + history->index_bases()[1]; - - for(int t = 0; t < max_t; ++t) { - for(int sol_idx = 0; sol_idx < static_cast(history->shape()[0]); - ++sol_idx) { - output << (*history)[sol_idx][t][0].transpose() << " "; - } - output << std::endl; - } } + + +//void History::write_history( + //const std::shared_ptr &history, + //const std::string &filename, const int n [> = 0 <]) +//{ + //std::ofstream output(filename); + //output << std::setprecision(12) << std::scientific; + + //const int max_t = + //(n != 0) ? n : history->shape()[1] + history->index_bases()[1]; + + //for(int t = 0; t < max_t; ++t) { + //for(int sol_idx = 0; sol_idx < static_cast(history->shape()[0]); + //++sol_idx) { + //output << (*history)[sol_idx][t][0].transpose() << " "; + //} + //output << std::endl; + //} +//} + +#endif From 972388e62ab200668024c9c17818f1c649e1e032 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 13:53:02 -0400 Subject: [PATCH 13/75] Correctly populate history (deriv) using RHS This closes #13 --- src/integrator/RHS/ode_rhs.h | 10 +++++----- src/integrator/RHS/rhs.h | 6 +++--- src/integrator/history.h | 29 ++++------------------------- 3 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h index dbd05b34..205f2e1d 100644 --- a/src/integrator/RHS/ode_rhs.h +++ b/src/integrator/RHS/ode_rhs.h @@ -11,9 +11,9 @@ namespace Integrator { class Integrator::ODE_RHS : public RHS { public: ODE_RHS(const double dt, - const std::shared_ptr &history) + const std::shared_ptr> &history) : RHS(dt, history){}; - virtual void evaluate(const int); + void evaluate(const int) const; private: }; @@ -21,9 +21,9 @@ class Integrator::ODE_RHS : public RHS { void Integrator::ODE_RHS::evaluate(const int n) const { const double time = n * dt; - for(int i = 0; i < history->shape()[0]; ++i) { - (*history)[i][n][1] = - 1 / (1 + std::exp(-(time - 10))) + (*history)[i][n][0]; + for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { + history->array[i][n][1] = + 1 / (1 + std::exp(-(time - 10))) + history->array[i][n][0]; } } diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index 2e8ce2f6..747ecdd8 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -11,13 +11,13 @@ namespace Integrator { template class Integrator::RHS { public: - RHS(const double dt, const std::shared_ptr &history) + RHS(const double dt, const std::shared_ptr> &history) : dt(dt), history(history){}; - virtual void evaluate(const int) = 0; + virtual void evaluate(const int) const = 0; protected: double dt; - std::shared_ptr history; + std::shared_ptr> history; }; #endif diff --git a/src/integrator/history.h b/src/integrator/history.h index f04c8175..1ed6cf76 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -19,7 +19,7 @@ template class Integrator::History { public: History(const int, const int, const int); - soltype_array history; + soltype_array array; private: }; @@ -27,32 +27,11 @@ class Integrator::History { template Integrator::History::History(const int num_particles, const int window, const int num_timesteps) - : history( - boost::extents[num_particles] - [typename soltype_array::extent_range(-window, num_timesteps)] - [2]) + : array(boost::extents[num_particles][ + typename soltype_array::extent_range(-window, num_timesteps)] + [2]) { } - -//void History::write_history( - //const std::shared_ptr &history, - //const std::string &filename, const int n [> = 0 <]) -//{ - //std::ofstream output(filename); - //output << std::setprecision(12) << std::scientific; - - //const int max_t = - //(n != 0) ? n : history->shape()[1] + history->index_bases()[1]; - - //for(int t = 0; t < max_t; ++t) { - //for(int sol_idx = 0; sol_idx < static_cast(history->shape()[0]); - //++sol_idx) { - //output << (*history)[sol_idx][t][0].transpose() << " "; - //} - //output << std::endl; - //} -//} - #endif From 598eb02cf8eff0127e3f7912256b2bd8a04e83cc Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 15:35:36 -0400 Subject: [PATCH 14/75] (WIP) Template integrator over solution type The code to generate the integration weights doesn't depend on the soltype, so I've also moved it out to its own file in hopes of speeding the compilation (slightly) --- src/CMakeLists.txt | 4 +- src/integrator/CMakeLists.txt | 6 +- src/integrator/RHS/ode_rhs.h | 2 +- src/integrator/integrator.h | 247 ++++++---------------------------- src/integrator/weights.cpp | 100 ++++++++++++++ src/integrator/weights.h | 23 ++++ 6 files changed, 168 insertions(+), 214 deletions(-) create mode 100644 src/integrator/weights.cpp create mode 100644 src/integrator/weights.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae08db61..4121c99b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,11 @@ -include("${CMAKE_CURRENT_LIST_DIR}/interactions/CMakeLists.txt") include("${CMAKE_CURRENT_LIST_DIR}/integrator/CMakeLists.txt") +include("${CMAKE_CURRENT_LIST_DIR}/interactions/CMakeLists.txt") target_sources(quest PRIVATE "${CMAKE_CURRENT_LIST_DIR}/common.h" "${CMAKE_CURRENT_LIST_DIR}/configuration.cpp" "${CMAKE_CURRENT_LIST_DIR}/configuration.h" - "${CMAKE_CURRENT_LIST_DIR}/history.cpp" - "${CMAKE_CURRENT_LIST_DIR}/history.h" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set.h" "${CMAKE_CURRENT_LIST_DIR}/math_utils.cpp" diff --git a/src/integrator/CMakeLists.txt b/src/integrator/CMakeLists.txt index 397a4741..33815b84 100644 --- a/src/integrator/CMakeLists.txt +++ b/src/integrator/CMakeLists.txt @@ -1,5 +1,9 @@ +include("${CMAKE_CURRENT_LIST_DIR}/RHS/CMakeLists.txt") + target_sources(quest PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/integrator.cpp" "${CMAKE_CURRENT_LIST_DIR}/integrator.h" + "${CMAKE_CURRENT_LIST_DIR}/weights.cpp" + "${CMAKE_CURRENT_LIST_DIR}/weights.h" + ) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h index 205f2e1d..53c545d9 100644 --- a/src/integrator/RHS/ode_rhs.h +++ b/src/integrator/RHS/ode_rhs.h @@ -23,7 +23,7 @@ void Integrator::ODE_RHS::evaluate(const int n) const const double time = n * dt; for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { history->array[i][n][1] = - 1 / (1 + std::exp(-(time - 10))) + history->array[i][n][0]; + 1 / (1 + std::exp(-(time - 10))) - history->array[i][n][0]; } } diff --git a/src/integrator/integrator.h b/src/integrator/integrator.h index 4b4b04f9..621d3735 100644 --- a/src/integrator/integrator.h +++ b/src/integrator/integrator.h @@ -1,275 +1,104 @@ #ifndef INTEGRATOR_H #define INTEGRATOR_H -#include -#include -#include -#include #include -#include -#include "../history.h" -#include "../interactions/pulse_interaction.h" #include "../math_utils.h" +#include "history.h" +#include "weights.h" -namespace PredictorCorrector { - class Weights; - class Integrator; - - typedef std::function rhs_func; +namespace Integrator { + template + class PredictorCorrector; } -class PredictorCorrector::Weights { +template +class Integrator::PredictorCorrector { public: - Weights(const int, const int, const double); - - Eigen::ArrayXXd ps, cs; - double future_coef; - - int width() const { return n_time; } - private: - int n_time; -}; - -class PredictorCorrector::Integrator { - public: - Integrator(const double, const int, const int, const double, - const std::shared_ptr &, - const std::vector &, - std::vector>); + PredictorCorrector(const double, const int, const int, const double, + const std::shared_ptr> &, + const std::shared_ptr> &); void solve() const; private: int num_solutions, time_idx_ubound; double dt; Weights weights; - std::shared_ptr history; - std::vector rhs_funcs; - std::vector> interactions; + std::shared_ptr> history; + std::shared_ptr> rhs; void solve_step(const int) const; void predictor(const int) const; - void evaluator(const int) const; void corrector(const int) const; - - bool all_finite(const int) const; - void throw_if_unbounded_solution(const int) const; - void log_percentage_complete(const int) const; }; constexpr int NUM_CORRECTOR_STEPS = 10; -std::complex semidisk(const double t) -{ - const std::complex iu(0, 1); - - if(0 <= t && t < 1) return iu * t; - if(1 <= t && t < M_PI + 1) return std::exp(iu * (t + M_PI_2 - 1)); - if(M_PI + 1 <= t && t < M_PI + 2) return iu * (t - (M_PI + 2)); - - return 0; -} - -class WeightsBuilder { - public: - WeightsBuilder(const int, const int, const double); - - Eigen::VectorXd predictors() { return compute_coeff(predictor_matrix()); } - Eigen::VectorXd correctors() { return compute_coeff(corrector_matrix()); } - private: - Eigen::VectorXcd lambdas; - Eigen::VectorXd times; - double timestep, future_time; - - Eigen::MatrixXcd predictor_matrix() const; - Eigen::MatrixXcd corrector_matrix() const; - Eigen::VectorXcd rhs_vector() const; - - Eigen::VectorXd compute_coeff(const Eigen::MatrixXcd &) const; -}; - -WeightsBuilder::WeightsBuilder(const int n_lambda, const int n_time, - const double radius) - : lambdas(n_lambda), - times(Eigen::VectorXd::LinSpaced(n_time, -1, 1)), - timestep(2.0 / (n_time - 1)), - future_time(1 + timestep) -{ - Eigen::VectorXd xs(Eigen::VectorXd::LinSpaced(n_lambda + 1, 0, M_PI + 2)); - for(int i = 0; i < n_lambda; ++i) lambdas[i] = radius * semidisk(xs[i]); -} - -Eigen::MatrixXcd WeightsBuilder::predictor_matrix() const -{ - Eigen::MatrixXcd result(lambdas.size(), 2 * times.size()); - - const Eigen::ArrayXXcd b((lambdas * times.transpose()).array().exp()); - - result.block(0, 0, lambdas.size(), times.size()) = b; - result.block(0, times.size(), lambdas.size(), times.size()) = - b.colwise() * lambdas.array(); - - return result; -} - -Eigen::MatrixXcd WeightsBuilder::corrector_matrix() const -{ - Eigen::MatrixXcd result(lambdas.size(), 2 * times.size() + 1); - - result.block(0, 0, lambdas.size(), 2 * times.size()) = predictor_matrix(); - result.block(0, 2 * times.size(), lambdas.size(), 1) = - lambdas.array() * rhs_vector().array(); - - return result; -} - -Eigen::VectorXcd WeightsBuilder::rhs_vector() const -{ - Eigen::ArrayXcd b(lambdas * future_time); - return b.exp(); -} - -Eigen::VectorXd WeightsBuilder::compute_coeff(const Eigen::MatrixXcd &mat) const -{ - Eigen::JacobiSVD decomp = - mat.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV); - - Eigen::VectorXcd b(rhs_vector()), least_squares(decomp.solve(b)); - - return least_squares.real(); -} - -PredictorCorrector::Weights::Weights(const int n_lambda, const int n_time, - const double radius) - : n_time(n_time) -{ - const double step_factor = (n_time - 1) / 2.0; - WeightsBuilder builder(n_lambda, n_time, radius); - - Eigen::VectorXd predictors(builder.predictors()); - Eigen::VectorXd correctors(builder.correctors()); - - // Eigen defaults to column major, hence the (n_time x 2) ordering - ps = Eigen::Map(predictors.data(), n_time, 2).transpose(); - cs = Eigen::Map(correctors.data(), n_time, 2).transpose(); - - ps.row(1) *= step_factor; - cs.row(1) *= step_factor; - future_coef = correctors(2 * n_time) * step_factor; -} - -PredictorCorrector::Integrator::Integrator( +template +Integrator::PredictorCorrector::PredictorCorrector( const double dt, const int n_lambda, const int n_time, const double radius, - const std::shared_ptr &history, - const std::vector &rhs_funcs, - std::vector> interactions) - : num_solutions(rhs_funcs.size()), - time_idx_ubound(history->index_bases()[1] + history->shape()[1]), + const std::shared_ptr> &history, + const std::shared_ptr> &rhs) + : num_solutions(history->array.shape()[0]), + time_idx_ubound(history->array.index_bases()[1] + + history->array.shape()[1]), dt(dt), weights(n_lambda, n_time, radius), history(history), - rhs_funcs(rhs_funcs), - interactions(std::move(interactions)) + rhs(rhs) { - assert(rhs_funcs.size() == history->shape()[0]); } -void PredictorCorrector::Integrator::solve() const +template +void Integrator::PredictorCorrector::solve() const { for(int step = 0; step < time_idx_ubound; ++step) { solve_step(step); - log_percentage_complete(step); - throw_if_unbounded_solution(step); } } -void PredictorCorrector::Integrator::solve_step(const int step) const +template +void Integrator::PredictorCorrector::solve_step(const int step) const { assert(0 <= step && step < time_idx_ubound); predictor(step); - evaluator(step); + rhs->evaluate(step); for(int m = 0; m < NUM_CORRECTOR_STEPS; ++m) { corrector(step); - evaluator(step); + rhs->evaluate(step); } } -void PredictorCorrector::Integrator::predictor(const int step) const +template +void Integrator::PredictorCorrector::predictor(const int step) const { const int start = step - weights.width(); for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - (*history)[sol_idx][step][0].setZero(); for(int h = 0; h < static_cast(weights.width()); ++h) { - (*history)[sol_idx][step][0] += - (*history)[sol_idx][start + h][0] * weights.ps(0, h) + - (*history)[sol_idx][start + h][1] * weights.ps(1, h) * dt; + history->array[sol_idx][step][0] += + history->array[sol_idx][start + h][0] * weights.ps(0, h) + + history->array[sol_idx][start + h][1] * weights.ps(1, h) * dt; } } } -void PredictorCorrector::Integrator::corrector(const int step) const +template +void Integrator::PredictorCorrector::corrector(const int step) const { const int start = step - weights.width(); for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - (*history)[sol_idx][step][0] = - weights.future_coef * (*history)[sol_idx][step][1] * dt; + history->array[sol_idx][step][0] = + weights.future_coef * history->array[sol_idx][step][1] * dt; for(int h = 0; h < static_cast(weights.width()); ++h) { - (*history)[sol_idx][step][0] += - (*history)[sol_idx][start + h][0] * weights.cs(0, h) + - (*history)[sol_idx][start + h][1] * weights.cs(1, h) * dt; - } - } -} - -void PredictorCorrector::Integrator::evaluator(const int step) const -{ - auto projected_efields = - std::accumulate(interactions.begin(), interactions.end(), - Interaction::ResultArray::Zero(num_solutions, 1).eval(), - [step](const Interaction::ResultArray &r, - const std::shared_ptr &interaction) { - return r + interaction->evaluate(step); - }); - - for(int solution = 0; solution < num_solutions; ++solution) { - (*history)[solution][step][1] = rhs_funcs[solution]( - (*history)[solution][step][0], projected_efields[solution]); - } -} - -bool PredictorCorrector::Integrator::all_finite(const int step) const -{ - for(int sol_idx = 0; sol_idx < num_solutions; ++sol_idx) { - History::soltype &sol = (*history)[sol_idx][step][0]; - History::soltype &dsol = (*history)[sol_idx][step][1]; - - if(!History::isfinite(sol) || !History::isfinite(dsol)) { - return false; + history->array[sol_idx][step][0] += + history->array[sol_idx][start + h][0] * weights.cs(0, h) + + history->array[sol_idx][start + h][1] * weights.cs(1, h) * dt; } } - return true; -} - -void PredictorCorrector::Integrator::throw_if_unbounded_solution( - const int step) const -{ - if(!all_finite(step)) { - const std::string msg = "unbounded history values at or before step "; - throw std::domain_error(msg + std::to_string(step)); - } -} - -void PredictorCorrector::Integrator::log_percentage_complete( - const int step) const -{ - if(step % (time_idx_ubound / 10) == 0) { - std::cout << "\t" << static_cast(step) / time_idx_ubound - << std::endl; - } } #endif diff --git a/src/integrator/weights.cpp b/src/integrator/weights.cpp new file mode 100644 index 00000000..be1ff893 --- /dev/null +++ b/src/integrator/weights.cpp @@ -0,0 +1,100 @@ +#include "weights.h" + +std::complex semidisk(const double t) +{ + const std::complex iu(0, 1); + + if(0 <= t && t < 1) return iu * t; + if(1 <= t && t < M_PI + 1) return std::exp(iu * (t + M_PI_2 - 1)); + if(M_PI + 1 <= t && t < M_PI + 2) return iu * (t - (M_PI + 2)); + + return 0; +} + +class WeightsBuilder { + public: + WeightsBuilder(const int, const int, const double); + + Eigen::VectorXd predictors() { return compute_coeff(predictor_matrix()); } + Eigen::VectorXd correctors() { return compute_coeff(corrector_matrix()); } + private: + Eigen::VectorXcd lambdas; + Eigen::VectorXd times; + double timestep, future_time; + + Eigen::MatrixXcd predictor_matrix() const; + Eigen::MatrixXcd corrector_matrix() const; + Eigen::VectorXcd rhs_vector() const; + + Eigen::VectorXd compute_coeff(const Eigen::MatrixXcd &) const; +}; + +WeightsBuilder::WeightsBuilder(const int n_lambda, const int n_time, + const double radius) + : lambdas(n_lambda), + times(Eigen::VectorXd::LinSpaced(n_time, -1, 1)), + timestep(2.0 / (n_time - 1)), + future_time(1 + timestep) +{ + Eigen::VectorXd xs(Eigen::VectorXd::LinSpaced(n_lambda + 1, 0, M_PI + 2)); + for(int i = 0; i < n_lambda; ++i) lambdas[i] = radius * semidisk(xs[i]); +} + +Eigen::MatrixXcd WeightsBuilder::predictor_matrix() const +{ + Eigen::MatrixXcd result(lambdas.size(), 2 * times.size()); + + const Eigen::ArrayXXcd b((lambdas * times.transpose()).array().exp()); + + result.block(0, 0, lambdas.size(), times.size()) = b; + result.block(0, times.size(), lambdas.size(), times.size()) = + b.colwise() * lambdas.array(); + + return result; +} + +Eigen::MatrixXcd WeightsBuilder::corrector_matrix() const +{ + Eigen::MatrixXcd result(lambdas.size(), 2 * times.size() + 1); + + result.block(0, 0, lambdas.size(), 2 * times.size()) = predictor_matrix(); + result.block(0, 2 * times.size(), lambdas.size(), 1) = + lambdas.array() * rhs_vector().array(); + + return result; +} + +Eigen::VectorXcd WeightsBuilder::rhs_vector() const +{ + Eigen::ArrayXcd b(lambdas * future_time); + return b.exp(); +} + +Eigen::VectorXd WeightsBuilder::compute_coeff(const Eigen::MatrixXcd &mat) const +{ + Eigen::JacobiSVD decomp = + mat.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV); + + Eigen::VectorXcd b(rhs_vector()), least_squares(decomp.solve(b)); + + return least_squares.real(); +} + +Integrator::Weights::Weights(const int n_lambda, const int n_time, + const double radius) + : n_time(n_time) +{ + const double step_factor = (n_time - 1) / 2.0; + WeightsBuilder builder(n_lambda, n_time, radius); + + Eigen::VectorXd predictors(builder.predictors()); + Eigen::VectorXd correctors(builder.correctors()); + + // Eigen defaults to column major, hence the (n_time x 2) ordering + ps = Eigen::Map(predictors.data(), n_time, 2).transpose(); + cs = Eigen::Map(correctors.data(), n_time, 2).transpose(); + + ps.row(1) *= step_factor; + cs.row(1) *= step_factor; + future_coef = correctors(2 * n_time) * step_factor; +} diff --git a/src/integrator/weights.h b/src/integrator/weights.h new file mode 100644 index 00000000..0a3ad379 --- /dev/null +++ b/src/integrator/weights.h @@ -0,0 +1,23 @@ +#ifndef WEIGHTS_H +#define WEIGHTS_H + +#include + +namespace Integrator{ + class Weights; +} + +class Integrator::Weights { + public: + Weights(const int, const int, const double); + + Eigen::ArrayXXd ps, cs; + double future_coef; + + int width() const { return n_time; } + private: + int n_time; +}; + + +#endif From 6180c5fd59c969c5f686694357540f2f5d077e4c Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 15:50:33 -0400 Subject: [PATCH 15/75] (WIP) Swap simulation code to use new History objects --- src/integrator/RHS/CMakeLists.txt | 0 src/integrator/integrator.h | 1 + src/interactions/green_function.h | 5 +- src/interactions/history_interaction.cpp | 8 +-- src/interactions/history_interaction.h | 13 ++--- src/interactions/rotating_green_function.h | 2 +- src/main.cpp | 52 ++++++++++---------- test/CMakeLists.txt | 1 - test/history_test.cpp | 57 ---------------------- 9 files changed, 41 insertions(+), 98 deletions(-) create mode 100644 src/integrator/RHS/CMakeLists.txt delete mode 100644 test/history_test.cpp diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt new file mode 100644 index 00000000..e69de29b diff --git a/src/integrator/integrator.h b/src/integrator/integrator.h index 621d3735..efb9c4c3 100644 --- a/src/integrator/integrator.h +++ b/src/integrator/integrator.h @@ -4,6 +4,7 @@ #include #include "../math_utils.h" +#include "RHS/rhs.h" #include "history.h" #include "weights.h" diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index fb0a4dfb..36a862c3 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -6,10 +6,10 @@ #include #include "../common.h" -#include "../history.h" #include "../lagrange_set.h" namespace GreenFunction { + typedef Eigen::Vector2cd soltype; class Dyadic; } @@ -20,8 +20,7 @@ class GreenFunction::Dyadic { virtual std::vector coefficients( const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; - virtual cmplx polarization_prefactor( - const History::soltype &matrix_elements) const + virtual cmplx polarization_prefactor(const soltype &matrix_elements) const { return 2 * matrix_elements[1].real(); } diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index 765a3fb6..da311c5f 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -4,7 +4,7 @@ using Vec3d = Eigen::Vector3d; HistoryInteraction::HistoryInteraction( const std::shared_ptr &dots, - const std::shared_ptr &history, + const std::shared_ptr> &history, const std::shared_ptr &dyadic, const int interp_order, const double dt, const double c0) : Interaction(dots), @@ -56,14 +56,14 @@ const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) const int s = time_idx - floor_delays[pair_idx]; for(int i = 0; i <= interp_order; ++i) { - if(s - i < (*history).index_bases()[1]) continue; + if(s - i < history->array.index_bases()[1]) continue; results[src] += - (*dyadic).polarization_prefactor((*history)[obs][s - i][0]) * + (*dyadic).polarization_prefactor(history->array[obs][s - i][0]) * coefficients[pair_idx][i]; results[obs] += - (*dyadic).polarization_prefactor((*history)[src][s - i][0]) * + (*dyadic).polarization_prefactor(history->array[src][s - i][0]) * coefficients[pair_idx][i]; } } diff --git a/src/interactions/history_interaction.h b/src/interactions/history_interaction.h index 65c1bd6a..bd9b08c8 100644 --- a/src/interactions/history_interaction.h +++ b/src/interactions/history_interaction.h @@ -4,7 +4,7 @@ #include #include -#include "../history.h" +#include "../integrator/history.h" #include "../lagrange_set.h" #include "../quantum_dot.h" #include "green_function.h" @@ -12,15 +12,16 @@ class HistoryInteraction : public Interaction { public: - HistoryInteraction(const std::shared_ptr &, - const std::shared_ptr &, - const std::shared_ptr &, - const int, const double, const double); + HistoryInteraction( + const std::shared_ptr &, + const std::shared_ptr> &, + const std::shared_ptr &, const int, const double, + const double); virtual const ResultArray &evaluate(const int); private: - std::shared_ptr history; + std::shared_ptr> history; std::shared_ptr dyadic; int interp_order, num_interactions; std::vector floor_delays; diff --git a/src/interactions/rotating_green_function.h b/src/interactions/rotating_green_function.h index 0194cce4..7f4b7c68 100644 --- a/src/interactions/rotating_green_function.h +++ b/src/interactions/rotating_green_function.h @@ -15,7 +15,7 @@ class GreenFunction::RotatingDyadic : public GreenFunction::Dyadic { const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; virtual cmplx polarization_prefactor( - const History::soltype &matrix_elements) const + const Eigen::Vector2cd &matrix_elements) const { return matrix_elements[1]; } diff --git a/src/main.cpp b/src/main.cpp index 6b4cb3a9..db487d15 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ #include #include "configuration.h" -#include "history.h" +#include "integrator/history.h" #include "integrator/integrator.h" #include "interactions/history_interaction.h" #include "interactions/pulse_interaction.h" @@ -22,38 +22,38 @@ int main(int argc, char *argv[]) cout << "Initializing..." << endl; - auto qds = make_shared(import_dots(config.qd_path)); - qds->resize(config.num_particles); - auto rhs_funs = rhs_functions(*qds, config.omega); + //auto qds = make_shared(import_dots(config.qd_path)); + //qds->resize(config.num_particles); + //auto rhs_funs = rhs_functions(*qds, config.omega); - // Set up History - auto history(History::make_shared_history(config.num_particles, 22, - config.num_timesteps)); - for(int t = -22; t <= 0; ++t) { - for(int sol_idx = 0; sol_idx < config.num_particles; ++sol_idx) { - (*history)[sol_idx][t][0] = Eigen::Vector2cd(1, 0); // Ground state - } - } + //// Set up History + //auto history(History::make_shared_history(config.num_particles, 22, + //config.num_timesteps)); + //for(int t = -22; t <= 0; ++t) { + //for(int sol_idx = 0; sol_idx < config.num_particles; ++sol_idx) { + //(*history)[sol_idx][t][0] = Eigen::Vector2cd(1, 0); // Ground state + //} + //} - auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); + //auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); - auto rotating_dyadic = make_shared( - config.mu0, config.c0, config.hbar, config.omega); + //auto rotating_dyadic = make_shared( + //config.mu0, config.c0, config.hbar, config.omega); - std::vector> interactions{ - make_shared(qds, pulse1, config.hbar, config.dt), - make_shared(qds, history, rotating_dyadic, - config.interpolation_order, - config.dt, config.c0)}; + //std::vector> interactions{ + //make_shared(qds, pulse1, config.hbar, config.dt), + //make_shared(qds, history, rotating_dyadic, + //config.interpolation_order, + //config.dt, config.c0)}; - PredictorCorrector::Integrator integrator( - config.dt, 18, 22, 3.15, history, rhs_funs, std::move(interactions)); + //PredictorCorrector::Integrator integrator( + //config.dt, 18, 22, 3.15, history, rhs_funs, std::move(interactions)); - cout << "Solving..." << endl; - integrator.solve(); + //cout << "Solving..." << endl; + //integrator.solve(); - cout << "Writing output..." << endl; - History::write_history(history, "output.dat"); + //cout << "Writing output..." << endl; + //History::write_history(history, "output.dat"); } catch(CommandLineException &e) { // User most likely queried for help or version info, so we can silently diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 387cb0f4..b0bdbec0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,6 @@ if(${Boost_FOUND}) target_sources(qtest-bin PRIVATE "${CMAKE_CURRENT_LIST_DIR}/main.cpp") target_sources(qtest-bin PUBLIC - "${CMAKE_CURRENT_LIST_DIR}/history_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" diff --git a/test/history_test.cpp b/test/history_test.cpp deleted file mode 100644 index bfefe892..00000000 --- a/test/history_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "../src/history.h" -#include - -BOOST_AUTO_TEST_SUITE(history) - -BOOST_AUTO_TEST_SUITE(nonfinite_detection) - -constexpr double dbl_inf = std::numeric_limits::infinity(), - dbl_nan = std::numeric_limits::quiet_NaN(); -constexpr std::complex zero(0, 0), real_inf(dbl_inf, 0), - imag_inf(dbl_inf, 0), real_nan(dbl_nan, 0), imag_nan(0, dbl_nan); - -BOOST_AUTO_TEST_CASE(zero_is_finite) -{ - History::soltype two_zeros(zero, zero); - BOOST_CHECK(History::isfinite(two_zeros)); -} - -BOOST_AUTO_TEST_CASE(real_inf_not_finite) -{ - History::soltype first_is_real_inf(real_inf, zero); - BOOST_CHECK(!History::isfinite(first_is_real_inf)); - - History::soltype second_is_real_inf(zero, real_inf); - BOOST_CHECK(!History::isfinite(second_is_real_inf)); -} - -BOOST_AUTO_TEST_CASE(imag_inf_not_finite) -{ - History::soltype first_is_imag_inf(imag_inf, zero); - BOOST_CHECK(!History::isfinite(first_is_imag_inf)); - - History::soltype second_is_imag_inf(zero, imag_inf); - BOOST_CHECK(!History::isfinite(second_is_imag_inf)); -} - -BOOST_AUTO_TEST_CASE(real_nan_not_finite) -{ - History::soltype first_is_real_nan(real_nan, zero); - BOOST_CHECK(!History::isfinite(first_is_real_nan)); - - History::soltype second_is_real_nan(zero, real_nan); - BOOST_CHECK(!History::isfinite(second_is_real_nan)); -} - -BOOST_AUTO_TEST_CASE(imag_nan_not_finite) -{ - History::soltype first_is_imag_nan(imag_nan, zero); - BOOST_CHECK(!History::isfinite(first_is_imag_nan)); - - History::soltype second_is_imag_nan(zero, imag_nan); - BOOST_CHECK(!History::isfinite(second_is_imag_nan)); -} - -BOOST_AUTO_TEST_SUITE_END() - -BOOST_AUTO_TEST_SUITE_END() From 3b65d009234e8962b3550262d1fcbb6472694e69 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 19:20:47 -0400 Subject: [PATCH 16/75] Add (template) headers to build manifest --- src/integrator/CMakeLists.txt | 2 +- src/integrator/RHS/CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/integrator/CMakeLists.txt b/src/integrator/CMakeLists.txt index 33815b84..f091b867 100644 --- a/src/integrator/CMakeLists.txt +++ b/src/integrator/CMakeLists.txt @@ -2,8 +2,8 @@ include("${CMAKE_CURRENT_LIST_DIR}/RHS/CMakeLists.txt") target_sources(quest PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/history.h" "${CMAKE_CURRENT_LIST_DIR}/integrator.h" "${CMAKE_CURRENT_LIST_DIR}/weights.cpp" "${CMAKE_CURRENT_LIST_DIR}/weights.h" - ) diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt index e69de29b..1f19d2cb 100644 --- a/src/integrator/RHS/CMakeLists.txt +++ b/src/integrator/RHS/CMakeLists.txt @@ -0,0 +1,6 @@ +target_sources(quest + PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/ode_rhs.h" + "${CMAKE_CURRENT_LIST_DIR}/rhs.h" +) + From ebb1e8c23b144a0b4a5b00f7036a803f8f1b9cc4 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 19:29:23 -0400 Subject: [PATCH 17/75] Include History with RHS --- src/integrator/RHS/rhs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index 747ecdd8..96e7b033 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -2,6 +2,7 @@ #define RHS_H #include +#include "../history.h" namespace Integrator { template From 185d2ef91ce2b8897693bc9843c2267495e54f73 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 19:36:41 -0400 Subject: [PATCH 18/75] Test construction of History object --- test/CMakeLists.txt | 3 ++- test/integrator_test.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/integrator_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b0bdbec0..8d30c4af 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,9 +7,10 @@ if(${Boost_FOUND}) target_sources(qtest-bin PRIVATE "${CMAKE_CURRENT_LIST_DIR}/main.cpp") target_sources(qtest-bin PUBLIC + "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp new file mode 100644 index 00000000..fc150ea5 --- /dev/null +++ b/test/integrator_test.cpp @@ -0,0 +1,33 @@ +#include "../src/integrator/integrator.h" +#include + +BOOST_AUTO_TEST_SUITE(integrator) + +BOOST_AUTO_TEST_SUITE(history) + +BOOST_AUTO_TEST_CASE(templated_types) +{ + Integrator::History int_hist(0, 0, 0); + Integrator::History dbl_hist(0, 0, 0); + Integrator::History cvec_hist(0, 0, 0); +} + +BOOST_AUTO_TEST_CASE(shape) +{ + const int num_particles = 2; + const int window = 4; + const int num_timesteps = 8; + Integrator::History hist(num_particles, window, num_timesteps); + + BOOST_CHECK(hist.array.shape()[0] == num_particles); + BOOST_CHECK(hist.array.shape()[1] == num_timesteps + window); + BOOST_CHECK(hist.array.shape()[2] == 2); + + BOOST_CHECK(hist.array.index_bases()[0] == 0); + BOOST_CHECK(hist.array.index_bases()[1] == -window); + BOOST_CHECK(hist.array.index_bases()[2] == 0); +} + +BOOST_AUTO_TEST_SUITE_END() + +BOOST_AUTO_TEST_SUITE_END() From c95f5757e76377b0c24168dd14636d596168f52f Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 19:57:48 -0400 Subject: [PATCH 19/75] Add Shape fixture for History dimensions --- test/integrator_test.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index fc150ea5..662e7441 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -3,24 +3,28 @@ BOOST_AUTO_TEST_SUITE(integrator) -BOOST_AUTO_TEST_SUITE(history) +struct Shape { + int num_particles, window, num_timesteps; + Shape() : num_particles(2), window(4), num_timesteps(8){}; +}; + +BOOST_FIXTURE_TEST_SUITE(history, Shape) BOOST_AUTO_TEST_CASE(templated_types) { - Integrator::History int_hist(0, 0, 0); - Integrator::History dbl_hist(0, 0, 0); - Integrator::History cvec_hist(0, 0, 0); + Integrator::History int_hist(num_particles, window, num_timesteps); + Integrator::History dbl_hist(num_particles, window, num_timesteps); + Integrator::History cvec_hist(num_particles, window, + num_timesteps); } BOOST_AUTO_TEST_CASE(shape) { - const int num_particles = 2; - const int window = 4; - const int num_timesteps = 8; Integrator::History hist(num_particles, window, num_timesteps); - BOOST_CHECK(hist.array.shape()[0] == num_particles); - BOOST_CHECK(hist.array.shape()[1] == num_timesteps + window); + BOOST_CHECK(hist.array.shape()[0] == static_cast(num_particles)); + BOOST_CHECK(hist.array.shape()[1] == + static_cast(num_timesteps + window)); BOOST_CHECK(hist.array.shape()[2] == 2); BOOST_CHECK(hist.array.index_bases()[0] == 0); From 1de1200bd21efcfa64816cd5093a6f2f71d40bdf Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 20:05:49 -0400 Subject: [PATCH 20/75] Add method to fill History with value --- src/integrator/history.h | 10 +++++++++- test/integrator_test.cpp | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/integrator/history.h b/src/integrator/history.h index 1ed6cf76..fec6cd8f 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -21,6 +21,8 @@ class Integrator::History { History(const int, const int, const int); soltype_array array; + void fill(const soltype &); + private: }; @@ -29,9 +31,15 @@ Integrator::History::History(const int num_particles, const int window, const int num_timesteps) : array(boost::extents[num_particles][ typename soltype_array::extent_range(-window, num_timesteps)] - [2]) + [2]) { } +template +void Integrator::History::fill(const soltype &val) +{ + std::fill(array.data(), array.data() + array.num_elements(), val); +} + #endif diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 662e7441..54f8b57c 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -32,6 +32,20 @@ BOOST_AUTO_TEST_CASE(shape) BOOST_CHECK(hist.array.index_bases()[2] == 0); } +BOOST_AUTO_TEST_CASE(filling) +{ + const int fill_value = 4; + Integrator::History hist(num_particles, window, num_timesteps); + hist.fill(fill_value); + + for(int n = 0; n < num_particles; ++n) { + for(int t = -window; t < num_timesteps; ++t) { + BOOST_CHECK(hist.array[n][t][0] == fill_value); + BOOST_CHECK(hist.array[n][t][1] == fill_value); + } + } +} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() From 94c7689d4ae122e4eab9526d1e8d7fb62bf20453 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 21 Jun 2017 20:35:54 -0400 Subject: [PATCH 21/75] Add numeric integration test --- test/integrator_test.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 54f8b57c..070e372d 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -1,5 +1,8 @@ -#include "../src/integrator/integrator.h" #include +#include + +#include "../src/integrator/RHS/ode_rhs.h" +#include "../src/integrator/integrator.h" BOOST_AUTO_TEST_SUITE(integrator) @@ -48,4 +51,33 @@ BOOST_AUTO_TEST_CASE(filling) BOOST_AUTO_TEST_SUITE_END() +struct SigmoidalSystem { + double rhs(double f, double t) { return 1 / (1 + std::exp(-(t - 10))) - f; } + double solution(double t) + { + return (-1 + std::exp(t) + std::exp(10) * std::log(1 + std::exp(10)) - + std::exp(10) * std::log(std::exp(10) + std::exp(t))) / + std::exp(t); + } +}; + +BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) +{ + const double dt = 0.1; + auto hist = std::make_shared>(1, 22, 201); + auto system_rhs = std::make_shared(dt, hist); + + hist->fill(0); + for(int i = -22; i <= 0; ++i) { + hist->array[0][i][0] = solution(i * dt); + hist->array[0][i][1] = rhs(hist->array[0][i][0], i * dt); + } + + Integrator::PredictorCorrector solver(dt, 18, 22, 3.15, hist, + system_rhs); + solver.solve(); + + BOOST_CHECK_CLOSE(hist->array[0][200][0], solution(20), 1e-12); +} + BOOST_AUTO_TEST_SUITE_END() From 9ed9f70a7fc64e18c1d413870ab551425712af26 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Thu, 22 Jun 2017 12:16:26 -0400 Subject: [PATCH 22/75] Use a unique_ptr to bring RHS into integrator Most of the other smart pointers I've used either manage a global resource (i.e. the history directly) or manage a resource without global state (e.g. a pulse). The RHS manages the history *indirectly* AND CAN MODIFY IT, so access to these things should be controlled a little more tightly. Hence unique_ptr. --- CMakeLists.txt | 4 +++- src/integrator/integrator.h | 8 ++++---- test/integrator_test.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41974ba8..8c816972 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,9 @@ enable_cxx_compiler_flag_if_supported("-Wextra") enable_cxx_compiler_flag_if_supported("-fdiagnostics-color=auto") enable_cxx_compiler_flag_if_supported("-pedantic") -set(CPP_FEATURES cxx_auto_type cxx_constexpr cxx_delegating_constructors cxx_lambdas cxx_range_for cxx_strong_enums) +# Require a C++14 standard +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) add_library(quest "") target_compile_features(quest PRIVATE ${CPP_FEATURES}) diff --git a/src/integrator/integrator.h b/src/integrator/integrator.h index efb9c4c3..400a3b1d 100644 --- a/src/integrator/integrator.h +++ b/src/integrator/integrator.h @@ -18,7 +18,7 @@ class Integrator::PredictorCorrector { public: PredictorCorrector(const double, const int, const int, const double, const std::shared_ptr> &, - const std::shared_ptr> &); + std::unique_ptr> &); void solve() const; private: @@ -26,7 +26,7 @@ class Integrator::PredictorCorrector { double dt; Weights weights; std::shared_ptr> history; - std::shared_ptr> rhs; + std::unique_ptr> rhs; void solve_step(const int) const; void predictor(const int) const; @@ -39,14 +39,14 @@ template Integrator::PredictorCorrector::PredictorCorrector( const double dt, const int n_lambda, const int n_time, const double radius, const std::shared_ptr> &history, - const std::shared_ptr> &rhs) + std::unique_ptr> &rhs) : num_solutions(history->array.shape()[0]), time_idx_ubound(history->array.index_bases()[1] + history->array.shape()[1]), dt(dt), weights(n_lambda, n_time, radius), history(history), - rhs(rhs) + rhs(std::move(rhs)) { } diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 070e372d..5ff011cf 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -65,7 +65,7 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; auto hist = std::make_shared>(1, 22, 201); - auto system_rhs = std::make_shared(dt, hist); + std::unique_ptr> system_rhs = std::make_unique(dt, hist); hist->fill(0); for(int i = -22; i <= 0; ++i) { From a59b3340f80122e7c41d7dc49c3bfc1f45f7acf2 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Fri, 23 Jun 2017 12:39:21 -0400 Subject: [PATCH 23/75] added a complex ode rhs which still needs an equation, added a test for the complex ode rhs which needs the solution filled in still. --- src/integrator/RHS/cmplx_ode_rhs.h | 29 +++++++++++++++++++++++++++++ test/integrator_test.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/integrator/RHS/cmplx_ode_rhs.h diff --git a/src/integrator/RHS/cmplx_ode_rhs.h b/src/integrator/RHS/cmplx_ode_rhs.h new file mode 100644 index 00000000..c2aae815 --- /dev/null +++ b/src/integrator/RHS/cmplx_ode_rhs.h @@ -0,0 +1,29 @@ +#ifndef CMPLX_ODE_RHS +#define CMPLX_ODE_RHS + + +namespace Integrator { + class CMPLX_0DE_RHS; +} + +class Integrator::CMPLX_ODE_RHS : public RHS> { + public: + CMPLX_ODE_RHS(const double dt, const std::shared_ptr< + History> &history) + : dt(dt), history(history){}; + void evaluate(const int) const; + + private: +}; + +void Integrator::CMPLX_ODE_RHS::evaluate(const int n) const +{ + const std::complex iu(0,1); + const double time = n * dt; + for(int i; i(history->array.shape()[0]); ++i) { + history->array[i][n][1] = 1; + } +} + +#endif + diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 5ff011cf..9b621ee7 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -61,6 +61,14 @@ struct SigmoidalSystem { } }; +struct ComplexSystem { + double rhs(double f, double t) { return 1; } + double solution(double t) + { + return 1; + } +}; + BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; @@ -81,3 +89,25 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) } BOOST_AUTO_TEST_SUITE_END() + +BOOST_FIXTURE_TEST_CASE(ODE_ERROR, ComplexSystem) +{ + const double dt = 0.1; + auto hist = std::make_shared>(1, 22, 201); + std::unique_ptr> system_rhs = std::make_unique< + Integrator::CMPLX_ODE_RHS>(dt, hist); + + hist->fill(0); + for(int i = -22; i <= 0; ++i) { + hist->array[0][i][0] = solution(i * dt); + hist->array[0][i][1] = rhs(hist->array[0][i][0], i * dt); + } + + Integrator::PredictorCorrector solver(dt, 18, 22, 3.15, hist, + system_rhs); + solver.solve(); + + BOOST_CHECK_CLOSE(hist->array[0][200][0], solution(20), 1e-12); +} + +BOOST_AUTO_TEST_SUITE_END() From c4964ce766368d68002644e97ae0a6d9a1f6f8da Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Fri, 23 Jun 2017 16:02:51 -0400 Subject: [PATCH 24/75] Pass evaluatable RHS function to ode_rhs --- src/integrator/RHS/ode_rhs.h | 18 +++++++++++++----- test/integrator_test.cpp | 8 +++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h index 53c545d9..6b96b730 100644 --- a/src/integrator/RHS/ode_rhs.h +++ b/src/integrator/RHS/ode_rhs.h @@ -2,6 +2,7 @@ #define ODE_RHS_H #include +#include #include "rhs.h" namespace Integrator { @@ -10,20 +11,27 @@ namespace Integrator { class Integrator::ODE_RHS : public RHS { public: - ODE_RHS(const double dt, - const std::shared_ptr> &history) - : RHS(dt, history){}; + ODE_RHS(const double, const std::shared_ptr> &, + const std::function &); void evaluate(const int) const; private: + std::function rhs_func; }; +Integrator::ODE_RHS::ODE_RHS( + const double dt, + const std::shared_ptr> &history, + const std::function &rhs_func) + : RHS(dt, history), rhs_func(rhs_func) +{ +} + void Integrator::ODE_RHS::evaluate(const int n) const { const double time = n * dt; for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { - history->array[i][n][1] = - 1 / (1 + std::exp(-(time - 10))) - history->array[i][n][0]; + history->array[i][n][1] = rhs_func(history->array[i][n][0], time); } } diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 5ff011cf..0a46bdb8 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -52,8 +52,8 @@ BOOST_AUTO_TEST_CASE(filling) BOOST_AUTO_TEST_SUITE_END() struct SigmoidalSystem { - double rhs(double f, double t) { return 1 / (1 + std::exp(-(t - 10))) - f; } - double solution(double t) + static double rhs(double f, double t) { return 1 / (1 + std::exp(-(t - 10))) - f; } + static double solution(double t) { return (-1 + std::exp(t) + std::exp(10) * std::log(1 + std::exp(10)) - std::exp(10) * std::log(std::exp(10) + std::exp(t))) / @@ -65,7 +65,9 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; auto hist = std::make_shared>(1, 22, 201); - std::unique_ptr> system_rhs = std::make_unique(dt, hist); + auto rhs_fun = std::function(rhs); + std::unique_ptr> system_rhs = + std::make_unique(dt, hist, rhs_fun); hist->fill(0); for(int i = -22; i <= 0; ++i) { From 363200b0ba79f6e5043fcb6a6bc661fcb1fa49df Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Fri, 23 Jun 2017 16:03:20 -0400 Subject: [PATCH 25/75] Make default return of semidisk complex --- src/integrator/weights.cpp | 2 +- src/integrator/weights.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/integrator/weights.cpp b/src/integrator/weights.cpp index be1ff893..78799c83 100644 --- a/src/integrator/weights.cpp +++ b/src/integrator/weights.cpp @@ -8,7 +8,7 @@ std::complex semidisk(const double t) if(1 <= t && t < M_PI + 1) return std::exp(iu * (t + M_PI_2 - 1)); if(M_PI + 1 <= t && t < M_PI + 2) return iu * (t - (M_PI + 2)); - return 0; + return std::complex(0,0); } class WeightsBuilder { diff --git a/src/integrator/weights.h b/src/integrator/weights.h index 0a3ad379..d0fa35a4 100644 --- a/src/integrator/weights.h +++ b/src/integrator/weights.h @@ -19,5 +19,4 @@ class Integrator::Weights { int n_time; }; - #endif From 85479c6864fb1930e1f845a01e53b92bc25bd3fd Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Mon, 26 Jun 2017 10:11:46 -0400 Subject: [PATCH 26/75] adds llg_rhs class based on Integrator::RHS template --- src/integrator/RHS/llg_rhs.h | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/integrator/RHS/llg_rhs.h diff --git a/src/integrator/RHS/llg_rhs.h b/src/integrator/RHS/llg_rhs.h new file mode 100644 index 00000000..dfe4c7b8 --- /dev/null +++ b/src/integrator/RHS/llg_rhs.h @@ -0,0 +1,40 @@ +#ifndef LLG_RHS_H +#define LLG_RHS_H + +#include "rhs.h" +#include + +namespace Integrator { + class LLG_RHS; +} + +typedef Eigen::Vector3d vec3d; + +class Integrator::LLG_RHS : public RHS { + public: + LLG_RHS(const double dt, + const std::shared_ptr> &history) + : RHS(dt, history){}; + void evaluate(const int) const; + + private: +}; + +void Integrator::LLG_RHS::evaluate(const int n) const +{ // constants subject to change + const double alpha = 1; + const double gamma0 = 1; + const double time = n * dt; + const double gamma = gamma0 / (1 + std::pow(alpha,2)); //might change +// vec3d hfield = hist_interaction + pulse_interaction; <-- seudo-code + vec3d hfield(0,0,0); + + for(int i = 0; static_cast(history->array.shape()[0]); ++i) { + vec3d mxh = history->array[i][n][0].cross(hfield); + history->array[i][n][1] = -gamma * mxh - gamma * alpha / + history->array[i][n][0].norm() * + history->array[i][n][0].cross(mxh); + }; +}; + +#endif From d6be3a9c284ac28aad29610b5e62ee38c48a38f3 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Mon, 26 Jun 2017 10:42:26 -0400 Subject: [PATCH 27/75] Pass array of rhs funcs to RHS() objects This makes it super easy to define-your-own general purpose ODE and has the advantage of obviating the ODE_RHS (since all of the behavior there gets passed in through the function objects) --- src/integrator/RHS/CMakeLists.txt | 1 - src/integrator/RHS/ode_rhs.h | 38 ------------------------------- src/integrator/RHS/rhs.h | 19 +++++++++++++--- test/integrator_test.cpp | 6 ++--- 4 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 src/integrator/RHS/ode_rhs.h diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt index 1f19d2cb..0168c016 100644 --- a/src/integrator/RHS/CMakeLists.txt +++ b/src/integrator/RHS/CMakeLists.txt @@ -1,6 +1,5 @@ target_sources(quest PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/ode_rhs.h" "${CMAKE_CURRENT_LIST_DIR}/rhs.h" ) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h deleted file mode 100644 index 6b96b730..00000000 --- a/src/integrator/RHS/ode_rhs.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ODE_RHS_H -#define ODE_RHS_H - -#include -#include -#include "rhs.h" - -namespace Integrator { - class ODE_RHS; -} - -class Integrator::ODE_RHS : public RHS { - public: - ODE_RHS(const double, const std::shared_ptr> &, - const std::function &); - void evaluate(const int) const; - - private: - std::function rhs_func; -}; - -Integrator::ODE_RHS::ODE_RHS( - const double dt, - const std::shared_ptr> &history, - const std::function &rhs_func) - : RHS(dt, history), rhs_func(rhs_func) -{ -} - -void Integrator::ODE_RHS::evaluate(const int n) const -{ - const double time = n * dt; - for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { - history->array[i][n][1] = rhs_func(history->array[i][n][0], time); - } -} - -#endif diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index 96e7b033..dee952f8 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -1,7 +1,9 @@ #ifndef RHS_H #define RHS_H +#include #include +#include #include "../history.h" namespace Integrator { @@ -12,13 +14,24 @@ namespace Integrator { template class Integrator::RHS { public: - RHS(const double dt, const std::shared_ptr> &history) - : dt(dt), history(history){}; - virtual void evaluate(const int) const = 0; + RHS(const double dt, const std::shared_ptr> &history, + const std::vector> &rhs_functions) + : dt(dt), history(history), rhs_functions(rhs_functions){}; + void evaluate(const int) const; protected: double dt; std::shared_ptr> history; + std::vector> rhs_functions; }; +template +void Integrator::RHS::evaluate(const int n) const +{ + const double time = n * dt; + for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { + history->array[i][n][1] = rhs_functions[i](history->array[i][n][0], time); + } +} + #endif diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 0a46bdb8..b4b65551 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -1,7 +1,7 @@ #include #include -#include "../src/integrator/RHS/ode_rhs.h" +#include "../src/integrator/RHS/rhs.h" #include "../src/integrator/integrator.h" BOOST_AUTO_TEST_SUITE(integrator) @@ -65,9 +65,9 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; auto hist = std::make_shared>(1, 22, 201); - auto rhs_fun = std::function(rhs); + std::vector> rhs_funcs{rhs}; std::unique_ptr> system_rhs = - std::make_unique(dt, hist, rhs_fun); + std::make_unique>(dt, hist, rhs_funcs); hist->fill(0); for(int i = -22; i <= 0; ++i) { From 212a3e08483271a06c0319c2adec699f1b09281c Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Mon, 26 Jun 2017 12:17:04 -0400 Subject: [PATCH 28/75] Properly type rhs functions --- src/integrator/RHS/rhs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index dee952f8..b789af1a 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -22,7 +22,7 @@ class Integrator::RHS { protected: double dt; std::shared_ptr> history; - std::vector> rhs_functions; + std::vector> rhs_functions; }; template From 2fd7eb8d6bea908a6578fcb228a621b24bc69a8a Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Mon, 26 Jun 2017 12:25:24 -0400 Subject: [PATCH 29/75] Revert "Properly type rhs functions" This reverts commit 212a3e08483271a06c0319c2adec699f1b09281c. --- src/integrator/RHS/rhs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index b789af1a..dee952f8 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -22,7 +22,7 @@ class Integrator::RHS { protected: double dt; std::shared_ptr> history; - std::vector> rhs_functions; + std::vector> rhs_functions; }; template From 14ddd3da4439ed4a188c4a9a40d5c757f2e56ad9 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Mon, 26 Jun 2017 12:25:31 -0400 Subject: [PATCH 30/75] Revert "Pass array of rhs funcs to RHS() objects" This reverts commit d6be3a9c284ac28aad29610b5e62ee38c48a38f3. --- src/integrator/RHS/CMakeLists.txt | 1 + src/integrator/RHS/ode_rhs.h | 38 +++++++++++++++++++++++++++++++ src/integrator/RHS/rhs.h | 19 +++------------- test/integrator_test.cpp | 6 ++--- 4 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 src/integrator/RHS/ode_rhs.h diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt index 0168c016..1f19d2cb 100644 --- a/src/integrator/RHS/CMakeLists.txt +++ b/src/integrator/RHS/CMakeLists.txt @@ -1,5 +1,6 @@ target_sources(quest PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/ode_rhs.h" "${CMAKE_CURRENT_LIST_DIR}/rhs.h" ) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h new file mode 100644 index 00000000..6b96b730 --- /dev/null +++ b/src/integrator/RHS/ode_rhs.h @@ -0,0 +1,38 @@ +#ifndef ODE_RHS_H +#define ODE_RHS_H + +#include +#include +#include "rhs.h" + +namespace Integrator { + class ODE_RHS; +} + +class Integrator::ODE_RHS : public RHS { + public: + ODE_RHS(const double, const std::shared_ptr> &, + const std::function &); + void evaluate(const int) const; + + private: + std::function rhs_func; +}; + +Integrator::ODE_RHS::ODE_RHS( + const double dt, + const std::shared_ptr> &history, + const std::function &rhs_func) + : RHS(dt, history), rhs_func(rhs_func) +{ +} + +void Integrator::ODE_RHS::evaluate(const int n) const +{ + const double time = n * dt; + for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { + history->array[i][n][1] = rhs_func(history->array[i][n][0], time); + } +} + +#endif diff --git a/src/integrator/RHS/rhs.h b/src/integrator/RHS/rhs.h index dee952f8..96e7b033 100644 --- a/src/integrator/RHS/rhs.h +++ b/src/integrator/RHS/rhs.h @@ -1,9 +1,7 @@ #ifndef RHS_H #define RHS_H -#include #include -#include #include "../history.h" namespace Integrator { @@ -14,24 +12,13 @@ namespace Integrator { template class Integrator::RHS { public: - RHS(const double dt, const std::shared_ptr> &history, - const std::vector> &rhs_functions) - : dt(dt), history(history), rhs_functions(rhs_functions){}; - void evaluate(const int) const; + RHS(const double dt, const std::shared_ptr> &history) + : dt(dt), history(history){}; + virtual void evaluate(const int) const = 0; protected: double dt; std::shared_ptr> history; - std::vector> rhs_functions; }; -template -void Integrator::RHS::evaluate(const int n) const -{ - const double time = n * dt; - for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { - history->array[i][n][1] = rhs_functions[i](history->array[i][n][0], time); - } -} - #endif diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index b4b65551..0a46bdb8 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -1,7 +1,7 @@ #include #include -#include "../src/integrator/RHS/rhs.h" +#include "../src/integrator/RHS/ode_rhs.h" #include "../src/integrator/integrator.h" BOOST_AUTO_TEST_SUITE(integrator) @@ -65,9 +65,9 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; auto hist = std::make_shared>(1, 22, 201); - std::vector> rhs_funcs{rhs}; + auto rhs_fun = std::function(rhs); std::unique_ptr> system_rhs = - std::make_unique>(dt, hist, rhs_funcs); + std::make_unique(dt, hist, rhs_fun); hist->fill(0); for(int i = -22; i <= 0; ++i) { From 2ea2e670c0df98df761c6b2190433229042d776e Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Mon, 26 Jun 2017 12:31:47 -0400 Subject: [PATCH 31/75] Use vector of rhs functions for ODE --- src/integrator/RHS/ode_rhs.h | 11 ++++++----- test/integrator_test.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/integrator/RHS/ode_rhs.h b/src/integrator/RHS/ode_rhs.h index 6b96b730..fcad8a5e 100644 --- a/src/integrator/RHS/ode_rhs.h +++ b/src/integrator/RHS/ode_rhs.h @@ -3,6 +3,7 @@ #include #include +#include #include "rhs.h" namespace Integrator { @@ -12,18 +13,18 @@ namespace Integrator { class Integrator::ODE_RHS : public RHS { public: ODE_RHS(const double, const std::shared_ptr> &, - const std::function &); + const std::vector> &); void evaluate(const int) const; private: - std::function rhs_func; + std::vector> rhs_functions; }; Integrator::ODE_RHS::ODE_RHS( const double dt, const std::shared_ptr> &history, - const std::function &rhs_func) - : RHS(dt, history), rhs_func(rhs_func) + const std::vector> &rhs_functions) + : RHS(dt, history), rhs_functions(rhs_functions) { } @@ -31,7 +32,7 @@ void Integrator::ODE_RHS::evaluate(const int n) const { const double time = n * dt; for(int i = 0; i < static_cast(history->array.shape()[0]); ++i) { - history->array[i][n][1] = rhs_func(history->array[i][n][0], time); + history->array[i][n][1] = rhs_functions[i](history->array[i][n][0], time); } } diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 0a46bdb8..3695a1c1 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -52,7 +52,10 @@ BOOST_AUTO_TEST_CASE(filling) BOOST_AUTO_TEST_SUITE_END() struct SigmoidalSystem { - static double rhs(double f, double t) { return 1 / (1 + std::exp(-(t - 10))) - f; } + static double rhs(double f, double t) + { + return 1 / (1 + std::exp(-(t - 10))) - f; + } static double solution(double t) { return (-1 + std::exp(t) + std::exp(10) * std::log(1 + std::exp(10)) - @@ -65,9 +68,9 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; auto hist = std::make_shared>(1, 22, 201); - auto rhs_fun = std::function(rhs); + std::vector> rhs_funcs{rhs}; std::unique_ptr> system_rhs = - std::make_unique(dt, hist, rhs_fun); + std::make_unique(dt, hist, rhs_funcs); hist->fill(0); for(int i = -22; i <= 0; ++i) { @@ -79,7 +82,7 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) system_rhs); solver.solve(); - BOOST_CHECK_CLOSE(hist->array[0][200][0], solution(20), 1e-12); + BOOST_CHECK_CLOSE(hist->array[0][200][0], solution(200 * dt), 1e-12); } BOOST_AUTO_TEST_SUITE_END() From 02d5904fb44ccfad4f96e338399e64a1993095e2 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 16:40:34 -0400 Subject: [PATCH 32/75] (WIP) Playing with propagation redesign --- src/propagation/green_function.cpp | 20 +++++++++++ src/propagation/green_function.h | 52 +++++++++++++++++++++++++++ src/propagation/history_evaluator.cpp | 9 +++++ src/propagation/history_evaluator.h | 38 ++++++++++++++++++++ src/propagation/propagation.h | 33 +++++++++++++++++ test/CMakeLists.txt | 1 + test/propagation_test.cpp | 38 ++++++++++++++++++++ 7 files changed, 191 insertions(+) create mode 100644 src/propagation/green_function.cpp create mode 100644 src/propagation/green_function.h create mode 100644 src/propagation/history_evaluator.cpp create mode 100644 src/propagation/history_evaluator.h create mode 100644 src/propagation/propagation.h create mode 100644 test/propagation_test.cpp diff --git a/src/propagation/green_function.cpp b/src/propagation/green_function.cpp new file mode 100644 index 00000000..f44fc016 --- /dev/null +++ b/src/propagation/green_function.cpp @@ -0,0 +1,20 @@ +#include "green_function.h" + +std::vector GreenFunction::Dyadic::coefficients( + const Eigen::Vector3d &dr, + const Interpolation::UniformLagrangeSet &interp) const +{ + std::vector coefs(interp.order() + 1, + Eigen::Matrix3cd::Zero()); + + const auto dyads(spatial_dyads(dr)); + + for(int i = 0; i <= interp.order(); ++i) { + for(int term = 0; term < 3; ++term) { + coefs[i] += mu0_over_4pi_hbar_ * dyads[term].cast() * + interp.weights[term][i]; + } + } + + return coefs; +} diff --git a/src/propagation/green_function.h b/src/propagation/green_function.h new file mode 100644 index 00000000..f9c76ee7 --- /dev/null +++ b/src/propagation/green_function.h @@ -0,0 +1,52 @@ +#ifndef GREEN_FUNCTION_H +#define GREEN_FUNCTION_H + +#include +#include +#include + +#include "../common.h" +#include "../lagrange_set.h" + +namespace GreenFunction { + typedef Eigen::Vector2cd soltype; + class Dyadic; +} + +class GreenFunction::Dyadic { + public: + Dyadic(const double mu0, const double c, const double hbar) + : c_(c), mu0_over_4pi_hbar_(mu0 / (4 * M_PI * hbar)){}; + virtual std::vector coefficients( + const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; + + protected: + double c_, mu0_over_4pi_hbar_; + + std::array spatial_dyads(const Eigen::Vector3d &dr) const + { + std::array results = { + {identity_minus_3rsq(dr) * std::pow(c_, 2) / std::pow(dr.norm(), 3), + identity_minus_3rsq(dr) * c_ / dr.squaredNorm(), + identity_minus_rsq(dr) / dr.norm()}}; + + return results; + } + + static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) + { + return dr * dr.transpose() / dr.squaredNorm(); + } + + static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); + } + + static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); + } +}; + +#endif diff --git a/src/propagation/history_evaluator.cpp b/src/propagation/history_evaluator.cpp new file mode 100644 index 00000000..2ba3efe0 --- /dev/null +++ b/src/propagation/history_evaluator.cpp @@ -0,0 +1,9 @@ +#include "history_evaluator.h" + +template +HistoryEvaluator::HistoryEvaluator( + const std::shared_ptr> &history, + const std::shared_ptr &dyad, const int interp_order, + const double c0, const double dt) : + FieldEvaluator(dots), history(history) +{} diff --git a/src/propagation/history_evaluator.h b/src/propagation/history_evaluator.h new file mode 100644 index 00000000..df7bd70d --- /dev/null +++ b/src/propagation/history_evaluator.h @@ -0,0 +1,38 @@ +#ifndef HISTORY_EVALUATOR_H +#define HISTORY_EVALUATOR_H + +#include "propagation.h" +#include "../integrator/history.h" +#include "green_function.h" + +namespace Propagation { + template + class HistoryEvaluator; +} + +template +class Propagation::HistoryEvaluator + : public Propagation::FieldEvaluator { + public: + HistoryEvaluator(const std::shared_ptr &, + const std::shared_ptr> &, + const std::shared_ptr &, const int, + const double, const double); + + private: + std::shared_ptr> history; + std::shared_ptr dyadic; + int interp_order, num_interactions; + std::vector floor_delays; + boost::multi_array, 2> + interpolated_propagators; + const double c0, dt; + + void build_coefficient_table(); + + static int coord2idx(const std::pair &); + static std::pair idx2coord(const int); + static std::pair split_double(const double); +}; + +#endif diff --git a/src/propagation/propagation.h b/src/propagation/propagation.h new file mode 100644 index 00000000..8dc21e1f --- /dev/null +++ b/src/propagation/propagation.h @@ -0,0 +1,33 @@ +#ifndef PROPAGATION_H +#define PROPAGATION_H + +#include +#include +#include + +#include "../quantum_dot.h" + +namespace Propagation { + template + class FieldEvaluator; +} + +template +class Propagation::FieldEvaluator { + public: + typedef Eigen::Matrix fieldtype; + typedef std::vector> + ResultTable; + + FieldEvaluator(const std::shared_ptr &dots) + : dots(dots), results(dots->size()){}; + + const fieldtype &operator[](const int i) const { return results[i]; } + virtual const ResultTable &evaluate(const int) = 0; + + protected: + std::shared_ptr dots; + ResultTable results; +}; + +#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8d30c4af..ccddef08 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ if(${Boost_FOUND}) PUBLIC "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/propagation_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) diff --git a/test/propagation_test.cpp b/test/propagation_test.cpp new file mode 100644 index 00000000..fdc4fc85 --- /dev/null +++ b/test/propagation_test.cpp @@ -0,0 +1,38 @@ +#include + +#include "../src/propagation/history_evaluator.h" + +BOOST_AUTO_TEST_SUITE(propagation) + +struct System { + double dt; + int num_steps, interp_order; + Integrator::History history; + std::shared_ptr dots; + std::shared_ptr dyadic_gf; + + System() + : dt(1e-2), + num_steps(2000), + interp_order(4), + history(2, 20, num_steps), + dots(std::make_shared(2)), + dyadic_gf(std::make_shared(4 * M_PI, 1, 1)) + { + history.fill(0); + dots->at(0) = + QuantumDot(Eigen::Vector3d(0, 0, 0), 2278.9013, + std::make_pair(10.0, 20.0), Eigen::Vector3d(0, 0, 1)); + dots->at(1) = + QuantumDot(Eigen::Vector3d(1, 0, 0), 2278.9013, + std::make_pair(10.0, 20.0), Eigen::Vector3d(0, 0, 1)); + }; +}; + +BOOST_FIXTURE_TEST_CASE(dyad, System) +{ + Eigen::Vector3d dr(dots->at(1).position() - dots->at(0).position()); + //UniformLagrangeSet uls(dr.norm()/dt +} + +BOOST_AUTO_TEST_SUITE_END() From cf31bc1983e01ab1edac9a30e7025db848b5e666 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 17:51:29 -0400 Subject: [PATCH 33/75] Use CRTP to maintain fixed- and rotating-frame propagators with correct types The fixed-frame propagator (Green's function) produces an electric field from a purely real signal, while the rotating-frame one produces a complex field from a complex signal. Using C++14's auto detection feature (thanks, CSullivan!) and the CRTP, we can maintain both with correct types with minimal code overhead/awful_templating_everywhere. --- src/interactions/green_function.h | 105 ++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 36a862c3..08b9ed7b 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -54,4 +54,109 @@ class GreenFunction::Dyadic { } }; +namespace Propagation { + template + class Propagator; + + class FixedFramePropagator; + class RotatingFramePropagator; +} + +template +class Propagation::Propagator { + public: + Propagator(const double mu0, const double c, const double hbar) + : c_(c), mu0_over_4pi_hbar_(mu0 / (4 * M_PI * hbar)){}; + auto coefficients(const Eigen::Vector3d &dr, + const Interpolation::UniformLagrangeSet &interp) const + { + return static_cast(this)->coefficients(dr, interp); + }; + + protected: + double c_, mu0_over_4pi_hbar_; + + std::array spatial_dyads(const Eigen::Vector3d &dr) const + { + std::array results = { + {identity_minus_3rsq(dr) * std::pow(c_, 2) / std::pow(dr.norm(), 3), + identity_minus_3rsq(dr) * c_ / dr.squaredNorm(), + identity_minus_rsq(dr) / dr.norm()}}; + + return results; + } + + static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) + { + return dr * dr.transpose() / dr.squaredNorm(); + } + + static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); + } + + static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); + } +}; + +class Propagation::FixedFramePropagator + : public Propagation::Propagator { + public: + FixedFramePropagator(const double mu0, const double c, const double hbar) + : Propagator(mu0, c, hbar){}; + std::vector coefficients( + const Eigen::Vector3d &dr, + const Interpolation::UniformLagrangeSet &interp) const + { + std::vector coefs(interp.order() + 1, + Eigen::Matrix3d::Zero()); + + const auto dyads(spatial_dyads(dr)); + + for(int i = 0; i <= interp.order(); ++i) { + coefs[i] += mu0_over_4pi_hbar_ * (dyads[0] * interp.weights[0][i] + + dyads[1] * interp.weights[1][i] + + dyads[2] * interp.weights[2][i]); + } + + return coefs; + } +}; + +class Propagation::RotatingFramePropagator + : public Propagation::Propagator { + public: + RotatingFramePropagator(const double mu0, const double c, const double hbar, + const double omega) + : Propagator(mu0, c, hbar), omega(omega){}; + std::vector coefficients( + const Eigen::Vector3d &dr, + const Interpolation::UniformLagrangeSet &interp) const + { + std::vector coefs(interp.order() + 1, + Eigen::Matrix3cd::Zero()); + + const auto dyads(spatial_dyads(dr)); + + for(int i = 0; i <= interp.order(); ++i) { + coefs[i] = + -mu0_over_4pi_hbar_ * std::exp(-iu * omega * dr.norm() / c_) * + (dyads[0].cast() * interp.weights[0][i] + + dyads[1].cast() * + (interp.weights[1][i] + iu * omega * interp.weights[0][i]) + + dyads[2].cast() * + (interp.weights[2][i] + 2.0 * iu * omega * interp.weights[1][i] - + std::pow(omega, 2) * interp.weights[0][i])); + } + + return coefs; + } + + private: + double omega; +}; + #endif From 4235a916cf23ab5ecfde2cf530364556aaa51ebb Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 17:51:45 -0400 Subject: [PATCH 34/75] (WIP) Add fixed & rotating frame propagator tests --- test/CMakeLists.txt | 1 + test/propagator_test.cpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/propagator_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8d30c4af..54021ff4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ if(${Boost_FOUND}) PUBLIC "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) diff --git a/test/propagator_test.cpp b/test/propagator_test.cpp new file mode 100644 index 00000000..1deeeb5a --- /dev/null +++ b/test/propagator_test.cpp @@ -0,0 +1,32 @@ +#include +#include + +#include "../src/interactions/green_function.h" + +BOOST_AUTO_TEST_SUITE(propagator) + +BOOST_AUTO_TEST_CASE(fixed_frame) +{ + Propagation::FixedFramePropagator ffp(4 * M_PI, 1, 1); + + Interpolation::UniformLagrangeSet uls(0.5, 4); + auto mats = ffp.coefficients(Eigen::Vector3d(1, 1, 1), uls); + + for(const auto &m : mats) { + std::cout << m << std::endl << std::endl; + } +} + +BOOST_AUTO_TEST_CASE(rotating_frame) +{ + Propagation::RotatingFramePropagator rfp(4 * M_PI, 1, 1, 2.2); + + Interpolation::UniformLagrangeSet uls(0.5, 4); + auto mats = rfp.coefficients(Eigen::Vector3d(1, 1, 1), uls); + + for(const auto &m : mats) { + std::cout << m << std::endl << std::endl; + } +} + +BOOST_AUTO_TEST_SUITE_END() From be7ed697ab7ea069cd15269ce243aa55134cc900 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 18:59:47 -0400 Subject: [PATCH 35/75] Check CRTP dyads against old GreenFunction code --- test/propagator_test.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test/propagator_test.cpp b/test/propagator_test.cpp index 1deeeb5a..10f8bb86 100644 --- a/test/propagator_test.cpp +++ b/test/propagator_test.cpp @@ -2,30 +2,41 @@ #include #include "../src/interactions/green_function.h" +#include "../src/interactions/rotating_green_function.h" BOOST_AUTO_TEST_SUITE(propagator) BOOST_AUTO_TEST_CASE(fixed_frame) { + GreenFunction::Dyadic dyadic(4 * M_PI, 1, 1); Propagation::FixedFramePropagator ffp(4 * M_PI, 1, 1); + Eigen::Vector3d dr(1, 1, 1); Interpolation::UniformLagrangeSet uls(0.5, 4); - auto mats = ffp.coefficients(Eigen::Vector3d(1, 1, 1), uls); - for(const auto &m : mats) { - std::cout << m << std::endl << std::endl; + auto dyadic_mats = dyadic.coefficients(dr, uls); + auto crtp_mats = ffp.coefficients(dr, uls); + + for(int i = 0; i < 4; ++i) { + auto delta = dyadic_mats[i] - crtp_mats[i]; + BOOST_CHECK_CLOSE(delta.squaredNorm(), 0, 1e-15); } } BOOST_AUTO_TEST_CASE(rotating_frame) { + GreenFunction::RotatingDyadic rotating_dyadic(4 * M_PI, 1, 1, 2.2); Propagation::RotatingFramePropagator rfp(4 * M_PI, 1, 1, 2.2); + Eigen::Vector3d dr(1, 1, 1); Interpolation::UniformLagrangeSet uls(0.5, 4); - auto mats = rfp.coefficients(Eigen::Vector3d(1, 1, 1), uls); - for(const auto &m : mats) { - std::cout << m << std::endl << std::endl; + auto rotating_dyadic_mats = rotating_dyadic.coefficients(dr, uls); + auto rotating_crtp_mats = rfp.coefficients(dr, uls); + + for(int i = 0; i < 4; ++i) { + auto delta = rotating_dyadic_mats[i] - rotating_crtp_mats[i]; + BOOST_CHECK_CLOSE(delta.squaredNorm(), 0, 1e-15); } } From ba4ac417662764fcc78a1f7896292ed29061f4e0 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 19:26:36 -0400 Subject: [PATCH 36/75] Swap out RotatingGreenFunction for crtp'd RotatingFramePropagator --- src/interactions/CMakeLists.txt | 3 -- src/interactions/green_function.cpp | 20 --------- src/interactions/green_function.h | 46 -------------------- src/interactions/history_interaction.cpp | 14 +++--- src/interactions/history_interaction.h | 6 +-- src/interactions/rotating_green_function.cpp | 24 ---------- src/interactions/rotating_green_function.h | 27 ------------ src/main.cpp | 2 +- test/propagator_test.cpp | 15 ------- 9 files changed, 10 insertions(+), 147 deletions(-) delete mode 100644 src/interactions/green_function.cpp delete mode 100644 src/interactions/rotating_green_function.cpp delete mode 100644 src/interactions/rotating_green_function.h diff --git a/src/interactions/CMakeLists.txt b/src/interactions/CMakeLists.txt index bd38a1e0..79b2a0a2 100644 --- a/src/interactions/CMakeLists.txt +++ b/src/interactions/CMakeLists.txt @@ -1,12 +1,9 @@ target_sources(quest PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/green_function.cpp" "${CMAKE_CURRENT_LIST_DIR}/green_function.h" "${CMAKE_CURRENT_LIST_DIR}/history_interaction.cpp" "${CMAKE_CURRENT_LIST_DIR}/history_interaction.h" "${CMAKE_CURRENT_LIST_DIR}/interaction.h" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction.h" - "${CMAKE_CURRENT_LIST_DIR}/rotating_green_function.cpp" - "${CMAKE_CURRENT_LIST_DIR}/rotating_green_function.h" ) diff --git a/src/interactions/green_function.cpp b/src/interactions/green_function.cpp deleted file mode 100644 index f44fc016..00000000 --- a/src/interactions/green_function.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "green_function.h" - -std::vector GreenFunction::Dyadic::coefficients( - const Eigen::Vector3d &dr, - const Interpolation::UniformLagrangeSet &interp) const -{ - std::vector coefs(interp.order() + 1, - Eigen::Matrix3cd::Zero()); - - const auto dyads(spatial_dyads(dr)); - - for(int i = 0; i <= interp.order(); ++i) { - for(int term = 0; term < 3; ++term) { - coefs[i] += mu0_over_4pi_hbar_ * dyads[term].cast() * - interp.weights[term][i]; - } - } - - return coefs; -} diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 08b9ed7b..a2803799 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -8,52 +8,6 @@ #include "../common.h" #include "../lagrange_set.h" -namespace GreenFunction { - typedef Eigen::Vector2cd soltype; - class Dyadic; -} - -class GreenFunction::Dyadic { - public: - Dyadic(const double mu0, const double c, const double hbar) - : c_(c), mu0_over_4pi_hbar_(mu0 / (4 * M_PI * hbar)){}; - virtual std::vector coefficients( - const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; - - virtual cmplx polarization_prefactor(const soltype &matrix_elements) const - { - return 2 * matrix_elements[1].real(); - } - - protected: - double c_, mu0_over_4pi_hbar_; - - std::array spatial_dyads(const Eigen::Vector3d &dr) const - { - std::array results = { - {identity_minus_3rsq(dr) * std::pow(c_, 2) / std::pow(dr.norm(), 3), - identity_minus_3rsq(dr) * c_ / dr.squaredNorm(), - identity_minus_rsq(dr) / dr.norm()}}; - - return results; - } - - static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) - { - return dr * dr.transpose() / dr.squaredNorm(); - } - - static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); - } - - static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); - } -}; - namespace Propagation { template class Propagator; diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index da311c5f..8bf530af 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -5,7 +5,7 @@ using Vec3d = Eigen::Vector3d; HistoryInteraction::HistoryInteraction( const std::shared_ptr &dots, const std::shared_ptr> &history, - const std::shared_ptr &dyadic, + const std::shared_ptr &dyadic, const int interp_order, const double dt, const double c0) : Interaction(dots), history(history), @@ -30,8 +30,7 @@ void HistoryInteraction::build_coefficient_table() Vec3d dr(separation((*dots)[src], (*dots)[obs])); - std::pair delay( - split_double(dr.norm() / (c0 * dt))); + std::pair delay(split_double(dr.norm() / (c0 * dt))); floor_delays[pair_idx] = delay.first; lagrange.calculate_weights(delay.second, dt); @@ -58,13 +57,12 @@ const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) for(int i = 0; i <= interp_order; ++i) { if(s - i < history->array.index_bases()[1]) continue; - results[src] += - (*dyadic).polarization_prefactor(history->array[obs][s - i][0]) * - coefficients[pair_idx][i]; + constexpr int RHO_01 = 1; + results[src] += + (history->array[obs][s - i][0])[RHO_01] * coefficients[pair_idx][i]; results[obs] += - (*dyadic).polarization_prefactor(history->array[src][s - i][0]) * - coefficients[pair_idx][i]; + (history->array[src][s - i][0])[RHO_01] * coefficients[pair_idx][i]; } } diff --git a/src/interactions/history_interaction.h b/src/interactions/history_interaction.h index bd9b08c8..f5f5a51c 100644 --- a/src/interactions/history_interaction.h +++ b/src/interactions/history_interaction.h @@ -15,14 +15,14 @@ class HistoryInteraction : public Interaction { HistoryInteraction( const std::shared_ptr &, const std::shared_ptr> &, - const std::shared_ptr &, const int, const double, - const double); + const std::shared_ptr &, const int, + const double, const double); virtual const ResultArray &evaluate(const int); private: std::shared_ptr> history; - std::shared_ptr dyadic; + std::shared_ptr dyadic; int interp_order, num_interactions; std::vector floor_delays; boost::multi_array coefficients; diff --git a/src/interactions/rotating_green_function.cpp b/src/interactions/rotating_green_function.cpp deleted file mode 100644 index a3e63046..00000000 --- a/src/interactions/rotating_green_function.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "rotating_green_function.h" - -std::vector GreenFunction::RotatingDyadic::coefficients( - const Eigen::Vector3d &dr, - const Interpolation::UniformLagrangeSet &interp) const -{ - std::vector coefs(interp.order() + 1, - Eigen::Matrix3cd::Zero()); - - const auto dyads(spatial_dyads(dr)); - - for(int i = 0; i <= interp.order(); ++i) { - coefs[i] = - -mu0_over_4pi_hbar_ * std::exp(-iu * omega_ * dr.norm() / c_) * - (dyads[0].cast() * interp.weights[0][i] + - dyads[1].cast() * - (interp.weights[1][i] + iu * omega_ * interp.weights[0][i]) + - dyads[2].cast() * - (interp.weights[2][i] + 2.0 * iu * omega_ * interp.weights[1][i] - - std::pow(omega_, 2) * interp.weights[0][i])); - } - - return coefs; -} diff --git a/src/interactions/rotating_green_function.h b/src/interactions/rotating_green_function.h deleted file mode 100644 index 7f4b7c68..00000000 --- a/src/interactions/rotating_green_function.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ROTATING_GREEN_FUNCTION_H -#define ROTATING_GREEN_FUNCTION_H - -#include "green_function.h" - -namespace GreenFunction { - class RotatingDyadic; -} - -class GreenFunction::RotatingDyadic : public GreenFunction::Dyadic { - public: - RotatingDyadic(const double mu0, const double c, const double hbar, const double omega) - : Dyadic(mu0, c, hbar), omega_(omega){}; - virtual std::vector coefficients( - const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; - - virtual cmplx polarization_prefactor( - const Eigen::Vector2cd &matrix_elements) const - { - return matrix_elements[1]; - } - - private: - double omega_; -}; - -#endif diff --git a/src/main.cpp b/src/main.cpp index db487d15..fd81f9f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,7 @@ #include "integrator/integrator.h" #include "interactions/history_interaction.h" #include "interactions/pulse_interaction.h" -#include "interactions/rotating_green_function.h" +#include "interactions/green_function.h" using namespace std; diff --git a/test/propagator_test.cpp b/test/propagator_test.cpp index 10f8bb86..8bce50d8 100644 --- a/test/propagator_test.cpp +++ b/test/propagator_test.cpp @@ -2,42 +2,27 @@ #include #include "../src/interactions/green_function.h" -#include "../src/interactions/rotating_green_function.h" BOOST_AUTO_TEST_SUITE(propagator) BOOST_AUTO_TEST_CASE(fixed_frame) { - GreenFunction::Dyadic dyadic(4 * M_PI, 1, 1); Propagation::FixedFramePropagator ffp(4 * M_PI, 1, 1); Eigen::Vector3d dr(1, 1, 1); Interpolation::UniformLagrangeSet uls(0.5, 4); - auto dyadic_mats = dyadic.coefficients(dr, uls); auto crtp_mats = ffp.coefficients(dr, uls); - - for(int i = 0; i < 4; ++i) { - auto delta = dyadic_mats[i] - crtp_mats[i]; - BOOST_CHECK_CLOSE(delta.squaredNorm(), 0, 1e-15); - } } BOOST_AUTO_TEST_CASE(rotating_frame) { - GreenFunction::RotatingDyadic rotating_dyadic(4 * M_PI, 1, 1, 2.2); Propagation::RotatingFramePropagator rfp(4 * M_PI, 1, 1, 2.2); Eigen::Vector3d dr(1, 1, 1); Interpolation::UniformLagrangeSet uls(0.5, 4); - auto rotating_dyadic_mats = rotating_dyadic.coefficients(dr, uls); auto rotating_crtp_mats = rfp.coefficients(dr, uls); - - for(int i = 0; i < 4; ++i) { - auto delta = rotating_dyadic_mats[i] - rotating_crtp_mats[i]; - BOOST_CHECK_CLOSE(delta.squaredNorm(), 0, 1e-15); - } } BOOST_AUTO_TEST_SUITE_END() From ddcc2b679fe692b4c20a4bab216bb1461c949818 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Tue, 27 Jun 2017 19:31:20 -0400 Subject: [PATCH 37/75] (WIP) Remove old GreenFunction stuff --- test/CMakeLists.txt | 1 - test/propagation_test.cpp | 38 -------------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 test/propagation_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9d498e37..54021ff4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,6 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/propagation_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) diff --git a/test/propagation_test.cpp b/test/propagation_test.cpp deleted file mode 100644 index fdc4fc85..00000000 --- a/test/propagation_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include - -#include "../src/propagation/history_evaluator.h" - -BOOST_AUTO_TEST_SUITE(propagation) - -struct System { - double dt; - int num_steps, interp_order; - Integrator::History history; - std::shared_ptr dots; - std::shared_ptr dyadic_gf; - - System() - : dt(1e-2), - num_steps(2000), - interp_order(4), - history(2, 20, num_steps), - dots(std::make_shared(2)), - dyadic_gf(std::make_shared(4 * M_PI, 1, 1)) - { - history.fill(0); - dots->at(0) = - QuantumDot(Eigen::Vector3d(0, 0, 0), 2278.9013, - std::make_pair(10.0, 20.0), Eigen::Vector3d(0, 0, 1)); - dots->at(1) = - QuantumDot(Eigen::Vector3d(1, 0, 0), 2278.9013, - std::make_pair(10.0, 20.0), Eigen::Vector3d(0, 0, 1)); - }; -}; - -BOOST_FIXTURE_TEST_CASE(dyad, System) -{ - Eigen::Vector3d dr(dots->at(1).position() - dots->at(0).position()); - //UniformLagrangeSet uls(dr.norm()/dt -} - -BOOST_AUTO_TEST_SUITE_END() From c2b5aa8aa34a34042ffd2255f299caaa78d300e9 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 28 Jun 2017 13:44:07 -0400 Subject: [PATCH 38/75] Rename interpolation weights => evaluations It's very confusing when the Lagrange polynomials themselves have weights (the sample values) and they're also called their evaluations "weights" as they're weighting a source signal to produce an output. I think this table works much better as a table of evaluations so that it's unambiguous what's going on. --- src/interactions/green_function.h | 14 +++--- src/lagrange_set.cpp | 16 +++--- src/lagrange_set.h | 2 +- test/lagrange_set_test.cpp | 81 +++++++++++++++---------------- 4 files changed, 56 insertions(+), 57 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index a2803799..fc179570 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -71,9 +71,9 @@ class Propagation::FixedFramePropagator const auto dyads(spatial_dyads(dr)); for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += mu0_over_4pi_hbar_ * (dyads[0] * interp.weights[0][i] + - dyads[1] * interp.weights[1][i] + - dyads[2] * interp.weights[2][i]); + coefs[i] += mu0_over_4pi_hbar_ * (dyads[0] * interp.evaluations[0][i] + + dyads[1] * interp.evaluations[1][i] + + dyads[2] * interp.evaluations[2][i]); } return coefs; @@ -98,12 +98,12 @@ class Propagation::RotatingFramePropagator for(int i = 0; i <= interp.order(); ++i) { coefs[i] = -mu0_over_4pi_hbar_ * std::exp(-iu * omega * dr.norm() / c_) * - (dyads[0].cast() * interp.weights[0][i] + + (dyads[0].cast() * interp.evaluations[0][i] + dyads[1].cast() * - (interp.weights[1][i] + iu * omega * interp.weights[0][i]) + + (interp.evaluations[1][i] + iu * omega * interp.evaluations[0][i]) + dyads[2].cast() * - (interp.weights[2][i] + 2.0 * iu * omega * interp.weights[1][i] - - std::pow(omega, 2) * interp.weights[0][i])); + (interp.evaluations[2][i] + 2.0 * iu * omega * interp.evaluations[1][i] - + std::pow(omega, 2) * interp.evaluations[0][i])); } return coefs; diff --git a/src/lagrange_set.cpp b/src/lagrange_set.cpp index b72597c5..4b8bd467 100644 --- a/src/lagrange_set.cpp +++ b/src/lagrange_set.cpp @@ -2,7 +2,7 @@ Interpolation::UniformLagrangeSet::UniformLagrangeSet(const int order) : - weights(boost::extents[Interpolation::NUM_DERIVATIVES][order + 1]), + evaluations(boost::extents[Interpolation::NUM_DERIVATIVES][order + 1]), order_(order) { } Interpolation::UniformLagrangeSet::UniformLagrangeSet(const double x, @@ -26,16 +26,16 @@ void Interpolation::UniformLagrangeSet::calculate_weights( d2_sum -= std::pow(x - m, -2); } - weights[0][basis_id] = d0_product; - weights[1][basis_id] = (weights[0][basis_id] * d1_sum); - weights[2][basis_id] = - (weights[0][basis_id] * d2_sum + - std::pow(weights[1][basis_id], 2) / weights[0][basis_id]); + evaluations[0][basis_id] = d0_product; + evaluations[1][basis_id] = (evaluations[0][basis_id] * d1_sum); + evaluations[2][basis_id] = + (evaluations[0][basis_id] * d2_sum + + std::pow(evaluations[1][basis_id], 2) / evaluations[0][basis_id]); } for(int i = 0; i <= order_; ++i) { - weights[1][i] *= std::pow(dt, -1); - weights[2][i] *= std::pow(dt, -2); + evaluations[1][i] *= std::pow(dt, -1); + evaluations[2][i] *= std::pow(dt, -2); } } diff --git a/src/lagrange_set.h b/src/lagrange_set.h index 23acba69..87801be4 100644 --- a/src/lagrange_set.h +++ b/src/lagrange_set.h @@ -11,7 +11,7 @@ namespace Interpolation { class Interpolation::UniformLagrangeSet { public: - InterpolationTable weights; + InterpolationTable evaluations; UniformLagrangeSet(const int); UniformLagrangeSet(const double, const int, const double = 1); diff --git a/test/lagrange_set_test.cpp b/test/lagrange_set_test.cpp index 110f66c1..5ff66171 100644 --- a/test/lagrange_set_test.cpp +++ b/test/lagrange_set_test.cpp @@ -1,6 +1,5 @@ #include "../src/lagrange_set.h" #include -#include BOOST_AUTO_TEST_SUITE(lagrange_interpolation) @@ -9,8 +8,8 @@ BOOST_AUTO_TEST_CASE(shape_constructor) constexpr int order = 5; Interpolation::UniformLagrangeSet ULS_easy(order); - BOOST_CHECK(ULS_easy.weights.shape()[0] == Interpolation::NUM_DERIVATIVES); - BOOST_CHECK(ULS_easy.weights.shape()[1] == order + 1); + BOOST_CHECK(ULS_easy.evaluations.shape()[0] == Interpolation::NUM_DERIVATIVES); + BOOST_CHECK(ULS_easy.evaluations.shape()[1] == order + 1); } BOOST_AUTO_TEST_CASE(value_constructor) @@ -19,8 +18,8 @@ BOOST_AUTO_TEST_CASE(value_constructor) constexpr double eval_point = 0.5; Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK(ULS_full.weights.shape()[0] == Interpolation::NUM_DERIVATIVES); - BOOST_CHECK(ULS_full.weights.shape()[1] == order + 1); + BOOST_CHECK(ULS_full.evaluations.shape()[0] == Interpolation::NUM_DERIVATIVES); + BOOST_CHECK(ULS_full.evaluations.shape()[1] == order + 1); } BOOST_AUTO_TEST_SUITE(mid_point_value_comparison) @@ -35,12 +34,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d0) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[0][0], compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][1], compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][2], compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][3], compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][4], compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][5], compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][0], compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][1], compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][2], compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][3], compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][4], compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][5], compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_CASE(full_constructor_d1) @@ -53,12 +52,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d1) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[1][0], -compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][1], -compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][2], -compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][3], -compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][4], -compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][5], -compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][0], -compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][1], -compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][2], -compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][3], -compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][4], -compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][5], -compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_CASE(full_constructor_d2) @@ -70,12 +69,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d2) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[2][0], compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][1], compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][2], compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][3], compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][4], compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][5], compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][0], compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][1], compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][2], compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][3], compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][4], compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][5], compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_SUITE_END() @@ -96,12 +95,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d0) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[0][0], compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][1], compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][2], compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][3], compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][4], compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[0][5], compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][0], compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][1], compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][2], compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][3], compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][4], compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[0][5], compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_CASE(full_constructor_d1) @@ -118,12 +117,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d1) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[1][0], -compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][1], -compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][2], -compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][3], -compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][4], -compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[1][5], -compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][0], -compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][1], -compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][2], -compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][3], -compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][4], -compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[1][5], -compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_CASE(full_constructor_d2) @@ -140,12 +139,12 @@ BOOST_AUTO_TEST_CASE(full_constructor_d2) Interpolation::UniformLagrangeSet ULS_full(eval_point, order); - BOOST_CHECK_CLOSE(ULS_full.weights[2][0], compare_array.at(0), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][1], compare_array.at(1), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][2], compare_array.at(2), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][3], compare_array.at(3), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][4], compare_array.at(4), 0.0001); - BOOST_CHECK_CLOSE(ULS_full.weights[2][5], compare_array.at(5), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][0], compare_array.at(0), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][1], compare_array.at(1), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][2], compare_array.at(2), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][3], compare_array.at(3), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][4], compare_array.at(4), 0.0001); + BOOST_CHECK_CLOSE(ULS_full.evaluations[2][5], compare_array.at(5), 0.0001); } BOOST_AUTO_TEST_SUITE_END() From 6408e71a24a5f9a4bb46f4ade3129c9ea6018974 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 28 Jun 2017 15:56:08 -0400 Subject: [PATCH 39/75] adds class for magnetic particles analagous to quantum dot class. Accompanied by a cpp file to define function implementations. --- src/magnetic_particle.cpp | 63 +++++++++++++++++++++++++++++++++++++++ src/magnetic_particle.h | 50 +++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 src/magnetic_particle.cpp create mode 100644 src/magnetic_particle.h diff --git a/src/magnetic_particle.cpp b/src/magnetic_particle.cpp new file mode 100644 index 00000000..dc3cf894 --- /dev/null +++ b/src/magnetic_particle.cpp @@ -0,0 +1,63 @@ +#include "magnetic_particle.h" + +MagneticParticle::MagneticParticle(const Eigen::Vector3d &pos, + const double alpha, const double gamma0, + const double sat_mag, const soltype &mag) + : pos(pos), + alpha(alpha), + gamma0(gamma0), + mag(mag), + sat_mag(sat_mag) +{ +} + +soltype MagneticParticle::llg_rhs(const soltype &mag, + const Eigen::Vector3d &hfield) +{ + const Eigen::Vector3d mxh = mag.cross(hfield); + const double gamma = gamma0 / ( 1 + std::pow(alpha,2)); + + return -gamma * mxh - gamma * alpha / sat_mag * mag.cross(mxh); +} + +const Eigen::Vector3d separation(const MagneticParticle &mp1, + const MagneticParticle &mp2) +{ + return mp2.pos - mp1.pos; +} + +rhs_func_vector rhs_functions(const DotVector &dots) +{ + rhs_func_vector funcs(dots.size()); + + using std::placeholders::_1; + using std::placeholders::_2; + std::transform(dots.begin(), dots.end(), funcs.begin(), + [](const MagneticParticle &mp) { + return std::bind(&MagneticParticle::llg_rhs, mp, _1, _2); + }); + return funcs; +} + +std::ostream &operator<<(std::ostream &os, const MagneticParticle &mp) +{ + os << mp.pos.transpose() << " " << mp.alpha << " " << mp.gamma0 << " " + << mp.sat_mag << " " << mp.mag.transpose() << std::endl; + return os; +} + +std::istream &operator>>(std::istream &is, MagneticParticle &mp) +{ + is >> mp.pos[0] >> mp.pos[1] >> mp.pos[2] >> mp.alpha >> mp.gamma0 >> + mp.sat_mag >> mp.mag[0] >> mp.mag[1] >> mp.mag[2]; + return is; +} + +DotVector import_dots(const std::string &fname) +{ + std::ifstream ifs(fname); + if(!ifs) throw std::runtime_error("Could not open " + fname); + + std::istream_iterator in_iter(ifs), eof; + return DotVector(in_iter, eof); +} diff --git a/src/magnetic_particle.h b/src/magnetic_particle.h new file mode 100644 index 00000000..c7d7115a --- /dev/null +++ b/src/magnetic_particle.h @@ -0,0 +1,50 @@ +#ifndef MAGNETIC_PARTICLE_H +#define MAGNETIC_PARTICLE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class MagneticParticle; + +typedef Eigen::Vector3d soltype; +typedef std::vector DotVector; +typedef std::vector< + std::function> + rhs_func_vector; + +class MagneticParticle { + public: + MagneticParticle() = default; + MagneticParticle(const Eigen::Vector3d &, const double, const double, + const double, const soltype &); + + soltype llg_rhs(const soltype &, const Eigen::Vector3d &); + + const Eigen::Vector3d &position() const { return pos; } + const soltype &magnetization() const { return mag; } + const double saturization() const { return sat_mag; } + friend const Eigen::Vector3d separation(const MagneticParticle &, + const MagneticParticle &); + + friend std::ostream &operator<<(std::ostream &, const MagneticParticle &); + friend std::istream &operator>>(std::istream &, MagneticParticle &); + + //private: + Eigen::Vector3d pos; + double alpha; + double gamma0; + soltype mag; + double sat_mag; +}; + +rhs_func_vector rhs_functions(const DotVector &); +DotVector import_dots(const std::string &); + +#endif From 2bac43de3521fe181035033cec0941ef19f2ae37 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 28 Jun 2017 16:22:20 -0400 Subject: [PATCH 40/75] Don't bin-pack arguments --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index cdc3f511..46b2ce8c 100644 --- a/.clang-format +++ b/.clang-format @@ -19,7 +19,7 @@ AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: true BinPackArguments: true -BinPackParameters: true +BinPackParameters: false BraceWrapping: AfterClass: false AfterControlStatement: false From bf20a1cf379bc3cc412cf65eb72e1ccf85e4aaed Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Wed, 28 Jun 2017 16:58:25 -0400 Subject: [PATCH 41/75] Develop BlochRHS type --- src/integrator/RHS/CMakeLists.txt | 2 ++ src/integrator/RHS/bloch_rhs.cpp | 32 +++++++++++++++++++++++++++++++ src/integrator/RHS/bloch_rhs.h | 32 +++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 src/integrator/RHS/bloch_rhs.cpp create mode 100644 src/integrator/RHS/bloch_rhs.h diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt index 1f19d2cb..e0779f38 100644 --- a/src/integrator/RHS/CMakeLists.txt +++ b/src/integrator/RHS/CMakeLists.txt @@ -1,5 +1,7 @@ target_sources(quest PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/bloch_rhs.cpp" + "${CMAKE_CURRENT_LIST_DIR}/bloch_rhs.h" "${CMAKE_CURRENT_LIST_DIR}/ode_rhs.h" "${CMAKE_CURRENT_LIST_DIR}/rhs.h" ) diff --git a/src/integrator/RHS/bloch_rhs.cpp b/src/integrator/RHS/bloch_rhs.cpp new file mode 100644 index 00000000..ba515ed0 --- /dev/null +++ b/src/integrator/RHS/bloch_rhs.cpp @@ -0,0 +1,32 @@ +#include "bloch_rhs.h" + +Integrator::BlochRHS::BlochRHS( + const double dt, + const std::shared_ptr> &history, + std::vector> &interactions, + std::vector &rhs_functions) + : Integrator::RHS(dt, history), + num_solutions(history->array.shape()[0]), + interactions(interactions), + rhs_functions(rhs_functions) +{ +} + +void Integrator::BlochRHS::evaluate(const int step) const +{ + auto eval_and_sum = + [step](const Interaction::ResultArray &r, + const std::shared_ptr &interaction) { + return r + interaction->evaluate(step); + }; + auto nil = Interaction::ResultArray::Zero(num_solutions, 1).eval(); + + auto projected_efields = std::accumulate( + interactions.begin(), interactions.end(), nil, eval_and_sum); + + for(int solution = 0; solution < num_solutions; ++solution) { + history->array[solution][step][1] = rhs_functions[solution]( + history->array[solution][step][0], projected_efields[solution]); + } + +} diff --git a/src/integrator/RHS/bloch_rhs.h b/src/integrator/RHS/bloch_rhs.h new file mode 100644 index 00000000..22173c4e --- /dev/null +++ b/src/integrator/RHS/bloch_rhs.h @@ -0,0 +1,32 @@ +#ifndef BLOCH_RHS_H +#define BLOCH_RHS_H + +#include +#include +#include + +#include "rhs.h" +#include "../../interactions/interaction.h" + +namespace Integrator { + class BlochRHS; +} + +class Integrator::BlochRHS : public Integrator::RHS { + public: + typedef std::function)> + BlochFunctionType; + BlochRHS(const double, + const std::shared_ptr> &, + std::vector> &, + std::vector &rhs_functions); + void evaluate(const int) const override; + + private: + int num_solutions; + std::vector> interactions; + std::vector rhs_functions; +}; + +#endif From 29ea0ad1817ebf0e74cc15411fe60b3ed08bb921 Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Thu, 29 Jun 2017 13:34:14 -0400 Subject: [PATCH 42/75] Remove "propagation" dir This stuff was an attempt to reconcile the differences between Bloch & LLG stuff, but, for the moment, I think they are irreconcilable. So we'll stick with known working code elsewhere until I can think of a better way to patch things together. --- src/propagation/green_function.cpp | 20 ----------- src/propagation/green_function.h | 52 --------------------------- src/propagation/history_evaluator.cpp | 9 ----- src/propagation/history_evaluator.h | 38 -------------------- src/propagation/propagation.h | 33 ----------------- 5 files changed, 152 deletions(-) delete mode 100644 src/propagation/green_function.cpp delete mode 100644 src/propagation/green_function.h delete mode 100644 src/propagation/history_evaluator.cpp delete mode 100644 src/propagation/history_evaluator.h delete mode 100644 src/propagation/propagation.h diff --git a/src/propagation/green_function.cpp b/src/propagation/green_function.cpp deleted file mode 100644 index f44fc016..00000000 --- a/src/propagation/green_function.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "green_function.h" - -std::vector GreenFunction::Dyadic::coefficients( - const Eigen::Vector3d &dr, - const Interpolation::UniformLagrangeSet &interp) const -{ - std::vector coefs(interp.order() + 1, - Eigen::Matrix3cd::Zero()); - - const auto dyads(spatial_dyads(dr)); - - for(int i = 0; i <= interp.order(); ++i) { - for(int term = 0; term < 3; ++term) { - coefs[i] += mu0_over_4pi_hbar_ * dyads[term].cast() * - interp.weights[term][i]; - } - } - - return coefs; -} diff --git a/src/propagation/green_function.h b/src/propagation/green_function.h deleted file mode 100644 index f9c76ee7..00000000 --- a/src/propagation/green_function.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef GREEN_FUNCTION_H -#define GREEN_FUNCTION_H - -#include -#include -#include - -#include "../common.h" -#include "../lagrange_set.h" - -namespace GreenFunction { - typedef Eigen::Vector2cd soltype; - class Dyadic; -} - -class GreenFunction::Dyadic { - public: - Dyadic(const double mu0, const double c, const double hbar) - : c_(c), mu0_over_4pi_hbar_(mu0 / (4 * M_PI * hbar)){}; - virtual std::vector coefficients( - const Eigen::Vector3d &, const Interpolation::UniformLagrangeSet &) const; - - protected: - double c_, mu0_over_4pi_hbar_; - - std::array spatial_dyads(const Eigen::Vector3d &dr) const - { - std::array results = { - {identity_minus_3rsq(dr) * std::pow(c_, 2) / std::pow(dr.norm(), 3), - identity_minus_3rsq(dr) * c_ / dr.squaredNorm(), - identity_minus_rsq(dr) / dr.norm()}}; - - return results; - } - - static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) - { - return dr * dr.transpose() / dr.squaredNorm(); - } - - static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); - } - - static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); - } -}; - -#endif diff --git a/src/propagation/history_evaluator.cpp b/src/propagation/history_evaluator.cpp deleted file mode 100644 index 2ba3efe0..00000000 --- a/src/propagation/history_evaluator.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "history_evaluator.h" - -template -HistoryEvaluator::HistoryEvaluator( - const std::shared_ptr> &history, - const std::shared_ptr &dyad, const int interp_order, - const double c0, const double dt) : - FieldEvaluator(dots), history(history) -{} diff --git a/src/propagation/history_evaluator.h b/src/propagation/history_evaluator.h deleted file mode 100644 index df7bd70d..00000000 --- a/src/propagation/history_evaluator.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef HISTORY_EVALUATOR_H -#define HISTORY_EVALUATOR_H - -#include "propagation.h" -#include "../integrator/history.h" -#include "green_function.h" - -namespace Propagation { - template - class HistoryEvaluator; -} - -template -class Propagation::HistoryEvaluator - : public Propagation::FieldEvaluator { - public: - HistoryEvaluator(const std::shared_ptr &, - const std::shared_ptr> &, - const std::shared_ptr &, const int, - const double, const double); - - private: - std::shared_ptr> history; - std::shared_ptr dyadic; - int interp_order, num_interactions; - std::vector floor_delays; - boost::multi_array, 2> - interpolated_propagators; - const double c0, dt; - - void build_coefficient_table(); - - static int coord2idx(const std::pair &); - static std::pair idx2coord(const int); - static std::pair split_double(const double); -}; - -#endif diff --git a/src/propagation/propagation.h b/src/propagation/propagation.h deleted file mode 100644 index 8dc21e1f..00000000 --- a/src/propagation/propagation.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef PROPAGATION_H -#define PROPAGATION_H - -#include -#include -#include - -#include "../quantum_dot.h" - -namespace Propagation { - template - class FieldEvaluator; -} - -template -class Propagation::FieldEvaluator { - public: - typedef Eigen::Matrix fieldtype; - typedef std::vector> - ResultTable; - - FieldEvaluator(const std::shared_ptr &dots) - : dots(dots), results(dots->size()){}; - - const fieldtype &operator[](const int i) const { return results[i]; } - virtual const ResultTable &evaluate(const int) = 0; - - protected: - std::shared_ptr dots; - ResultTable results; -}; - -#endif From e67f3b2fec8161cfbf1a9af428599bca5c7084ed Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Thu, 29 Jun 2017 13:39:33 -0400 Subject: [PATCH 43/75] Build BlochRHS and integrate with solver code --- src/integrator/RHS/bloch_rhs.cpp | 8 ++--- src/integrator/RHS/bloch_rhs.h | 10 ++---- src/integrator/history.h | 13 +++++++ src/main.cpp | 58 ++++++++++++++++++-------------- src/quantum_dot.cpp | 14 ++++---- src/quantum_dot.h | 17 ++++++---- 6 files changed, 69 insertions(+), 51 deletions(-) diff --git a/src/integrator/RHS/bloch_rhs.cpp b/src/integrator/RHS/bloch_rhs.cpp index ba515ed0..e7776080 100644 --- a/src/integrator/RHS/bloch_rhs.cpp +++ b/src/integrator/RHS/bloch_rhs.cpp @@ -3,12 +3,12 @@ Integrator::BlochRHS::BlochRHS( const double dt, const std::shared_ptr> &history, - std::vector> &interactions, - std::vector &rhs_functions) + std::vector> interactions, + std::vector rhs_functions) : Integrator::RHS(dt, history), num_solutions(history->array.shape()[0]), - interactions(interactions), - rhs_functions(rhs_functions) + interactions(std::move(interactions)), + rhs_functions(std::move(rhs_functions)) { } diff --git a/src/integrator/RHS/bloch_rhs.h b/src/integrator/RHS/bloch_rhs.h index 22173c4e..bde379a4 100644 --- a/src/integrator/RHS/bloch_rhs.h +++ b/src/integrator/RHS/bloch_rhs.h @@ -5,22 +5,18 @@ #include #include -#include "rhs.h" #include "../../interactions/interaction.h" - +#include "rhs.h" namespace Integrator { class BlochRHS; } class Integrator::BlochRHS : public Integrator::RHS { public: - typedef std::function)> - BlochFunctionType; BlochRHS(const double, const std::shared_ptr> &, - std::vector> &, - std::vector &rhs_functions); + std::vector>, + std::vector); void evaluate(const int) const override; private: diff --git a/src/integrator/history.h b/src/integrator/history.h index fec6cd8f..acce890c 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -18,10 +18,13 @@ namespace Integrator { template class Integrator::History { public: + static constexpr int DERIV_0 = 0, DERIV_1 = 1; + History(const int, const int, const int); soltype_array array; void fill(const soltype &); + void initialize_past(const soltype &); private: }; @@ -42,4 +45,14 @@ void Integrator::History::fill(const soltype &val) std::fill(array.data(), array.data() + array.num_elements(), val); } +template +void Integrator::History::initialize_past(const soltype &val) +{ + for(int n = 0; n < static_cast(array.shape()[0]); ++n) { + for(int t = array.index_bases()[1]; t <= 0; ++t) { + array[n][t][DERIV_0] = val; + } + } +} + #endif diff --git a/src/main.cpp b/src/main.cpp index fd81f9f0..6ba70db2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,11 +6,12 @@ #include #include "configuration.h" +#include "integrator/RHS/bloch_rhs.h" #include "integrator/history.h" #include "integrator/integrator.h" +#include "interactions/green_function.h" #include "interactions/history_interaction.h" #include "interactions/pulse_interaction.h" -#include "interactions/green_function.h" using namespace std; @@ -22,38 +23,43 @@ int main(int argc, char *argv[]) cout << "Initializing..." << endl; - //auto qds = make_shared(import_dots(config.qd_path)); - //qds->resize(config.num_particles); - //auto rhs_funs = rhs_functions(*qds, config.omega); + auto qds = make_shared(import_dots(config.qd_path)); + qds->resize(config.num_particles); + auto rhs_funs = rhs_functions(*qds, config.omega); + + // Set up History + auto history = std::make_shared>( + config.num_particles, 22, config.num_timesteps); + history->fill(Eigen::Vector2cd(0, 0)); + history->initialize_past(Eigen::Vector2cd(1, 0)); - //// Set up History - //auto history(History::make_shared_history(config.num_particles, 22, - //config.num_timesteps)); - //for(int t = -22; t <= 0; ++t) { - //for(int sol_idx = 0; sol_idx < config.num_particles; ++sol_idx) { - //(*history)[sol_idx][t][0] = Eigen::Vector2cd(1, 0); // Ground state - //} - //} + // Set up Interactions + auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); + auto rotating_dyadic = make_shared( + config.mu0, config.c0, config.hbar, config.omega); - //auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); + std::vector> interactions{ + make_shared(qds, pulse1, config.hbar, config.dt), + make_shared(qds, history, rotating_dyadic, + config.interpolation_order, config.dt, + config.c0)}; - //auto rotating_dyadic = make_shared( - //config.mu0, config.c0, config.hbar, config.omega); + // Set up RHS functions + auto rhs_funcs = rhs_functions(*qds, config.omega); - //std::vector> interactions{ - //make_shared(qds, pulse1, config.hbar, config.dt), - //make_shared(qds, history, rotating_dyadic, - //config.interpolation_order, - //config.dt, config.c0)}; + // Set up Bloch RHS + std::unique_ptr> bloch_rhs = + std::make_unique( + config.dt, history, std::move(interactions), std::move(rhs_funcs)); - //PredictorCorrector::Integrator integrator( - //config.dt, 18, 22, 3.15, history, rhs_funs, std::move(interactions)); + Integrator::PredictorCorrector solver( + config.dt, 18, 22, 3.15, history, bloch_rhs); - //cout << "Solving..." << endl; - //integrator.solve(); + // cout << "Solving..." << endl; + solver.solve(); - //cout << "Writing output..." << endl; - //History::write_history(history, "output.dat"); + // cout << "Writing output..." << endl; + // History::write_history(history, "output.dat"); } catch(CommandLineException &e) { // User most likely queried for help or version info, so we can silently diff --git a/src/quantum_dot.cpp b/src/quantum_dot.cpp index 2a608323..943b2a6a 100644 --- a/src/quantum_dot.cpp +++ b/src/quantum_dot.cpp @@ -1,6 +1,7 @@ #include "quantum_dot.h" -QuantumDot::QuantumDot(const Eigen::Vector3d &pos, const double freq, +QuantumDot::QuantumDot(const Eigen::Vector3d &pos, + const double freq, const std::pair &damping, const Eigen::Vector3d &dip) : pos(pos), freq(freq), damping(damping), dip(dip) @@ -8,7 +9,8 @@ QuantumDot::QuantumDot(const Eigen::Vector3d &pos, const double freq, } matrix_elements QuantumDot::liouville_rhs(const matrix_elements &rho, - const cmplx rabi, const double laser_freq) const + const cmplx rabi, + const double laser_freq) const { const cmplx m0 = -iu * (rabi * std::conj(rho[1]) - std::conj(rabi) * rho[1]) - (rho[0] - 1.0) / damping.first; @@ -46,12 +48,10 @@ DotVector import_dots(const std::string &fname) return DotVector(in_iter, eof); } -typedef std::vector< - std::function> - rhs_func_vector; -rhs_func_vector rhs_functions(const DotVector &dots, const double laser_frequency) +std::vector rhs_functions(const DotVector &dots, + const double laser_frequency) { - rhs_func_vector funcs(dots.size()); + std::vector funcs(dots.size()); using std::placeholders::_1; using std::placeholders::_2; diff --git a/src/quantum_dot.h b/src/quantum_dot.h index 9fac7662..c36a3eca 100644 --- a/src/quantum_dot.h +++ b/src/quantum_dot.h @@ -17,14 +17,20 @@ class QuantumDot; typedef std::vector DotVector; typedef Eigen::Vector2cd matrix_elements; +typedef std::function)> + BlochFunctionType; class QuantumDot { public: QuantumDot() = default; - QuantumDot(const Eigen::Vector3d &, const double, - const std::pair &, const Eigen::Vector3d &); + QuantumDot(const Eigen::Vector3d &, + const double, + const std::pair &, + const Eigen::Vector3d &); - matrix_elements liouville_rhs(const matrix_elements &, const cmplx, + matrix_elements liouville_rhs(const matrix_elements &, + const cmplx, const double) const; const Eigen::Vector3d &position() const { return pos; } @@ -48,9 +54,6 @@ class QuantumDot { }; DotVector import_dots(const std::string &); - -std::vector< - std::function> -rhs_functions(const DotVector &, const double); +std::vector rhs_functions(const DotVector &, const double); #endif From a6e33c378a0b45180bf4de2380b4f8233224198e Mon Sep 17 00:00:00 2001 From: Connor Glosser Date: Thu, 29 Jun 2017 13:59:19 -0400 Subject: [PATCH 44/75] Write new history table to file after sim --- src/main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6ba70db2..5e7ba030 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,11 +55,18 @@ int main(int argc, char *argv[]) Integrator::PredictorCorrector solver( config.dt, 18, 22, 3.15, history, bloch_rhs); - // cout << "Solving..." << endl; + cout << "Solving..." << endl; solver.solve(); - // cout << "Writing output..." << endl; - // History::write_history(history, "output.dat"); + cout << "Writing output..." << endl; + ofstream outfile("output.dat"); + outfile << scientific << setprecision(15); + for(int t = 0; t < config.num_timesteps; ++t) { + for(int n = 0; n < config.num_particles; ++n) { + outfile << history->array[n][t][0].transpose() << " "; + } + outfile << "\n"; + } } catch(CommandLineException &e) { // User most likely queried for help or version info, so we can silently From 1dcdd6100af41aaea55e0bf9b696db3574c8eb73 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 29 Jun 2017 16:12:29 -0400 Subject: [PATCH 45/75] made pulse agnostic to the type of field and add a cos term for non-rwa calculations. --- src/CMakeLists.txt | 2 ++ src/pulse.cpp | 19 +++++++++++-------- src/pulse.h | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4121c99b..8f6c0881 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,8 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/pulse.h" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot.h" + "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.cpp"` + "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.h"` ) add_executable(quest-bin "") diff --git a/src/pulse.cpp b/src/pulse.cpp index 54b56b6c..ace953a1 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -1,14 +1,17 @@ #include "pulse.h" -Pulse::Pulse(const double amplitude, const double delay, const double width, - const double freq, const Eigen::Vector3d &wavevector, - const Eigen::Vector3d &polarization) +Pulse::Pulse(const double amplitude, + const double delay, + const double width, + const double freq, + const Eigen::Vector3d &wavevector, + const Eigen::Vector3d &field_orientation) : amplitude(amplitude), delay(delay), width(width), freq(freq), wavevector(wavevector), - polarization(polarization.normalized()) + field_orientation(field_orientation.normalized()) { } @@ -16,21 +19,21 @@ Eigen::Vector3d Pulse::operator()(const Eigen::Vector3d &r, const double t) const { const double arg = wavevector.dot(r) - freq * (t - delay); - return (amplitude / 2 * polarization) * gaussian(arg / width); // * cos(arg); + return (amplitude / 2 * field_orientation * gaussian(arg / width) * cos(arg); } std::ostream &operator<<(std::ostream &os, const Pulse &p) { os << p.amplitude << " " << p.delay << " " << p.width << " " << p.freq << " " - << p.wavevector.transpose() << " " << p.polarization.transpose(); + << p.wavevector.transpose() << " " << p.field_orientation.transpose(); return os; } std::istream &operator>>(std::istream &is, Pulse &p) { is >> p.amplitude >> p.delay >> p.width >> p.freq >> p.wavevector[0] >> - p.wavevector[1] >> p.wavevector[2] >> p.polarization[0] >> - p.polarization[1] >> p.polarization[2]; + p.wavevector[1] >> p.wavevector[2] >> p.field_orientation[0] >> + p.field_orientation[1] >> p.field_orientation[2]; return is; } diff --git a/src/pulse.h b/src/pulse.h index 4495efb7..999deb34 100644 --- a/src/pulse.h +++ b/src/pulse.h @@ -20,7 +20,7 @@ class Pulse { private: double amplitude, delay, width, freq; - Eigen::Vector3d wavevector, polarization; + Eigen::Vector3d wavevector, field_orientation; }; Pulse read_pulse_config(const std::string &); From 2fb875c9ce7d43aacc773c9a0a54d1e7d7a85395 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 29 Jun 2017 17:28:28 -0400 Subject: [PATCH 46/75] changed interactions.h to handle vectors and changed the pulse_interaction and pulse to fit the llg stuff --- src/interactions/interaction.h | 6 +++--- src/interactions/pulse_interaction.cpp | 6 +++--- src/magnetic_particle.h | 2 +- src/pulse.cpp | 2 +- test/CMakeLists.txt | 11 ----------- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/interactions/interaction.h b/src/interactions/interaction.h index 30b7dc01..0d6d0cd5 100644 --- a/src/interactions/interaction.h +++ b/src/interactions/interaction.h @@ -4,15 +4,15 @@ #include #include -#include "../quantum_dot.h" +#include "../magnetic_particle.h" class Interaction { public: - typedef Eigen::Array ResultArray; + typedef std::vector ResultArray; Interaction(const std::shared_ptr &dots) : dots(dots), results(dots->size()){}; - const cmplx &operator[](const int i) const { return results[i]; } + const Eigen::Vector3d &operator[](const int i) const { return results[i]; } virtual const ResultArray &evaluate(const int) = 0; protected: diff --git a/src/interactions/pulse_interaction.cpp b/src/interactions/pulse_interaction.cpp index 790f5314..98155c49 100644 --- a/src/interactions/pulse_interaction.cpp +++ b/src/interactions/pulse_interaction.cpp @@ -2,7 +2,8 @@ PulseInteraction::PulseInteraction(const std::shared_ptr &dots, const std::shared_ptr pulse, - const double hbar, const double dt) + const double hbar, + const double dt) : Interaction(dots), pulse(std::move(pulse)), hbar(hbar), dt(dt) { } @@ -12,8 +13,7 @@ const Interaction::ResultArray &PulseInteraction::evaluate(const int time_idx) const double time = time_idx * dt; for(size_t i = 0; i < dots->size(); ++i) { - results[i] = - (*pulse)((*dots)[i].position(), time).dot((*dots)[i].dipole()) / hbar; + results[i] = (*pulse)((*dots)[i].position(), time); } return results; diff --git a/src/magnetic_particle.h b/src/magnetic_particle.h index c7d7115a..e33edcd6 100644 --- a/src/magnetic_particle.h +++ b/src/magnetic_particle.h @@ -36,7 +36,7 @@ class MagneticParticle { friend std::ostream &operator<<(std::ostream &, const MagneticParticle &); friend std::istream &operator>>(std::istream &, MagneticParticle &); - //private: + private: Eigen::Vector3d pos; double alpha; double gamma0; diff --git a/src/pulse.cpp b/src/pulse.cpp index ace953a1..fdc1625b 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -19,7 +19,7 @@ Eigen::Vector3d Pulse::operator()(const Eigen::Vector3d &r, const double t) const { const double arg = wavevector.dot(r) - freq * (t - delay); - return (amplitude / 2 * field_orientation * gaussian(arg / width) * cos(arg); + return (amplitude / 2 * field_orientation * gaussian(arg / width) * cos(arg)); } std::ostream &operator<<(std::ostream &os, const Pulse &p) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 949c3fb2..54021ff4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,20 +9,9 @@ if(${Boost_FOUND}) PUBLIC "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" -<<<<<<< HEAD -<<<<<<< HEAD - "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/history_interaction_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" - ) - target_link_libraries(qtest PUBLIC libquest ${Boost_LIBRARIES}) -======= -======= "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" ->>>>>>> a6e33c378a0b45180bf4de2380b4f8233224198e "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) ->>>>>>> 9ed9f70a7fc64e18c1d413870ab551425712af26 endif(${Boost_FOUND}) From 25596239afec71b2d876e9699630a56ee844751e Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 4 Jul 2017 14:11:41 -0400 Subject: [PATCH 47/75] mass changes to overall code to implement llg behavior over bloch. --- src/CMakeLists.txt | 8 ++--- src/integrator/RHS/CMakeLists.txt | 4 +-- src/integrator/RHS/llg_rhs.h | 37 ++++++++---------------- src/interactions/history_interaction.cpp | 21 +++++++------- src/interactions/history_interaction.h | 16 +++++----- src/main.cpp | 25 ++++++++-------- test/CMakeLists.txt | 6 ++-- 7 files changed, 52 insertions(+), 65 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8f6c0881..035e2c0c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,10 +12,10 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/math_utils.h" "${CMAKE_CURRENT_LIST_DIR}/pulse.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse.h" - "${CMAKE_CURRENT_LIST_DIR}/quantum_dot.cpp" - "${CMAKE_CURRENT_LIST_DIR}/quantum_dot.h" - "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.cpp"` - "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.h"` + #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot.h" + "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.cpp" + "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.h" ) add_executable(quest-bin "") diff --git a/src/integrator/RHS/CMakeLists.txt b/src/integrator/RHS/CMakeLists.txt index e0779f38..ddc63915 100644 --- a/src/integrator/RHS/CMakeLists.txt +++ b/src/integrator/RHS/CMakeLists.txt @@ -1,7 +1,7 @@ target_sources(quest PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/bloch_rhs.cpp" - "${CMAKE_CURRENT_LIST_DIR}/bloch_rhs.h" + "${CMAKE_CURRENT_LIST_DIR}/llg_rhs.h" + "${CMAKE_CURRENT_LIST_DIR}/llg_rhs.cpp" "${CMAKE_CURRENT_LIST_DIR}/ode_rhs.h" "${CMAKE_CURRENT_LIST_DIR}/rhs.h" ) diff --git a/src/integrator/RHS/llg_rhs.h b/src/integrator/RHS/llg_rhs.h index dfe4c7b8..cc1f8891 100644 --- a/src/integrator/RHS/llg_rhs.h +++ b/src/integrator/RHS/llg_rhs.h @@ -1,40 +1,27 @@ #ifndef LLG_RHS_H #define LLG_RHS_H -#include "rhs.h" #include +#include "../../interactions/interaction.h" +#include "rhs.h" + namespace Integrator { class LLG_RHS; } -typedef Eigen::Vector3d vec3d; - -class Integrator::LLG_RHS : public RHS { +class Integrator::LLG_RHS : public RHS { public: - LLG_RHS(const double dt, - const std::shared_ptr> &history) - : RHS(dt, history){}; - void evaluate(const int) const; + LLG_RHS(const double, + const std::shared_ptr> &, + std::vector>, + rhs_func_vector); + void evaluate(const int) const override; private: + int num_solutions; + std::vector> interactions; + rhs_func_vector rhs_functions; }; -void Integrator::LLG_RHS::evaluate(const int n) const -{ // constants subject to change - const double alpha = 1; - const double gamma0 = 1; - const double time = n * dt; - const double gamma = gamma0 / (1 + std::pow(alpha,2)); //might change -// vec3d hfield = hist_interaction + pulse_interaction; <-- seudo-code - vec3d hfield(0,0,0); - - for(int i = 0; static_cast(history->array.shape()[0]); ++i) { - vec3d mxh = history->array[i][n][0].cross(hfield); - history->array[i][n][1] = -gamma * mxh - gamma * alpha / - history->array[i][n][0].norm() * - history->array[i][n][0].cross(mxh); - }; -}; - #endif diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index 8bf530af..806adad2 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -4,9 +4,11 @@ using Vec3d = Eigen::Vector3d; HistoryInteraction::HistoryInteraction( const std::shared_ptr &dots, - const std::shared_ptr> &history, - const std::shared_ptr &dyadic, - const int interp_order, const double dt, const double c0) + const std::shared_ptr> &history, + const std::shared_ptr &dyadic, + const int interp_order, + const double dt, + const double c0) : Interaction(dots), history(history), dyadic(dyadic), @@ -35,19 +37,18 @@ void HistoryInteraction::build_coefficient_table() floor_delays[pair_idx] = delay.first; lagrange.calculate_weights(delay.second, dt); - std::vector interp_dyads( + std::vector interp_dyads( dyadic->coefficients(dr, lagrange)); for(int i = 0; i <= interp_order; ++i) { - coefficients[pair_idx][i] = - (*dots)[obs].dipole().dot(interp_dyads[i] * (*dots)[src].dipole()); + coefficients[pair_idx][i] = interp_dyads[i]; } } } const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) { - results.setZero(); + for(int i = 0; i < results.size(); ++i) results[i] = Eigen::Vector3d(0, 0, 0); for(int pair_idx = 0; pair_idx < num_interactions; ++pair_idx) { int src, obs; @@ -57,12 +58,10 @@ const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) for(int i = 0; i <= interp_order; ++i) { if(s - i < history->array.index_bases()[1]) continue; - constexpr int RHO_01 = 1; - results[src] += - (history->array[obs][s - i][0])[RHO_01] * coefficients[pair_idx][i]; + coefficients[pair_idx][i] * history->array[obs][s - i][0]; results[obs] += - (history->array[src][s - i][0])[RHO_01] * coefficients[pair_idx][i]; + coefficients[pair_idx][i] * history->array[src][s - i][0]; } } diff --git a/src/interactions/history_interaction.h b/src/interactions/history_interaction.h index f5f5a51c..8e1ccd93 100644 --- a/src/interactions/history_interaction.h +++ b/src/interactions/history_interaction.h @@ -6,7 +6,7 @@ #include "../integrator/history.h" #include "../lagrange_set.h" -#include "../quantum_dot.h" +#include "../magnetic_particle.h" #include "green_function.h" #include "interaction.h" @@ -14,18 +14,20 @@ class HistoryInteraction : public Interaction { public: HistoryInteraction( const std::shared_ptr &, - const std::shared_ptr> &, - const std::shared_ptr &, const int, - const double, const double); + const std::shared_ptr> &, + const std::shared_ptr &, + const int, + const double, + const double); virtual const ResultArray &evaluate(const int); private: - std::shared_ptr> history; - std::shared_ptr dyadic; + std::shared_ptr> history; + std::shared_ptr dyadic; int interp_order, num_interactions; std::vector floor_delays; - boost::multi_array coefficients; + boost::multi_array coefficients; const double dt; const double c0; diff --git a/src/main.cpp b/src/main.cpp index 5e7ba030..2d35560f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ #include #include "configuration.h" -#include "integrator/RHS/bloch_rhs.h" +#include "integrator/RHS/llg_rhs.h" #include "integrator/history.h" #include "integrator/integrator.h" #include "interactions/green_function.h" @@ -25,35 +25,34 @@ int main(int argc, char *argv[]) auto qds = make_shared(import_dots(config.qd_path)); qds->resize(config.num_particles); - auto rhs_funs = rhs_functions(*qds, config.omega); // Set up History - auto history = std::make_shared>( + auto history = std::make_shared>( config.num_particles, 22, config.num_timesteps); - history->fill(Eigen::Vector2cd(0, 0)); - history->initialize_past(Eigen::Vector2cd(1, 0)); + history->fill(soltype(0, 0, 0)); + history->initialize_past(soltype(1, 1, 1)); // Set up Interactions auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); - auto rotating_dyadic = make_shared( - config.mu0, config.c0, config.hbar, config.omega); + auto dyadic = make_shared( + config.mu0, config.c0, config.hbar); std::vector> interactions{ make_shared(qds, pulse1, config.hbar, config.dt), - make_shared(qds, history, rotating_dyadic, + make_shared(qds, history, dyadic, config.interpolation_order, config.dt, config.c0)}; // Set up RHS functions - auto rhs_funcs = rhs_functions(*qds, config.omega); + auto rhs_funcs = rhs_functions(*qds); // Set up Bloch RHS - std::unique_ptr> bloch_rhs = - std::make_unique( + std::unique_ptr> llg_rhs = + std::make_unique( config.dt, history, std::move(interactions), std::move(rhs_funcs)); - Integrator::PredictorCorrector solver( - config.dt, 18, 22, 3.15, history, bloch_rhs); + Integrator::PredictorCorrector solver( + config.dt, 18, 22, 3.15, history, llg_rhs); cout << "Solving..." << endl; solver.solve(); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 54021ff4..591ec350 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,11 +7,11 @@ if(${Boost_FOUND}) target_sources(qtest-bin PRIVATE "${CMAKE_CURRENT_LIST_DIR}/main.cpp") target_sources(qtest-bin PUBLIC - "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) From 5544692313ddb4e37dd7eb933f7895595668f138 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 4 Jul 2017 14:21:20 -0400 Subject: [PATCH 48/75] added mp.txt. it is a file with three magnetic particles in it --- mp.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 mp.txt diff --git a/mp.txt b/mp.txt new file mode 100644 index 00000000..035be6ef --- /dev/null +++ b/mp.txt @@ -0,0 +1,3 @@ +0 1 1 1 2 3 4 5 6 +3 2 1 1 1 1 6 5 4 +4 4 0 2 3 5 1 2 3 From 50b4bd8ffa5859ab4fa3e0e024df1194fadf034c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 6 Jul 2017 15:35:39 -0400 Subject: [PATCH 49/75] fixed warning messages by specifying a type qualifier in history_interaction and removing the saturization() function from magnetic_particle.h --- src/interactions/history_interaction.cpp | 2 +- src/magnetic_particle.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index 806adad2..4592940f 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -48,7 +48,7 @@ void HistoryInteraction::build_coefficient_table() const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) { - for(int i = 0; i < results.size(); ++i) results[i] = Eigen::Vector3d(0, 0, 0); + for(unsigned int i = 0; i < results.size(); ++i) results[i] = Eigen::Vector3d(0, 0, 0); for(int pair_idx = 0; pair_idx < num_interactions; ++pair_idx) { int src, obs; diff --git a/src/magnetic_particle.h b/src/magnetic_particle.h index e33edcd6..362ecd06 100644 --- a/src/magnetic_particle.h +++ b/src/magnetic_particle.h @@ -29,7 +29,6 @@ class MagneticParticle { const Eigen::Vector3d &position() const { return pos; } const soltype &magnetization() const { return mag; } - const double saturization() const { return sat_mag; } friend const Eigen::Vector3d separation(const MagneticParticle &, const MagneticParticle &); From 80b81caf3585f2d95075e0db4b41e667f1ce2ad8 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Mon, 10 Jul 2017 15:23:50 -0400 Subject: [PATCH 50/75] removed many unecessary files and removed outdated/incomplete tests --- src/integrator/RHS/bloch_rhs.cpp | 32 --------------- src/integrator/RHS/bloch_rhs.h | 28 ------------- src/integrator/RHS/cmplx_ode_rhs.h | 29 -------------- src/integrator/RHS/llg_rhs.cpp | 29 ++++++++++++++ src/quantum_dot.cpp | 64 ------------------------------ src/quantum_dot.h | 59 --------------------------- test/CMakeLists.txt | 5 +-- test/integrator_test.cpp | 30 -------------- test/pulse_interaction_test.cpp | 34 ++++++++-------- test/quantum_dot_test.cpp | 47 ---------------------- 10 files changed, 49 insertions(+), 308 deletions(-) delete mode 100644 src/integrator/RHS/bloch_rhs.cpp delete mode 100644 src/integrator/RHS/bloch_rhs.h delete mode 100644 src/integrator/RHS/cmplx_ode_rhs.h create mode 100644 src/integrator/RHS/llg_rhs.cpp delete mode 100644 src/quantum_dot.cpp delete mode 100644 src/quantum_dot.h delete mode 100644 test/quantum_dot_test.cpp diff --git a/src/integrator/RHS/bloch_rhs.cpp b/src/integrator/RHS/bloch_rhs.cpp deleted file mode 100644 index e7776080..00000000 --- a/src/integrator/RHS/bloch_rhs.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "bloch_rhs.h" - -Integrator::BlochRHS::BlochRHS( - const double dt, - const std::shared_ptr> &history, - std::vector> interactions, - std::vector rhs_functions) - : Integrator::RHS(dt, history), - num_solutions(history->array.shape()[0]), - interactions(std::move(interactions)), - rhs_functions(std::move(rhs_functions)) -{ -} - -void Integrator::BlochRHS::evaluate(const int step) const -{ - auto eval_and_sum = - [step](const Interaction::ResultArray &r, - const std::shared_ptr &interaction) { - return r + interaction->evaluate(step); - }; - auto nil = Interaction::ResultArray::Zero(num_solutions, 1).eval(); - - auto projected_efields = std::accumulate( - interactions.begin(), interactions.end(), nil, eval_and_sum); - - for(int solution = 0; solution < num_solutions; ++solution) { - history->array[solution][step][1] = rhs_functions[solution]( - history->array[solution][step][0], projected_efields[solution]); - } - -} diff --git a/src/integrator/RHS/bloch_rhs.h b/src/integrator/RHS/bloch_rhs.h deleted file mode 100644 index bde379a4..00000000 --- a/src/integrator/RHS/bloch_rhs.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef BLOCH_RHS_H -#define BLOCH_RHS_H - -#include -#include -#include - -#include "../../interactions/interaction.h" -#include "rhs.h" -namespace Integrator { - class BlochRHS; -} - -class Integrator::BlochRHS : public Integrator::RHS { - public: - BlochRHS(const double, - const std::shared_ptr> &, - std::vector>, - std::vector); - void evaluate(const int) const override; - - private: - int num_solutions; - std::vector> interactions; - std::vector rhs_functions; -}; - -#endif diff --git a/src/integrator/RHS/cmplx_ode_rhs.h b/src/integrator/RHS/cmplx_ode_rhs.h deleted file mode 100644 index c2aae815..00000000 --- a/src/integrator/RHS/cmplx_ode_rhs.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef CMPLX_ODE_RHS -#define CMPLX_ODE_RHS - - -namespace Integrator { - class CMPLX_0DE_RHS; -} - -class Integrator::CMPLX_ODE_RHS : public RHS> { - public: - CMPLX_ODE_RHS(const double dt, const std::shared_ptr< - History> &history) - : dt(dt), history(history){}; - void evaluate(const int) const; - - private: -}; - -void Integrator::CMPLX_ODE_RHS::evaluate(const int n) const -{ - const std::complex iu(0,1); - const double time = n * dt; - for(int i; i(history->array.shape()[0]); ++i) { - history->array[i][n][1] = 1; - } -} - -#endif - diff --git a/src/integrator/RHS/llg_rhs.cpp b/src/integrator/RHS/llg_rhs.cpp new file mode 100644 index 00000000..8fd9a90a --- /dev/null +++ b/src/integrator/RHS/llg_rhs.cpp @@ -0,0 +1,29 @@ +#include "llg_rhs.h" +#include +#include +#include + +Integrator::LLG_RHS::LLG_RHS( + const double dt, + const std::shared_ptr> &history, + std::vector> interactions, + rhs_func_vector rhs_functions) + : Integrator::RHS(dt, history), + num_solutions(history->array.shape()[0]), + interactions(std::move(interactions)), + rhs_functions(std::move(rhs_functions)) +{ +} + +void Integrator::LLG_RHS::evaluate(const int step) const +{ + auto pulse_interactions = interactions[0]->evaluate(step); + auto history_interactions = interactions[1]->evaluate(step); + + for(int sol = 0; sol < num_solutions; ++sol) { + history->array[sol][step][1] = + rhs_functions[sol](history->array[sol][step][0], + pulse_interactions[sol] + history_interactions[sol]); + std::cout << history->array[sol][step][1].transpose() << std::endl; + } +} diff --git a/src/quantum_dot.cpp b/src/quantum_dot.cpp deleted file mode 100644 index 943b2a6a..00000000 --- a/src/quantum_dot.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "quantum_dot.h" - -QuantumDot::QuantumDot(const Eigen::Vector3d &pos, - const double freq, - const std::pair &damping, - const Eigen::Vector3d &dip) - : pos(pos), freq(freq), damping(damping), dip(dip) -{ -} - -matrix_elements QuantumDot::liouville_rhs(const matrix_elements &rho, - const cmplx rabi, - const double laser_freq) const -{ - const cmplx m0 = -iu * (rabi * std::conj(rho[1]) - std::conj(rabi) * rho[1]) - - (rho[0] - 1.0) / damping.first; - const cmplx m1 = - -iu * (rabi * (1.0 - 2.0 * rho[0]) + rho[1] * (laser_freq - freq)) - - rho[1] / damping.second; - return matrix_elements(m0, m1); -} - -Eigen::Vector3d separation(const QuantumDot &d1, const QuantumDot &d2) -{ - return d2.pos - d1.pos; -} - -std::ostream &operator<<(std::ostream &os, const QuantumDot &qd) -{ - os << qd.pos.transpose() << " " << qd.freq << " " << qd.damping.first << " " - << qd.damping.second << " " << qd.dip.transpose(); - return os; -} - -std::istream &operator>>(std::istream &is, QuantumDot &qd) -{ - is >> qd.pos[0] >> qd.pos[1] >> qd.pos[2] >> qd.freq >> qd.damping.first >> - qd.damping.second >> qd.dip[0] >> qd.dip[1] >> qd.dip[2]; - return is; -} - -DotVector import_dots(const std::string &fname) -{ - std::ifstream ifs(fname); - if(!ifs) throw std::runtime_error("Could not open " + fname); - - std::istream_iterator in_iter(ifs), eof; - return DotVector(in_iter, eof); -} - -std::vector rhs_functions(const DotVector &dots, - const double laser_frequency) -{ - std::vector funcs(dots.size()); - - using std::placeholders::_1; - using std::placeholders::_2; - std::transform(dots.begin(), dots.end(), funcs.begin(), - [laser_frequency](const QuantumDot &d) { - return std::bind(&QuantumDot::liouville_rhs, d, _1, _2, - laser_frequency); - }); - return funcs; -} diff --git a/src/quantum_dot.h b/src/quantum_dot.h deleted file mode 100644 index c36a3eca..00000000 --- a/src/quantum_dot.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef QUANTUM_DOT_H -#define QUANTUM_DOT_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" - -class QuantumDot; - -typedef std::vector DotVector; -typedef Eigen::Vector2cd matrix_elements; -typedef std::function)> - BlochFunctionType; - -class QuantumDot { - public: - QuantumDot() = default; - QuantumDot(const Eigen::Vector3d &, - const double, - const std::pair &, - const Eigen::Vector3d &); - - matrix_elements liouville_rhs(const matrix_elements &, - const cmplx, - const double) const; - - const Eigen::Vector3d &position() const { return pos; } - const Eigen::Vector3d &dipole() const { return dip; } - friend Eigen::Vector3d separation(const QuantumDot &, const QuantumDot &); - friend inline double dyadic_product(const QuantumDot &obs, - const Eigen::Matrix3d &dyad, - const QuantumDot &src) - { - return obs.dip.transpose() * dyad * src.dip; - } - - friend std::ostream &operator<<(std::ostream &, const QuantumDot &); - friend std::istream &operator>>(std::istream &, QuantumDot &); - - private: - Eigen::Vector3d pos; - double freq; - std::pair damping; - Eigen::Vector3d dip; -}; - -DotVector import_dots(const std::string &); -std::vector rhs_functions(const DotVector &, const double); - -#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 591ec350..dbf4ffba 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,11 +7,10 @@ if(${Boost_FOUND}) target_sources(qtest-bin PRIVATE "${CMAKE_CURRENT_LIST_DIR}/main.cpp") target_sources(qtest-bin PUBLIC - #"${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" - #"${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" - #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) diff --git a/test/integrator_test.cpp b/test/integrator_test.cpp index 05bb1160..3695a1c1 100644 --- a/test/integrator_test.cpp +++ b/test/integrator_test.cpp @@ -64,14 +64,6 @@ struct SigmoidalSystem { } }; -struct ComplexSystem { - double rhs(double f, double t) { return 1; } - double solution(double t) - { - return 1; - } -}; - BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) { const double dt = 0.1; @@ -94,25 +86,3 @@ BOOST_FIXTURE_TEST_CASE(ODE_ERROR, SigmoidalSystem) } BOOST_AUTO_TEST_SUITE_END() - -BOOST_FIXTURE_TEST_CASE(ODE_ERROR, ComplexSystem) -{ - const double dt = 0.1; - auto hist = std::make_shared>(1, 22, 201); - std::unique_ptr> system_rhs = std::make_unique< - Integrator::CMPLX_ODE_RHS>(dt, hist); - - hist->fill(0); - for(int i = -22; i <= 0; ++i) { - hist->array[0][i][0] = solution(i * dt); - hist->array[0][i][1] = rhs(hist->array[0][i][0], i * dt); - } - - Integrator::PredictorCorrector solver(dt, 18, 22, 3.15, hist, - system_rhs); - solver.solve(); - - BOOST_CHECK_CLOSE(hist->array[0][200][0], solution(20), 1e-12); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/test/pulse_interaction_test.cpp b/test/pulse_interaction_test.cpp index 3eaa64f9..3ac55f5b 100644 --- a/test/pulse_interaction_test.cpp +++ b/test/pulse_interaction_test.cpp @@ -36,27 +36,29 @@ BOOST_AUTO_TEST_CASE(pulse_shape_2) BOOST_CHECK_CLOSE(pulse_eval(2), compare_array(2), 1e-6); } +// Following code tests the interaction between pulse and a QD + // QD Configuration Information: -const Eigen::Vector3d pos(1, 1, 1); -const double dot_freq = 2278.9013; -const std::pair damping(1, 1); -const Eigen::Vector3d dip(1, 2, 3); +//const Eigen::Vector3d pos(1, 1, 1); +//const double dot_freq = 2278.9013; +//const std::pair damping(1, 1); +//const Eigen::Vector3d dip(1, 2, 3); -BOOST_AUTO_TEST_CASE(dot_pulse_interaction) -{ - const double compare_value = 1.0641745059e3; +//BOOST_AUTO_TEST_CASE(dot_pulse_interaction) +//{ + //const double compare_value = 1.0641745059e3; - DotVector dots_vec = {QuantumDot(pos, dot_freq, damping, dip)}; - auto dots = std::make_shared(dots_vec); + //DotVector dots_vec = {QuantumDot(pos, dot_freq, damping, dip)}; + //auto dots = std::make_shared(dots_vec); - std::shared_ptr pulse_ptr = std::make_shared( - Pulse(amplitude, delay, width, pulse_freq, wavevector, polarization)); + //std::shared_ptr pulse_ptr = std::make_shared( + //Pulse(amplitude, delay, width, pulse_freq, wavevector, polarization)); - PulseInteraction pulse_interaction = - PulseInteraction(dots, pulse_ptr, 1, 0.1); // hbar=1, dt=1 + //PulseInteraction pulse_interaction = + //PulseInteraction(dots, pulse_ptr, 1, 0.1); // hbar=1, dt=1 - auto results = pulse_interaction.evaluate(52); + //auto results = pulse_interaction.evaluate(52); - BOOST_CHECK_CLOSE(real(results(0)), compare_value, 1e-6); -} + //BOOST_CHECK_CLOSE(real(results(0)), compare_value, 1e-6); +//} BOOST_AUTO_TEST_SUITE_END() diff --git a/test/quantum_dot_test.cpp b/test/quantum_dot_test.cpp deleted file mode 100644 index 85d94e7b..00000000 --- a/test/quantum_dot_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "../src/quantum_dot.h" -#include - -BOOST_AUTO_TEST_SUITE(quantum_dot) - -BOOST_AUTO_TEST_SUITE(liouville_rhs) - -const Eigen::Vector3d pos(0, 0, 0), dipole(0, 0, 1); -const double omega = 2278.9013; -const std::pair ts(10, 20); -const QuantumDot qd(pos, omega, ts, dipole); - -BOOST_AUTO_TEST_CASE(resonant_rhs) -{ - const Eigen::Vector3cd efield(0, 0, 1); - const cmplx rabi = efield.dot(dipole); - - Eigen::Matrix2cd hamiltonian_matrix; - hamiltonian_matrix << 0, rabi, std::conj(rabi), 0; - - Eigen::Matrix2cd density_matrix; - density_matrix << 1, cmplx(0.5, 0.5), cmplx(0.5, -0.5), 0; - - Eigen::Matrix2cd dissipator; - dissipator << (density_matrix(0, 0) - 1.0) / ts.first, - density_matrix(0, 1) / ts.second, density_matrix(1, 0) / ts.second, - density_matrix(1, 1) / ts.first; - - // Evaluate the commutator & dissipator - Eigen::Matrix2cd matrix_rhs( - -iu * (hamiltonian_matrix * density_matrix - - density_matrix * hamiltonian_matrix) - dissipator); - - matrix_elements rhs(qd.liouville_rhs( - matrix_elements(density_matrix(0, 0), density_matrix(0, 1)), rabi, - omega)); - - BOOST_CHECK_CLOSE(matrix_rhs(0, 0).real(), rhs(0).real(), 1e-9); - BOOST_CHECK_CLOSE(matrix_rhs(0, 0).imag(), rhs(0).imag(), 1e-9); - - BOOST_CHECK_CLOSE(matrix_rhs(0, 1).real(), rhs(1).real(), 1e-9); - BOOST_CHECK_CLOSE(matrix_rhs(0, 1).imag(), rhs(1).imag(), 1e-9); -} - -BOOST_AUTO_TEST_SUITE_END() - -BOOST_AUTO_TEST_SUITE_END() From eca8ab336f5e8d80d49d9e544414f43dfa888ca2 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Fri, 14 Jul 2017 14:16:39 -0400 Subject: [PATCH 51/75] adds unfinished history interaction test --- test/CMakeLists.txt | 3 +- test/hist_inter_test2.cpp | 72 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 test/hist_inter_test2.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dbf4ffba..8fa059bf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,8 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/hist_inter_test2.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) diff --git a/test/hist_inter_test2.cpp b/test/hist_inter_test2.cpp new file mode 100644 index 00000000..5732dc88 --- /dev/null +++ b/test/hist_inter_test2.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +#include "../src/integrator/history.h" +#include "../src/interactions/green_function.h" +#include "../src/interactions/history_interaction.h" +#include "../src/math_utils.h" + +BOOST_AUTO_TEST_SUITE(history_interaction) + +typedef Eigen::Vector3d vec3d; + +BOOST_AUTO_TEST_CASE(history_interaction) +{ + const double mu0 = 1; + const double c = 20; + const double hbar = 1; + vec3d pos1(0, 0, 0); + vec3d pos2(0, 0, 0.9); + double total_t = 10; + double dt = 0.5e-1; + int steps = total_t / dt; + std::vector mag1(steps, vec3d(0, 0, 0)), + mag2(steps, vec3d(0, 0, 0)); + Eigen::VectorXd times = Eigen::VectorXd::LinSpaced(steps, 0, total_t - dt); + + for(int i = 0; i < steps; ++i) { + mag1[i][1] = gaussian(times[i] - 5); + mag2[i][1] = gaussian(times[i] - 4); + } + + const std::vector mag_control1(mag1); + const std::vector mag_control2(mag2); + + auto mp1 = MagneticParticle(pos1, 1, 1, 1, mag1[0]); + auto mp2 = MagneticParticle(pos2, 1, 1, 1, mag2[0]); + + DotVector mpvec = {mp1, mp2}; + auto mpvec_ptr = std::make_shared(mpvec); + + auto dyadic = + std::make_shared(mu0, c, hbar); + + auto history = std::make_shared>(2, -22, steps); + + + for(int step = -22; step < steps; ++step) { + if(step < 0) { + history->array[0][step][0] = vec3d(0, 0, 0); + history->array[1][step][0] = vec3d(0, 0, 0); + } else { + history->array[0][step][0] = mag1[step]; + history->array[1][step][0] = mag2[step]; + } + } + + for(int i=-22; iarray[0][110][0].transpose() << std::endl; + + for(int i=0; i Date: Fri, 14 Jul 2017 14:58:14 -0400 Subject: [PATCH 52/75] (WIP) Constructing vector-valued history interaction test --- test/hist_inter_test2.cpp | 89 ++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/test/hist_inter_test2.cpp b/test/hist_inter_test2.cpp index 5732dc88..cb7d3437 100644 --- a/test/hist_inter_test2.cpp +++ b/test/hist_inter_test2.cpp @@ -10,63 +10,54 @@ BOOST_AUTO_TEST_SUITE(history_interaction) typedef Eigen::Vector3d vec3d; -BOOST_AUTO_TEST_CASE(history_interaction) +struct Universe { + double mu0, c, hbar, dt; + std::shared_ptr propagator; + + Universe() + : mu0(1), + c(1), + hbar(1), + dt(0.05), + propagator(std::make_shared( + mu0, c, hbar)){}; + + Eigen::Vector3d source(double t) + { + return Eigen::Vector3d(0, 0, exp(-std::pow(t - 5, 2) / 2.0)); + } +}; + +BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) { - const double mu0 = 1; - const double c = 20; - const double hbar = 1; vec3d pos1(0, 0, 0); - vec3d pos2(0, 0, 0.9); - double total_t = 10; - double dt = 0.5e-1; - int steps = total_t / dt; - std::vector mag1(steps, vec3d(0, 0, 0)), - mag2(steps, vec3d(0, 0, 0)); - Eigen::VectorXd times = Eigen::VectorXd::LinSpaced(steps, 0, total_t - dt); + vec3d pos2(0, 0, 0.5 * c * dt); + const double total_t = 10; + const int steps = total_t / dt; + std::cout << steps << std::endl; - for(int i = 0; i < steps; ++i) { - mag1[i][1] = gaussian(times[i] - 5); - mag2[i][1] = gaussian(times[i] - 4); - } + // Set up history with one source "column" + auto history = std::make_shared>(2, -22, steps); + history->fill(Eigen::Vector3d::Zero()); - const std::vector mag_control1(mag1); - const std::vector mag_control2(mag2); + for(int i = -22; i < steps; ++i) { + history->array[0][i][0] = source(i * dt); + } - auto mp1 = MagneticParticle(pos1, 1, 1, 1, mag1[0]); - auto mp2 = MagneticParticle(pos2, 1, 1, 1, mag2[0]); + // Set up particle list -- don't really care about their "initial" condition (the Eigen:: vector) + std::shared_ptr dots(std::make_shared( + DotVector({MagneticParticle(pos1, 1, 1, 1, Eigen::Vector3d::Zero()), + MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); - DotVector mpvec = {mp1, mp2}; - auto mpvec_ptr = std::make_shared(mpvec); - auto dyadic = - std::make_shared(mu0, c, hbar); - - auto history = std::make_shared>(2, -22, steps); - - - for(int step = -22; step < steps; ++step) { - if(step < 0) { - history->array[0][step][0] = vec3d(0, 0, 0); - history->array[1][step][0] = vec3d(0, 0, 0); - } else { - history->array[0][step][0] = mag1[step]; - history->array[1][step][0] = mag2[step]; - } - } + HistoryInteraction history_interaction(dots, history, propagator, 5, dt, c); - for(int i=-22; iarray[0][110][0].transpose() << std::endl; - - for(int i=0; i Date: Tue, 18 Jul 2017 13:46:18 -0400 Subject: [PATCH 53/75] Replaced history_interaction Greens function with corrected version. Replaced mu0 with e0 in configuration and elsewhere. Rewrote history_interaction_test. --- src/configuration.cpp | 2 +- src/configuration.h | 2 +- src/interactions/green_function.h | 77 ++++-------------------------- src/main.cpp | 2 +- test/hist_inter_test2.cpp | 63 ------------------------- test/history_interaction_test.cpp | 78 ++++++++++++++++++++----------- test/propagator_test.cpp | 14 +++--- 7 files changed, 71 insertions(+), 167 deletions(-) delete mode 100644 test/hist_inter_test2.cpp diff --git a/src/configuration.cpp b/src/configuration.cpp index 75cae73e..c7e59210 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -24,7 +24,7 @@ po::variables_map parse_configs(int argc, char *argv[]) { constants_description.add_options() ("constants.c0", po::value(&config.c0)->required(), "speed of light in vacuum") ("constants.hbar", po::value(&config.hbar)->required(), "reduced Planck constant") - ("constants.mu0", po::value(&config.mu0)->required(), "vacuum permeability") + ("constants.e0", po::value(&config.e0)->required(), "vacuum permittivity") ("constants.laser_frequency", po::value(&config.omega)->required(), "(angular) frequency of incident pulse") ; diff --git a/src/configuration.h b/src/configuration.h index dabb78f8..6d119ec6 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -12,7 +12,7 @@ struct Configuration { int num_particles; int num_timesteps; - double c0, hbar, mu0, omega; + double c0, hbar, e0, omega; double dt, total_time; int interpolation_order; std::string qd_path, pulse_path; diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index fc179570..0255b25f 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -19,8 +19,8 @@ namespace Propagation { template class Propagation::Propagator { public: - Propagator(const double mu0, const double c, const double hbar) - : c_(c), mu0_over_4pi_hbar_(mu0 / (4 * M_PI * hbar)){}; + Propagator(const double e0, const double c, const double hbar) + : c(c), e0(e0), hbar(hbar){}; auto coefficients(const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const { @@ -28,39 +28,14 @@ class Propagation::Propagator { }; protected: - double c_, mu0_over_4pi_hbar_; - - std::array spatial_dyads(const Eigen::Vector3d &dr) const - { - std::array results = { - {identity_minus_3rsq(dr) * std::pow(c_, 2) / std::pow(dr.norm(), 3), - identity_minus_3rsq(dr) * c_ / dr.squaredNorm(), - identity_minus_rsq(dr) / dr.norm()}}; - - return results; - } - - static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) - { - return dr * dr.transpose() / dr.squaredNorm(); - } - - static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); - } - - static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) - { - return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); - } + double c, e0, hbar; }; class Propagation::FixedFramePropagator : public Propagation::Propagator { public: - FixedFramePropagator(const double mu0, const double c, const double hbar) - : Propagator(mu0, c, hbar){}; + FixedFramePropagator(const double e0, const double c, const double hbar) + : Propagator(e0, c, hbar){}; std::vector coefficients( const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const @@ -68,49 +43,17 @@ class Propagation::FixedFramePropagator std::vector coefs(interp.order() + 1, Eigen::Matrix3d::Zero()); - const auto dyads(spatial_dyads(dr)); + Eigen::Matrix3d r_matrix; + r_matrix << 0, dr[2], -dr[1], -dr[2], 0, dr[0], dr[1], -dr[0], 0; for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += mu0_over_4pi_hbar_ * (dyads[0] * interp.evaluations[0][i] + - dyads[1] * interp.evaluations[1][i] + - dyads[2] * interp.evaluations[2][i]); + coefs[i] += e0 / (4 * M_PI) * -1 * r_matrix * + (interp.evaluations[1][i] / std::pow(dr.norm(), 3) - + interp.evaluations[2][i] * c / std::pow(dr.norm(), 2)); } return coefs; } }; -class Propagation::RotatingFramePropagator - : public Propagation::Propagator { - public: - RotatingFramePropagator(const double mu0, const double c, const double hbar, - const double omega) - : Propagator(mu0, c, hbar), omega(omega){}; - std::vector coefficients( - const Eigen::Vector3d &dr, - const Interpolation::UniformLagrangeSet &interp) const - { - std::vector coefs(interp.order() + 1, - Eigen::Matrix3cd::Zero()); - - const auto dyads(spatial_dyads(dr)); - - for(int i = 0; i <= interp.order(); ++i) { - coefs[i] = - -mu0_over_4pi_hbar_ * std::exp(-iu * omega * dr.norm() / c_) * - (dyads[0].cast() * interp.evaluations[0][i] + - dyads[1].cast() * - (interp.evaluations[1][i] + iu * omega * interp.evaluations[0][i]) + - dyads[2].cast() * - (interp.evaluations[2][i] + 2.0 * iu * omega * interp.evaluations[1][i] - - std::pow(omega, 2) * interp.evaluations[0][i])); - } - - return coefs; - } - - private: - double omega; -}; - #endif diff --git a/src/main.cpp b/src/main.cpp index 2d35560f..c227761f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) // Set up Interactions auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); auto dyadic = make_shared( - config.mu0, config.c0, config.hbar); + config.e0, config.c0, config.hbar); std::vector> interactions{ make_shared(qds, pulse1, config.hbar, config.dt), diff --git a/test/hist_inter_test2.cpp b/test/hist_inter_test2.cpp deleted file mode 100644 index cb7d3437..00000000 --- a/test/hist_inter_test2.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include -#include "../src/integrator/history.h" -#include "../src/interactions/green_function.h" -#include "../src/interactions/history_interaction.h" -#include "../src/math_utils.h" - -BOOST_AUTO_TEST_SUITE(history_interaction) - -typedef Eigen::Vector3d vec3d; - -struct Universe { - double mu0, c, hbar, dt; - std::shared_ptr propagator; - - Universe() - : mu0(1), - c(1), - hbar(1), - dt(0.05), - propagator(std::make_shared( - mu0, c, hbar)){}; - - Eigen::Vector3d source(double t) - { - return Eigen::Vector3d(0, 0, exp(-std::pow(t - 5, 2) / 2.0)); - } -}; - -BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) -{ - vec3d pos1(0, 0, 0); - vec3d pos2(0, 0, 0.5 * c * dt); - const double total_t = 10; - const int steps = total_t / dt; - std::cout << steps << std::endl; - - // Set up history with one source "column" - auto history = std::make_shared>(2, -22, steps); - history->fill(Eigen::Vector3d::Zero()); - - for(int i = -22; i < steps; ++i) { - history->array[0][i][0] = source(i * dt); - } - - // Set up particle list -- don't really care about their "initial" condition (the Eigen:: vector) - std::shared_ptr dots(std::make_shared( - DotVector({MagneticParticle(pos1, 1, 1, 1, Eigen::Vector3d::Zero()), - MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); - - - HistoryInteraction history_interaction(dots, history, propagator, 5, dt, c); - - //std::cout << std::scientific << std::setprecision(8); - //for(int i=0; i #include +#include +#include +#include "../src/integrator/history.h" +#include "../src/interactions/green_function.h" +#include "../src/interactions/history_interaction.h" +#include "../src/math_utils.h" BOOST_AUTO_TEST_SUITE(history_interaction) -BOOST_AUTO_TEST_CASE(history_interaction) +typedef Eigen::Vector3d vec3d; + +struct Universe { + double mu0, c, hbar, dt; + std::shared_ptr propagator; + + Universe() + : mu0(1), + c(1), + hbar(1), + dt(0.05), + propagator(std::make_shared( + mu0, c, hbar)){}; + + Eigen::Vector3d source(double t) + { + return Eigen::Vector3d(0, exp(-std::pow(t - 5, 2) / 2.0), 0); + } +}; + +BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) { - Eigen::Vector3d pos1(0, 0, 0); - Eigen::Vector3d pos2(1, 1, 1); - const std::pair damping(1, 1); - const double freq = 2278.9013; - const Eigen::Vector3d dip(1, 2, 3); - - QuantumDot qd1(pos1, freq, damping, dip); - QuantumDot qd2(pos2, freq, damping, dip); - - DotVector dots_vec = {qd1, qd2}; - auto dots = std::make_shared(dots_vec); - - auto history(History::make_shared_history(2, 22, 1)); - for(int dot_idx = 0; dot_idx < 2; ++dot_idx) { - for(int time_idx = -22; time_idx <= 0; ++time_idx) { - (*history)[dot_idx][time_idx][0] = History::soltype(1, 1); - } + vec3d pos1(0, 0, 0); + vec3d pos2(0, 0, 0.5 * c * dt); + const double total_t = 10; + const int steps = total_t / dt; + + // Set up history with one source "column" + auto history = std::make_shared>(2, 22, steps); + history->fill(Eigen::Vector3d::Zero()); + + for(int i = -22; i < steps; ++i) { + history->array[1][i][0] = source(i * dt); } + + // Set up particle list -- don't really care about their "initial" condition (the Eigen:: vector) + std::shared_ptr dots(std::make_shared( + DotVector({MagneticParticle(pos1, 1, 1, 1, Eigen::Vector3d::Zero()), + MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); - auto dyadic( - std::make_shared(GreenFunction::Dyadic(1, 2, 1))); - auto hist_inter = HistoryInteraction(dots, history, dyadic, 1, 1, 1); - auto result = hist_inter.evaluate(1); - const std::vector compare_array = {-2.6953857109, -2.6953857109}; + HistoryInteraction history_interaction(dots, history, propagator, 5, dt, c); - BOOST_CHECK_CLOSE(result(0).real(), compare_array.at(0), 1e-6); - BOOST_CHECK_CLOSE(result(1).real(), compare_array.at(1), 1e-6); + std::cout << std::scientific << std::setprecision(8); + for(int i=0; i Date: Wed, 19 Jul 2017 14:34:57 -0400 Subject: [PATCH 54/75] Added analytic test to compare history_interaction to. --- test/CMakeLists.txt | 2 +- test/history_interaction_test.cpp | 79 +++++++++++++++++++++++++------ 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8fa059bf..7bdbd562 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,7 +11,7 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" #"${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/hist_inter_test2.cpp" + "${CMAKE_CURRENT_LIST_DIR}/history_interaction_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) endif(${Boost_FOUND}) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index a72bc6d7..7edc34a0 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -1,8 +1,8 @@ +#include "../src/integrator/history.h" #include #include -#include #include -#include "../src/integrator/history.h" +#include #include "../src/interactions/green_function.h" #include "../src/interactions/history_interaction.h" #include "../src/math_utils.h" @@ -12,29 +12,61 @@ BOOST_AUTO_TEST_SUITE(history_interaction) typedef Eigen::Vector3d vec3d; struct Universe { - double mu0, c, hbar, dt; + double e0, c, hbar, dt; std::shared_ptr propagator; Universe() - : mu0(1), + : e0(1), c(1), hbar(1), - dt(0.05), - propagator(std::make_shared( - mu0, c, hbar)){}; + dt(0.01), + propagator( + std::make_shared(e0, c, hbar)){}; Eigen::Vector3d source(double t) { return Eigen::Vector3d(0, exp(-std::pow(t - 5, 2) / 2.0), 0); } + + Eigen::Vector3d mag_d0_source(double t, double delay) + { + return Eigen::Vector3d(0, exp(-std::pow(t - 5 - delay, 2) / 2.0), 0); + } + + Eigen::Vector3d mag_d1_source(double t, double delay) + { + return Eigen::Vector3d(0, -(t - 5 - delay) * exp(-std::pow(t - 5 - delay, 2) / 2.0), + 0); + } + + Eigen::Vector3d mag_d2_source(double t, double delay) + { + return Eigen::Vector3d( + 0, exp(-std::pow(t - 5 - delay, 2) / 2.0) * (std::pow(5+delay-t,2)-1), + 0); + } + + Eigen::Vector3d analytic_interaction(Eigen::Vector3d &magd1, + Eigen::Vector3d &magd2, + Eigen::Matrix3d &r_matrix, + double c, + double e0, + double dist) + { + return e0 / (4 * M_PI) * r_matrix * + (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2)); + } }; BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) { vec3d pos1(0, 0, 0); - vec3d pos2(0, 0, 0.5 * c * dt); + vec3d pos2(0, 0, 6.5 * c * dt); const double total_t = 10; const int steps = total_t / dt; + const double dist = (pos2 - pos1).norm(); + const double delay = dist / c; + Eigen::Vector3d dr(pos2 - pos1); // Set up history with one source "column" auto history = std::make_shared>(2, 22, steps); @@ -43,20 +75,37 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) for(int i = -22; i < steps; ++i) { history->array[1][i][0] = source(i * dt); } - - // Set up particle list -- don't really care about their "initial" condition (the Eigen:: vector) + + // Set up particle list -- don't really care about their "initial" condition + // (the Eigen:: vector) std::shared_ptr dots(std::make_shared( DotVector({MagneticParticle(pos1, 1, 1, 1, Eigen::Vector3d::Zero()), MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); + HistoryInteraction history_interaction(dots, history, propagator, 7, dt, c); - HistoryInteraction history_interaction(dots, history, propagator, 5, dt, c); + // Analytic Calculations + Eigen::Matrix3d r_matrix; + r_matrix << 0, dr[2], -dr[1], -dr[2], 0, dr[0], dr[1], -dr[0], 0; + std::cout << std::scientific << std::setprecision(8); - for(int i=0; i Date: Wed, 19 Jul 2017 15:17:38 -0400 Subject: [PATCH 55/75] Changed r_matrix cross product in history interaction test to a cross product with -dr --- src/interactions/green_function.h | 2 +- test/history_interaction_test.cpp | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 0255b25f..61f5cbe9 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -47,7 +47,7 @@ class Propagation::FixedFramePropagator r_matrix << 0, dr[2], -dr[1], -dr[2], 0, dr[0], dr[1], -dr[0], 0; for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += e0 / (4 * M_PI) * -1 * r_matrix * + coefs[i] += e0 / (4 * M_PI) * -r_matrix * (interp.evaluations[1][i] / std::pow(dr.norm(), 3) - interp.evaluations[2][i] * c / std::pow(dr.norm(), 2)); } diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index 7edc34a0..b84611d5 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -48,13 +48,13 @@ struct Universe { Eigen::Vector3d analytic_interaction(Eigen::Vector3d &magd1, Eigen::Vector3d &magd2, - Eigen::Matrix3d &r_matrix, + Eigen::Vector3d &dr, double c, double e0, double dist) { - return e0 / (4 * M_PI) * r_matrix * - (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2)); + return e0 / (4 * M_PI) * -dr.cross( + (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2))); } }; @@ -83,29 +83,16 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); HistoryInteraction history_interaction(dots, history, propagator, 7, dt, c); - - // Analytic Calculations - - Eigen::Matrix3d r_matrix; - r_matrix << 0, dr[2], -dr[1], -dr[2], 0, dr[0], dr[1], -dr[0], 0; std::cout << std::scientific << std::setprecision(8); for(int i = steps*0.1; i < steps*0.9; ++i) { Eigen::Vector3d magd1 = mag_d1_source(i * dt, delay); Eigen::Vector3d magd2 = mag_d2_source(i * dt, delay); - Eigen::Vector3d interaction = - analytic_interaction(magd1, magd2, r_matrix, c, e0, dist); + analytic_interaction(magd1, magd2, dr, c, e0, dist); - //std::cout << i << " " << magd1[1] << " | " << magd2[1] << std::endl; BOOST_CHECK_CLOSE(interaction[0],history_interaction.evaluate(i)[0][0], 1e-6); - //std::cout << i << " " << history_interaction.evaluate(i)[0][0] << std::endl; - //std::cout << i << " " << interaction[0] << " | " << history_interaction.evaluate(i)[0][0]<< std::endl; - - //std::cout << i << " "; - //std::cout << history_interaction.evaluate(i)[0].transpose() << " | "; - //std::cout << history_interaction.evaluate(i)[0].transpose() << std::endl; } } BOOST_AUTO_TEST_SUITE_END() From 121526ad19dfc623638ed74eaff78b18a1e42d5c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 19 Jul 2017 16:04:40 -0400 Subject: [PATCH 56/75] removed matrix multiplication from green_function.h and added a cross product to the history_interaction evaluate function. Alleviates memory usage. --- src/integrator/RHS/llg_rhs.cpp | 1 - src/interactions/green_function.h | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/integrator/RHS/llg_rhs.cpp b/src/integrator/RHS/llg_rhs.cpp index 8fd9a90a..19070056 100644 --- a/src/integrator/RHS/llg_rhs.cpp +++ b/src/integrator/RHS/llg_rhs.cpp @@ -24,6 +24,5 @@ void Integrator::LLG_RHS::evaluate(const int step) const history->array[sol][step][1] = rhs_functions[sol](history->array[sol][step][0], pulse_interactions[sol] + history_interactions[sol]); - std::cout << history->array[sol][step][1].transpose() << std::endl; } } diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 61f5cbe9..96ddefe6 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -36,18 +36,14 @@ class Propagation::FixedFramePropagator public: FixedFramePropagator(const double e0, const double c, const double hbar) : Propagator(e0, c, hbar){}; - std::vector coefficients( + std::vector coefficients( const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const { - std::vector coefs(interp.order() + 1, - Eigen::Matrix3d::Zero()); - - Eigen::Matrix3d r_matrix; - r_matrix << 0, dr[2], -dr[1], -dr[2], 0, dr[0], dr[1], -dr[0], 0; + std::vector coefs(interp.order() + 1, 0); for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += e0 / (4 * M_PI) * -r_matrix * + coefs[i] += e0 / (4 * M_PI) * (interp.evaluations[1][i] / std::pow(dr.norm(), 3) - interp.evaluations[2][i] * c / std::pow(dr.norm(), 2)); } From 23cc8442f2f790d50e32ac8edea81b6cfaad6406 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 19 Jul 2017 16:05:47 -0400 Subject: [PATCH 57/75] Removed matrix multiplication from green_function.h and added a cross product in the history_interaction evaluate function. --- src/interactions/history_interaction.cpp | 12 +++++++----- src/interactions/history_interaction.h | 2 +- test/history_interaction_test.cpp | 23 ++++++++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index 4592940f..f750e2b6 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -37,8 +37,7 @@ void HistoryInteraction::build_coefficient_table() floor_delays[pair_idx] = delay.first; lagrange.calculate_weights(delay.second, dt); - std::vector interp_dyads( - dyadic->coefficients(dr, lagrange)); + std::vector interp_dyads(dyadic->coefficients(dr, lagrange)); for(int i = 0; i <= interp_order; ++i) { coefficients[pair_idx][i] = interp_dyads[i]; @@ -48,20 +47,23 @@ void HistoryInteraction::build_coefficient_table() const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) { - for(unsigned int i = 0; i < results.size(); ++i) results[i] = Eigen::Vector3d(0, 0, 0); + for(unsigned int i = 0; i < results.size(); ++i) + results[i] = Eigen::Vector3d(0, 0, 0); for(int pair_idx = 0; pair_idx < num_interactions; ++pair_idx) { int src, obs; std::tie(src, obs) = idx2coord(pair_idx); const int s = time_idx - floor_delays[pair_idx]; + Vec3d dr(separation((*dots)[src], (*dots)[obs])); + for(int i = 0; i <= interp_order; ++i) { if(s - i < history->array.index_bases()[1]) continue; results[src] += - coefficients[pair_idx][i] * history->array[obs][s - i][0]; + dr.cross(coefficients[pair_idx][i] * history->array[obs][s - i][0]); results[obs] += - coefficients[pair_idx][i] * history->array[src][s - i][0]; + dr.cross(coefficients[pair_idx][i] * history->array[src][s - i][0]); } } diff --git a/src/interactions/history_interaction.h b/src/interactions/history_interaction.h index 8e1ccd93..6053dd48 100644 --- a/src/interactions/history_interaction.h +++ b/src/interactions/history_interaction.h @@ -27,7 +27,7 @@ class HistoryInteraction : public Interaction { std::shared_ptr dyadic; int interp_order, num_interactions; std::vector floor_delays; - boost::multi_array coefficients; + boost::multi_array coefficients; const double dt; const double c0; diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index b84611d5..45c91460 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -35,15 +35,15 @@ struct Universe { Eigen::Vector3d mag_d1_source(double t, double delay) { - return Eigen::Vector3d(0, -(t - 5 - delay) * exp(-std::pow(t - 5 - delay, 2) / 2.0), - 0); + return Eigen::Vector3d( + 0, -(t - 5 - delay) * exp(-std::pow(t - 5 - delay, 2) / 2.0), 0); } Eigen::Vector3d mag_d2_source(double t, double delay) { - return Eigen::Vector3d( - 0, exp(-std::pow(t - 5 - delay, 2) / 2.0) * (std::pow(5+delay-t,2)-1), - 0); + return Eigen::Vector3d(0, exp(-std::pow(t - 5 - delay, 2) / 2.0) * + (std::pow(5 + delay - t, 2) - 1), + 0); } Eigen::Vector3d analytic_interaction(Eigen::Vector3d &magd1, @@ -53,8 +53,9 @@ struct Universe { double e0, double dist) { - return e0 / (4 * M_PI) * -dr.cross( - (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2))); + return e0 / (4 * M_PI) * + -dr.cross( + (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2))); } }; @@ -83,16 +84,16 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); HistoryInteraction history_interaction(dots, history, propagator, 7, dt, c); - - std::cout << std::scientific << std::setprecision(8); - for(int i = steps*0.1; i < steps*0.9; ++i) { + std::cout << std::scientific << std::setprecision(8); + for(int i = steps * 0.1; i < steps * 0.9; ++i) { Eigen::Vector3d magd1 = mag_d1_source(i * dt, delay); Eigen::Vector3d magd2 = mag_d2_source(i * dt, delay); Eigen::Vector3d interaction = analytic_interaction(magd1, magd2, dr, c, e0, dist); - BOOST_CHECK_CLOSE(interaction[0],history_interaction.evaluate(i)[0][0], 1e-6); + BOOST_CHECK_CLOSE(interaction[0], history_interaction.evaluate(i)[0][0], + 1e-6); } } BOOST_AUTO_TEST_SUITE_END() From 85c4a30615114b475cedb7360997998a58593db6 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 20 Jul 2017 14:14:17 -0400 Subject: [PATCH 58/75] changed the greens function according to a recalculation using different fourier transform rules. --- src/interactions/green_function.h | 2 +- test/history_interaction_test.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 96ddefe6..97d9c5dd 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -45,7 +45,7 @@ class Propagation::FixedFramePropagator for(int i = 0; i <= interp.order(); ++i) { coefs[i] += e0 / (4 * M_PI) * (interp.evaluations[1][i] / std::pow(dr.norm(), 3) - - interp.evaluations[2][i] * c / std::pow(dr.norm(), 2)); + interp.evaluations[2][i] / (c * std::pow(dr.norm(), 2))); } return coefs; diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index 45c91460..eb338685 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -16,9 +16,9 @@ struct Universe { std::shared_ptr propagator; Universe() - : e0(1), - c(1), - hbar(1), + : e0(3), + c(2), + hbar(4), dt(0.01), propagator( std::make_shared(e0, c, hbar)){}; @@ -54,8 +54,8 @@ struct Universe { double dist) { return e0 / (4 * M_PI) * - -dr.cross( - (magd1 / std::pow(dist, 3) - magd2 * c / std::pow(dist, 2))); + dr.cross( + (magd1 / std::pow(dist, 3) - magd2 / (c * std::pow(dist, 2)))); } }; @@ -67,7 +67,7 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) const int steps = total_t / dt; const double dist = (pos2 - pos1).norm(); const double delay = dist / c; - Eigen::Vector3d dr(pos2 - pos1); + Eigen::Vector3d dr(pos1 - pos2); // corresponds to separation calculation // Set up history with one source "column" auto history = std::make_shared>(2, 22, steps); From e71e864059ba936407775642f69ebd83f4a3b918 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 25 Jul 2017 13:11:10 -0400 Subject: [PATCH 59/75] Reworked pulse interaction test to test magnetic particle and pulse interactions --- test/CMakeLists.txt | 2 +- test/pulse_interaction_test.cpp | 106 ++++++++++++++++++-------------- 2 files changed, 60 insertions(+), 48 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7bdbd562..d656865b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,7 @@ if(${Boost_FOUND}) "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" - #"${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/history_interaction_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) diff --git a/test/pulse_interaction_test.cpp b/test/pulse_interaction_test.cpp index 3ac55f5b..656d107d 100644 --- a/test/pulse_interaction_test.cpp +++ b/test/pulse_interaction_test.cpp @@ -3,62 +3,74 @@ BOOST_AUTO_TEST_SUITE(pulse_interaction) -// Pulse configuration information: -const double amplitude = 15589.2260227; -const double delay = 5; -const double width = 227.89013; -const double pulse_freq = 2278.9013; -const Eigen::Vector3d wavevector(1, 0, 0); -const Eigen::Vector3d polarization(1, 0, 0); - -auto pulse = - Pulse(amplitude, delay, width, pulse_freq, wavevector, polarization); - -BOOST_AUTO_TEST_CASE(pulse_shape_1) +struct Universe { + double amp, delay, width, freq, dt; + Eigen::Vector3d wavevector, magnetization; + Pulse pulse; + + Universe() + : amp(2), + delay(0.5), + width(2), + freq(10), + dt(1), + wavevector(1, 1, 1), + magnetization(1, 1, 1), + pulse(Pulse(amp, delay, width, freq, wavevector, magnetization)){}; + + Eigen::Vector3d evaluate(double amp, + double delay, + double width, + double freq, + double t, + Eigen::Vector3d wavevec, + Eigen::Vector3d mag, + Eigen::Vector3d pos) + { + double arg = wavevec.dot(pos) - freq * (t - delay); + return (amp * 2 * mag.normalized() * + std::exp(-std::pow(arg / width, 2) / 2) * cos(arg)); + } +}; + +BOOST_FIXTURE_TEST_CASE(pulse_shape, Universe) { - const Eigen::Vector3d compare_array(7.7945379681e3, 0, 0); - - auto pulse_eval = pulse(Eigen::Vector3d(1, 1, 1), 5); - - BOOST_CHECK_CLOSE(pulse_eval(0), compare_array(0), 1e-6); - BOOST_CHECK_CLOSE(pulse_eval(1), compare_array(1), 1e-6); - BOOST_CHECK_CLOSE(pulse_eval(2), compare_array(2), 1e-6); -} + const double t = 1; + const Eigen::Vector3d pos(1, 1, 1); -BOOST_AUTO_TEST_CASE(pulse_shape_2) -{ - const Eigen::Vector3d compare_array(1.0456587493e3, 0, 0); + const Eigen::Vector3d compare_array( + evaluate(amp, delay, width, freq, t, wavevector, magnetization, pos)); - auto pulse_eval = pulse(Eigen::Vector3d(-1, 0, 1), 5.2); + auto pulse_eval = pulse(pos, t); - BOOST_CHECK_CLOSE(pulse_eval(0), compare_array(0), 1e-6); - BOOST_CHECK_CLOSE(pulse_eval(1), compare_array(1), 1e-6); - BOOST_CHECK_CLOSE(pulse_eval(2), compare_array(2), 1e-6); + BOOST_CHECK_CLOSE(pulse_eval(0), compare_array(0), 1e-15); + BOOST_CHECK_CLOSE(pulse_eval(1), compare_array(1), 1e-15); + BOOST_CHECK_CLOSE(pulse_eval(2), compare_array(2), 1e-15); } -// Following code tests the interaction between pulse and a QD - -// QD Configuration Information: -//const Eigen::Vector3d pos(1, 1, 1); -//const double dot_freq = 2278.9013; -//const std::pair damping(1, 1); -//const Eigen::Vector3d dip(1, 2, 3); - -//BOOST_AUTO_TEST_CASE(dot_pulse_interaction) -//{ - //const double compare_value = 1.0641745059e3; +BOOST_FIXTURE_TEST_CASE(dot_pulse_interaction, Universe) +{ + const Eigen::Vector3d pos(1, 1, 1); + const Eigen::Vector3d particle_mag(1, 0, 1); + const double alpha = 2; + const double gamma0 = 2; + const double sat_mag = 2; + const double t = 1; - //DotVector dots_vec = {QuantumDot(pos, dot_freq, damping, dip)}; - //auto dots = std::make_shared(dots_vec); + DotVector dots_vec = { + MagneticParticle(pos, alpha, gamma0, sat_mag, particle_mag)}; + auto dots = std::make_shared(dots_vec); - //std::shared_ptr pulse_ptr = std::make_shared( - //Pulse(amplitude, delay, width, pulse_freq, wavevector, polarization)); + std::shared_ptr pulse_ptr = std::make_shared(pulse); - //PulseInteraction pulse_interaction = - //PulseInteraction(dots, pulse_ptr, 1, 0.1); // hbar=1, dt=1 + PulseInteraction pulse_interaction = PulseInteraction(dots, pulse_ptr, 1, dt); - //auto results = pulse_interaction.evaluate(52); + auto results = pulse_interaction.evaluate(1); + auto analytic_pulse = + evaluate(amp, delay, width, freq, t, wavevector, magnetization, pos); - //BOOST_CHECK_CLOSE(real(results(0)), compare_value, 1e-6); -//} + BOOST_CHECK(results[0][0] == analytic_pulse[0]); + BOOST_CHECK(results[0][1] == analytic_pulse[1]); + BOOST_CHECK(results[0][2] == analytic_pulse[2]); +} BOOST_AUTO_TEST_SUITE_END() From b62c552a0870c0dbb7bb6e2eeb306390ed41a4aa Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 26 Jul 2017 13:27:01 -0400 Subject: [PATCH 60/75] changed the constants in the history interaction, its corresponding test and the propagator to following Gaussian units. --- src/interactions/green_function.h | 6 +++--- src/interactions/history_interaction.cpp | 4 ++-- src/pulse.cpp | 2 +- test/history_interaction_test.cpp | 8 +++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 97d9c5dd..67c23439 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -43,9 +43,9 @@ class Propagation::FixedFramePropagator std::vector coefs(interp.order() + 1, 0); for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += e0 / (4 * M_PI) * - (interp.evaluations[1][i] / std::pow(dr.norm(), 3) - - interp.evaluations[2][i] / (c * std::pow(dr.norm(), 2))); + coefs[i] += (interp.evaluations[1][i] / (c * std::pow(dr.norm(), 3)) - + interp.evaluations[2][i] / + (std::pow(c, 2) * std::pow(dr.norm(), 2))); } return coefs; diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index f750e2b6..960b7729 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -61,9 +61,9 @@ const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) if(s - i < history->array.index_bases()[1]) continue; results[src] += - dr.cross(coefficients[pair_idx][i] * history->array[obs][s - i][0]); + -dr.cross(coefficients[pair_idx][i] * history->array[obs][s - i][0]); results[obs] += - dr.cross(coefficients[pair_idx][i] * history->array[src][s - i][0]); + -dr.cross(coefficients[pair_idx][i] * history->array[src][s - i][0]); } } diff --git a/src/pulse.cpp b/src/pulse.cpp index fdc1625b..2fad4e19 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -19,7 +19,7 @@ Eigen::Vector3d Pulse::operator()(const Eigen::Vector3d &r, const double t) const { const double arg = wavevector.dot(r) - freq * (t - delay); - return (amplitude / 2 * field_orientation * gaussian(arg / width) * cos(arg)); + return (amplitude * 2 * field_orientation * gaussian(arg / width) * cos(arg)); } std::ostream &operator<<(std::ostream &os, const Pulse &p) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index eb338685..15017abe 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -50,12 +50,10 @@ struct Universe { Eigen::Vector3d &magd2, Eigen::Vector3d &dr, double c, - double e0, double dist) { - return e0 / (4 * M_PI) * - dr.cross( - (magd1 / std::pow(dist, 3) - magd2 / (c * std::pow(dist, 2)))); + return -dr.cross((magd1 / (c * std::pow(dist, 3)) - + magd2 / (std::pow(c, 2) * std::pow(dist, 2)))); } }; @@ -90,7 +88,7 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) Eigen::Vector3d magd1 = mag_d1_source(i * dt, delay); Eigen::Vector3d magd2 = mag_d2_source(i * dt, delay); Eigen::Vector3d interaction = - analytic_interaction(magd1, magd2, dr, c, e0, dist); + analytic_interaction(magd1, magd2, dr, c, dist); BOOST_CHECK_CLOSE(interaction[0], history_interaction.evaluate(i)[0][0], 1e-6); From f66fc29f53c606599cbf6695300cff1e683f419e Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 10 Aug 2017 11:17:14 -0400 Subject: [PATCH 61/75] Moved the normalization of field_orientation into the operator() function to avoid issues with the default constructor bypassing normalization. --- src/pulse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pulse.cpp b/src/pulse.cpp index 2fad4e19..774855b2 100644 --- a/src/pulse.cpp +++ b/src/pulse.cpp @@ -11,7 +11,7 @@ Pulse::Pulse(const double amplitude, width(width), freq(freq), wavevector(wavevector), - field_orientation(field_orientation.normalized()) + field_orientation(field_orientation) { } @@ -19,7 +19,7 @@ Eigen::Vector3d Pulse::operator()(const Eigen::Vector3d &r, const double t) const { const double arg = wavevector.dot(r) - freq * (t - delay); - return (amplitude * 2 * field_orientation * gaussian(arg / width) * cos(arg)); + return (amplitude * 2 * field_orientation.normalized() * gaussian(arg / width) * cos(arg)); } std::ostream &operator<<(std::ostream &os, const Pulse &p) From 9129c60623661663327313750a6e7035a7a40501 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Fri, 8 Sep 2017 11:12:29 -0400 Subject: [PATCH 62/75] corrected coefs calculation --- src/interactions/green_function.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 67c23439..695e6b57 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -8,7 +8,8 @@ #include "../common.h" #include "../lagrange_set.h" -namespace Propagation { + namespace Propagation +{ template class Propagator; @@ -43,11 +44,11 @@ class Propagation::FixedFramePropagator std::vector coefs(interp.order() + 1, 0); for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += (interp.evaluations[1][i] / (c * std::pow(dr.norm(), 3)) - - interp.evaluations[2][i] / - (std::pow(c, 2) * std::pow(dr.norm(), 2))); + coefs[i] += interp.evaluations[1][i] / (c * std::pow(dr.norm(), 3)) + + interp.evaluations[2][i] / std::pow(c * dr.norm(), 2); + //std::cout << coefs[i] << " "; } - + //std::cout << std::endl; return coefs; } }; From 278c8924c0776f6668f8e4398f7896bb5b212ef8 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 14 Sep 2017 11:11:44 -0400 Subject: [PATCH 63/75] Corrected the dyadic green's function and subsequent code changes. Mostly required types to be changed and additional calculations to be added. --- src/interactions/green_function.h | 49 +++++++++++++++++------- src/interactions/history_interaction.cpp | 6 +-- src/interactions/history_interaction.h | 2 +- src/main.cpp | 7 ++-- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 695e6b57..e7604b72 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -8,8 +8,7 @@ #include "../common.h" #include "../lagrange_set.h" - namespace Propagation -{ +namespace Propagation { template class Propagator; @@ -20,8 +19,7 @@ template class Propagation::Propagator { public: - Propagator(const double e0, const double c, const double hbar) - : c(c), e0(e0), hbar(hbar){}; + Propagator(const double c) : c(c){}; auto coefficients(const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const { @@ -29,28 +27,53 @@ class Propagation::Propagator { }; protected: - double c, e0, hbar; + double c; }; class Propagation::FixedFramePropagator : public Propagation::Propagator { public: - FixedFramePropagator(const double e0, const double c, const double hbar) - : Propagator(e0, c, hbar){}; - std::vector coefficients( + FixedFramePropagator(const double c) : Propagator(c){}; + std::vector coefficients( const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const { - std::vector coefs(interp.order() + 1, 0); + std::vector coefs(interp.order() + 1, Eigen::Matrix3d::Zero()); + + std::array dyads(spatial_dyads(dr)); for(int i = 0; i <= interp.order(); ++i) { - coefs[i] += interp.evaluations[1][i] / (c * std::pow(dr.norm(), 3)) + - interp.evaluations[2][i] / std::pow(c * dr.norm(), 2); - //std::cout << coefs[i] << " "; + for(int term = 0; term < 3; ++term) { + coefs[i] += -1 * dyads[term] * interp.evaluations[term][i]; + } } - //std::cout << std::endl; return coefs; } + + protected: + std::array spatial_dyads(const Eigen::Vector3d &dr) const + { + std::array results = { + {identity_minus_3rsq(dr) / std::pow(dr.norm(), 3), + identity_minus_3rsq(dr) / (c * dr.squaredNorm()), + identity_minus_rsq(dr) / (std::pow(c, 2) * dr.norm())}}; + + return results; + } + static Eigen::Matrix3d rhat_dyadic(const Eigen::Vector3d &dr) + { + return dr * dr.transpose() / dr.squaredNorm(); + } + + static Eigen::Matrix3d identity_minus_rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - rhat_dyadic(dr); + } + + static Eigen::Matrix3d identity_minus_3rsq(const Eigen::Vector3d &dr) + { + return Eigen::Matrix3d::Identity() - 3 * rhat_dyadic(dr); + } }; #endif diff --git a/src/interactions/history_interaction.cpp b/src/interactions/history_interaction.cpp index 960b7729..7c160647 100644 --- a/src/interactions/history_interaction.cpp +++ b/src/interactions/history_interaction.cpp @@ -37,7 +37,7 @@ void HistoryInteraction::build_coefficient_table() floor_delays[pair_idx] = delay.first; lagrange.calculate_weights(delay.second, dt); - std::vector interp_dyads(dyadic->coefficients(dr, lagrange)); + std::vector interp_dyads(dyadic->coefficients(dr, lagrange)); for(int i = 0; i <= interp_order; ++i) { coefficients[pair_idx][i] = interp_dyads[i]; @@ -61,9 +61,9 @@ const Interaction::ResultArray &HistoryInteraction::evaluate(const int time_idx) if(s - i < history->array.index_bases()[1]) continue; results[src] += - -dr.cross(coefficients[pair_idx][i] * history->array[obs][s - i][0]); + coefficients[pair_idx][i] * history->array[obs][s - i][0]; results[obs] += - -dr.cross(coefficients[pair_idx][i] * history->array[src][s - i][0]); + coefficients[pair_idx][i] * history->array[src][s - i][0]; } } diff --git a/src/interactions/history_interaction.h b/src/interactions/history_interaction.h index 6053dd48..8e1ccd93 100644 --- a/src/interactions/history_interaction.h +++ b/src/interactions/history_interaction.h @@ -27,7 +27,7 @@ class HistoryInteraction : public Interaction { std::shared_ptr dyadic; int interp_order, num_interactions; std::vector floor_delays; - boost::multi_array coefficients; + boost::multi_array coefficients; const double dt; const double c0; diff --git a/src/main.cpp b/src/main.cpp index c227761f..3df06a16 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,8 +34,7 @@ int main(int argc, char *argv[]) // Set up Interactions auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); - auto dyadic = make_shared( - config.e0, config.c0, config.hbar); + auto dyadic = make_shared(config.c0); std::vector> interactions{ make_shared(qds, pulse1, config.hbar, config.dt), @@ -51,8 +50,8 @@ int main(int argc, char *argv[]) std::make_unique( config.dt, history, std::move(interactions), std::move(rhs_funcs)); - Integrator::PredictorCorrector solver( - config.dt, 18, 22, 3.15, history, llg_rhs); + Integrator::PredictorCorrector solver(config.dt, 18, 22, 3.15, + history, llg_rhs); cout << "Solving..." << endl; solver.solve(); From 3f8d4c4ebcafc71f50adf56b74b101a4cd39a12c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Mon, 2 Oct 2017 18:25:52 -0400 Subject: [PATCH 64/75] Moved the demagnetization term to self_interaction.h. this fixed a bug where the incorrect mag was used to calculate demagnetization. Also adds an updated history_interaction test, which needs to still be fixed further. Also adds an llg_rhs test that is incomplete atm. --- src/integrator/RHS/llg_rhs.cpp | 10 ++++++-- src/interactions/CMakeLists.txt | 2 ++ src/interactions/green_function.h | 3 ++- src/interactions/self_interaction.cpp | 17 ++++++++++++++ src/interactions/self_interaction.h | 18 ++++++++++++++ src/main.cpp | 6 +++-- test/CMakeLists.txt | 3 ++- test/history_interaction_test.cpp | 34 +++++++++++++++++---------- test/llg_test.cpp | 19 +++++++++++++++ 9 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 src/interactions/self_interaction.cpp create mode 100644 src/interactions/self_interaction.h create mode 100644 test/llg_test.cpp diff --git a/src/integrator/RHS/llg_rhs.cpp b/src/integrator/RHS/llg_rhs.cpp index 19070056..e6b07cf5 100644 --- a/src/integrator/RHS/llg_rhs.cpp +++ b/src/integrator/RHS/llg_rhs.cpp @@ -1,6 +1,6 @@ #include "llg_rhs.h" -#include #include +#include #include Integrator::LLG_RHS::LLG_RHS( @@ -19,10 +19,16 @@ void Integrator::LLG_RHS::evaluate(const int step) const { auto pulse_interactions = interactions[0]->evaluate(step); auto history_interactions = interactions[1]->evaluate(step); + auto self_interactions = interactions[2]->evaluate(step); for(int sol = 0; sol < num_solutions; ++sol) { history->array[sol][step][1] = rhs_functions[sol](history->array[sol][step][0], - pulse_interactions[sol] + history_interactions[sol]); + pulse_interactions[sol] + history_interactions[sol] + + self_interactions[sol]); + } + if(step == 0) { + std::cout << "step: " << step << " " + << "dM: " << history->array[0][step][1].transpose() << std::endl; } } diff --git a/src/interactions/CMakeLists.txt b/src/interactions/CMakeLists.txt index 79b2a0a2..b52c5290 100644 --- a/src/interactions/CMakeLists.txt +++ b/src/interactions/CMakeLists.txt @@ -6,4 +6,6 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/interaction.h" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction.h" + "${CMAKE_CURRENT_LIST_DIR}/self_interaction.cpp" + "${CMAKE_CURRENT_LIST_DIR}/self_interaction.h" ) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index e7604b72..144cb14a 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -38,7 +38,8 @@ class Propagation::FixedFramePropagator const Eigen::Vector3d &dr, const Interpolation::UniformLagrangeSet &interp) const { - std::vector coefs(interp.order() + 1, Eigen::Matrix3d::Zero()); + std::vector coefs(interp.order() + 1, + Eigen::Matrix3d::Zero()); std::array dyads(spatial_dyads(dr)); diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp new file mode 100644 index 00000000..35cebada --- /dev/null +++ b/src/interactions/self_interaction.cpp @@ -0,0 +1,17 @@ +#include "self_interaction.h" + +SelfInteraction::SelfInteraction( + const std::shared_ptr &dots, + const std::shared_ptr> &history) + : Interaction(dots), history(history) +{ +} + +const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) +{ + // result = history[particle][dt][0] * 1/3; + for(int i = 0; i < dots->size(); ++i) { + results[i] = history->array[i][time_idx][0] / 3; + return results; + } +} diff --git a/src/interactions/self_interaction.h b/src/interactions/self_interaction.h new file mode 100644 index 00000000..fed2a073 --- /dev/null +++ b/src/interactions/self_interaction.h @@ -0,0 +1,18 @@ +#ifndef SELF_INTERACTION +#define SELF_INTERACTION + +#include +#include "../integrator/history.h" +#include "interaction.h" + +class SelfInteraction : public Interaction { + public: + SelfInteraction(const std::shared_ptr &, + const std::shared_ptr> &); + virtual const ResultArray &evaluate(const int); + + private: + std::shared_ptr> history; +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp index 3df06a16..796fbbd5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,7 @@ #include "interactions/green_function.h" #include "interactions/history_interaction.h" #include "interactions/pulse_interaction.h" +#include "interactions/self_interaction.h" using namespace std; @@ -30,7 +31,7 @@ int main(int argc, char *argv[]) auto history = std::make_shared>( config.num_particles, 22, config.num_timesteps); history->fill(soltype(0, 0, 0)); - history->initialize_past(soltype(1, 1, 1)); + history->initialize_past(soltype(100, 100, 100)); // Set up Interactions auto pulse1 = make_shared(read_pulse_config(config.pulse_path)); @@ -40,7 +41,8 @@ int main(int argc, char *argv[]) make_shared(qds, pulse1, config.hbar, config.dt), make_shared(qds, history, dyadic, config.interpolation_order, config.dt, - config.c0)}; + config.c0), + make_shared(qds, history)}; // Set up RHS functions auto rhs_funcs = rhs_functions(*qds); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d656865b..fd4421e1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,8 +9,9 @@ if(${Boost_FOUND}) PUBLIC "${CMAKE_CURRENT_LIST_DIR}/integrator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/lagrange_set_test.cpp" - "${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/propagator_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse_interaction_test.cpp" + #"${CMAKE_CURRENT_LIST_DIR}/llg_test.cpp" "${CMAKE_CURRENT_LIST_DIR}/history_interaction_test.cpp" ) target_link_libraries(qtest-bin PUBLIC quest ${Boost_LIBRARIES}) diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index 15017abe..1f415fcd 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -12,16 +12,13 @@ BOOST_AUTO_TEST_SUITE(history_interaction) typedef Eigen::Vector3d vec3d; struct Universe { - double e0, c, hbar, dt; + double c, dt; std::shared_ptr propagator; Universe() - : e0(3), - c(2), - hbar(4), + : c(2), dt(0.01), - propagator( - std::make_shared(e0, c, hbar)){}; + propagator(std::make_shared(c)){}; Eigen::Vector3d source(double t) { @@ -46,14 +43,20 @@ struct Universe { 0); } - Eigen::Vector3d analytic_interaction(Eigen::Vector3d &magd1, + Eigen::Vector3d analytic_interaction(Eigen::Vector3d &mag, + Eigen::Vector3d &magd1, Eigen::Vector3d &magd2, Eigen::Vector3d &dr, double c, double dist) { - return -dr.cross((magd1 / (c * std::pow(dist, 3)) - - magd2 / (std::pow(c, 2) * std::pow(dist, 2)))); + Eigen::Matrix3d rr = dr * dr.transpose() / dr.squaredNorm(); + Eigen::Matrix3d irr = Eigen::Matrix3d::Identity() - rr; + Eigen::Matrix3d i3rr = Eigen::Matrix3d::Identity() - 3 * rr; + + return mag / 3 - (i3rr * mag / std::pow(dist, 3) + + i3rr * magd1 / (c * std::pow(dist, 2)) + + irr * magd2 / (std::pow(c, 2) * dist)); } }; @@ -84,14 +87,21 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) HistoryInteraction history_interaction(dots, history, propagator, 7, dt, c); std::cout << std::scientific << std::setprecision(8); - for(int i = steps * 0.1; i < steps * 0.9; ++i) { + for(int i = 1; i < steps; ++i) { + Eigen::Vector3d magd0 = mag_d0_source(i * dt, delay); Eigen::Vector3d magd1 = mag_d1_source(i * dt, delay); Eigen::Vector3d magd2 = mag_d2_source(i * dt, delay); Eigen::Vector3d interaction = - analytic_interaction(magd1, magd2, dr, c, dist); + analytic_interaction(magd0, magd1, magd2, dr, c, dist); + //std::cout << magd0.transpose() << std::endl; + std::cout << interaction.transpose() << " | " << history_interaction.evaluate(i)[0].transpose() << std::endl; BOOST_CHECK_CLOSE(interaction[0], history_interaction.evaluate(i)[0][0], - 1e-6); + 1e-8); + BOOST_CHECK_CLOSE(interaction[1], history_interaction.evaluate(i)[0][1], + 1e-8); + BOOST_CHECK_CLOSE(interaction[2], history_interaction.evaluate(i)[0][2], + 1e-8); } } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/llg_test.cpp b/test/llg_test.cpp new file mode 100644 index 00000000..2d4a548e --- /dev/null +++ b/test/llg_test.cpp @@ -0,0 +1,19 @@ +#include +#include +#include "../src/magnetic_particle.h" + +BOOST_AUTO_TEST_SUITE(llg_rhs) + +BOOST_AUTO_TEST_CASE(llg_rhs) +{ + typedef Eigen : Vector3d vec3d; + + vec3d pos(1, 1, 1); + vec3d mag(100, 100, 100); + const double alpha = 2; + const double gamma0 = 3; + const double sat_mag = 100; + + MagneticParticle mp(pos, alpha, gamma0, sat_mag, mag); +} +BOOST_AUTO_TEST_SUITE_END() From 695805aed6fcc980d02fc56084c4715209aa0bcc Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 17 Oct 2017 15:59:01 -0400 Subject: [PATCH 65/75] removed self-interaction from history interaction test and comparing fields at src and at obs points to analytic interaction. Added output of fields to a file in the build directory for data analysis. --- src/interactions/self_interaction.cpp | 1 - test/history_interaction_test.cpp | 44 +++++++++++++++++++-------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index 35cebada..d21bd20c 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -9,7 +9,6 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { - // result = history[particle][dt][0] * 1/3; for(int i = 0; i < dots->size(); ++i) { results[i] = history->array[i][time_idx][0] / 3; return results; diff --git a/test/history_interaction_test.cpp b/test/history_interaction_test.cpp index 1f415fcd..9a397b5e 100644 --- a/test/history_interaction_test.cpp +++ b/test/history_interaction_test.cpp @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include #include "../src/interactions/green_function.h" #include "../src/interactions/history_interaction.h" @@ -17,7 +19,7 @@ struct Universe { Universe() : c(2), - dt(0.01), + dt(.01), propagator(std::make_shared(c)){}; Eigen::Vector3d source(double t) @@ -54,9 +56,9 @@ struct Universe { Eigen::Matrix3d irr = Eigen::Matrix3d::Identity() - rr; Eigen::Matrix3d i3rr = Eigen::Matrix3d::Identity() - 3 * rr; - return mag / 3 - (i3rr * mag / std::pow(dist, 3) + - i3rr * magd1 / (c * std::pow(dist, 2)) + - irr * magd2 / (std::pow(c, 2) * dist)); + return -(i3rr * mag / std::pow(dist, 3) + + i3rr * magd1 / (c * std::pow(dist, 2)) + + irr * magd2 / (std::pow(c, 2) * dist)); } }; @@ -75,6 +77,7 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) history->fill(Eigen::Vector3d::Zero()); for(int i = -22; i < steps; ++i) { + history->array[0][i][0] = source(i * dt); history->array[1][i][0] = source(i * dt); } @@ -85,6 +88,9 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) MagneticParticle(pos2, 1, 1, 1, Eigen::Vector3d::Zero())}))); HistoryInteraction history_interaction(dots, history, propagator, 7, dt, c); + std::vector obs_fields(steps); + std::vector src_fields(steps); + std::vector analytic(steps); std::cout << std::scientific << std::setprecision(8); for(int i = 1; i < steps; ++i) { @@ -93,15 +99,27 @@ BOOST_FIXTURE_TEST_CASE(history_interaction, Universe) Eigen::Vector3d magd2 = mag_d2_source(i * dt, delay); Eigen::Vector3d interaction = analytic_interaction(magd0, magd1, magd2, dr, c, dist); - //std::cout << magd0.transpose() << std::endl; - std::cout << interaction.transpose() << " | " << history_interaction.evaluate(i)[0].transpose() << std::endl; - - BOOST_CHECK_CLOSE(interaction[0], history_interaction.evaluate(i)[0][0], - 1e-8); - BOOST_CHECK_CLOSE(interaction[1], history_interaction.evaluate(i)[0][1], - 1e-8); - BOOST_CHECK_CLOSE(interaction[2], history_interaction.evaluate(i)[0][2], - 1e-8); + + obs_fields[i] = history_interaction.evaluate(i)[0]; + src_fields[i] = history_interaction.evaluate(i)[1]; + analytic[i] = interaction; + + BOOST_CHECK_CLOSE(interaction[0], obs_fields[i][0], 1e-8); + BOOST_CHECK_CLOSE(interaction[1], obs_fields[i][1], 1e-8); + BOOST_CHECK_CLOSE(interaction[2], obs_fields[i][2], 1e-8); + BOOST_CHECK_CLOSE(interaction[0], src_fields[i][0], 1e-8); + BOOST_CHECK_CLOSE(interaction[1], src_fields[i][1], 1e-8); + BOOST_CHECK_CLOSE(interaction[2], src_fields[i][2], 1e-8); + } + + std::ofstream outfile; + outfile.open("fields.dat"); + outfile << std::scientific << std::setprecision(15); + for(int i = 0; i < steps; ++i) { + outfile << obs_fields[i].transpose() << " | " + << src_fields[i].transpose() << " | " + << analytic[i].transpose() << std::endl; } + outfile.close(); } BOOST_AUTO_TEST_SUITE_END() From 6451c54a62d6ec77ca47eb07dce440a545f60b6c Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 17 Oct 2017 16:23:17 -0400 Subject: [PATCH 66/75] corrected a few errors in llg_test.cpp --- test/llg_test.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/llg_test.cpp b/test/llg_test.cpp index 2d4a548e..3010f226 100644 --- a/test/llg_test.cpp +++ b/test/llg_test.cpp @@ -6,14 +6,18 @@ BOOST_AUTO_TEST_SUITE(llg_rhs) BOOST_AUTO_TEST_CASE(llg_rhs) { - typedef Eigen : Vector3d vec3d; + typedef Eigen::Vector3d vec3d; - vec3d pos(1, 1, 1); - vec3d mag(100, 100, 100); + vec3d pos(1, 2, 1); + const vec3d mag(100, 100, 100); const double alpha = 2; const double gamma0 = 3; const double sat_mag = 100; MagneticParticle mp(pos, alpha, gamma0, sat_mag, mag); + const vec3d field(10,100,50); + + vec3d mp.llg_rhs(mag, field); + } BOOST_AUTO_TEST_SUITE_END() From a9752d78cbf0679a97fa30f9a210af0cb76b16d1 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Wed, 25 Oct 2017 14:32:04 -0400 Subject: [PATCH 67/75] added an Euler integrator to swap with PC integrator. It current breaks because rhs_funcntions runs out of scope and is destroyed and the integrator cannot find it. The Euler integrator likely needs to become a subclass in Integrator. --- src/integrator/CMakeLists.txt | 2 ++ src/integrator/euler.cpp | 19 +++++++++++++++++++ src/integrator/euler.h | 25 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/integrator/euler.cpp create mode 100644 src/integrator/euler.h diff --git a/src/integrator/CMakeLists.txt b/src/integrator/CMakeLists.txt index f091b867..054ad703 100644 --- a/src/integrator/CMakeLists.txt +++ b/src/integrator/CMakeLists.txt @@ -6,4 +6,6 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/integrator.h" "${CMAKE_CURRENT_LIST_DIR}/weights.cpp" "${CMAKE_CURRENT_LIST_DIR}/weights.h" + "${CMAKE_CURRENT_LIST_DIR}/euler.cpp" + "${CMAKE_CURRENT_LIST_DIR}/euler.h" ) diff --git a/src/integrator/euler.cpp b/src/integrator/euler.cpp new file mode 100644 index 00000000..82df5c45 --- /dev/null +++ b/src/integrator/euler.cpp @@ -0,0 +1,19 @@ +#include "euler.h" + +EulerIntegrator::EulerIntegrator( + const int step, + const double dt, + const std::shared_ptr> &history, + std::unique_ptr> &rhs_functions) + : step(step), dt(dt), history(history), rhs_functions(rhs_functions) +{ +} + +void EulerIntegrator::solve() const +{ + rhs_functions->evaluate(step); + for(unsigned int num = 0; num < history->array.size(); ++num) { + history->array[step + 1][num][0] = + history->array[step][num][1] * dt + history->array[step][num][0]; + } +} diff --git a/src/integrator/euler.h b/src/integrator/euler.h new file mode 100644 index 00000000..6106ebb9 --- /dev/null +++ b/src/integrator/euler.h @@ -0,0 +1,25 @@ +#ifndef EULER_INTEGRATOR +#define EULER_INTEGRATOR + +#include +#include "RHS/rhs.h" +#include "history.h" + +class EulerIntegrator; + +class EulerIntegrator { + public: + EulerIntegrator(const int, + const double, + const std::shared_ptr> &, + std::unique_ptr> &); + void solve() const; + + private: + const int step; + const double dt; + const std::shared_ptr> history; + std::unique_ptr> rhs_functions; +}; + +#endif From 21fa378f1ef4b976ede8646fc2ecb98a0c3b8af7 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 14 Dec 2017 14:35:19 -0500 Subject: [PATCH 68/75] called std::move on the unique ptr to rhs_functions. Prevents running out of scope and not being able to access rhs_functions --- src/integrator/euler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrator/euler.cpp b/src/integrator/euler.cpp index 82df5c45..6e518a30 100644 --- a/src/integrator/euler.cpp +++ b/src/integrator/euler.cpp @@ -5,7 +5,7 @@ EulerIntegrator::EulerIntegrator( const double dt, const std::shared_ptr> &history, std::unique_ptr> &rhs_functions) - : step(step), dt(dt), history(history), rhs_functions(rhs_functions) + : step(step), dt(dt), history(history), rhs_functions(std::move(rhs_functions)) { } From cdb767387a5b6c1a95875ee77d8c7f165e38c760 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 14 Dec 2017 14:39:45 -0500 Subject: [PATCH 69/75] Removed comments from src/CMakelists.txt --- src/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 035e2c0c..bd72dbf4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,8 +12,6 @@ target_sources(quest "${CMAKE_CURRENT_LIST_DIR}/math_utils.h" "${CMAKE_CURRENT_LIST_DIR}/pulse.cpp" "${CMAKE_CURRENT_LIST_DIR}/pulse.h" - #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot.cpp" - #"${CMAKE_CURRENT_LIST_DIR}/quantum_dot.h" "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.cpp" "${CMAKE_CURRENT_LIST_DIR}/magnetic_particle.h" ) From bcb0d6daa6b70f481e55767538c61b6f5aeb97c0 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Thu, 21 Dec 2017 14:48:30 -0500 Subject: [PATCH 70/75] Added factor of -4pi to self_interaction term --- src/interactions/self_interaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index d21bd20c..46217d40 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -10,7 +10,7 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { for(int i = 0; i < dots->size(); ++i) { - results[i] = history->array[i][time_idx][0] / 3; + results[i] = -4*M_PI*history->array[i][time_idx][0] / 3; return results; } } From 873e5f442638b8eb9acfea974659526211ce24cc Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 2 Jan 2018 13:13:56 -0500 Subject: [PATCH 71/75] fixed bug where return statement was inside the for loop. --- src/interactions/self_interaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index 46217d40..926351ca 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -10,7 +10,7 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { for(int i = 0; i < dots->size(); ++i) { - results[i] = -4*M_PI*history->array[i][time_idx][0] / 3; - return results; + results[i] = -4 * M_PI * history->array[i][time_idx][0] / 3; } + return results; } From 7ba1bfc32b0687e5e338b4898e7cef6d01a0bdb7 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 2 Jan 2018 13:14:52 -0500 Subject: [PATCH 72/75] fixed bug where return statement was inside the for loop. --- src/interactions/self_interaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index 46217d40..926351ca 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -10,7 +10,7 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { for(int i = 0; i < dots->size(); ++i) { - results[i] = -4*M_PI*history->array[i][time_idx][0] / 3; - return results; + results[i] = -4 * M_PI * history->array[i][time_idx][0] / 3; } + return results; } From 63580be9c1f449ec7088b904ba26c5622acbf5a7 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 2 Jan 2018 13:37:17 -0500 Subject: [PATCH 73/75] Made necessary changes to convert to SI units from Gaussian. --- src/interactions/green_function.h | 2 +- src/interactions/self_interaction.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactions/green_function.h b/src/interactions/green_function.h index 144cb14a..7e22eceb 100644 --- a/src/interactions/green_function.h +++ b/src/interactions/green_function.h @@ -45,7 +45,7 @@ class Propagation::FixedFramePropagator for(int i = 0; i <= interp.order(); ++i) { for(int term = 0; term < 3; ++term) { - coefs[i] += -1 * dyads[term] * interp.evaluations[term][i]; + coefs[i] += -1/(4*M_PI) * dyads[term] * interp.evaluations[term][i]; } } return coefs; diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index 926351ca..3a176262 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -10,7 +10,7 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { for(int i = 0; i < dots->size(); ++i) { - results[i] = -4 * M_PI * history->array[i][time_idx][0] / 3; + results[i] = -1 * history->array[i][time_idx][0] / 3; } return results; } From 093834d2fc135a7db51d4f3b11b9942b5fc203bc Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 2 Jan 2018 15:21:24 -0500 Subject: [PATCH 74/75] Updated example files to fit with magnetic particles in SI units --- examples/dots.cfg | 1026 +------------------------------------------- examples/input.cfg | 16 +- examples/pulse.cfg | 2 +- 3 files changed, 11 insertions(+), 1033 deletions(-) diff --git a/examples/dots.cfg b/examples/dots.cfg index 233c33f0..ba007caf 100644 --- a/examples/dots.cfg +++ b/examples/dots.cfg @@ -1,1024 +1,2 @@ --0.006772025629369738 0.006193253263435561 -0.010766531732233575 2278.9013 10 20 0.00052917721 0 0 -0.011823480098434758 0.010089453212510147 -0.008611542585243048 2278.9013 10 20 0.00052917721 0 0 -0.011242527517184298 -0.016822951509246842 0.005613471249154789 2278.9013 10 20 0.00052917721 0 0 -0.010860643182375451 0.018595175717389723 0.004115821381241114 2278.9013 10 20 0.00052917721 0 0 -0.014764048030885157 -0.0012128901263820935 -0.021720335850805683 2278.9013 10 20 0.00052917721 0 0 -0.020714309341955728 0.013456687392935596 -0.009111111395931737 2278.9013 10 20 0.00052917721 0 0 --0.01204625451146818 0.01603054652468411 0.019236234792667395 2278.9013 10 20 0.00052917721 0 0 --0.009655087631337322 0.02669196503974297 0.0035574087330482174 2278.9013 10 20 0.00052917721 0 0 --0.025631074209349347 0.005322360851495456 0.011702506217435682 2278.9013 10 20 0.00052917721 0 0 --0.025830188283723243 0.013741365179252008 0.003112110221678621 2278.9013 10 20 0.00052917721 0 0 --0.023686970340693003 -0.01634649451771747 -0.007582250449801375 2278.9013 10 20 0.00052917721 0 0 --0.011852022893683645 0.023702090698450085 -0.016280823743409834 2278.9013 10 20 0.00052917721 0 0 -0.017231449774589513 -0.008339028430368267 0.025644934150385545 2278.9013 10 20 0.00052917721 0 0 --0.018676380240599644 -0.012416226660655394 0.02523425464562118 2278.9013 10 20 0.00052917721 0 0 -0.026092858248059736 -0.0057523594664321 0.02147700270298797 2278.9013 10 20 0.00052917721 0 0 --0.007384253846381084 -0.028254202287620878 0.0183726659395389 2278.9013 10 20 0.00052917721 0 0 -0.03118099378908279 -0.013103079676621776 0.007018759388823292 2278.9013 10 20 0.00052917721 0 0 -0.009102432681234007 -0.015210698728506777 -0.029669985893745976 2278.9013 10 20 0.00052917721 0 0 -0.008629497915307816 -0.029558020312717148 0.01634191434082677 2278.9013 10 20 0.00052917721 0 0 -0.018878106537187245 0.022146242463752963 -0.021021477346681916 2278.9013 10 20 0.00052917721 0 0 -0.009553946315620454 -0.03101769598211107 0.01724988589140314 2278.9013 10 20 0.00052917721 0 0 --0.03352257118087382 0.011750698567110529 0.010229849905361632 2278.9013 10 20 0.00052917721 0 0 --0.02735982735777165 -0.02126260830680632 0.01292021930193632 2278.9013 10 20 0.00052917721 0 0 --0.0322260797820747 0.005788373781328238 0.017352690118422165 2278.9013 10 20 0.00052917721 0 0 -0.0058206851934825 -0.025691760401734876 0.02638240925009655 2278.9013 10 20 0.00052917721 0 0 --0.014085640331730487 0.01034759548066444 -0.03334742804395058 2278.9013 10 20 0.00052917721 0 0 --0.011808986158662438 -0.01775534316803734 0.03141294130196931 2278.9013 10 20 0.00052917721 0 0 --0.014591306640515611 0.025973641705128836 0.024238601460918663 2278.9013 10 20 0.00052917721 0 0 --0.021703981589634602 0.003985842558584918 0.03181267154038503 2278.9013 10 20 0.00052917721 0 0 -5.99264957512613e-6 0.022558647469564708 0.03148426831457801 2278.9013 10 20 0.00052917721 0 0 -0.027414016567643307 0.0010293233963747372 -0.02783738534955954 2278.9013 10 20 0.00052917721 0 0 --0.024848980157426592 -0.015568912366828669 -0.02623481634016761 2278.9013 10 20 0.00052917721 0 0 -0.033609335731674184 -0.014241884540032224 -0.016488850137562683 2278.9013 10 20 0.00052917721 0 0 -0.02310203173810732 0.029998209267919296 0.01374983589081974 2278.9013 10 20 0.00052917721 0 0 -0.025532712673355162 0.014977597873779724 0.0276184063661436 2278.9013 10 20 0.00052917721 0 0 --0.034004712259837366 0.023432385325339977 0.0021243636349861372 2278.9013 10 20 0.00052917721 0 0 -0.0008257138103114348 0.03524761379882063 0.021962197272815176 2278.9013 10 20 0.00052917721 0 0 --0.037683913015942594 -0.006084203256886467 0.016609521899008772 2278.9013 10 20 0.00052917721 0 0 -0.021996645952549965 0.019461694398659635 0.02960217112171537 2278.9013 10 20 0.00052917721 0 0 --0.01102896557635863 -0.026408863914462788 -0.03126274388697409 2278.9013 10 20 0.00052917721 0 0 --0.020301577301626683 -0.03638364495931401 -0.010602197005754155 2278.9013 10 20 0.00052917721 0 0 --0.0236961784599774 0.011204686887349435 0.034786699074960015 2278.9013 10 20 0.00052917721 0 0 --0.02758084874433281 0.01017954953238287 0.03275652837353216 2278.9013 10 20 0.00052917721 0 0 --0.012576050990783572 0.021737401368820075 0.036205990433759605 2278.9013 10 20 0.00052917721 0 0 --0.018739591445679438 0.01771153396691716 0.0360230076838951 2278.9013 10 20 0.00052917721 0 0 --0.006548052905877844 -0.038669846710965794 0.020848108692418654 2278.9013 10 20 0.00052917721 0 0 --0.025382004417770887 -0.03625941182423903 0.004764262976945266 2278.9013 10 20 0.00052917721 0 0 --0.027059190311662817 0.035682839137332 0.0035234929352037647 2278.9013 10 20 0.00052917721 0 0 -0.03019994223651956 -0.010204386487233874 0.033076017018835835 2278.9013 10 20 0.00052917721 0 0 -0.002762636774831906 0.027244848161306512 -0.036886072280105486 2278.9013 10 20 0.00052917721 0 0 --0.037448253510882934 0.02447465701582846 0.011806771017087547 2278.9013 10 20 0.00052917721 0 0 -0.02801399121265319 -0.032935162968977916 -0.01682408402439145 2278.9013 10 20 0.00052917721 0 0 --0.029644664903801188 -0.012353640338771954 0.03349504670219178 2278.9013 10 20 0.00052917721 0 0 -0.004947142060272025 0.017751226054722624 0.042761240774410014 2278.9013 10 20 0.00052917721 0 0 --0.04578163421351594 -0.01114835440549633 0.0031399186031587645 2278.9013 10 20 0.00052917721 0 0 --0.04530170834374492 0.01421687882429512 -0.0030688762971594064 2278.9013 10 20 0.00052917721 0 0 -0.029895272492624247 0.02552162429473742 0.027056533946177186 2278.9013 10 20 0.00052917721 0 0 --0.02473674692289979 -0.0043729573734014315 0.041128861250500526 2278.9013 10 20 0.00052917721 0 0 -0.03269016501184935 0.0071404680848860536 0.03475119373797586 2278.9013 10 20 0.00052917721 0 0 -0.04094461793854398 -0.0252450047477642 -0.004839757867001693 2278.9013 10 20 0.00052917721 0 0 --0.028589830339467992 -0.0207866925252444 0.03328730282051856 2278.9013 10 20 0.00052917721 0 0 --0.02050581596568063 -0.012042305452681756 0.04234606144955083 2278.9013 10 20 0.00052917721 0 0 -0.032029957760573935 -0.03248107077212664 0.01714277090069105 2278.9013 10 20 0.00052917721 0 0 -0.017837880021675245 -0.03409802968534709 0.031942598600863126 2278.9013 10 20 0.00052917721 0 0 -0.02609892732833541 -0.03308784788405966 -0.02725981618750456 2278.9013 10 20 0.00052917721 0 0 --0.016807470591651108 0.03303610237502608 0.03402082483192698 2278.9013 10 20 0.00052917721 0 0 --0.04281029378138018 -0.020803283398943162 0.0169817156398801 2278.9013 10 20 0.00052917721 0 0 --0.03499780307962613 -0.03286879278749266 -0.016333511686570323 2278.9013 10 20 0.00052917721 0 0 --0.02407127153179639 0.025005528365193264 -0.03737690670100924 2278.9013 10 20 0.00052917721 0 0 -0.009648742318198233 -0.03594685276353776 -0.03524575389741508 2278.9013 10 20 0.00052917721 0 0 --0.0397899402589873 0.024468742421143386 0.021805658594699684 2278.9013 10 20 0.00052917721 0 0 -0.04078945364675668 0.0018281977351372047 0.03196627945961206 2278.9013 10 20 0.00052917721 0 0 --0.019596144308173635 0.012965878460415414 0.04636133164893108 2278.9013 10 20 0.00052917721 0 0 --0.02501083522608344 -0.04299720450269584 -0.016884546245572563 2278.9013 10 20 0.00052917721 0 0 --0.022983829900277197 -0.04724103554809572 0.0015073314407056948 2278.9013 10 20 0.00052917721 0 0 --0.02128615085956237 -0.048099624128236595 -0.004725557811046832 2278.9013 10 20 0.00052917721 0 0 -0.012443634325416675 -0.04903110056419174 -0.015650025864429762 2278.9013 10 20 0.00052917721 0 0 -0.021587473275376468 0.021275762129630893 -0.04346007573198629 2278.9013 10 20 0.00052917721 0 0 --0.03049415605663025 -0.027057088540677898 -0.0340024619371212 2278.9013 10 20 0.00052917721 0 0 -0.049131944825264506 -0.010790874364736636 0.017055743489054087 2278.9013 10 20 0.00052917721 0 0 -0.037137750177581974 -0.03690675691196715 0.011911205582103734 2278.9013 10 20 0.00052917721 0 0 --0.0426119502956559 0.021625247293193317 -0.02483554845300262 2278.9013 10 20 0.00052917721 0 0 -0.04521889656806005 0.016796996581965207 -0.024094756485055602 2278.9013 10 20 0.00052917721 0 0 --0.028015477835915625 -0.005556589685435875 0.04608840589197377 2278.9013 10 20 0.00052917721 0 0 --0.04429545615074715 0.029692736506737538 0.010490652451114801 2278.9013 10 20 0.00052917721 0 0 --0.001967007747745886 0.038914528702641116 -0.03861095952360649 2278.9013 10 20 0.00052917721 0 0 -0.04004983763376069 -0.02485241751531936 0.028117388681383138 2278.9013 10 20 0.00052917721 0 0 -0.015187752762407747 0.04080104655961003 -0.034203379815850476 2278.9013 10 20 0.00052917721 0 0 -0.04997178819107828 0.023848614765152376 0.001601034341951968 2278.9013 10 20 0.00052917721 0 0 --0.05175873668839348 -0.020064757044593318 -0.005530729330623985 2278.9013 10 20 0.00052917721 0 0 --0.025625757017003425 -0.026584246052943794 -0.04183615069074492 2278.9013 10 20 0.00052917721 0 0 --0.04377386692082502 0.022305426515417892 0.026966440940671854 2278.9013 10 20 0.00052917721 0 0 -0.05543681477367263 0.0063431274784109815 0.005778329066910282 2278.9013 10 20 0.00052917721 0 0 -0.03992893095341532 0.011212545874222046 -0.037966015515739304 2278.9013 10 20 0.00052917721 0 0 --0.04559667918088356 -0.016610587792817377 -0.028527384799413358 2278.9013 10 20 0.00052917721 0 0 --0.03891964848299101 0.03405328034037458 0.02267197320144293 2278.9013 10 20 0.00052917721 0 0 --0.034106829668880456 -0.040124122139334195 0.021047152465056007 2278.9013 10 20 0.00052917721 0 0 -0.01158503242656106 -0.03664898071446232 -0.04223359628658924 2278.9013 10 20 0.00052917721 0 0 -0.03183331479190343 0.04536767233251804 0.015501989298833063 2278.9013 10 20 0.00052917721 0 0 --0.002710832058869461 0.052508192986581326 -0.023813812777589205 2278.9013 10 20 0.00052917721 0 0 --0.004217732994960255 0.030375284337302855 -0.04892021059986695 2278.9013 10 20 0.00052917721 0 0 --0.02367887466028834 -0.031012417671304082 -0.04272072663943449 2278.9013 10 20 0.00052917721 0 0 --0.04900385190452283 0.006350487642663938 0.030125323113297242 2278.9013 10 20 0.00052917721 0 0 --0.031439072336682694 -0.012935892439825292 -0.04697363823261319 2278.9013 10 20 0.00052917721 0 0 -0.020531761892505607 -0.04070967198631403 -0.03679839405903862 2278.9013 10 20 0.00052917721 0 0 --0.04243174763332058 0.004351357562060343 -0.04061631619956857 2278.9013 10 20 0.00052917721 0 0 -0.008799753024454127 -0.04021997340769734 0.04236734057917263 2278.9013 10 20 0.00052917721 0 0 --0.041084221725256775 0.030695823692149016 0.02946227253975947 2278.9013 10 20 0.00052917721 0 0 -0.025700256939825528 -0.010638846733982743 -0.05223813002250019 2278.9013 10 20 0.00052917721 0 0 -0.01208333001958195 -0.0473566061298612 -0.033888781243017696 2278.9013 10 20 0.00052917721 0 0 -0.045525316325091936 -0.03776279346216621 0.006436294117784291 2278.9013 10 20 0.00052917721 0 0 --0.04688923384775562 0.030176192244361966 -0.02129768654052483 2278.9013 10 20 0.00052917721 0 0 --0.041392681659623565 0.03810426876108797 0.01996585472715462 2278.9013 10 20 0.00052917721 0 0 -0.03636519229787033 -0.03929386584391675 -0.027216022440201215 2278.9013 10 20 0.00052917721 0 0 -0.06026951177383322 0.003809856189712857 -0.000969257356094988 2278.9013 10 20 0.00052917721 0 0 -0.05298147591327518 -0.02903162514122093 -0.00016924345609858893 2278.9013 10 20 0.00052917721 0 0 -0.04115365983515917 -0.04336819975778089 -0.01073023197966827 2278.9013 10 20 0.00052917721 0 0 --0.0243798295682347 0.0017992423287984671 -0.05566287483373181 2278.9013 10 20 0.00052917721 0 0 --0.0395230118661099 -0.006507476981551186 0.04587665198676605 2278.9013 10 20 0.00052917721 0 0 -0.048128811410537375 0.037505368049524535 0.004200969835016943 2278.9013 10 20 0.00052917721 0 0 --0.014153095540118177 -0.001312197319271291 -0.05972568548572002 2278.9013 10 20 0.00052917721 0 0 -0.0317309504569927 -0.0410425400481878 -0.033053744680500374 2278.9013 10 20 0.00052917721 0 0 -0.01086083745244415 -0.021629301624529418 0.056897164273820466 2278.9013 10 20 0.00052917721 0 0 --0.015909018732193136 -0.04720681751107231 -0.03664648499339945 2278.9013 10 20 0.00052917721 0 0 --0.03984024646281081 0.04121465905495858 -0.02370606549055493 2278.9013 10 20 0.00052917721 0 0 --0.03413460980731248 -0.0055675008224123634 -0.05177883128269889 2278.9013 10 20 0.00052917721 0 0 --0.004844738532989834 0.051183020292442205 0.035549450942335525 2278.9013 10 20 0.00052917721 0 0 -0.012703945903368319 0.06166133259945966 -0.002114715178204496 2278.9013 10 20 0.00052917721 0 0 -0.06171984719282164 -0.012876850915737592 -0.0012392238969165525 2278.9013 10 20 0.00052917721 0 0 --0.03904801716020323 0.04804816513568244 -0.01346708423176235 2278.9013 10 20 0.00052917721 0 0 -0.03714899282094525 -0.03412238292343739 -0.038702450500250785 2278.9013 10 20 0.00052917721 0 0 --0.00583806657755398 -0.0631028589021854 0.008275030166944086 2278.9013 10 20 0.00052917721 0 0 -0.0033269574449465433 0.06033246430979894 0.021138258965175072 2278.9013 10 20 0.00052917721 0 0 -0.012091483745959863 -0.044548802290185485 0.044594685275788415 2278.9013 10 20 0.00052917721 0 0 --0.05323910860897971 -0.026408993073814224 0.02425553732562369 2278.9013 10 20 0.00052917721 0 0 -0.059404021853654065 -0.018414103439753415 -0.015971679364936098 2278.9013 10 20 0.00052917721 0 0 --0.03921212105245081 -0.02895631725977804 0.04192228082285743 2278.9013 10 20 0.00052917721 0 0 -0.04617509444469825 0.0073426096019860165 0.04413787156175103 2278.9013 10 20 0.00052917721 0 0 -0.03692978748335135 -0.010455727792460012 0.05198768838076928 2278.9013 10 20 0.00052917721 0 0 -0.014073563856486837 -0.057994992202418355 -0.024898349617831272 2278.9013 10 20 0.00052917721 0 0 -0.043956755317967944 0.04633581054750935 -0.010179996590638452 2278.9013 10 20 0.00052917721 0 0 --0.05651488770529153 0.03157067932704716 0.00047427394001420264 2278.9013 10 20 0.00052917721 0 0 --0.013093718119896292 0.0031307403457228045 0.06369321258623128 2278.9013 10 20 0.00052917721 0 0 --0.024960379104717434 0.05870523320302257 0.013527282578636557 2278.9013 10 20 0.00052917721 0 0 -0.010819278272772626 0.06442783436086486 0.006100792795974808 2278.9013 10 20 0.00052917721 0 0 -0.06533003409150179 0.0030385685254440964 -0.00702035919989924 2278.9013 10 20 0.00052917721 0 0 --0.03996324921886707 -0.04588980746068333 0.025536610931882364 2278.9013 10 20 0.00052917721 0 0 -0.030544339071487236 -0.022809387130126035 0.05392518981334815 2278.9013 10 20 0.00052917721 0 0 -0.06303174528994493 0.0036626125220529104 -0.019443623840210755 2278.9013 10 20 0.00052917721 0 0 -0.054123895414406986 0.037980237892819846 0.0005762297206738931 2278.9013 10 20 0.00052917721 0 0 --0.053675238928957314 0.03762987461431988 0.010727418447440129 2278.9013 10 20 0.00052917721 0 0 -0.005139719258885789 -0.05390787287860621 0.038749932367454054 2278.9013 10 20 0.00052917721 0 0 --0.03826232121044637 0.04732691567264957 0.027293562410763694 2278.9013 10 20 0.00052917721 0 0 --0.0546929631413933 0.017582751454176704 0.03392214199654242 2278.9013 10 20 0.00052917721 0 0 -0.037566218749465474 0.052141832495767204 -0.018166436749280035 2278.9013 10 20 0.00052917721 0 0 --0.05594233363646539 0.030963621533404706 0.02001279258072919 2278.9013 10 20 0.00052917721 0 0 -0.06579899526351807 -0.011436389678061987 0.006619917206792281 2278.9013 10 20 0.00052917721 0 0 --0.040317671329484384 -0.040881237726653585 0.03521293896848937 2278.9013 10 20 0.00052917721 0 0 -0.012848163546173241 0.06090847384908543 -0.026084659142086464 2278.9013 10 20 0.00052917721 0 0 --0.04648585225982543 -0.04890238472223918 -0.0032840051012621996 2278.9013 10 20 0.00052917721 0 0 -0.043303963482646646 0.03377390111072376 0.039714917146426554 2278.9013 10 20 0.00052917721 0 0 -0.026481119112345963 0.007929786944353312 -0.06188451752457447 2278.9013 10 20 0.00052917721 0 0 --0.02068124328504717 0.03939104237315655 -0.05132895880039512 2278.9013 10 20 0.00052917721 0 0 --0.007005042992712207 0.0658092426689531 -0.01589125372528377 2278.9013 10 20 0.00052917721 0 0 -0.05421292523158261 0.029148505904064537 -0.029151526474350264 2278.9013 10 20 0.00052917721 0 0 --0.024889065613015904 -0.03132964809815336 -0.055114181979638216 2278.9013 10 20 0.00052917721 0 0 -0.012717955500851863 -0.03699465016277331 0.055858002250177896 2278.9013 10 20 0.00052917721 0 0 --0.049968244739922785 -0.04609705711686002 -0.0071411453822213256 2278.9013 10 20 0.00052917721 0 0 --0.05499823075737251 0.027927420219358234 0.0305226679029324 2278.9013 10 20 0.00052917721 0 0 --0.024086527560184423 0.05273968940714602 -0.03717069813219759 2278.9013 10 20 0.00052917721 0 0 -0.0020390927973740758 -0.06177561764919037 -0.030417716777595027 2278.9013 10 20 0.00052917721 0 0 --0.03678685106405433 0.03663020236106762 0.04533468841964483 2278.9013 10 20 0.00052917721 0 0 -0.013656590880422703 -0.015817925647045705 -0.06582891752376019 2278.9013 10 20 0.00052917721 0 0 -0.000023076167885272003 -0.02919614098149914 0.06259981211145882 2278.9013 10 20 0.00052917721 0 0 -0.05694763046014406 0.03867154613257556 0.006375535338470684 2278.9013 10 20 0.00052917721 0 0 -0.06373995364411056 -0.012828968018559872 0.024221612903403078 2278.9013 10 20 0.00052917721 0 0 -0.050131279895596514 0.022095470980780796 -0.04260946923011988 2278.9013 10 20 0.00052917721 0 0 -0.05814655279813019 0.021063297796356628 0.03158299298108863 2278.9013 10 20 0.00052917721 0 0 -0.03094229495750145 -0.058225062942683425 -0.02318981245942192 2278.9013 10 20 0.00052917721 0 0 -0.0035335693835387705 0.0648294732284902 -0.026037124269349732 2278.9013 10 20 0.00052917721 0 0 --0.06380578111453539 0.015043752336277916 0.024543716571292173 2278.9013 10 20 0.00052917721 0 0 -0.06255564899557964 -0.018509520819876613 -0.02545342666449041 2278.9013 10 20 0.00052917721 0 0 -0.023409677132946616 -0.008549063619046005 0.0656623695653033 2278.9013 10 20 0.00052917721 0 0 --0.006017344945517034 0.04365207207457772 -0.05501564487801178 2278.9013 10 20 0.00052917721 0 0 --0.013485968567125084 0.06460421272925765 0.02483766791241404 2278.9013 10 20 0.00052917721 0 0 --0.029242388007521658 0.048456942692407245 -0.04251213326690806 2278.9013 10 20 0.00052917721 0 0 -0.04068130724900354 -0.03416665551799564 -0.046819504635738085 2278.9013 10 20 0.00052917721 0 0 -0.013955530854825093 -0.04017719701353095 -0.056687055066121594 2278.9013 10 20 0.00052917721 0 0 --0.06639055747385492 -0.00839450595434832 -0.023441748459701706 2278.9013 10 20 0.00052917721 0 0 --0.03221699201423056 0.06018627565334983 -0.020066152407110238 2278.9013 10 20 0.00052917721 0 0 --0.011805904865234473 -0.06365738705999416 -0.02953958862911643 2278.9013 10 20 0.00052917721 0 0 -0.06962112704517076 0.01462174379587683 -0.003778174959990943 2278.9013 10 20 0.00052917721 0 0 -0.0007895631585979057 -0.06755116767365621 -0.02273171880885838 2278.9013 10 20 0.00052917721 0 0 --0.0014769733343087954 -0.05616266533473124 -0.04399518029823435 2278.9013 10 20 0.00052917721 0 0 --0.021745166047944575 -0.06743370919135483 -0.008495688325454998 2278.9013 10 20 0.00052917721 0 0 -0.008139672183837432 0.036275708240982085 -0.061006185452074785 2278.9013 10 20 0.00052917721 0 0 --0.06852079939460654 -0.020573007476855032 -0.0012745089093158524 2278.9013 10 20 0.00052917721 0 0 -0.057806096058063805 -0.0033844606830556456 -0.04223903429003645 2278.9013 10 20 0.00052917721 0 0 -0.06961643695028197 0.01315238349101766 -0.011739007060091622 2278.9013 10 20 0.00052917721 0 0 -0.031593774615065184 0.04609602058061729 -0.045147826095111365 2278.9013 10 20 0.00052917721 0 0 --0.06731651965188162 0.010771897037953115 -0.022900407487025654 2278.9013 10 20 0.00052917721 0 0 --0.035762294452218735 -0.02278911643279874 0.058183939719205435 2278.9013 10 20 0.00052917721 0 0 -0.06629008386271773 0.0045086440202776745 0.028488838393820326 2278.9013 10 20 0.00052917721 0 0 --0.014118979965708933 0.03729512361007603 0.06044777209198593 2278.9013 10 20 0.00052917721 0 0 --0.03635333181430239 -0.00938215646010837 0.06243502701639586 2278.9013 10 20 0.00052917721 0 0 -0.013733525354003906 0.045602981607161086 -0.05548207123884141 2278.9013 10 20 0.00052917721 0 0 --0.01839909151889818 -0.04482083947280574 -0.05483934873139562 2278.9013 10 20 0.00052917721 0 0 -0.06781601755802741 -0.011916351544253745 -0.02544692178539143 2278.9013 10 20 0.00052917721 0 0 -0.0378639707652928 -0.028304543820086847 -0.05620254306653821 2278.9013 10 20 0.00052917721 0 0 --0.01685604731094892 -0.00230353392284377 -0.07154928555352028 2278.9013 10 20 0.00052917721 0 0 -0.032189118992200616 -0.06585290539316987 0.009557906520495763 2278.9013 10 20 0.00052917721 0 0 --0.025672594397960602 -0.06632201719185304 -0.020526167683235175 2278.9013 10 20 0.00052917721 0 0 -0.019971973536031418 0.005137179158783756 -0.0711485843905949 2278.9013 10 20 0.00052917721 0 0 -0.06737126715736258 -0.028145485132581582 0.013629853608263298 2278.9013 10 20 0.00052917721 0 0 --0.006990992106341853 0.07101081140773668 0.020808176185298788 2278.9013 10 20 0.00052917721 0 0 --0.022843014036487974 -0.07072048267404582 0.0014141573225260329 2278.9013 10 20 0.00052917721 0 0 --0.021955596575465752 -0.023607381037122732 -0.06705684016140803 2278.9013 10 20 0.00052917721 0 0 --0.002420248638956901 -0.07393981972693986 0.00826352986863721 2278.9013 10 20 0.00052917721 0 0 --0.01156753423017387 -0.029812573566802503 0.06723184216407313 2278.9013 10 20 0.00052917721 0 0 --0.006431612123247998 0.037971857008472165 0.06377843985794851 2278.9013 10 20 0.00052917721 0 0 -0.017879100479759436 -0.06716650420193487 -0.026868730117789508 2278.9013 10 20 0.00052917721 0 0 -0.022231656866576188 0.002451111320156296 0.07111942908586272 2278.9013 10 20 0.00052917721 0 0 --0.049142242207049824 -0.055956122411324305 -0.006508100626495095 2278.9013 10 20 0.00052917721 0 0 --0.015611602071320618 -0.05530204106363573 -0.04786618481924432 2278.9013 10 20 0.00052917721 0 0 -0.05025532201231209 0.04961741351601473 -0.024986119952096708 2278.9013 10 20 0.00052917721 0 0 --0.0025669784175034738 0.041234155780906334 0.06250316211252188 2278.9013 10 20 0.00052917721 0 0 --0.02884837615862651 -0.053849557043862045 -0.0435295937852585 2278.9013 10 20 0.00052917721 0 0 --0.05003847569972053 0.05469696554078829 -0.012902292581732644 2278.9013 10 20 0.00052917721 0 0 -0.06148962232450739 0.0025653504567972885 0.04334976578166283 2278.9013 10 20 0.00052917721 0 0 --0.029329965345837483 0.022677389144588722 0.06572291603862973 2278.9013 10 20 0.00052917721 0 0 --0.0637033231808159 0.040484652535381305 0.00043469722129707566 2278.9013 10 20 0.00052917721 0 0 -0.0377095079698373 0.05983006708492111 -0.027090755261483968 2278.9013 10 20 0.00052917721 0 0 --0.01585757146926331 0.028928039340402834 -0.06835125138425127 2278.9013 10 20 0.00052917721 0 0 -0.028558876792707133 0.03259701265934295 0.0625451838057105 2278.9013 10 20 0.00052917721 0 0 -0.01934229469995924 0.07222048373366974 0.014230492173204934 2278.9013 10 20 0.00052917721 0 0 -0.06191576716084818 0.04188404334016693 0.01431611393141291 2278.9013 10 20 0.00052917721 0 0 -0.02137520722944053 -0.042696533467182496 0.05945640099073535 2278.9013 10 20 0.00052917721 0 0 --0.053961131168109217 0.023880522874361487 -0.04832893380041969 2278.9013 10 20 0.00052917721 0 0 --0.014308849668752954 0.005347126238987532 -0.07494644011457025 2278.9013 10 20 0.00052917721 0 0 --0.00035166029750677286 0.062002525836553524 0.04486674909634375 2278.9013 10 20 0.00052917721 0 0 -0.04575800451546108 0.04399144540143457 -0.04293961566969662 2278.9013 10 20 0.00052917721 0 0 -0.01436107592383462 -0.026607863777011798 0.07044398726787188 2278.9013 10 20 0.00052917721 0 0 -0.06142856004077846 -0.02887699047663711 -0.03593631530269581 2278.9013 10 20 0.00052917721 0 0 --0.016648826638865633 0.07194980022109176 -0.021622644248226963 2278.9013 10 20 0.00052917721 0 0 -0.055933484347053974 -0.025651926428154448 -0.04620890885538448 2278.9013 10 20 0.00052917721 0 0 -0.07713311373890358 -0.004236492904666045 0.0011651150638533059 2278.9013 10 20 0.00052917721 0 0 -0.024533706072668915 -0.06226118108364459 -0.03864355021207083 2278.9013 10 20 0.00052917721 0 0 -0.03660500471804912 0.06792022730573333 0.005321380354167737 2278.9013 10 20 0.00052917721 0 0 -0.05474393168587466 -0.054835122209928006 -0.002519201957456363 2278.9013 10 20 0.00052917721 0 0 -0.0554771554344653 -0.045385405360973574 -0.029614114200780917 2278.9013 10 20 0.00052917721 0 0 -0.030408406141251454 0.040559932725522496 0.058887462541978186 2278.9013 10 20 0.00052917721 0 0 --0.02341217417841923 -0.0731820154483146 0.012095033611089323 2278.9013 10 20 0.00052917721 0 0 --0.05663654427894124 0.0535269048520961 -0.0017426902731372818 2278.9013 10 20 0.00052917721 0 0 --0.010641046587892389 -0.07481542644972583 0.019735252474716525 2278.9013 10 20 0.00052917721 0 0 -0.007565691247240491 0.061623004473492005 -0.047392323405616166 2278.9013 10 20 0.00052917721 0 0 -0.07199928097711772 0.01719230377438824 0.02493691726844638 2278.9013 10 20 0.00052917721 0 0 --0.020137562081137983 -0.015491638124519036 0.07386574036901145 2278.9013 10 20 0.00052917721 0 0 --0.033184895287547644 -0.05703723762071433 -0.042522305968119345 2278.9013 10 20 0.00052917721 0 0 --0.051278963578404 -0.05381852585376426 0.02538204564234514 2278.9013 10 20 0.00052917721 0 0 -0.037905528354884255 -0.023193061327502207 -0.06482383395272262 2278.9013 10 20 0.00052917721 0 0 -0.07461209914051325 0.01718752263221124 -0.017768396655382712 2278.9013 10 20 0.00052917721 0 0 --0.023417906449309023 0.025888641418532088 0.07058982237578365 2278.9013 10 20 0.00052917721 0 0 -0.011243937589216713 0.02530579544785233 -0.0738165864828094 2278.9013 10 20 0.00052917721 0 0 --0.006582336424852009 -0.050454395121255824 -0.06028671733505278 2278.9013 10 20 0.00052917721 0 0 --0.04425715600521907 -0.0037840355553984684 0.06534160692096619 2278.9013 10 20 0.00052917721 0 0 --0.011751558944937845 0.040819311737963604 -0.06667335988252066 2278.9013 10 20 0.00052917721 0 0 --0.05689915341832452 0.008184554335193162 -0.054399490605388706 2278.9013 10 20 0.00052917721 0 0 --0.010584210216968482 0.05769474986019252 0.05337245680390407 2278.9013 10 20 0.00052917721 0 0 --0.04857489158759043 -0.04585930293133805 -0.04281853772230326 2278.9013 10 20 0.00052917721 0 0 -0.045432741303974455 0.05331380998241436 0.037996359584626604 2278.9013 10 20 0.00052917721 0 0 --0.045294932571195434 -0.06485015824390178 0.009967000704642182 2278.9013 10 20 0.00052917721 0 0 -0.022466453892430183 -0.06876137740922247 0.03356340880617681 2278.9013 10 20 0.00052917721 0 0 -0.01863934225790037 0.029337877625198183 -0.0717866022737064 2278.9013 10 20 0.00052917721 0 0 -0.04185073916189386 -0.016210282053991387 -0.06609896420419095 2278.9013 10 20 0.00052917721 0 0 --0.07294575246042698 -0.024328949936636368 0.022001624440199485 2278.9013 10 20 0.00052917721 0 0 -0.05756646553991934 0.035592975512499236 -0.04262684376185977 2278.9013 10 20 0.00052917721 0 0 -0.014107673692181799 0.0716124963998443 -0.032775572195980984 2278.9013 10 20 0.00052917721 0 0 --0.017190654211316825 0.06418673771277644 -0.04458898164237912 2278.9013 10 20 0.00052917721 0 0 -0.038634061054955926 0.008134140345085528 -0.0696740885609628 2278.9013 10 20 0.00052917721 0 0 --0.07786533894830305 0.0003557671542162022 -0.01875273796954474 2278.9013 10 20 0.00052917721 0 0 --0.009549556121723646 0.05556426803150272 0.05714545966933776 2278.9013 10 20 0.00052917721 0 0 -0.038815238756432 0.06380662519736918 -0.029850722284893216 2278.9013 10 20 0.00052917721 0 0 --0.013978376353112887 0.07272514540082087 0.03185132219004039 2278.9013 10 20 0.00052917721 0 0 -0.04215803508384108 -0.052654929100257014 -0.04426266732666523 2278.9013 10 20 0.00052917721 0 0 --0.027422758276367143 0.03520809314290663 -0.06729475811481422 2278.9013 10 20 0.00052917721 0 0 --0.008340243240382739 0.08029782213009756 -0.003153360914532999 2278.9013 10 20 0.00052917721 0 0 -0.054675506042112076 0.033885725693081736 0.049527679239448175 2278.9013 10 20 0.00052917721 0 0 -0.020793659625164496 -0.02271304649521827 0.07515253185050547 2278.9013 10 20 0.00052917721 0 0 -0.00031145070140203845 -0.07846629912397451 -0.021271134413708315 2278.9013 10 20 0.00052917721 0 0 -0.07457120215435498 0.03267004416928537 0.002997537208592971 2278.9013 10 20 0.00052917721 0 0 -0.011129895082168273 -0.026585211392426977 -0.07626225597350755 2278.9013 10 20 0.00052917721 0 0 --0.05314025509530404 0.04477482532047883 0.04273626456299651 2278.9013 10 20 0.00052917721 0 0 --0.04134375943390439 0.054072761138322545 0.0450603375324804 2278.9013 10 20 0.00052917721 0 0 -0.058691883911772436 -0.032592695669482474 -0.046472490386330556 2278.9013 10 20 0.00052917721 0 0 -0.059670887155792995 -0.00025925784346780834 -0.05578258377230111 2278.9013 10 20 0.00052917721 0 0 -0.00996478301479875 0.0008797430781413151 -0.08107184429181458 2278.9013 10 20 0.00052917721 0 0 -0.027233649120946335 0.05367508839103724 0.055312553767513206 2278.9013 10 20 0.00052917721 0 0 -0.05718185800594078 -0.0552857256663937 -0.01892101754133979 2278.9013 10 20 0.00052917721 0 0 -0.07919479696172776 0.008483890333176702 0.018504297676858572 2278.9013 10 20 0.00052917721 0 0 --0.0788703741211142 0.020436449323637584 0.0074270943098699305 2278.9013 10 20 0.00052917721 0 0 --0.027397430802680645 -0.07693563357903538 -0.005724767109092976 2278.9013 10 20 0.00052917721 0 0 -0.07641348506908752 0.007774088141758173 0.028504384139118488 2278.9013 10 20 0.00052917721 0 0 --0.06681201135597681 0.040845983493527305 0.024836080619293266 2278.9013 10 20 0.00052917721 0 0 --0.026261692530877456 -0.015140720366858373 0.07654240691828917 2278.9013 10 20 0.00052917721 0 0 -0.005965146751866324 0.07037146731113136 -0.04233820416138229 2278.9013 10 20 0.00052917721 0 0 -0.020073649052730846 -0.03168375314220756 0.07332617857081708 2278.9013 10 20 0.00052917721 0 0 -0.011466783223074484 0.01010525425092057 -0.08120400218346244 2278.9013 10 20 0.00052917721 0 0 -0.04197698802489208 -0.06666287963422302 0.025007996252751352 2278.9013 10 20 0.00052917721 0 0 -0.020728037380975006 0.05848474024785577 0.05468869751511951 2278.9013 10 20 0.00052917721 0 0 --0.03726971088336628 -0.058208944850426686 0.045666225458851795 2278.9013 10 20 0.00052917721 0 0 --0.01990696275778242 -0.08037816581760499 -0.0025221917991840037 2278.9013 10 20 0.00052917721 0 0 --0.014406389810909193 0.026735185607504153 0.0771952506123183 2278.9013 10 20 0.00052917721 0 0 --0.036780889451532905 -0.06796101078015182 -0.030195648762692928 2278.9013 10 20 0.00052917721 0 0 -0.03311060372119923 -0.024635860434084444 0.07216704490801579 2278.9013 10 20 0.00052917721 0 0 --0.010807668248395075 -0.038922676433771564 -0.07267143974939871 2278.9013 10 20 0.00052917721 0 0 -0.08039579209203723 -0.005259233916064865 -0.02103635763713546 2278.9013 10 20 0.00052917721 0 0 --0.06858499461049025 0.02493699426774776 -0.04017228196849598 2278.9013 10 20 0.00052917721 0 0 --0.06897235993827383 -0.024735897475905266 0.03992776704807405 2278.9013 10 20 0.00052917721 0 0 -0.010088618634249369 0.08292202501243084 -0.0021255891581868913 2278.9013 10 20 0.00052917721 0 0 --0.056407314792324026 0.025599879408334247 -0.056123473194794854 2278.9013 10 20 0.00052917721 0 0 --0.0340770104937656 0.07113468349236163 -0.02843394261293547 2278.9013 10 20 0.00052917721 0 0 -0.01503361804239789 0.036661628317673334 -0.07400483957546933 2278.9013 10 20 0.00052917721 0 0 --0.056114999723994696 0.03534584836890908 0.05164938055757112 2278.9013 10 20 0.00052917721 0 0 -0.0803804665850622 0.02025564000388791 0.014163503761758067 2278.9013 10 20 0.00052917721 0 0 -0.003248021549072666 0.0691890122748402 0.047700190394820374 2278.9013 10 20 0.00052917721 0 0 -0.06028619602793611 0.008613793579668183 0.05807076660122812 2278.9013 10 20 0.00052917721 0 0 --0.01578128258720979 -0.03057449403672058 -0.0768650500949464 2278.9013 10 20 0.00052917721 0 0 -0.03283787633647112 -0.011448923717362114 0.0767205785364874 2278.9013 10 20 0.00052917721 0 0 --0.033881883896853204 -0.04591803986391463 0.06196335398948266 2278.9013 10 20 0.00052917721 0 0 --0.020763979195158877 -0.013066670110881917 0.08093443685959689 2278.9013 10 20 0.00052917721 0 0 --0.032181600792407006 0.06450401701482023 -0.04428871188263206 2278.9013 10 20 0.00052917721 0 0 -0.06092284239285356 0.04429221819816592 -0.0385538206588521 2278.9013 10 20 0.00052917721 0 0 -0.022528669757084063 -0.02367488380884425 -0.07816938941360449 2278.9013 10 20 0.00052917721 0 0 -0.02337687529042054 -0.06132423201264692 -0.05368911645955293 2278.9013 10 20 0.00052917721 0 0 -0.02125176078742752 -0.08188872309452166 -0.006092324275539518 2278.9013 10 20 0.00052917721 0 0 -0.06464261570854901 -0.05046809765850585 0.021825521591463115 2278.9013 10 20 0.00052917721 0 0 -0.027923099866643097 0.0045612420143612 0.08002805971006571 2278.9013 10 20 0.00052917721 0 0 -0.015503673097415627 -0.0571005360499004 0.06091684378239648 2278.9013 10 20 0.00052917721 0 0 --0.025890072830096533 -0.035973618220304704 0.07260514024808667 2278.9013 10 20 0.00052917721 0 0 --0.0538244848268008 -0.05368920966907903 0.03847375844153056 2278.9013 10 20 0.00052917721 0 0 -0.07075689037496108 0.011722522247110512 -0.04601189675330164 2278.9013 10 20 0.00052917721 0 0 --0.05645335405659657 0.0206227793358833 -0.06062064278474105 2278.9013 10 20 0.00052917721 0 0 -0.06037098725452472 0.04066196382116205 0.04485228386204648 2278.9013 10 20 0.00052917721 0 0 --0.016293344632116902 0.0014766216473381388 -0.08410046655450162 2278.9013 10 20 0.00052917721 0 0 --0.062242909089618464 -0.005993169244930097 0.05870568469123061 2278.9013 10 20 0.00052917721 0 0 --0.04328966512819582 0.06883393292015394 0.027436986569423005 2278.9013 10 20 0.00052917721 0 0 -0.05053664368745542 0.05454249107017439 0.043292713923566706 2278.9013 10 20 0.00052917721 0 0 -0.006495054316148885 0.0498003021724982 0.07016119396093118 2278.9013 10 20 0.00052917721 0 0 --0.07164368090688464 -0.040068156783514663 -0.026712068111051535 2278.9013 10 20 0.00052917721 0 0 --0.07549710434549528 0.04092382964436836 -0.00976793162392009 2278.9013 10 20 0.00052917721 0 0 -0.08052543645672955 0.003661355746031214 0.03221663897308791 2278.9013 10 20 0.00052917721 0 0 --0.05322203587266963 -0.0008028927642588224 0.06860017983906258 2278.9013 10 20 0.00052917721 0 0 -0.04224396842411149 -0.054706363582657486 -0.05264774888388807 2278.9013 10 20 0.00052917721 0 0 -0.07540042031840549 -0.03415302164663714 0.02643935645166584 2278.9013 10 20 0.00052917721 0 0 --0.06760532625167603 0.05143353665579031 0.018451197584474277 2278.9013 10 20 0.00052917721 0 0 --0.05929449738642492 -0.06330286062419388 0.006107631441511163 2278.9013 10 20 0.00052917721 0 0 --0.029822622180409486 0.060813458592891056 -0.05453309272950568 2278.9013 10 20 0.00052917721 0 0 -0.006420898653449969 -0.07879438959231386 -0.03625966151443394 2278.9013 10 20 0.00052917721 0 0 --0.03591917740679684 0.04047543530577702 0.06819258874544032 2278.9013 10 20 0.00052917721 0 0 -0.05730038903955559 0.03144588578143903 -0.05770026761038988 2278.9013 10 20 0.00052917721 0 0 -0.01974127048340163 -0.023941676840063653 0.08148802135345262 2278.9013 10 20 0.00052917721 0 0 -0.04454278238777154 -0.04774275031444092 -0.05780557408400741 2278.9013 10 20 0.00052917721 0 0 --0.04556678163306499 -0.022215910395555205 -0.07105113036692562 2278.9013 10 20 0.00052917721 0 0 -0.038321423957259015 0.07565884748307905 0.021082867773604907 2278.9013 10 20 0.00052917721 0 0 --0.04368689584423363 0.053226977005046416 0.053827208742075305 2278.9013 10 20 0.00052917721 0 0 --0.0059631613095134095 0.07046430000566378 0.05155178845799252 2278.9013 10 20 0.00052917721 0 0 --0.036224463085172964 0.07894359356214359 0.011800342336200975 2278.9013 10 20 0.00052917721 0 0 --0.07142176439773529 -0.02225835184264896 -0.04592694398638969 2278.9013 10 20 0.00052917721 0 0 --0.01293275139817246 0.061660564857671074 0.061129817395342734 2278.9013 10 20 0.00052917721 0 0 --0.06911367710988564 -0.049319252046881146 0.022423427167207244 2278.9013 10 20 0.00052917721 0 0 --0.05198566989942413 0.0037544365121616186 0.07071995675030313 2278.9013 10 20 0.00052917721 0 0 --0.08653787349786801 -0.01478903458944103 0.003513018903287979 2278.9013 10 20 0.00052917721 0 0 --0.02270285729776894 0.0834528027648932 -0.015676248754208588 2278.9013 10 20 0.00052917721 0 0 --0.08766094382871023 0.00510264554929224 -0.004903816591069088 2278.9013 10 20 0.00052917721 0 0 --0.02268553586411881 0.03218593144722204 0.0786657132914153 2278.9013 10 20 0.00052917721 0 0 --0.03356191311762896 0.011789455034910246 -0.08056057475493628 2278.9013 10 20 0.00052917721 0 0 -0.08391003471329034 0.012066261791817023 -0.024413755076571564 2278.9013 10 20 0.00052917721 0 0 -0.00895405643684477 -0.06234021522487698 0.062054472215794965 2278.9013 10 20 0.00052917721 0 0 -0.002208334529376299 -0.08850547765188799 0.0021869320044624607 2278.9013 10 20 0.00052917721 0 0 -0.0264435210618994 -0.08456367482819849 0.000038524597087308265 2278.9013 10 20 0.00052917721 0 0 --0.0036692963169344117 -0.03982777002281962 0.07912248456118104 2278.9013 10 20 0.00052917721 0 0 --0.028489891861241567 0.04543091263237953 -0.07084328853893418 2278.9013 10 20 0.00052917721 0 0 -0.04262258061650126 0.014613006036553522 0.07660646597747522 2278.9013 10 20 0.00052917721 0 0 -0.032998778216475955 0.08163785740994584 -0.012409638019717617 2278.9013 10 20 0.00052917721 0 0 --0.040992595119738295 0.06140696309829824 0.04959734414999084 2278.9013 10 20 0.00052917721 0 0 --0.047793140130109546 -0.03127128555089781 0.06824090982338832 2278.9013 10 20 0.00052917721 0 0 --0.07733476151179544 0.0019145640633468908 0.04399483351013106 2278.9013 10 20 0.00052917721 0 0 --0.045467423070344015 -0.04525742261231497 0.06204812296075235 2278.9013 10 20 0.00052917721 0 0 -0.01287362716402407 -0.08757304636673638 -0.012473613242447501 2278.9013 10 20 0.00052917721 0 0 -0.04807913550088616 0.05362668902081824 -0.05296053244118512 2278.9013 10 20 0.00052917721 0 0 -0.02271817736935805 -0.08254284215908914 0.025904781733641635 2278.9013 10 20 0.00052917721 0 0 -0.03891138598225119 -0.06785296490513687 0.0435384445135687 2278.9013 10 20 0.00052917721 0 0 -0.07643727338768591 0.0035814583550194956 0.04660373538303875 2278.9013 10 20 0.00052917721 0 0 --0.024079928111127136 0.0854241313975791 0.0123704645820229 2278.9013 10 20 0.00052917721 0 0 -0.009946454373285507 -0.058081867335680215 -0.06757679866438804 2278.9013 10 20 0.00052917721 0 0 --0.0050840892450592645 0.03853136079064923 0.08082239776961253 2278.9013 10 20 0.00052917721 0 0 --0.027580822314711706 0.0486428526768421 0.07016330523540071 2278.9013 10 20 0.00052917721 0 0 --0.05894005791760937 0.06265133084742397 -0.025651310128558424 2278.9013 10 20 0.00052917721 0 0 -0.02835462961511004 -0.031961894594547346 -0.07894267969408672 2278.9013 10 20 0.00052917721 0 0 --0.042032472905718155 0.07698898989083075 0.01933770315728789 2278.9013 10 20 0.00052917721 0 0 -0.016549865417393506 0.07961835277748192 -0.038508737172280094 2278.9013 10 20 0.00052917721 0 0 --0.07078657970844016 -0.04907153769681766 0.02612627884101304 2278.9013 10 20 0.00052917721 0 0 -0.00007034861380922353 0.05508172783179749 0.0712424530636746 2278.9013 10 20 0.00052917721 0 0 -0.0660594063982462 0.060399698341096986 -0.010761436444674144 2278.9013 10 20 0.00052917721 0 0 -0.050615100485669196 0.0742272982870078 -0.007784695942387343 2278.9013 10 20 0.00052917721 0 0 --0.07838423604269143 -0.008887892363801664 0.04381323973419743 2278.9013 10 20 0.00052917721 0 0 --0.056687570126227715 0.07007651222983513 -0.005994811666373945 2278.9013 10 20 0.00052917721 0 0 -0.05415465939823538 0.0692315543091111 -0.02104473700932097 2278.9013 10 20 0.00052917721 0 0 -0.08226196707581229 -0.03011553898026864 -0.022451935126066247 2278.9013 10 20 0.00052917721 0 0 -0.07258326942611104 -0.009669599593154221 -0.05311623071085758 2278.9013 10 20 0.00052917721 0 0 -0.08079219578302699 -0.010268234290515876 0.03961999444259989 2278.9013 10 20 0.00052917721 0 0 --0.07543262583818244 0.02001208891831613 0.04608781441161214 2278.9013 10 20 0.00052917721 0 0 -0.003981757650617923 0.015030664331522448 0.08933788113463459 2278.9013 10 20 0.00052917721 0 0 --0.06735357539542422 0.029044612784683232 0.053346213921852625 2278.9013 10 20 0.00052917721 0 0 --0.04954457387667871 0.07593306808812456 0.005222676603267362 2278.9013 10 20 0.00052917721 0 0 -0.009375953501611245 -0.05503338458556878 0.07189977295418393 2278.9013 10 20 0.00052917721 0 0 -0.07439068018272521 -0.044532065564209744 0.027784803908569244 2278.9013 10 20 0.00052917721 0 0 -0.06855118480642641 -0.049791299528103405 0.03342317598861799 2278.9013 10 20 0.00052917721 0 0 --0.016068661512648685 0.0004035538062553967 -0.08965643092312647 2278.9013 10 20 0.00052917721 0 0 --0.02608671994635342 -0.08590171145396724 0.01582464946241613 2278.9013 10 20 0.00052917721 0 0 -0.06272781098201269 0.05650975925559987 -0.034467338963154515 2278.9013 10 20 0.00052917721 0 0 --0.040473964827132614 0.039389419874152565 0.07164980076821953 2278.9013 10 20 0.00052917721 0 0 --0.04407747412094043 0.05497929468336987 0.05797586131958038 2278.9013 10 20 0.00052917721 0 0 --0.001329645603927232 0.09119970711326009 -0.004742006557960365 2278.9013 10 20 0.00052917721 0 0 -0.062193518666073866 0.009321867858819943 -0.06642780845862437 2278.9013 10 20 0.00052917721 0 0 --0.03761405064302015 0.01653393786056845 0.08181567710647686 2278.9013 10 20 0.00052917721 0 0 --0.023906559621286627 0.05422296123812392 -0.06981416727854939 2278.9013 10 20 0.00052917721 0 0 -0.050047900171950876 0.0735872375170804 0.02193372661244064 2278.9013 10 20 0.00052917721 0 0 --0.02221661512447598 -0.018270960890177934 -0.08706678216212471 2278.9013 10 20 0.00052917721 0 0 -0.0038819456451244516 -0.0017136144120549202 -0.0918791322981787 2278.9013 10 20 0.00052917721 0 0 --0.003307364671346291 0.089006989028864 -0.02342389429810915 2278.9013 10 20 0.00052917721 0 0 --0.046493097832885966 -0.017387972091964965 0.07778454909676408 2278.9013 10 20 0.00052917721 0 0 --0.04800362353614229 0.07881279810817765 0.0018435415204062777 2278.9013 10 20 0.00052917721 0 0 --0.05125638410265168 0.04928005061506613 0.05900293358137054 2278.9013 10 20 0.00052917721 0 0 --0.08393514141161473 0.006754441333234329 0.03829896604785055 2278.9013 10 20 0.00052917721 0 0 --0.06847859934778189 0.06203770955384935 -0.004932952276337665 2278.9013 10 20 0.00052917721 0 0 -0.024683310111302426 -0.0833332402207719 -0.03225806227068673 2278.9013 10 20 0.00052917721 0 0 -0.0600854755267074 0.04311694640708297 -0.05599530027485791 2278.9013 10 20 0.00052917721 0 0 --0.04926608596677712 0.04900909320475666 -0.061604827990713124 2278.9013 10 20 0.00052917721 0 0 --0.03345894849706926 -0.08370690506512565 0.022401821583181714 2278.9013 10 20 0.00052917721 0 0 --0.00846405994943944 0.0905849880847851 0.019601203875404205 2278.9013 10 20 0.00052917721 0 0 --0.07323263806150448 -0.05296461749227979 0.022540788700553538 2278.9013 10 20 0.00052917721 0 0 -0.009096837223139087 0.06803494879402927 -0.06297411509521267 2278.9013 10 20 0.00052917721 0 0 --0.03197622689563323 0.08679279813301305 0.012142058463989636 2278.9013 10 20 0.00052917721 0 0 --0.047407047914104494 -0.08039760498225806 -0.002609964108490348 2278.9013 10 20 0.00052917721 0 0 -0.017093462371489565 0.08655334457827002 -0.031016222695672557 2278.9013 10 20 0.00052917721 0 0 -0.014087136121015087 0.0029659768919976237 -0.09241936129475714 2278.9013 10 20 0.00052917721 0 0 -0.033312343907277275 -0.07454896588026497 -0.04568046417270677 2278.9013 10 20 0.00052917721 0 0 --0.04863078403676746 0.010701101657007384 -0.07938828508435866 2278.9013 10 20 0.00052917721 0 0 --0.044741338827783195 -0.04159686276603314 0.07109839412914332 2278.9013 10 20 0.00052917721 0 0 --0.0061742634760308945 0.07238080167914851 -0.05926472842700545 2278.9013 10 20 0.00052917721 0 0 -0.010869764029005358 -0.0930298434979494 0.0046670801908024195 2278.9013 10 20 0.00052917721 0 0 --0.07659620887500015 -0.044855487136463146 0.030373604004693133 2278.9013 10 20 0.00052917721 0 0 --0.0230720831986444 -0.046866511443033054 -0.07796883214488148 2278.9013 10 20 0.00052917721 0 0 --0.030145532635621086 -0.05386358035652944 -0.07084605771769698 2278.9013 10 20 0.00052917721 0 0 --0.030205390823313638 0.03279199397361349 0.08276807404006781 2278.9013 10 20 0.00052917721 0 0 -0.015074494724759857 -0.09213747542826556 0.011357527688521829 2278.9013 10 20 0.00052917721 0 0 -0.036749676015063404 -0.08366423899149272 -0.02246371800229474 2278.9013 10 20 0.00052917721 0 0 -0.08180598789238175 -0.04275724914866297 0.019223504117738044 2278.9013 10 20 0.00052917721 0 0 --0.08549739884375532 0.03237146966412929 0.023196341734424752 2278.9013 10 20 0.00052917721 0 0 -0.07605742991157927 0.02079105439674689 -0.05210399743825736 2278.9013 10 20 0.00052917721 0 0 -0.040966344154056866 -0.07980668937371624 -0.030049136335663085 2278.9013 10 20 0.00052917721 0 0 -0.0491798240224508 -0.045503929453435676 -0.06681786683988039 2278.9013 10 20 0.00052917721 0 0 --0.06052609863469141 0.07172361390162152 0.012459324157464813 2278.9013 10 20 0.00052917721 0 0 -0.07719323634062913 -0.009092547885662272 -0.0541284362609685 2278.9013 10 20 0.00052917721 0 0 --0.054070647106932046 0.07307400154393573 -0.02696328798269315 2278.9013 10 20 0.00052917721 0 0 -0.08750059314239539 0.03641062357418523 0.004900505719923176 2278.9013 10 20 0.00052917721 0 0 -0.06260989511165782 0.019440502976186325 0.06887042556007644 2278.9013 10 20 0.00052917721 0 0 --0.06632072812083314 -0.05815495846359944 -0.03589438320016913 2278.9013 10 20 0.00052917721 0 0 --0.09327740924745717 -0.0030991246557022234 -0.019041275725185713 2278.9013 10 20 0.00052917721 0 0 --0.0046008884230338 -0.05460347083094774 -0.07792367404674264 2278.9013 10 20 0.00052917721 0 0 -0.03944974055640721 0.06913527847278794 0.05261308767065542 2278.9013 10 20 0.00052917721 0 0 -0.040278878742183 0.033719588048002014 0.07970919718172148 2278.9013 10 20 0.00052917721 0 0 --0.007989939667126855 -0.03293227339234073 -0.08934732286881197 2278.9013 10 20 0.00052917721 0 0 --0.023482074477538084 0.07527331571253476 -0.054031556753832116 2278.9013 10 20 0.00052917721 0 0 --0.00014230606697090975 0.05773727088555397 0.07644304207862934 2278.9013 10 20 0.00052917721 0 0 -0.0913906046778446 -0.027587907928671496 0.008033559734555218 2278.9013 10 20 0.00052917721 0 0 --0.033762605284852976 -0.0332100623083561 -0.08340197070796787 2278.9013 10 20 0.00052917721 0 0 -0.043824462163015276 0.07318155484407002 0.04385131448690821 2278.9013 10 20 0.00052917721 0 0 -0.08787658375306856 0.005945570764670949 0.037993729115742336 2278.9013 10 20 0.00052917721 0 0 -0.04093471692181594 0.08560947156123022 0.014381430426396391 2278.9013 10 20 0.00052917721 0 0 --0.09339840331698435 0.022593296732487334 0.003441309681143423 2278.9013 10 20 0.00052917721 0 0 -0.07500938488081699 0.05307384173391849 0.02854944417448657 2278.9013 10 20 0.00052917721 0 0 --0.03660318579672134 -0.009238488959291802 -0.08853719628230702 2278.9013 10 20 0.00052917721 0 0 -0.04648217488910855 -0.0246739259967787 0.0807205781279649 2278.9013 10 20 0.00052917721 0 0 --0.018229611968545056 -0.0718870274481134 0.061722541217925364 2278.9013 10 20 0.00052917721 0 0 -0.031775932608300306 0.0665161849165557 -0.06253154461445062 2278.9013 10 20 0.00052917721 0 0 -0.0700679271976431 -0.04964932646014747 -0.044411914964165466 2278.9013 10 20 0.00052917721 0 0 --0.09062060728304935 0.02293175805387332 0.02470061592022904 2278.9013 10 20 0.00052917721 0 0 -0.08645169193281449 -0.025642462186604043 0.03498394352320239 2278.9013 10 20 0.00052917721 0 0 -0.04243264106946948 0.08524185048379979 -0.01734918325594237 2278.9013 10 20 0.00052917721 0 0 -0.09112596009952934 -0.0017399672877072558 0.03296751528776437 2278.9013 10 20 0.00052917721 0 0 -0.07617952532750788 -0.009983864709243007 0.05909255358487403 2278.9013 10 20 0.00052917721 0 0 --0.05768255071484443 0.03394363914576026 -0.07017136902516294 2278.9013 10 20 0.00052917721 0 0 --0.020245229653541696 -0.09271165981977378 0.01999608793811858 2278.9013 10 20 0.00052917721 0 0 --0.044064998404195976 0.08480867275459159 -0.017093933947228468 2278.9013 10 20 0.00052917721 0 0 --0.06768343965871693 -0.05853323174260108 0.03798276677294349 2278.9013 10 20 0.00052917721 0 0 --0.010413310368464268 0.0768473639306424 -0.05869190699502336 2278.9013 10 20 0.00052917721 0 0 --0.07206093521113865 -0.05336899256868388 0.03773259940594037 2278.9013 10 20 0.00052917721 0 0 -0.04424963750211108 -0.08096887877088446 -0.030854634888392296 2278.9013 10 20 0.00052917721 0 0 -0.08854357698612114 0.04025322894244521 0.004341185163855288 2278.9013 10 20 0.00052917721 0 0 -0.014745276349842795 -0.09567537856762864 0.011188320400481733 2278.9013 10 20 0.00052917721 0 0 -0.035342749166941356 0.08783281240314511 0.0232977256029252 2278.9013 10 20 0.00052917721 0 0 --0.03130414669098858 0.023365917296102656 -0.0894042874649846 2278.9013 10 20 0.00052917721 0 0 --0.06407346841023423 0.03280902407818198 -0.06622643286110175 2278.9013 10 20 0.00052917721 0 0 --0.03685816310297424 -0.048094042114794566 0.07679646359270259 2278.9013 10 20 0.00052917721 0 0 --0.05347714272085102 0.08194153134093168 -0.003504489438023173 2278.9013 10 20 0.00052917721 0 0 -0.0694787153877428 -0.046189123178078995 0.05125863093212252 2278.9013 10 20 0.00052917721 0 0 -0.08328033097899173 -0.01328981054924494 -0.049807049463969355 2278.9013 10 20 0.00052917721 0 0 --0.011364392208838059 0.02236024918546181 -0.09495280751554933 2278.9013 10 20 0.00052917721 0 0 --0.06799010338209091 0.029907401764056485 0.06426562740174246 2278.9013 10 20 0.00052917721 0 0 --0.06182023698604264 0.07441917381744506 0.017103704030689393 2278.9013 10 20 0.00052917721 0 0 -0.08025805346630865 0.05673937757156733 -0.0019958113691704304 2278.9013 10 20 0.00052917721 0 0 -0.00964322203570872 -0.07852131093645154 -0.05841568021899776 2278.9013 10 20 0.00052917721 0 0 -0.039941591391110975 0.06523311259522369 -0.06188262954069457 2278.9013 10 20 0.00052917721 0 0 --0.09632565534243603 -0.015524257337895697 0.013964183695176269 2278.9013 10 20 0.00052917721 0 0 -0.03514964104960683 0.08986664047571447 0.020387859418865895 2278.9013 10 20 0.00052917721 0 0 --0.07113155860378895 0.054020810571010824 -0.041954790191752134 2278.9013 10 20 0.00052917721 0 0 -0.08233054415159291 0.016737105490743143 -0.05185640949452383 2278.9013 10 20 0.00052917721 0 0 --0.06208001115953457 -0.012276050109969905 -0.07583039097708946 2278.9013 10 20 0.00052917721 0 0 -0.07513994423882164 0.06113371300935566 0.01928643867229829 2278.9013 10 20 0.00052917721 0 0 -0.016247728390319627 -0.0845312804780021 -0.04848642475025644 2278.9013 10 20 0.00052917721 0 0 --0.0975122906289776 -0.003486093882769492 -0.016544885540633603 2278.9013 10 20 0.00052917721 0 0 --0.007978246400817846 -0.09157191070110793 -0.03670571134394163 2278.9013 10 20 0.00052917721 0 0 -0.047506454104407125 0.086422804117183 -0.008947853110981285 2278.9013 10 20 0.00052917721 0 0 --0.03680357916801347 0.02405326110761996 0.088811844927152 2278.9013 10 20 0.00052917721 0 0 --0.07891959334222579 -0.03142085818610796 -0.051044002058303395 2278.9013 10 20 0.00052917721 0 0 --0.035024197247029265 -0.09134880716241314 -0.016378933221981806 2278.9013 10 20 0.00052917721 0 0 --0.061560966223581426 -0.07656866244905991 -0.013700971944167528 2278.9013 10 20 0.00052917721 0 0 --0.029419334065041935 -0.07009745228139524 0.06372790272730122 2278.9013 10 20 0.00052917721 0 0 --0.05603194746147899 0.06019011299560656 0.05551892691390159 2278.9013 10 20 0.00052917721 0 0 -0.0694185724423248 -0.05111840528466835 0.04912268080974458 2278.9013 10 20 0.00052917721 0 0 -0.08216137478215668 -0.03872877597809116 -0.03996481162782661 2278.9013 10 20 0.00052917721 0 0 --0.02806458807521922 0.02623341083459374 0.09158814340579124 2278.9013 10 20 0.00052917721 0 0 --0.03727327180167622 0.07131766489081715 0.05852488054127619 2278.9013 10 20 0.00052917721 0 0 -0.09464795289156092 -0.029861580409202115 0.008046863657342751 2278.9013 10 20 0.00052917721 0 0 --0.06695550572664763 0.02510748252218087 0.06930396967784747 2278.9013 10 20 0.00052917721 0 0 -0.0635536823731318 -0.02489464734589547 -0.07252305554249563 2278.9013 10 20 0.00052917721 0 0 -0.014371885812680896 0.07778813373847526 -0.06052987297282039 2278.9013 10 20 0.00052917721 0 0 --0.06928033814583756 -0.033530669637597654 -0.06327333776165531 2278.9013 10 20 0.00052917721 0 0 -0.06868666383748889 -0.05747038229340354 -0.043679591221039926 2278.9013 10 20 0.00052917721 0 0 -0.03143576882539856 0.006486362936192869 -0.09442484190096628 2278.9013 10 20 0.00052917721 0 0 -0.013392231925212439 -0.08485249433967346 0.05070006459740678 2278.9013 10 20 0.00052917721 0 0 --0.08037145423536257 0.058425638053765105 -0.009398167187963435 2278.9013 10 20 0.00052917721 0 0 --0.08617228851015496 0.040740817737442425 -0.030050612586546344 2278.9013 10 20 0.00052917721 0 0 -0.004442410720806422 0.004402448649046153 -0.09974795306772344 2278.9013 10 20 0.00052917721 0 0 -0.05908127696945936 -0.08064288121967306 0.002860042957045783 2278.9013 10 20 0.00052917721 0 0 -0.07940284120710206 -0.054704135391424186 0.0266502991540159 2278.9013 10 20 0.00052917721 0 0 --0.061318380234312186 0.07909228906236887 -0.0009453268264190684 2278.9013 10 20 0.00052917721 0 0 --0.044545513249206914 0.05077884314094394 -0.07387387870546308 2278.9013 10 20 0.00052917721 0 0 --0.060745306105356084 -0.045410287984955444 0.06563321140811346 2278.9013 10 20 0.00052917721 0 0 --0.06007633405435028 0.06507536388304896 0.04717069805160051 2278.9013 10 20 0.00052917721 0 0 -0.09522495757575866 0.003369434449251363 -0.03154122755758293 2278.9013 10 20 0.00052917721 0 0 --0.03718861706751181 0.0932387086651521 -0.0008363431195970716 2278.9013 10 20 0.00052917721 0 0 -0.04669455129081057 -0.03251644719938318 0.08294685887003428 2278.9013 10 20 0.00052917721 0 0 -0.08687566234126898 0.019647191765288508 0.046846933847282946 2278.9013 10 20 0.00052917721 0 0 --0.032128385404538495 0.016885334999154566 -0.09392307235978054 2278.9013 10 20 0.00052917721 0 0 --0.0442678117268287 0.09012152571566406 -0.00831643027149026 2278.9013 10 20 0.00052917721 0 0 -0.09265012107375709 0.03541472058097894 0.017724698277650885 2278.9013 10 20 0.00052917721 0 0 -0.03337629229331812 -0.07216462267814142 -0.061960630183879706 2278.9013 10 20 0.00052917721 0 0 --0.03868079392213175 0.060287498857807764 -0.07101592188688896 2278.9013 10 20 0.00052917721 0 0 -0.09076432390464301 0.00204053689469208 -0.044065082301094516 2278.9013 10 20 0.00052917721 0 0 --0.027921303468307512 -0.04034673764683544 -0.08832693011387271 2278.9013 10 20 0.00052917721 0 0 -0.06694122568892003 -0.052550225304928394 0.05465787524997462 2278.9013 10 20 0.00052917721 0 0 -0.008899482991634622 -0.09619485812024195 0.030282636844923827 2278.9013 10 20 0.00052917721 0 0 -0.037321087107814066 0.04132253469266328 0.08459559002819889 2278.9013 10 20 0.00052917721 0 0 --0.027498489182042063 -0.04920256247639637 0.08414507751825845 2278.9013 10 20 0.00052917721 0 0 --0.07519524235666619 0.019490689224217428 0.06499419335120704 2278.9013 10 20 0.00052917721 0 0 --0.07805223016250487 0.017694207962379527 -0.062122107243094 2278.9013 10 20 0.00052917721 0 0 --0.06386307262181035 -0.04108667730123139 -0.06707316242770511 2278.9013 10 20 0.00052917721 0 0 --0.08901597591247334 0.0477502430809113 0.009033942712407428 2278.9013 10 20 0.00052917721 0 0 -0.015055262443761042 0.041521890691292695 -0.09134162360219333 2278.9013 10 20 0.00052917721 0 0 -0.04172869590063222 0.05376446025487214 -0.07547431455473594 2278.9013 10 20 0.00052917721 0 0 --0.06434311732318876 0.031635559871772634 -0.07208422922093763 2278.9013 10 20 0.00052917721 0 0 -0.033639161134142836 0.09449914823079841 -0.016819274435263154 2278.9013 10 20 0.00052917721 0 0 --0.07283498426517973 -0.045097852952765305 -0.05492307121660811 2278.9013 10 20 0.00052917721 0 0 --0.04810920835128779 0.04953348786454692 0.07481425853892798 2278.9013 10 20 0.00052917721 0 0 --0.05514419341407034 0.04040071775288523 0.0755863144358806 2278.9013 10 20 0.00052917721 0 0 --0.020466794233124086 -0.09297322270339647 0.03646529773743257 2278.9013 10 20 0.00052917721 0 0 --0.09720169855313204 -0.029379091689121895 0.009623704764737395 2278.9013 10 20 0.00052917721 0 0 -0.08740677487028031 0.04124624166686619 0.03277828904985691 2278.9013 10 20 0.00052917721 0 0 -0.026867986184072823 -0.007112350310627014 0.09824578061876443 2278.9013 10 20 0.00052917721 0 0 --0.09981790421863668 -0.0215114609668679 -0.0015136876826563617 2278.9013 10 20 0.00052917721 0 0 -0.0676434925659315 0.026160862601306845 -0.0719020184118698 2278.9013 10 20 0.00052917721 0 0 -0.04961920306231421 0.08555952870730071 0.02573743855122429 2278.9013 10 20 0.00052917721 0 0 -0.03782980622154275 -0.09488666936593837 0.0052307240685675604 2278.9013 10 20 0.00052917721 0 0 --0.06569561466383367 -0.06152431179998563 0.04862482927525913 2278.9013 10 20 0.00052917721 0 0 --0.09901750520608008 0.02215270466107211 -0.014087255898064088 2278.9013 10 20 0.00052917721 0 0 -0.013512653953959897 -0.09463720679547935 0.0369573971614805 2278.9013 10 20 0.00052917721 0 0 --0.002442700859159763 0.024264867525993328 -0.09961507012618015 2278.9013 10 20 0.00052917721 0 0 --0.029567853479448125 -0.013500585602920168 0.0972754847176649 2278.9013 10 20 0.00052917721 0 0 -0.08544136723926532 0.053999815054839806 -0.01816179284112618 2278.9013 10 20 0.00052917721 0 0 -0.02923545977321995 -0.0906392700180512 -0.038610685710673665 2278.9013 10 20 0.00052917721 0 0 -0.04534348955264356 0.02983427036193098 -0.0873106773614388 2278.9013 10 20 0.00052917721 0 0 -0.0573902770511408 -0.07357510962871963 -0.043651426996603127 2278.9013 10 20 0.00052917721 0 0 -0.07684362233456171 -0.04763119501902957 0.0494738256594196 2278.9013 10 20 0.00052917721 0 0 -0.0454790734352038 0.04229722447678519 -0.08226606546601042 2278.9013 10 20 0.00052917721 0 0 -0.09856208976572928 -0.0025770656477809295 -0.030411286913378077 2278.9013 10 20 0.00052917721 0 0 -0.009542390976171433 -0.08578681907159952 0.056634698504794745 2278.9013 10 20 0.00052917721 0 0 -0.09048481446962342 -0.049753521689849145 0.0021220393796157477 2278.9013 10 20 0.00052917721 0 0 --0.012363724189307368 -0.09065848718240568 -0.048147775186102415 2278.9013 10 20 0.00052917721 0 0 --0.026491401414578786 -0.07368040436490852 0.06786808024772317 2278.9013 10 20 0.00052917721 0 0 --0.05978336663801967 -0.06428896988752672 -0.05518422187905586 2278.9013 10 20 0.00052917721 0 0 -0.05389388109833987 -0.08750826732093761 0.016009620692828685 2278.9013 10 20 0.00052917721 0 0 -0.03212468372624494 -0.062105941052419705 0.07717047267703803 2278.9013 10 20 0.00052917721 0 0 --0.08770682039052516 -0.046456008013191274 0.032014693134251426 2278.9013 10 20 0.00052917721 0 0 --0.050348035701573424 -0.09100319304725243 0.008567048810544486 2278.9013 10 20 0.00052917721 0 0 -0.0031945494817289255 0.0317011356367875 0.09941110743973275 2278.9013 10 20 0.00052917721 0 0 -0.029615671426479695 0.039228039167256146 0.09213036739054647 2278.9013 10 20 0.00052917721 0 0 --0.03895956170257636 -0.038039297619011425 0.08912170723180196 2278.9013 10 20 0.00052917721 0 0 --0.0900545460807245 0.009949745120069464 0.05198193410317159 2278.9013 10 20 0.00052917721 0 0 --0.05018059310507916 0.08981742579962743 -0.01840271137328181 2278.9013 10 20 0.00052917721 0 0 --0.06284662202431276 -0.07599547652743541 -0.03470374092131068 2278.9013 10 20 0.00052917721 0 0 -0.08101717574429734 -0.03203068256757974 -0.05794550449283395 2278.9013 10 20 0.00052917721 0 0 -0.03418176376143933 -0.006013495941229519 -0.09886801076751434 2278.9013 10 20 0.00052917721 0 0 -0.017923541877160387 -0.05737252311289559 0.08590429263621957 2278.9013 10 20 0.00052917721 0 0 -0.057682157544935775 -0.043647708885807546 0.07642530173523454 2278.9013 10 20 0.00052917721 0 0 --0.0474107154613711 -0.059244926549282706 -0.07299851587139944 2278.9013 10 20 0.00052917721 0 0 --0.08689109661660271 -0.05897426513265136 -0.008606245885544817 2278.9013 10 20 0.00052917721 0 0 -0.0056400245629218415 0.06595813020206909 -0.08198222721372422 2278.9013 10 20 0.00052917721 0 0 -0.05992939143596382 -0.07355068482873584 0.045852736701909536 2278.9013 10 20 0.00052917721 0 0 -0.0654762049895401 0.0023350817283058767 0.08256179035664124 2278.9013 10 20 0.00052917721 0 0 --0.07759302589368991 0.03918167874866463 -0.05962775352550012 2278.9013 10 20 0.00052917721 0 0 --0.0782508148325699 -0.06339477700285728 -0.031192602299566385 2278.9013 10 20 0.00052917721 0 0 --0.06913741786555491 -0.06373897062163314 0.047798629127776826 2278.9013 10 20 0.00052917721 0 0 -0.08860811223462206 0.03672893525400822 0.04410512907768899 2278.9013 10 20 0.00052917721 0 0 -0.0646762530700965 -0.0831775669925674 0.00869480162667785 2278.9013 10 20 0.00052917721 0 0 --0.01435847658259537 0.06769009859329755 -0.08011973472466141 2278.9013 10 20 0.00052917721 0 0 -0.03719406356722699 0.020985863094143298 0.09692588363594207 2278.9013 10 20 0.00052917721 0 0 --0.0656476690320292 0.08291230298257118 -0.007744465527787681 2278.9013 10 20 0.00052917721 0 0 -0.03692345281692111 0.0641851804880238 0.07631334968468134 2278.9013 10 20 0.00052917721 0 0 -0.04404562107581944 -0.08158922258979126 0.052095369187945106 2278.9013 10 20 0.00052917721 0 0 -0.04696676616110329 0.05725089246292481 0.07633637283458361 2278.9013 10 20 0.00052917721 0 0 --0.0812580069675034 -0.028029978387856924 -0.06264208917515346 2278.9013 10 20 0.00052917721 0 0 -0.05310994549862108 0.004754710835816467 -0.09204488430039481 2278.9013 10 20 0.00052917721 0 0 -0.06437383882152758 -0.018152345187409102 -0.08282335098245408 2278.9013 10 20 0.00052917721 0 0 -0.06905861151090775 0.07681108119115149 -0.025866419000399654 2278.9013 10 20 0.00052917721 0 0 -0.057852538631153805 0.08872778784014451 0.01125947738021571 2278.9013 10 20 0.00052917721 0 0 --0.024967576950288173 0.08993568795186663 -0.051707432827658134 2278.9013 10 20 0.00052917721 0 0 --0.06495910329366919 -0.08209542816959153 -0.020804046635057027 2278.9013 10 20 0.00052917721 0 0 --0.05558066580223786 0.08829085078866133 -0.022636098701796892 2278.9013 10 20 0.00052917721 0 0 -0.04523110511692163 -0.07619495706696483 -0.05955441057006969 2278.9013 10 20 0.00052917721 0 0 --0.06914575525874966 0.004280720414249262 -0.08124441805506677 2278.9013 10 20 0.00052917721 0 0 --0.08715664681036561 0.01521528995736654 -0.0600681403766373 2278.9013 10 20 0.00052917721 0 0 --0.038097858785101135 0.08004545666839841 0.05985738499542492 2278.9013 10 20 0.00052917721 0 0 --0.09714672912498948 0.017262751432979784 0.04139121814699048 2278.9013 10 20 0.00052917721 0 0 --0.06224966812575036 -0.03270327929206068 -0.08067125943737818 2278.9013 10 20 0.00052917721 0 0 --0.055854646053938306 0.02801847804343227 -0.08689338510203862 2278.9013 10 20 0.00052917721 0 0 --0.03968857667401132 -0.06708800005266044 -0.07343598614268076 2278.9013 10 20 0.00052917721 0 0 -0.000023458836903189617 -0.08496938259177789 0.06524077285883234 2278.9013 10 20 0.00052917721 0 0 --0.018703070861470494 -0.07910004090781764 -0.0701306700635575 2278.9013 10 20 0.00052917721 0 0 --0.07218606863408969 -0.030592896771241718 0.07349195235152517 2278.9013 10 20 0.00052917721 0 0 -0.00352539319055728 0.04705233358106248 0.0965688358964405 2278.9013 10 20 0.00052917721 0 0 --0.07413977708948472 -0.02432816605224558 0.07403782731121294 2278.9013 10 20 0.00052917721 0 0 -0.05382959419091615 -0.07017794910767824 -0.061434784745985765 2278.9013 10 20 0.00052917721 0 0 --0.002755702174382757 -0.09693231141841 0.047032080776431506 2278.9013 10 20 0.00052917721 0 0 -0.029917748853203308 0.09976548545254205 0.02819890966472971 2278.9013 10 20 0.00052917721 0 0 --0.06756640086809018 0.051516659217502814 0.06661124289862941 2278.9013 10 20 0.00052917721 0 0 --0.08415331051349412 0.054826059877956634 0.03980389112719551 2278.9013 10 20 0.00052917721 0 0 --0.05414324938121848 0.0932222177920507 0.007424441854611441 2278.9013 10 20 0.00052917721 0 0 --0.007358374657302824 0.06885480219714446 -0.08295919813827499 2278.9013 10 20 0.00052917721 0 0 --0.08882952327351834 0.058187008013927455 -0.02006788036183943 2278.9013 10 20 0.00052917721 0 0 --0.008596318478993503 0.06658431326636632 -0.08479519733532531 2278.9013 10 20 0.00052917721 0 0 --0.0629612331811153 -0.06417913875619016 0.060166677201968666 2278.9013 10 20 0.00052917721 0 0 -0.06659101994626193 0.03567217523321442 -0.07750768394021557 2278.9013 10 20 0.00052917721 0 0 -0.026701921231642556 0.04236814117744153 -0.09620847941262375 2278.9013 10 20 0.00052917721 0 0 --0.09963877349163364 0.024911520093832074 0.034905929860344576 2278.9013 10 20 0.00052917721 0 0 --0.06416228833690094 0.07392347213252798 -0.04678416247883216 2278.9013 10 20 0.00052917721 0 0 -0.0719774476475471 0.04191565619355342 -0.06957140804434592 2278.9013 10 20 0.00052917721 0 0 --0.07833134311559697 0.07470992002495908 0.008927894487241461 2278.9013 10 20 0.00052917721 0 0 -0.07221241734230233 0.01702328524280905 -0.07937043630426135 2278.9013 10 20 0.00052917721 0 0 -0.059516157926171154 -0.09096686979507904 0.005724273130149116 2278.9013 10 20 0.00052917721 0 0 -0.03646035882657783 -0.05597003044877796 -0.0860166762436215 2278.9013 10 20 0.00052917721 0 0 -0.014738500929136034 -0.09490349709500892 -0.051497421898871326 2278.9013 10 20 0.00052917721 0 0 --0.04953912038481356 -0.06457669502544422 0.07253769019559764 2278.9013 10 20 0.00052917721 0 0 --0.016069783928124193 -0.06835606015342485 -0.08361572173024417 2278.9013 10 20 0.00052917721 0 0 --0.010779179980616782 -0.04689410505972813 0.09804519426549091 2278.9013 10 20 0.00052917721 0 0 -0.061449623851515534 -0.013595767665965375 -0.08928920207047478 2278.9013 10 20 0.00052917721 0 0 -0.06739712605274617 0.05843256407194586 -0.06308727802671918 2278.9013 10 20 0.00052917721 0 0 -0.038233002011392236 0.027032888317043202 -0.09876949551551631 2278.9013 10 20 0.00052917721 0 0 -0.022299613673118612 -0.09153113480927275 -0.05544101881883379 2278.9013 10 20 0.00052917721 0 0 --0.05569553678397601 -0.0597883429304876 0.07261345825492405 2278.9013 10 20 0.00052917721 0 0 -0.058140600488339245 -0.0049324412269878826 -0.09249302810624704 2278.9013 10 20 0.00052917721 0 0 -0.035041298667149834 -0.09185843589541859 0.04799626033361576 2278.9013 10 20 0.00052917721 0 0 -0.0773111397074821 0.007624995494808218 0.07711983369490472 2278.9013 10 20 0.00052917721 0 0 -0.07529306503980221 0.0628627478852784 0.04870497312850458 2278.9013 10 20 0.00052917721 0 0 --0.07316841881971045 0.001915191847273845 -0.08147891913046126 2278.9013 10 20 0.00052917721 0 0 --0.08795699900636239 0.03751641441971204 -0.05352138343242219 2278.9013 10 20 0.00052917721 0 0 -0.07842392821230137 -0.040686514645629446 -0.06485766750579994 2278.9013 10 20 0.00052917721 0 0 -0.05146054075342443 0.004607832844076565 0.09680585697513777 2278.9013 10 20 0.00052917721 0 0 -0.07405828644711843 0.049720975185319594 -0.06407527846875374 2278.9013 10 20 0.00052917721 0 0 -0.04125045520680032 0.08163772801906899 0.06144232936857874 2278.9013 10 20 0.00052917721 0 0 -0.049959310584047345 0.093568909233336 -0.02988176350241961 2278.9013 10 20 0.00052917721 0 0 --0.0422447014037704 0.06531877914599071 0.07807255435782412 2278.9013 10 20 0.00052917721 0 0 --0.05984879934392251 0.04407535807152818 0.08142641592612548 2278.9013 10 20 0.00052917721 0 0 --0.054362303414018626 0.035593112095041124 0.08909118763107343 2278.9013 10 20 0.00052917721 0 0 --0.0815718733235733 0.07321608767371712 -0.012251209150870024 2278.9013 10 20 0.00052917721 0 0 -0.05625082108456714 -0.07083133677634626 -0.06326164476968499 2278.9013 10 20 0.00052917721 0 0 --0.09277799064726011 -0.03628327817223381 -0.04760202129674945 2278.9013 10 20 0.00052917721 0 0 --0.027985270092046877 -0.08777720181495735 -0.06125428835651969 2278.9013 10 20 0.00052917721 0 0 --0.0136344885308331 -0.07235294518752833 0.08260207352608523 2278.9013 10 20 0.00052917721 0 0 --0.025889385533722442 -0.06663012323302844 -0.08449077195744231 2278.9013 10 20 0.00052917721 0 0 --0.06635836976181467 0.016783580585592373 0.08698623719866877 2278.9013 10 20 0.00052917721 0 0 -0.040640598272965234 -0.09829978243108384 -0.03129157952395811 2278.9013 10 20 0.00052917721 0 0 --0.04448479168777136 -0.08692423031170904 0.05276649956203944 2278.9013 10 20 0.00052917721 0 0 --0.05836026221799154 0.09232366726579344 -0.019744284988316874 2278.9013 10 20 0.00052917721 0 0 --0.07676224381617869 -0.04763048349738769 -0.06455221827863178 2278.9013 10 20 0.00052917721 0 0 --0.06742191570459805 0.04359065459285122 0.07676212462712595 2278.9013 10 20 0.00052917721 0 0 --0.027314067382452012 0.08029795662247946 0.07181909777822781 2278.9013 10 20 0.00052917721 0 0 -0.029623482057135553 0.09228267416562524 -0.055017917496011426 2278.9013 10 20 0.00052917721 0 0 --0.07382508380560843 -0.044041651243669266 0.07103713843998843 2278.9013 10 20 0.00052917721 0 0 --0.08940787292308622 -0.045170498208843834 0.04905840508728304 2278.9013 10 20 0.00052917721 0 0 --0.024358988334687803 -0.09522182557500394 0.05285717779490995 2278.9013 10 20 0.00052917721 0 0 -0.0547806413104156 -0.06950072724687034 -0.06807608640545809 2278.9013 10 20 0.00052917721 0 0 --0.05861306562154467 -0.06839352197511336 -0.06605215209619486 2278.9013 10 20 0.00052917721 0 0 -0.06504909039874951 -0.07630372574461058 -0.04929631476869056 2278.9013 10 20 0.00052917721 0 0 --0.07543757933673287 -0.0809306756089444 0.015910267288757773 2278.9013 10 20 0.00052917721 0 0 --0.07057956054198278 -0.040093908879661355 0.07711791715819205 2278.9013 10 20 0.00052917721 0 0 -0.03684839251257388 -0.0683837015407148 0.08071032536533407 2278.9013 10 20 0.00052917721 0 0 --0.05410188861942622 0.08192285304359576 -0.05398446753988553 2278.9013 10 20 0.00052917721 0 0 -0.08381578557799235 0.03161286202898794 0.0674153922498939 2278.9013 10 20 0.00052917721 0 0 -0.03543315979009126 0.053789681305704995 -0.09177330012059678 2278.9013 10 20 0.00052917721 0 0 --0.0646519744928859 -0.09059514028049426 -0.014597202466456127 2278.9013 10 20 0.00052917721 0 0 -0.05908875415306203 0.08816495004831149 -0.03672404694197717 2278.9013 10 20 0.00052917721 0 0 -0.05824690391096171 -0.05478633597712193 0.0789592131968429 2278.9013 10 20 0.00052917721 0 0 --0.05475332649231057 0.0982301551875111 0.0023224180349275536 2278.9013 10 20 0.00052917721 0 0 --0.0578918376759919 0.07925276665881542 -0.0552454252026206 2278.9013 10 20 0.00052917721 0 0 --0.05071685131368836 -0.06692999936253136 -0.07505633751009744 2278.9013 10 20 0.00052917721 0 0 --0.004460813665270236 0.09024289159584997 -0.06731983507462427 2278.9013 10 20 0.00052917721 0 0 -0.0704535481141535 -0.08464301666942153 0.023987368663311637 2278.9013 10 20 0.00052917721 0 0 --0.018106109482199817 0.05227344646678006 0.09823455531075154 2278.9013 10 20 0.00052917721 0 0 -0.06942409798288124 -0.017374085699740693 0.0875277275192376 2278.9013 10 20 0.00052917721 0 0 --0.06331363993383471 -0.010735383938230425 0.09306216850006055 2278.9013 10 20 0.00052917721 0 0 --0.05148451318826175 -0.012976565164955212 0.09986036685922439 2278.9013 10 20 0.00052917721 0 0 -0.0730291256374147 -0.058264497361848494 -0.06390804161169839 2278.9013 10 20 0.00052917721 0 0 -0.06316327969168145 -0.05287926991903216 0.07775579741400723 2278.9013 10 20 0.00052917721 0 0 --0.05965034681305162 0.058754166386910445 -0.07636545557482308 2278.9013 10 20 0.00052917721 0 0 -0.04009407829563594 -0.0471437422303666 0.094968176477984 2278.9013 10 20 0.00052917721 0 0 --0.03203756071556013 -0.053547688601911086 0.09467050501666541 2278.9013 10 20 0.00052917721 0 0 -0.08881869217130106 -0.07024809072727586 0.007341423724118279 2278.9013 10 20 0.00052917721 0 0 --0.05654448663146025 0.06335490093075502 -0.07528625920454537 2278.9013 10 20 0.00052917721 0 0 -0.09516092015924388 0.061683709130784914 -0.004622965282048697 2278.9013 10 20 0.00052917721 0 0 -0.008445961410775471 0.06735982108650851 -0.09109310050016117 2278.9013 10 20 0.00052917721 0 0 --0.01667300283056472 -0.07151868971261433 -0.08669840844295906 2278.9013 10 20 0.00052917721 0 0 --0.05240035473644852 0.08674458575592991 0.05138812878040572 2278.9013 10 20 0.00052917721 0 0 --0.05723198780934702 0.07098143505638599 0.06790241108580997 2278.9013 10 20 0.00052917721 0 0 -0.0015070569588186422 -0.09635022852219793 0.06035695904852889 2278.9013 10 20 0.00052917721 0 0 --0.05807587863115743 -0.008284839941114674 0.09740934588102046 2278.9013 10 20 0.00052917721 0 0 -0.08442756292589176 -0.024100912910104133 0.0723229290470459 2278.9013 10 20 0.00052917721 0 0 -0.04900410203064082 -0.0705666947702201 -0.07461649459557052 2278.9013 10 20 0.00052917721 0 0 -0.05769898745438268 0.07219852684314804 0.06647129027106541 2278.9013 10 20 0.00052917721 0 0 -0.049228380381176995 -0.028348309878585776 -0.09866867571232948 2278.9013 10 20 0.00052917721 0 0 -0.035693582887002195 0.09443391317918898 0.052673109318924605 2278.9013 10 20 0.00052917721 0 0 -0.055557520035612706 0.054415085522730555 -0.08347973721227711 2278.9013 10 20 0.00052917721 0 0 --0.08633736774045911 0.056798324034918746 -0.0487671103439849 2278.9013 10 20 0.00052917721 0 0 --0.09357498659096009 0.06555553094715694 -0.0031264752711802624 2278.9013 10 20 0.00052917721 0 0 --0.04322062759968026 -0.08271258815187629 0.06632581042761154 2278.9013 10 20 0.00052917721 0 0 --0.027734094422866784 0.0638179598023274 -0.09094321250693346 2278.9013 10 20 0.00052917721 0 0 --0.06590208511760298 0.09141945430145637 0.02035737953182276 2278.9013 10 20 0.00052917721 0 0 --0.05250057124259999 0.05223932858998798 -0.08750745374839827 2278.9013 10 20 0.00052917721 0 0 -0.08665258847113405 0.06056773834153473 -0.044344144270131836 2278.9013 10 20 0.00052917721 0 0 -0.06724743764232732 -0.09279300738580443 -0.008002604144034697 2278.9013 10 20 0.00052917721 0 0 -0.09498097089148178 0.05438107427296823 0.03546220979069742 2278.9013 10 20 0.00052917721 0 0 --0.010649550611577852 0.06649409374207088 0.0935570090382874 2278.9013 10 20 0.00052917721 0 0 --0.06030670769888927 0.04122969073337329 -0.08920910390178485 2278.9013 10 20 0.00052917721 0 0 --0.06591774846400533 0.04447452025098109 0.08355956912340184 2278.9013 10 20 0.00052917721 0 0 --0.06249810747220688 0.06317987151498555 0.07357425111888183 2278.9013 10 20 0.00052917721 0 0 --0.013793637517703738 -0.06217829560342686 0.09620497938968403 2278.9013 10 20 0.00052917721 0 0 --0.08253524090556058 0.06387762575766576 0.04928352756018195 2278.9013 10 20 0.00052917721 0 0 --0.0867602471835339 0.048403763618944495 0.0590956363523929 2278.9013 10 20 0.00052917721 0 0 --0.006526077768474858 -0.06962010413892505 0.09216836353818358 2278.9013 10 20 0.00052917721 0 0 --0.08164878013795204 0.008217603176084998 0.08156397342416438 2278.9013 10 20 0.00052917721 0 0 --0.0820141954975043 0.026276243246878994 -0.07739833266871912 2278.9013 10 20 0.00052917721 0 0 --0.06078165894953286 -0.07217010398081314 -0.06718799596444874 2278.9013 10 20 0.00052917721 0 0 --0.07085153856454607 0.06401957381832812 0.06570104145940758 2278.9013 10 20 0.00052917721 0 0 -0.08475596119589934 0.07808737265443605 -0.013286214210291247 2278.9013 10 20 0.00052917721 0 0 --0.06950840940657804 -0.009426126314458105 -0.0924431351149653 2278.9013 10 20 0.00052917721 0 0 --0.07443203355469591 0.08591167650411125 0.024093251261931625 2278.9013 10 20 0.00052917721 0 0 --0.010488710541282809 -0.08998720766569224 -0.07284457458823737 2278.9013 10 20 0.00052917721 0 0 --0.08919189424530088 0.07061143714541274 -0.02416034858844901 2278.9013 10 20 0.00052917721 0 0 --0.06145090127222236 0.05818594544234934 -0.08025165414633312 2278.9013 10 20 0.00052917721 0 0 -0.08599285222741493 0.0095364016585619 0.07825839238844218 2278.9013 10 20 0.00052917721 0 0 --0.08186888622753766 0.08016583538137412 -0.022382259618890787 2278.9013 10 20 0.00052917721 0 0 --0.09222399381672702 0.036007406483556936 -0.06189925702879137 2278.9013 10 20 0.00052917721 0 0 --0.030668459931949776 0.09583482106468 -0.05945270368431882 2278.9013 10 20 0.00052917721 0 0 -0.0018487185074678725 -0.09405900262660749 0.0694224501169482 2278.9013 10 20 0.00052917721 0 0 --0.04387997817136813 -0.08116289619564285 0.07190768951129412 2278.9013 10 20 0.00052917721 0 0 -0.0725802290088352 0.08956051545568988 -0.02115157061615036 2278.9013 10 20 0.00052917721 0 0 --0.08466345665545683 0.0695361039135105 0.04172022762294553 2278.9013 10 20 0.00052917721 0 0 -0.0924932146593811 0.07106838836710094 -0.012083594968837874 2278.9013 10 20 0.00052917721 0 0 -0.08593849111510515 0.06848312509428622 0.04103019235518468 2278.9013 10 20 0.00052917721 0 0 -0.012616067890870664 -0.09671827235447006 -0.06525076527636309 2278.9013 10 20 0.00052917721 0 0 -0.09330130701457823 -0.06225919345933692 -0.034611488594558204 2278.9013 10 20 0.00052917721 0 0 -0.02534964790290417 -0.061246663975610405 -0.09706587352191542 2278.9013 10 20 0.00052917721 0 0 --0.09406787530357918 -0.01965196647490186 -0.06774180583459496 2278.9013 10 20 0.00052917721 0 0 -0.07147036650820882 -0.015884697515622326 0.09215251374576439 2278.9013 10 20 0.00052917721 0 0 --0.0954811653754811 0.05890882621399507 0.03570107025536773 2278.9013 10 20 0.00052917721 0 0 -0.09129592651960061 -0.06922609928933221 0.027498176236753435 2278.9013 10 20 0.00052917721 0 0 -0.08093061367613874 -0.059152983546268995 -0.061945101816740594 2278.9013 10 20 0.00052917721 0 0 -0.08496545142143774 -0.031260695128173865 -0.07546163959074359 2278.9013 10 20 0.00052917721 0 0 --0.05660884041714995 0.07382794572475732 0.0725095727796834 2278.9013 10 20 0.00052917721 0 0 -0.06829576261946807 -0.09362098638352231 0.022443454282902398 2278.9013 10 20 0.00052917721 0 0 -0.0729677065462383 -0.04122731269309671 0.08318002598628532 2278.9013 10 20 0.00052917721 0 0 -0.03837578250557194 -0.07400758206322389 0.08370663200465317 2278.9013 10 20 0.00052917721 0 0 --0.026341052903669004 -0.0756836363940313 -0.08681596342569153 2278.9013 10 20 0.00052917721 0 0 -0.0915452890156383 0.057286170791729596 -0.04814423292254838 2278.9013 10 20 0.00052917721 0 0 --0.09679373496184746 0.06776380245261382 -0.004676403368113979 2278.9013 10 20 0.00052917721 0 0 -0.054745623291738654 0.07793808651226208 -0.07031622738791177 2278.9013 10 20 0.00052917721 0 0 --0.0876963691998679 -0.07698907267394278 -0.020982067473477528 2278.9013 10 20 0.00052917721 0 0 -0.09121803749408469 0.042045149411660376 0.06301058576179225 2278.9013 10 20 0.00052917721 0 0 -0.0823831370589923 0.05428588213252877 -0.06585421752927023 2278.9013 10 20 0.00052917721 0 0 -0.01956800044320095 -0.08516724215568416 0.08028714780807511 2278.9013 10 20 0.00052917721 0 0 -0.06356940538448513 -0.09116022539526958 0.041727153206448264 2278.9013 10 20 0.00052917721 0 0 -0.03240635784126855 0.09560848433087954 0.06259596361499065 2278.9013 10 20 0.00052917721 0 0 -0.07680027316268379 0.08287603102302499 0.03678038543380363 2278.9013 10 20 0.00052917721 0 0 --0.08549925913990139 -0.02329961119064139 -0.07918417078527482 2278.9013 10 20 0.00052917721 0 0 -0.08327185614721333 -0.0841495190994439 -0.012293064115895813 2278.9013 10 20 0.00052917721 0 0 --0.06858380954694385 0.054242456403639616 -0.08079190127089383 2278.9013 10 20 0.00052917721 0 0 -0.060837716186721735 -0.052533240940620285 0.08785357498374213 2278.9013 10 20 0.00052917721 0 0 -0.0634769594165121 0.09909371115713328 0.018205235747771997 2278.9013 10 20 0.00052917721 0 0 --0.07813198027036078 0.07822151347771517 0.04445727124154458 2278.9013 10 20 0.00052917721 0 0 --0.07696954363739483 0.020742603436477325 0.08860256416262358 2278.9013 10 20 0.00052917721 0 0 --0.09526002562639901 -0.017558893264848663 -0.06963181824719239 2278.9013 10 20 0.00052917721 0 0 -0.06704612398528131 0.02208223322091063 0.0961800517579765 2278.9013 10 20 0.00052917721 0 0 --0.028795250599156164 -0.0985012780635777 0.06126674405659377 2278.9013 10 20 0.00052917721 0 0 --0.06920364846501428 -0.008570307439234648 -0.09712678115590515 2278.9013 10 20 0.00052917721 0 0 -0.06756259042020901 -0.06545634871646688 -0.07386456549188147 2278.9013 10 20 0.00052917721 0 0 --0.07411503137876257 0.0665285783147958 -0.06629236722558751 2278.9013 10 20 0.00052917721 0 0 --0.08791157072931777 -0.07866723924398844 -0.021251676813833387 2278.9013 10 20 0.00052917721 0 0 --0.061970613231519645 0.06689731211626132 0.07784552282649898 2278.9013 10 20 0.00052917721 0 0 --0.07240418999910861 -0.030982672421918378 -0.09044294066029757 2278.9013 10 20 0.00052917721 0 0 --0.06814120967312681 0.09878876620555643 -0.0001341824026702687 2278.9013 10 20 0.00052917721 0 0 --0.04309165383499647 0.0989547098369511 0.05248794194923012 2278.9013 10 20 0.00052917721 0 0 -0.07172713201954245 0.020173742650637094 0.09415125133001179 2278.9013 10 20 0.00052917721 0 0 -0.07773935205095461 0.02967045562595949 -0.08691581964000084 2278.9013 10 20 0.00052917721 0 0 --0.01499009087623776 -0.07259482576115575 0.09482008323773061 2278.9013 10 20 0.00052917721 0 0 -0.060610686734341834 0.07656877067934226 -0.07036187831130847 2278.9013 10 20 0.00052917721 0 0 -0.08970768992573686 0.06400090165609112 0.04904533458688942 2278.9013 10 20 0.00052917721 0 0 -0.05172810971287123 -0.08346914850595177 0.07049185111954231 2278.9013 10 20 0.00052917721 0 0 --0.004520872243391705 0.09290482616679652 -0.07741809882052161 2278.9013 10 20 0.00052917721 0 0 --0.09678070540925665 0.06078386612778247 0.03999164213085549 2278.9013 10 20 0.00052917721 0 0 --0.03903271210016246 -0.07795023571147017 0.08422930810047724 2278.9013 10 20 0.00052917721 0 0 --0.07261655850233634 0.05958492605201943 -0.07674386102554043 2278.9013 10 20 0.00052917721 0 0 -0.05379480996017061 0.08924624058120456 -0.062099875884759376 2278.9013 10 20 0.00052917721 0 0 --0.03574622159116453 0.09240972209654125 0.07002105705288925 2278.9013 10 20 0.00052917721 0 0 --0.07333792515968784 -0.09088764091100074 0.03302223599016191 2278.9013 10 20 0.00052917721 0 0 --0.09340550227895855 -0.017157026839765555 -0.075716622308595 2278.9013 10 20 0.00052917721 0 0 -0.0775784160764712 -0.09353282651636036 0.002884066794102358 2278.9013 10 20 0.00052917721 0 0 -0.09093314472900149 -0.07470411877575697 0.03062075059919178 2278.9013 10 20 0.00052917721 0 0 --0.0069943025639318535 0.08912993636133582 0.08256098678497631 2278.9013 10 20 0.00052917721 0 0 --0.09754142101402874 -0.06824179048257784 0.02554966662807795 2278.9013 10 20 0.00052917721 0 0 --0.04228229212606266 0.06554118623474081 0.09373395421975311 2278.9013 10 20 0.00052917721 0 0 -0.05343447342289903 -0.08159329542053667 -0.07322416151045957 2278.9013 10 20 0.00052917721 0 0 --0.06039294648278254 0.09859376026346778 0.03933634480870224 2278.9013 10 20 0.00052917721 0 0 --0.09925587820500104 0.035625968889981485 -0.061775387871856546 2278.9013 10 20 0.00052917721 0 0 -0.06892267151782833 -0.09644969805751552 -0.03162702745752788 2278.9013 10 20 0.00052917721 0 0 --0.08683404659422789 -0.009878212392038066 0.08615719890085188 2278.9013 10 20 0.00052917721 0 0 --0.07750914348765411 -0.07491555352598744 -0.05877309830328742 2278.9013 10 20 0.00052917721 0 0 -0.09198066059383542 -0.036576826713853816 0.07278964284050282 2278.9013 10 20 0.00052917721 0 0 --0.09581390276506696 -0.014565115111430604 0.07554644517119086 2278.9013 10 20 0.00052917721 0 0 --0.02174289042999733 -0.08099634498238636 0.08983399545978843 2278.9013 10 20 0.00052917721 0 0 -0.09266977109923558 -0.07932360598526847 0.015417208098981394 2278.9013 10 20 0.00052917721 0 0 -0.026155328255551058 -0.08688787626750075 0.08302797179288329 2278.9013 10 20 0.00052917721 0 0 --0.09077629979707078 0.008960748332606183 0.08275140296216066 2278.9013 10 20 0.00052917721 0 0 -0.07692257506886463 0.03785062460129973 -0.08849420971466002 2278.9013 10 20 0.00052917721 0 0 --0.090117549273518 0.07981096011494526 0.026369891383305644 2278.9013 10 20 0.00052917721 0 0 --0.0925711498773015 0.055452264615287794 0.05967631521793293 2278.9013 10 20 0.00052917721 0 0 --0.07114438810567439 -0.06648310926115006 -0.07566730392507681 2278.9013 10 20 0.00052917721 0 0 --0.0421381576137419 0.07966047808015736 0.08419592128002529 2278.9013 10 20 0.00052917721 0 0 -0.06857258609122341 -0.05614264852005277 -0.08585564755223718 2278.9013 10 20 0.00052917721 0 0 --0.06660705466859909 0.030399171030228322 -0.0994524962741575 2278.9013 10 20 0.00052917721 0 0 -0.028396118451909924 0.08765636037841673 -0.08232788338020253 2278.9013 10 20 0.00052917721 0 0 -0.09436606780538193 0.02954328527345107 0.0741728016306209 2278.9013 10 20 0.00052917721 0 0 --0.036244096106237744 0.09856554893090069 0.06532758552192569 2278.9013 10 20 0.00052917721 0 0 --0.03104934739539217 0.06738934308254141 0.0989984263347336 2278.9013 10 20 0.00052917721 0 0 --0.08588245955643131 0.016536420547947017 0.08756302349197181 2278.9013 10 20 0.00052917721 0 0 -0.004120371232902653 -0.09969959836657208 -0.07328773310761155 2278.9013 10 20 0.00052917721 0 0 --0.071834254937762 -0.03688763633177933 -0.0939052233601386 2278.9013 10 20 0.00052917721 0 0 -0.05005957025171237 0.0994012243880733 -0.05439518346942898 2278.9013 10 20 0.00052917721 0 0 --0.06382859825616011 0.06151330705702823 -0.08663225564279456 2278.9013 10 20 0.00052917721 0 0 -0.02699504569241651 0.09290727479897559 0.07749076636094765 2278.9013 10 20 0.00052917721 0 0 --0.07890629923573489 0.0013869040163217994 -0.09579157302235844 2278.9013 10 20 0.00052917721 0 0 --0.07670806206959202 -0.0971072234922932 0.009667978712160075 2278.9013 10 20 0.00052917721 0 0 --0.0039000350599701084 -0.0823798233204493 0.09286537992459504 2278.9013 10 20 0.00052917721 0 0 --0.09697676458886573 -0.05933474333759453 0.05038528990125085 2278.9013 10 20 0.00052917721 0 0 --0.09795753168500307 -0.0002870147781392496 0.07661736260360247 2278.9013 10 20 0.00052917721 0 0 --0.05881672356102441 -0.04487990443774953 0.09997784917017571 2278.9013 10 20 0.00052917721 0 0 -0.025708112345896095 0.09612966397425521 0.07491549675935183 2278.9013 10 20 0.00052917721 0 0 --0.0475009982463202 0.09462392897662641 -0.06588092002606394 2278.9013 10 20 0.00052917721 0 0 -0.09168127532865533 0.07838435580392816 -0.031910273826865954 2278.9013 10 20 0.00052917721 0 0 -0.05220381814303693 -0.09956047407237312 -0.05428733343839853 2278.9013 10 20 0.00052917721 0 0 --0.09679929203778442 -0.07868088202153378 0.006290939107427895 2278.9013 10 20 0.00052917721 0 0 -0.08176809249295558 -0.09377413826159436 0.011647501616162848 2278.9013 10 20 0.00052917721 0 0 -0.091401654622139 0.07830524015286783 -0.033907680921711814 2278.9013 10 20 0.00052917721 0 0 -0.07090180268468443 -0.04608293736776986 0.09242353861648023 2278.9013 10 20 0.00052917721 0 0 -0.05328521023359095 0.09768493775833581 0.05776108279551112 2278.9013 10 20 0.00052917721 0 0 --0.07838828338125792 -0.09548718464470263 -0.021557277596149726 2278.9013 10 20 0.00052917721 0 0 -0.09275227658279495 -0.07472655062257527 -0.040395859424990466 2278.9013 10 20 0.00052917721 0 0 --0.08167268609019629 0.006812437139266769 0.09560552024145497 2278.9013 10 20 0.00052917721 0 0 -0.06049083311229264 -0.05817243763046259 0.09411874477246368 2278.9013 10 20 0.00052917721 0 0 --0.09448102541663539 0.05828065135124255 -0.060056121278598995 2278.9013 10 20 0.00052917721 0 0 -0.0063782731587425645 0.0982449238067673 -0.07929413082115466 2278.9013 10 20 0.00052917721 0 0 --0.08600078456699531 -0.05627251623685611 -0.07407953416847687 2278.9013 10 20 0.00052917721 0 0 -0.07158542331729034 -0.06453543065324685 -0.082282187279094 2278.9013 10 20 0.00052917721 0 0 -0.09488893907386647 -0.07514408716461188 -0.03772468030833159 2278.9013 10 20 0.00052917721 0 0 --0.051261594369895414 0.08942518639708741 0.07406534054786862 2278.9013 10 20 0.00052917721 0 0 --0.07988017539002812 -0.020793165039148465 -0.09648236294670312 2278.9013 10 20 0.00052917721 0 0 --0.08708430934397668 0.07383566410346398 -0.05560132722840305 2278.9013 10 20 0.00052917721 0 0 -0.09428875530572811 -0.021546881272145935 0.08234192806600943 2278.9013 10 20 0.00052917721 0 0 -0.08262793168215449 0.07940646920176037 0.05507621974857435 2278.9013 10 20 0.00052917721 0 0 -0.06740552280265161 0.07995598075164945 -0.07300817239088037 2278.9013 10 20 0.00052917721 0 0 -0.08445981233083366 -0.060887757598551806 -0.07367341701465324 2278.9013 10 20 0.00052917721 0 0 --0.05967386417180068 -0.06660970383550738 -0.09127516317548232 2278.9013 10 20 0.00052917721 0 0 --0.06855799234126514 0.07789225411436868 0.07464861684500829 2278.9013 10 20 0.00052917721 0 0 -0.06900899798038873 0.05109961058816237 0.09475484675670698 2278.9013 10 20 0.00052917721 0 0 --0.09887877926642652 0.05936751791342432 -0.05541431881673348 2278.9013 10 20 0.00052917721 0 0 -0.09334860358802599 0.08077497010883833 -0.03377602814824271 2278.9013 10 20 0.00052917721 0 0 -0.055031363372807895 -0.06131372034605803 -0.09812936773449565 2278.9013 10 20 0.00052917721 0 0 -0.07234203495005753 0.0856940853474149 0.062009194360913955 2278.9013 10 20 0.00052917721 0 0 -0.09528388676084293 -0.0533554353340539 0.06705453636910041 2278.9013 10 20 0.00052917721 0 0 --0.08979509663282931 0.0915451327562452 -0.004376469887090784 2278.9013 10 20 0.00052917721 0 0 --0.07053002295032396 0.0656038388437935 -0.084842563276363 2278.9013 10 20 0.00052917721 0 0 --0.03739683086283674 0.08271425874834093 -0.09150954551863413 2278.9013 10 20 0.00052917721 0 0 -0.06520327658468639 -0.07788463185306571 0.07938097324501558 2278.9013 10 20 0.00052917721 0 0 --0.08872502237806426 0.0880011136656203 -0.03191760906405261 2278.9013 10 20 0.00052917721 0 0 --0.09640767175042875 0.07245850886145888 -0.046603641487287795 2278.9013 10 20 0.00052917721 0 0 --0.09178145101521529 0.09033422240831762 0.013452416918447563 2278.9013 10 20 0.00052917721 0 0 -0.08092130821273402 0.09961180205538839 0.017826360776391048 2278.9013 10 20 0.00052917721 0 0 -0.08442094588138382 0.0912294861414023 -0.036824338430932524 2278.9013 10 20 0.00052917721 0 0 --0.08348678431833484 -0.09949637380197596 0.002904246915471864 2278.9013 10 20 0.00052917721 0 0 -0.05871419361899666 0.08807723489520947 0.07548183377962808 2278.9013 10 20 0.00052917721 0 0 -0.08321168725061723 0.08276340144460481 0.05744143117462008 2278.9013 10 20 0.00052917721 0 0 --0.028215178267261276 -0.07940584386510458 -0.09998177550793808 2278.9013 10 20 0.00052917721 0 0 -0.08747373470479536 -0.09711555260409277 -0.005087965233904812 2278.9013 10 20 0.00052917721 0 0 --0.05999931076678203 0.09122019932101555 -0.07263596613120069 2278.9013 10 20 0.00052917721 0 0 -0.040624474010830414 0.09080326659843929 0.08555763048630194 2278.9013 10 20 0.00052917721 0 0 -0.08898225939333138 -0.09278398716551187 0.026880931636437566 2278.9013 10 20 0.00052917721 0 0 -0.04296576947822617 0.08134076836770066 -0.09378917841211887 2278.9013 10 20 0.00052917721 0 0 -0.08897912309383604 -0.0957578649813143 -0.014574148354759064 2278.9013 10 20 0.00052917721 0 0 -0.026784072176509133 0.09865698899355535 0.08285666854101853 2278.9013 10 20 0.00052917721 0 0 -0.08707352568679205 0.07235305488754623 0.06757479863651589 2278.9013 10 20 0.00052917721 0 0 -0.057420930971801176 0.07641358182438496 -0.09134143329942337 2278.9013 10 20 0.00052917721 0 0 --0.08381861792363157 -0.0880087633072629 0.05221285842660034 2278.9013 10 20 0.00052917721 0 0 --0.09273856239886577 0.064234887152747 -0.06907262860034424 2278.9013 10 20 0.00052917721 0 0 -0.0899370608430991 0.04673926973823184 -0.0850108713042704 2278.9013 10 20 0.00052917721 0 0 --0.06918770366859928 0.05271999644305042 -0.09979852561875735 2278.9013 10 20 0.00052917721 0 0 --0.06788805422514724 0.054785516926635025 -0.09965725554552693 2278.9013 10 20 0.00052917721 0 0 -0.07969545461836702 0.08921400632778964 0.05702843502114702 2278.9013 10 20 0.00052917721 0 0 -0.07704828880862413 0.08729172702438737 -0.06392144820482576 2278.9013 10 20 0.00052917721 0 0 -0.08263367590272991 -0.09099154922990865 0.05066458764365772 2278.9013 10 20 0.00052917721 0 0 --0.06286876588156409 0.061385384335049864 0.09995307060561659 2278.9013 10 20 0.00052917721 0 0 -0.081047718704711 0.09853125064894863 0.039099959048413346 2278.9013 10 20 0.00052917721 0 0 -0.07522524722398694 -0.06475664348886861 0.08928996526751115 2278.9013 10 20 0.00052917721 0 0 --0.09333566025013507 -0.04383429852708004 -0.08480796914817468 2278.9013 10 20 0.00052917721 0 0 --0.07458699966712706 -0.08794758179596371 0.06733428238790412 2278.9013 10 20 0.00052917721 0 0 --0.08958634790585718 -0.0094564345485606 -0.09871723323890247 2278.9013 10 20 0.00052917721 0 0 --0.07312901338979247 -0.054172413010368264 -0.09807692560951564 2278.9013 10 20 0.00052917721 0 0 --0.0981006258327293 0.07959714781216759 -0.04433589383843406 2278.9013 10 20 0.00052917721 0 0 --0.023573388590623745 -0.08680799877572465 -0.09961794378578526 2278.9013 10 20 0.00052917721 0 0 --0.0037121002616357646 -0.0920120336538654 0.09789184336146628 2278.9013 10 20 0.00052917721 0 0 --0.09897210682430369 -0.014089566917483198 0.0903413191019275 2278.9013 10 20 0.00052917721 0 0 -0.0993268630839032 0.08237871861621521 0.03951953861942448 2278.9013 10 20 0.00052917721 0 0 --0.06080301906100341 0.08990096897513106 0.08086759756247669 2278.9013 10 20 0.00052917721 0 0 --0.0883646155288347 0.07433306527389782 0.07071410151949209 2278.9013 10 20 0.00052917721 0 0 --0.07226687324549774 0.09524144580311761 0.063602624937239 2278.9013 10 20 0.00052917721 0 0 --0.09136141442128876 -0.09745449497851333 -0.024147383656342614 2278.9013 10 20 0.00052917721 0 0 --0.07775247581714781 -0.07042327139953031 0.08648147352401386 2278.9013 10 20 0.00052917721 0 0 --0.09171780266183949 0.09542450395045055 0.032200084338226076 2278.9013 10 20 0.00052917721 0 0 --0.07551939743597855 0.07068212832181059 0.08893968792916757 2278.9013 10 20 0.00052917721 0 0 -0.0895640278700447 0.09052017747954572 0.049088259039003546 2278.9013 10 20 0.00052917721 0 0 -0.02997735712088584 0.09221721908905695 -0.09608406295675159 2278.9013 10 20 0.00052917721 0 0 --0.039472488420880636 -0.09315669766427248 -0.09184448506215775 2278.9013 10 20 0.00052917721 0 0 -0.005919384468687783 -0.09920102009079809 -0.09386992837549757 2278.9013 10 20 0.00052917721 0 0 -0.08567778741706433 0.08173922012370682 0.06881458229920012 2278.9013 10 20 0.00052917721 0 0 --0.09354109675391398 0.08803022197681037 0.04772693525928062 2278.9013 10 20 0.00052917721 0 0 --0.09722309567536838 -0.09675791607616277 0.003506385541268975 2278.9013 10 20 0.00052917721 0 0 -0.08228729402748036 -0.08236204729827512 0.07263583044013083 2278.9013 10 20 0.00052917721 0 0 -0.048633105179497704 -0.08479209904609797 -0.09636112257345542 2278.9013 10 20 0.00052917721 0 0 -0.09954771711142807 0.09497885168644316 -0.00006172087025385631 2278.9013 10 20 0.00052917721 0 0 --0.09471118148261998 0.08472242347165704 0.054229465060349535 2278.9013 10 20 0.00052917721 0 0 --0.08722806319387144 -0.06162047832938278 -0.08769646945598603 2278.9013 10 20 0.00052917721 0 0 -0.09651441130391414 -0.08288179434370882 -0.05439192126092193 2278.9013 10 20 0.00052917721 0 0 -0.0039201744426613505 -0.09754818747601143 0.09868982592248199 2278.9013 10 20 0.00052917721 0 0 -0.04043313790840686 0.09687979887997872 -0.091167071131319 2278.9013 10 20 0.00052917721 0 0 --0.04135694964222425 0.08763079312124483 -0.09990936567561604 2278.9013 10 20 0.00052917721 0 0 -0.08663319712300288 0.05485814306636144 0.09440186330106837 2278.9013 10 20 0.00052917721 0 0 -0.07767822409969144 0.05921558749097472 0.09960331223212782 2278.9013 10 20 0.00052917721 0 0 -0.08623599768458368 0.06421774642892619 0.08892412800217753 2278.9013 10 20 0.00052917721 0 0 -0.04496359676082662 0.09842097182184661 0.08843604863693089 2278.9013 10 20 0.00052917721 0 0 --0.09169817077043232 0.04030776831835903 0.0979472488916493 2278.9013 10 20 0.00052917721 0 0 --0.08160828783098223 0.09653493492928839 0.06087264382013036 2278.9013 10 20 0.00052917721 0 0 -0.04826053733337532 0.08899364512486363 0.09723810089355334 2278.9013 10 20 0.00052917721 0 0 --0.09962336435120353 -0.05083634600034029 -0.08516824717202387 2278.9013 10 20 0.00052917721 0 0 -0.05957090598857345 -0.0816250016971812 0.097958788460699 2278.9013 10 20 0.00052917721 0 0 -0.08479061750457939 -0.05978515867675804 0.09586784011857041 2278.9013 10 20 0.00052917721 0 0 -0.0986766590418568 0.01945848994524635 -0.09933051781796454 2278.9013 10 20 0.00052917721 0 0 -0.08169654148341826 -0.08647113392229455 -0.07684176970253559 2278.9013 10 20 0.00052917721 0 0 --0.08889910723171468 0.09185143454630895 0.06141844270277752 2278.9013 10 20 0.00052917721 0 0 --0.09348434362843622 -0.09914788696062143 0.03956655653608432 2278.9013 10 20 0.00052917721 0 0 --0.09889333178941045 0.051870256882421195 0.0876686508983271 2278.9013 10 20 0.00052917721 0 0 --0.060470340407129425 -0.08207646725262385 -0.09906426314398309 2278.9013 10 20 0.00052917721 0 0 -0.09602938195115546 0.04888524828995999 -0.09408864165779807 2278.9013 10 20 0.00052917721 0 0 --0.09959558627047327 0.08676675973293885 -0.054992635161009606 2278.9013 10 20 0.00052917721 0 0 --0.06534452652239997 0.08825644399971921 -0.09217846894571163 2278.9013 10 20 0.00052917721 0 0 --0.09949347432721262 0.09083698279106989 0.04938556647705877 2278.9013 10 20 0.00052917721 0 0 --0.09956985466371679 -0.06435227561574769 -0.08143717909261305 2278.9013 10 20 0.00052917721 0 0 -0.09019954262386864 0.05416161095782129 -0.0989540150410061 2278.9013 10 20 0.00052917721 0 0 -0.0945080580615234 0.060351545789145644 0.09256844476572446 2278.9013 10 20 0.00052917721 0 0 --0.09824929699449786 -0.07881811572968422 -0.07484345628252947 2278.9013 10 20 0.00052917721 0 0 --0.08013871454913837 -0.07664605401265856 -0.09625942514596153 2278.9013 10 20 0.00052917721 0 0 -0.09228094096343142 -0.07950157648100425 -0.08289855705204274 2278.9013 10 20 0.00052917721 0 0 -0.06733547669176948 0.09364911840453505 0.09264080788471185 2278.9013 10 20 0.00052917721 0 0 --0.07518988628313003 -0.08222475048117528 -0.09804589713234535 2278.9013 10 20 0.00052917721 0 0 --0.09127888826044728 -0.08502877514723728 -0.08210008709881031 2278.9013 10 20 0.00052917721 0 0 -0.09586967698119864 0.06137293420184653 -0.09667194298666296 2278.9013 10 20 0.00052917721 0 0 -0.095828820474051 0.05692311811339934 -0.09956274324518963 2278.9013 10 20 0.00052917721 0 0 --0.0665478422700706 -0.09802885287240337 -0.0921427440105253 2278.9013 10 20 0.00052917721 0 0 --0.06467552471703433 0.09727164315568326 -0.09572063483336518 2278.9013 10 20 0.00052917721 0 0 --0.08304016405920031 0.07835410108638807 -0.0994220510520149 2278.9013 10 20 0.00052917721 0 0 --0.08559779351875191 0.09989199113582492 -0.07593256946680524 2278.9013 10 20 0.00052917721 0 0 -0.08614520997433084 0.09506288070446028 -0.08240369547596046 2278.9013 10 20 0.00052917721 0 0 --0.08872924268382135 0.084705745998707 -0.09104487700181271 2278.9013 10 20 0.00052917721 0 0 -0.09545703198852379 -0.09775695273145549 -0.07485386535487265 2278.9013 10 20 0.00052917721 0 0 --0.09995258856504793 -0.09401627007393162 -0.09308608020362932 2278.9013 10 20 0.00052917721 0 0 +0.00000000 0.00000000 0.00000000 0.10000000 175920000000.00000000 0.50000000 10.00000000 10.00000000 10.00000000 +0.00010000 0.00010000 0.00010000 0.10000000 175920000000.00000000 0.50000000 10.00000000 10.00000000 10.00000000 diff --git a/examples/input.cfg b/examples/input.cfg index c36c7c94..89e79d95 100644 --- a/examples/input.cfg +++ b/examples/input.cfg @@ -1,10 +1,10 @@ [parameters] - num_particles = 2 - total_time = 20 - timestep = 0.5e-2 - interpolation_order = 3 + num_particles = 2 + total_time = 1e-10 + timestep = 1e-15 + interpolation_order = 5 [constants] - c0 = 299.792458 # um/ps - hbar = 0.65821193 # meV*ps - mu0 = 2.0133545e-04 # meV ps^2/(e^2 um) - laser_frequency = 2278.9013 # rad/ps + c0 = 2.99792458e8 # m/s + hbar = 6.62607004e-34 # m^2 kg/s + e0 = 8.85418782e-12 #s^4/m^3 A^2/kg + laser_frequency = 6.283185307e9 #rad/s = 1GHz diff --git a/examples/pulse.cfg b/examples/pulse.cfg index 4fcd249c..02b1a7cc 100644 --- a/examples/pulse.cfg +++ b/examples/pulse.cfg @@ -1 +1 @@ -15589.2260227 5 227.89013 2278.9013 0 0 7.6015964 1 0 0 +0000 .5e-10 .2 6.283185307e9 0 1 0 0 0 1 From 6acab6dfff14401b800ef7ad335d39bc546873f9 Mon Sep 17 00:00:00 2001 From: Jack Hamel Date: Tue, 2 Jan 2018 16:55:11 -0500 Subject: [PATCH 75/75] Changed initialize_past function in history.h to handle any M specified in dots.cfg. Fixed warning during compile time due to unsigned vs signed int comparison in self_interaction.cpp --- src/integrator/history.h | 14 ++++++++------ src/interactions/self_interaction.cpp | 2 +- src/main.cpp | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/integrator/history.h b/src/integrator/history.h index acce890c..0bb53e85 100644 --- a/src/integrator/history.h +++ b/src/integrator/history.h @@ -7,6 +7,8 @@ #include #include +#include "../magnetic_particle.h" + namespace Integrator { template class History; @@ -24,7 +26,7 @@ class Integrator::History { soltype_array array; void fill(const soltype &); - void initialize_past(const soltype &); + void initialize_past(const std::shared_ptr &); private: }; @@ -46,12 +48,12 @@ void Integrator::History::fill(const soltype &val) } template -void Integrator::History::initialize_past(const soltype &val) +void Integrator::History::initialize_past(const std::shared_ptr< + const DotVector> &dots) { - for(int n = 0; n < static_cast(array.shape()[0]); ++n) { - for(int t = array.index_bases()[1]; t <= 0; ++t) { - array[n][t][DERIV_0] = val; - } + for(int time_idx=array.index_bases()[1]; time_idx <= 0; ++time_idx) { + for(int i=0; i < static_cast(array.shape()[0]); ++i) + array[i][time_idx][DERIV_0] = (*dots)[i].magnetization(); } } diff --git a/src/interactions/self_interaction.cpp b/src/interactions/self_interaction.cpp index 3a176262..6d03965a 100644 --- a/src/interactions/self_interaction.cpp +++ b/src/interactions/self_interaction.cpp @@ -9,7 +9,7 @@ SelfInteraction::SelfInteraction( const Interaction::ResultArray &SelfInteraction::evaluate(const int time_idx) { - for(int i = 0; i < dots->size(); ++i) { + for(int i = 0; i < static_cast(dots->size()); ++i) { results[i] = -1 * history->array[i][time_idx][0] / 3; } return results; diff --git a/src/main.cpp b/src/main.cpp index 796fbbd5..4b127fbe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,7 +31,8 @@ int main(int argc, char *argv[]) auto history = std::make_shared>( config.num_particles, 22, config.num_timesteps); history->fill(soltype(0, 0, 0)); - history->initialize_past(soltype(100, 100, 100)); + history->initialize_past(qds); + // Set up Interactions auto pulse1 = make_shared(read_pulse_config(config.pulse_path));