Tudat/SimulationSetup/PropagationSetup/createTorqueModel.cpp
//! Function to create torque model object.
Function to create torque model object.
Function to create torque model object .
std::shared_ptr< basic_astrodynamics::TorqueModel > createTorqueModel(
        const std::shared_ptr< simulation_setup::Body > bodyUndergoingTorque,
        const std::shared_ptr< simulation_setup::Body > bodyExertingTorque,
        const std::shared_ptr< TorqueSettings > torqueSettings,
        const std::string& nameOfBodyUndergoingTorque,
        const std::string& nameOfBodyExertingTorque )
{
    std::shared_ptr< basic_astrodynamics::TorqueModel > torqueModel;
    switch( torqueSettings->torqueType_ )
    {
    case basic_astrodynamics::inertial_torque:
    {
        torqueModel = createInertialTorqueModel(
                    bodyUndergoingTorque, nameOfBodyUndergoingTorque );
        break;
    }
    case basic_astrodynamics::second_order_gravitational_torque:
    {
        torqueModel = createSecondDegreeGravitationalTorqueModel(
                    bodyUndergoingTorque, bodyExertingTorque, nameOfBodyUndergoingTorque, nameOfBodyExertingTorque );
        break;
    }
    case basic_astrodynamics::aerodynamic_torque:
    {
        torqueModel = createAerodynamicTorqueModel(
                    bodyUndergoingTorque, bodyExertingTorque, nameOfBodyUndergoingTorque, nameOfBodyExertingTorque );
        break;
    }
    case basic_astrodynamics::spherical_harmonic_gravitational_torque:
    {
        torqueModel = createSphericalHarmonicGravitationalTorqueModel(
                    bodyUndergoingTorque, bodyExertingTorque, torqueSettings, nameOfBodyUndergoingTorque, nameOfBodyExertingTorque );
        break;
    }
    default:
        throw std::runtime_error(
                    "Error, did not recognize type " + std::to_string( torqueSettings->torqueType_ ) +
                    " when making torque model" );
    }
    return torqueModel;
}
std :: shared_ptr < basic_astrodynamics :: TorqueModel > createTorqueModel ( const std :: shared_ptr < simulation_setup :: Body > bodyUndergoingTorque , const std :: shared_ptr < simulation_setup :: Body > bodyExertingTorque , const std :: shared_ptr < TorqueSettings > torqueSettings , const std :: string & nameOfBodyUndergoingTorque , const std :: string & nameOfBodyExertingTorque ) { std :: shared_ptr < basic_astrodynamics :: TorqueModel > torqueModel ; switch ( torqueSettings -> torqueType_ ) { case basic_astrodynamics :: inertial_torque : { torqueModel = createInertialTorqueModel ( bodyUndergoingTorque , nameOfBodyUndergoingTorque ) ; break ; } case basic_astrodynamics :: second_order_gravitational_torque : { torqueModel = createSecondDegreeGravitationalTorqueModel ( bodyUndergoingTorque , bodyExertingTorque , nameOfBodyUndergoingTorque , nameOfBodyExertingTorque ) ; break ; } case basic_astrodynamics :: aerodynamic_torque : { torqueModel = createAerodynamicTorqueModel ( bodyUndergoingTorque , bodyExertingTorque , nameOfBodyUndergoingTorque , nameOfBodyExertingTorque ) ; break ; } case basic_astrodynamics :: spherical_harmonic_gravitational_torque : { torqueModel = createSphericalHarmonicGravitationalTorqueModel ( bodyUndergoingTorque , bodyExertingTorque , torqueSettings , nameOfBodyUndergoingTorque , nameOfBodyExertingTorque ) ; break ; } default : throw std :: runtime_error ( " " + std :: to_string ( torqueSettings -> torqueType_ ) + " " ) ; } return torqueModel ; }
Function to create torque model object.
Function to create torque model object .