ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
PlanetInfo.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, LLC.
15******************************************************************************/
16/*
17Simple Planet header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_ASSEMBLIES_PLANET_INFO_MODEL_H
23#define MODELS_ASSEMBLIES_PLANET_INFO_MODEL_H
24
25#include "core/macros.h"
26#include "core/CartesianVector.hpp"
27#include "simulation/Model.h"
28#include "utils/planetdefaults.h"
29
30namespace modelspace {
31
32 /**
33 * @brief Planet Information Model
34 *
35 * The planet info model is a simple model designed to capture planet information,
36 * which is currently held in clockwerk/utils/defaults.h. It is configured based
37 * on the name of the planet, which is parameterized at sim start. If the planet
38 * name input by the user cannot be found, the planet information model will raise
39 * an error on sim start.
40 *
41 * Author: Alex Reynolds <alex.reynolds@attx.tech>
42 */
43 class PlanetInfo : public Model {
44 public:
45 // Model params
46 // NAME TYPE DEFAULT VALUE
48 /** The planet name which will be used to query data from planetinfo */
49 SIGNAL(planet_name, std::string, "earth")
51
52 // Model inputs
53 // NAME TYPE DEFAULT VALUE
55
57
58 // Model outputs
59 // NAME TYPE DEFAULT VALUE
61 /** A pointer to the planet info object itself for easy passing to other models.
62 * Is a void pointer and must be cast in downstream model. Nullptr is set to
63 * self in constructor. */
64 SIGNAL(self_id, void*, nullptr)
65 /** Equatorial radius of the planet, in meters. Default is Earth R per WGS84 */
66 SIGNAL(semimajor_axis, double, clockwerk::earth_wgs84.semimajor_axis)
67 /** Flattening for the planet. Default is WGS84 flattening */
68 SIGNAL(flattening, double, clockwerk::earth_wgs84.flattening)
69 /** Gravitational parameter for planet. Default is WGS84 value */
70 SIGNAL(mu, double, clockwerk::earth_wgs84.mu)
71 /** J2 parameter for planet. Default is derived from WGS84 but inexact. */
72 SIGNAL(J2, double, clockwerk::earth_wgs84.J2)
73 /** J3 parameter for planet. Default is derived from WGS84 but inexact. */
74 SIGNAL(J3, double, clockwerk::earth_wgs84.J3)
75 /** Mean angular velocity of the planet. Assumes rotation about Z axis. Default is WGS84 Earth. */
76 SIGNAL(mean_ang_vel, CartesianVector3D, CartesianVector3D({0.0,0.0,clockwerk::earth_wgs84.semimajor_axis}))
78
79 // Model-specific implementations of startup and derivative
80 PlanetInfo();
81 PlanetInfo(Model &pnt, const std::string &m_name="earth_info");
82 PlanetInfo(SimulationExecutive &e, const std::string &m_name="earth_info");
83 ~PlanetInfo() {}
84 protected:
85 int start();
86 };
87
88}
89
90#endif
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
Base model class for derived implementation.
Definition Model.h:56
Planet Information Model.
Definition PlanetInfo.h:43
int start()
Function to perform task startup activities (step once after creation)
Definition PlanetInfo.cpp:36
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#define CartesianVector3D
Definition macros.h:54
#define END_OUTPUTS
Definition macros.h:90
#define END_PARAMS
Definition macros.h:98
#define START_OUTPUTS
Definition macros.h:88
#define END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
clockwerk::DataIO< double > semimajor_axis
Definition PlanetInfo.h:66
clockwerk::DataIO< void * > self_id
Definition PlanetInfo.h:64
clockwerk::DataIO< double > flattening
Definition PlanetInfo.h:68
clockwerk::DataIO< double > J3
Definition PlanetInfo.h:74
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > mean_ang_vel
Definition PlanetInfo.h:76
clockwerk::DataIO< double > mu
Definition PlanetInfo.h:70
clockwerk::DataIO< double > J2
Definition PlanetInfo.h:72
clockwerk::DataIO< std::string > planet_name
Definition PlanetInfo.h:49