Tudat/Astrodynamics/Aerodynamics/flightConditions.cpp
//! Constructor, sets objects and functions from which relevant environment and state variables are retrieved.
Constructor, sets objects and functions from which relevant environment and state variables are retrieved.
Constructor sets objects and functions from which relevant environment and state variables are retrieved .
AtmosphericFlightConditions::AtmosphericFlightConditions(
        const std::shared_ptr< aerodynamics::AtmosphereModel > atmosphereModel,
        const std::shared_ptr< basic_astrodynamics::BodyShapeModel > shapeModel,
        const std::shared_ptr< AerodynamicCoefficientInterface > aerodynamicCoefficientInterface,
        const std::shared_ptr< reference_frames::AerodynamicAngleCalculator > aerodynamicAngleCalculator,
        const std::function< double( const std::string& ) > controlSurfaceDeflectionFunction ):
    FlightConditions( shapeModel, aerodynamicAngleCalculator ),
    atmosphereModel_( atmosphereModel ),
    aerodynamicCoefficientInterface_( aerodynamicCoefficientInterface ),
    controlSurfaceDeflectionFunction_( controlSurfaceDeflectionFunction )
{
    if( std::dynamic_pointer_cast< aerodynamics::StandardAtmosphere >( atmosphereModel_ ) == nullptr )
    {
        updateLatitudeAndLongitudeForAtmosphere_ = 1;
    }
    else
    {
        updateLatitudeAndLongitudeForAtmosphere_ = 0;
    }
    isLatitudeAndLongitudeSet_ = 0;
    if( updateLatitudeAndLongitudeForAtmosphere_ && aerodynamicAngleCalculator_== nullptr )
    {
        throw std::runtime_error( "Error when making flight conditions, angles are to be updated, but no calculator is set" );
    }
}
AtmosphericFlightConditions :: AtmosphericFlightConditions ( const std :: shared_ptr < aerodynamics :: AtmosphereModel > atmosphereModel , const std :: shared_ptr < basic_astrodynamics :: BodyShapeModel > shapeModel , const std :: shared_ptr < AerodynamicCoefficientInterface > aerodynamicCoefficientInterface , const std :: shared_ptr < reference_frames :: AerodynamicAngleCalculator > aerodynamicAngleCalculator , const std :: function < double ( const std :: string & ) > controlSurfaceDeflectionFunction ) : FlightConditions ( shapeModel , aerodynamicAngleCalculator ) , atmosphereModel_ ( atmosphereModel ) , aerodynamicCoefficientInterface_ ( aerodynamicCoefficientInterface ) , controlSurfaceDeflectionFunction_ ( controlSurfaceDeflectionFunction ) { if ( std :: dynamic_pointer_cast < aerodynamics :: StandardAtmosphere > ( atmosphereModel_ ) == nullptr ) { updateLatitudeAndLongitudeForAtmosphere_ = 1 ; } else { updateLatitudeAndLongitudeForAtmosphere_ = 0 ; } isLatitudeAndLongitudeSet_ = 0 ; if ( updateLatitudeAndLongitudeForAtmosphere_ && aerodynamicAngleCalculator_ == nullptr ) { throw std :: runtime_error ( " " ) ; } }
Constructor, sets objects and functions from which relevant environment and state variables are retrieved.
Constructor sets objects and functions from which relevant environment and state variables are retrieved .
// Check if atmosphere requires latitude and longitude update.