Tudat/SimulationSetup/EnvironmentSetup/createAtmosphereModel.cpp
//! Function to create a wind model.
Function to create a wind model.
Function to create a wind model .
std::shared_ptr< aerodynamics::WindModel > createWindModel(
        const std::shared_ptr< WindModelSettings > windSettings,
        const std::string& body )
{
    std::shared_ptr< aerodynamics::WindModel > windModel;
    switch( windSettings->getWindModelType( ) )
    {
    case custom_wind_model:
    {
        std::shared_ptr< CustomWindModelSettings > customWindModelSettings =
                std::dynamic_pointer_cast< CustomWindModelSettings >( windSettings );
        if( customWindModelSettings == nullptr )
        {
            throw std::runtime_error( "Error when making custom wind model for body " + body + ", input is incompatible" );
        }
        windModel = std::make_shared< aerodynamics::CustomWindModel >(
                    customWindModelSettings->getWindFunction( ) );
        break;
    }
    default:
        throw std::runtime_error( "Error when making wind model for body " + body + ", input type not recognized" );
    }
    return windModel;
}
std :: shared_ptr < aerodynamics :: WindModel > createWindModel ( const std :: shared_ptr < WindModelSettings > windSettings , const std :: string & body ) { std :: shared_ptr < aerodynamics :: WindModel > windModel ; switch ( windSettings -> getWindModelType ( ) ) { case custom_wind_model : { std :: shared_ptr < CustomWindModelSettings > customWindModelSettings = std :: dynamic_pointer_cast < CustomWindModelSettings > ( windSettings ) ; if ( customWindModelSettings == nullptr ) { throw std :: runtime_error ( " " + body + " " ) ; } windModel = std :: make_shared < aerodynamics :: CustomWindModel > ( customWindModelSettings -> getWindFunction ( ) ) ; break ; } default : throw std :: runtime_error ( " " + body + " " ) ; } return windModel ; }
Function to create a wind model.
Function to create a wind model .
// Check wind model type and create requested model // Check input consistency