ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
PointMassGravityModel.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/*
17Point mass gravity model header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_ENVIRONMENT_POINT_MASS_GRAVITY_MODEL
23#define MODELS_ENVIRONMENT_POINT_MASS_GRAVITY_MODEL
24
25#include "core/macros.h"
26#include "simulation/Model.h"
27#include "six_dof_dynamics/Frame.hpp"
28#include "six_dof_dynamics/Node.hpp"
29#include "utils/frameutils.hpp"
30#include "utils/planetdefaults.h"
31
32namespace modelspace {
33
34 /**
35 * @brief Point mass gravity model
36 *
37 * This model generates forces acting on a body under the influence of a
38 * simple point mass gravity field.
39 */
40 class PointMassGravityModel : public Model {
41 public:
42 // TODO: Replace need for mass with direct acceleration calculation when
43 // body accel methods are implemented
44 // Model params
45 // NAME TYPE DEFAULT VALUE
47 /** This is the gravitational parameter of our parent planet. Defaults to
48 * Earth's gravitational parameter for ease of use */
49 SIGNAL(mu, double, clockwerk::earth_wgs84.mu)
50 /** This is the mass of the body, which will be multiplied by our force
51 * to get the force calculation... TODO to replace this with accel methods */
52 SIGNAL(body_mass, double, 1.0)
54
55 // Model inputs
56 // NAME TYPE DEFAULT VALUE
58 /** The position of the object body in the reference frame f */
61
62 // Model outputs
63 // NAME TYPE DEFAULT VALUE
65 /** This is the acceleration due to gravity calculated in the same reference frame as pos_body__f */
68
69 // Model-specific implementations of startup and derivative
70 PointMassGravityModel();
71 PointMassGravityModel(Model &pnt, const std::string &m_name="point_mass_gravity");
72 PointMassGravityModel(SimulationExecutive &e, const std::string &m_name="point_mass_gravity");
73 PointMassGravityModel(Model &pnt, int schedule_slot, const std::string &m_name="point_mass_gravity");
74 PointMassGravityModel(SimulationExecutive &e, int schedule_slot, const std::string &m_name="point_mass_gravity");
75 ~PointMassGravityModel() {}
76
77 protected:
78 int execute();
79
80 // Temporary vectors and variables to carry out our calculations
81 double _r;
82 double _multiplier;
83 CartesianVector3D _grav_force__planet;
84 };
85}
86
87#endif
Base model class for derived implementation.
Definition Model.h:56
Point mass gravity model.
Definition PointMassGravityModel.h:40
int execute()
Function to execute the task. All math and calculations should be here.
Definition PointMassGravityModel.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< clockwerk::CartesianVector< double, 3 > > pos_body__f
Definition PointMassGravityModel.h:59
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > grav_force__f
Definition PointMassGravityModel.h:66
clockwerk::DataIO< double > body_mass
Definition PointMassGravityModel.h:52
clockwerk::DataIO< double > mu
Definition PointMassGravityModel.h:49