-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from bluescarni/pr/elp2000
ELP2000 lunar theory
- Loading branch information
Showing
35 changed files
with
46,117 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#include <iostream> | ||
|
||
#include <boost/program_options.hpp> | ||
|
||
#include <fmt/core.h> | ||
#include <fmt/ranges.h> | ||
|
||
#include <spdlog/spdlog.h> | ||
#include <spdlog/stopwatch.h> | ||
|
||
#include <heyoka/kw.hpp> | ||
#include <heyoka/llvm_state.hpp> | ||
#include <heyoka/logging.hpp> | ||
#include <heyoka/model/elp2000.hpp> | ||
|
||
using namespace heyoka; | ||
using namespace heyoka::model; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
namespace po = boost::program_options; | ||
|
||
double thresh{}; | ||
|
||
po::options_description desc("Options"); | ||
|
||
desc.add_options()("help", "produce help message")("thresh", po::value<double>(&thresh)->default_value(1e-7), | ||
"threshold value"); | ||
|
||
po::variables_map vm; | ||
po::store(po::parse_command_line(argc, argv, desc), vm); | ||
po::notify(vm); | ||
|
||
if (vm.count("help") != 0u) { | ||
std::cout << desc << "\n"; | ||
return 0; | ||
} | ||
|
||
// Fetch the logger. | ||
create_logger(); | ||
set_logger_level_trace(); | ||
auto logger = spdlog::get("heyoka"); | ||
|
||
spdlog::stopwatch sw; | ||
auto sol = model::elp2000_cartesian_e2000(kw::thresh = thresh); | ||
logger->trace("Creating the solution took: {}", sw); | ||
|
||
llvm_state s; | ||
|
||
sw.reset(); | ||
add_cfunc<double>(s, "func", sol, kw::compact_mode = true); | ||
s.compile(); | ||
logger->trace("Compiling the solution took: {}", sw); | ||
|
||
auto *cf_ptr | ||
= reinterpret_cast<void (*)(double *, const double *, const double *, const double *)>(s.jit_lookup("func")); | ||
|
||
double out[3]{}; | ||
|
||
for (auto date : {2469000.5, 2449000.5, 2429000.5, 2409000.5, 2389000.5}) { | ||
const double tm = (date - 2451545.0) / (36525); | ||
|
||
sw.reset(); | ||
cf_ptr(out, nullptr, nullptr, &tm); | ||
logger->trace("Computing the solution took: {}", sw); | ||
logger->trace("State for date {}: {}", date, out); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ coverage: | |
- "test/.*" | ||
- "tutorial/.*" | ||
- "src/detail/vsop2013/.*" | ||
- "src/detail/elp2000/.*" | ||
|
||
comment: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef HEYOKA_DETAIL_ELP2000_ELP_10_15_HPP | ||
#define HEYOKA_DETAIL_ELP2000_ELP_10_15_HPP | ||
|
||
#include <cstdint> | ||
|
||
#include <heyoka/config.hpp> | ||
|
||
HEYOKA_BEGIN_NAMESPACE | ||
|
||
namespace model::detail | ||
{ | ||
|
||
extern const std::int8_t elp2000_idx_10[14328][11]; | ||
extern const double elp2000_phi_A_10[14328][2]; | ||
|
||
extern const std::int8_t elp2000_idx_11[5233][11]; | ||
extern const double elp2000_phi_A_11[5233][2]; | ||
|
||
extern const std::int8_t elp2000_idx_12[6631][11]; | ||
extern const double elp2000_phi_A_12[6631][2]; | ||
|
||
extern const std::int8_t elp2000_idx_13[4384][11]; | ||
extern const double elp2000_phi_A_13[4384][2]; | ||
|
||
extern const std::int8_t elp2000_idx_14[833][11]; | ||
extern const double elp2000_phi_A_14[833][2]; | ||
|
||
extern const std::int8_t elp2000_idx_15[1715][11]; | ||
extern const double elp2000_phi_A_15[1715][2]; | ||
|
||
} // namespace model::detail | ||
|
||
HEYOKA_END_NAMESPACE | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef HEYOKA_DETAIL_ELP2000_ELP_16_21_HPP | ||
#define HEYOKA_DETAIL_ELP2000_ELP_16_21_HPP | ||
|
||
#include <cstdint> | ||
|
||
#include <heyoka/config.hpp> | ||
|
||
HEYOKA_BEGIN_NAMESPACE | ||
|
||
namespace model::detail | ||
{ | ||
|
||
extern const std::int8_t elp2000_idx_16[170][11]; | ||
extern const double elp2000_phi_A_16[170][2]; | ||
|
||
extern const std::int8_t elp2000_idx_17[150][11]; | ||
extern const double elp2000_phi_A_17[150][2]; | ||
|
||
extern const std::int8_t elp2000_idx_18[114][11]; | ||
extern const double elp2000_phi_A_18[114][2]; | ||
|
||
extern const std::int8_t elp2000_idx_19[226][11]; | ||
extern const double elp2000_phi_A_19[226][2]; | ||
|
||
extern const std::int8_t elp2000_idx_20[188][11]; | ||
extern const double elp2000_phi_A_20[188][2]; | ||
|
||
extern const std::int8_t elp2000_idx_21[169][11]; | ||
extern const double elp2000_phi_A_21[169][2]; | ||
|
||
} // namespace model::detail | ||
|
||
HEYOKA_END_NAMESPACE | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef HEYOKA_DETAIL_ELP2000_ELP_1_3_HPP | ||
#define HEYOKA_DETAIL_ELP2000_ELP_1_3_HPP | ||
|
||
#include <cstdint> | ||
|
||
#include <heyoka/config.hpp> | ||
|
||
HEYOKA_BEGIN_NAMESPACE | ||
|
||
namespace model::detail | ||
{ | ||
|
||
extern const std::int8_t elp2000_idx_1[1023][4]; | ||
extern const double elp2000_A_B_1[1023][6]; | ||
|
||
extern const std::int8_t elp2000_idx_2[918][4]; | ||
extern const double elp2000_A_B_2[918][6]; | ||
|
||
extern const std::int8_t elp2000_idx_3[704][4]; | ||
extern const double elp2000_A_B_3[704][6]; | ||
|
||
} // namespace model::detail | ||
|
||
HEYOKA_END_NAMESPACE | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2020, 2021, 2022, 2023 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef HEYOKA_DETAIL_ELP2000_ELP_22_36_HPP | ||
#define HEYOKA_DETAIL_ELP2000_ELP_22_36_HPP | ||
|
||
#include <cstdint> | ||
|
||
#include <heyoka/config.hpp> | ||
|
||
HEYOKA_BEGIN_NAMESPACE | ||
|
||
namespace model::detail | ||
{ | ||
|
||
extern const std::int8_t elp2000_idx_22[3][5]; | ||
extern const double elp2000_phi_A_22[3][2]; | ||
|
||
extern const std::int8_t elp2000_idx_23[2][5]; | ||
extern const double elp2000_phi_A_23[2][2]; | ||
|
||
extern const std::int8_t elp2000_idx_24[2][5]; | ||
extern const double elp2000_phi_A_24[2][2]; | ||
|
||
extern const std::int8_t elp2000_idx_25[6][5]; | ||
extern const double elp2000_phi_A_25[6][2]; | ||
|
||
extern const std::int8_t elp2000_idx_26[4][5]; | ||
extern const double elp2000_phi_A_26[4][2]; | ||
|
||
extern const std::int8_t elp2000_idx_27[5][5]; | ||
extern const double elp2000_phi_A_27[5][2]; | ||
|
||
extern const std::int8_t elp2000_idx_28[20][5]; | ||
extern const double elp2000_phi_A_28[20][2]; | ||
|
||
extern const std::int8_t elp2000_idx_29[12][5]; | ||
extern const double elp2000_phi_A_29[12][2]; | ||
|
||
extern const std::int8_t elp2000_idx_30[14][5]; | ||
extern const double elp2000_phi_A_30[14][2]; | ||
|
||
extern const std::int8_t elp2000_idx_31[11][5]; | ||
extern const double elp2000_phi_A_31[11][2]; | ||
|
||
extern const std::int8_t elp2000_idx_32[4][5]; | ||
extern const double elp2000_phi_A_32[4][2]; | ||
|
||
extern const std::int8_t elp2000_idx_33[10][5]; | ||
extern const double elp2000_phi_A_33[10][2]; | ||
|
||
extern const std::int8_t elp2000_idx_34[28][5]; | ||
extern const double elp2000_phi_A_34[28][2]; | ||
|
||
extern const std::int8_t elp2000_idx_35[13][5]; | ||
extern const double elp2000_phi_A_35[13][2]; | ||
|
||
extern const std::int8_t elp2000_idx_36[19][5]; | ||
extern const double elp2000_phi_A_36[19][2]; | ||
|
||
} // namespace model::detail | ||
|
||
HEYOKA_END_NAMESPACE | ||
|
||
#endif |
Oops, something went wrong.