Skip to content

Class astrea::astro::ForceModel

ClassList > astrea > astro > ForceModel

Class to manage multiple force models and compute the total force on a vehicle. More...

  • #include <ForceModel.hpp>

Public Functions

Type Name
ForceModel () = default
Default constructor for ForceModel .
const std::unique_ptr< Force > & add (Args &&... args)
Adds a force model of type T with the given arguments.
const std::unique_ptr< Force > & at (const std::string & name) const
Retrieves a force model by name.
CartesianVector< Acceleration, frames::earth::icrf > compute_forces (const State & state, const Vehicle & vehicle) const
Computes the total force on a vehicle by summing the forces from all added force models.
const std::unique_ptr< Force > & get () const
Retrieves a force model by type.
std::size_t size () const
Returns the number of forces added to the ForceModel .
~ForceModel () = default
Default destructor for ForceModel .

Detailed Description

This class allows adding different force models, computing the total force on a vehicle, and retrieving specific force models by name or type.

Public Functions Documentation

function ForceModel

Default constructor for ForceModel .

astrea::astro::ForceModel::ForceModel () = default


function add

Adds a force model of type T with the given arguments.

template<typename T, typename... Args>
inline const std::unique_ptr< Force > & astrea::astro::ForceModel::add (
    Args &&... args
) 

Template parameters:

  • T Type of the force model to add
  • Args Types of the arguments for the constructor of T

Parameters:

  • args Arguments to pass to the constructor of T

Returns:

const std::unique_ptr<Force>& Reference to the added force model


function at

Retrieves a force model by name.

const std::unique_ptr< Force > & astrea::astro::ForceModel::at (
    const std::string & name
) const

Parameters:

  • name Name of the force model to retrieve

Returns:

const std::unique_ptr<Force>& Reference to the force model with the given name.


function compute_forces

Computes the total force on a vehicle by summing the forces from all added force models.

CartesianVector < Acceleration, frames::earth::icrf > astrea::astro::ForceModel::compute_forces (
    const State & state,
    const Vehicle & vehicle
) const

Parameters:

  • state Cartesian state vector of the vehicle
  • vehicle Vehicle object representing the spacecraft

Returns:

AccelerationVector<frames::earth::icrf> The total computed acceleration vector from all force models.


function get

Retrieves a force model by type.

template<typename T>
inline const std::unique_ptr< Force > & astrea::astro::ForceModel::get () const

Template parameters:

  • T Type of the force model to retrieve

Returns:

const std::unique_ptr<Force>& Reference to the force model of type T.


function size

Returns the number of forces added to the ForceModel .

inline std::size_t astrea::astro::ForceModel::size () const

Returns:

std::size_t Number of forces.


function ~ForceModel

Default destructor for ForceModel .

astrea::astro::ForceModel::~ForceModel () = default



The documentation for this class was generated from the following file astrea/astro/astro/propagation/force_models/ForceModel.hpp