diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b220315aa5..5e02f6830c 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.13.0.dev35 +current_version = 2.13.0.dev41 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? diff --git a/include/tudat/astro/basic_astro/accelerationModel.h b/include/tudat/astro/basic_astro/accelerationModel.h index be00931ed9..46b408ab45 100644 --- a/include/tudat/astro/basic_astro/accelerationModel.h +++ b/include/tudat/astro/basic_astro/accelerationModel.h @@ -132,7 +132,7 @@ typedef AccelerationModel< Eigen::Vector2d > AccelerationModel2d; //! Typedef for shared-pointer to a 2D acceleration model. typedef std::shared_ptr< AccelerationModel2d > AccelerationModel2dPointer; -extern template class AccelerationModel< Eigen::Vector3d >; +//extern template class AccelerationModel< Eigen::Vector3d >; //! Update the members of an acceleration model and evaluate the acceleration. diff --git a/include/tudat/astro/basic_astro/accelerationModelTypes.h b/include/tudat/astro/basic_astro/accelerationModelTypes.h index e022ef3fa3..545b64b00b 100644 --- a/include/tudat/astro/basic_astro/accelerationModelTypes.h +++ b/include/tudat/astro/basic_astro/accelerationModelTypes.h @@ -17,6 +17,8 @@ #include "tudat/astro/gravitation/sphericalHarmonicsGravityModel.h" #include "tudat/astro/gravitation/mutualSphericalHarmonicGravityModel.h" #include "tudat/astro/gravitation/thirdBodyPerturbation.h" +#include "tudat/astro/gravitation/ringGravityModel.h" +#include "tudat/astro/gravitation/polyhedronGravityModel.h" #include "tudat/astro/gravitation/directTidalDissipationAcceleration.h" #include "tudat/astro/aerodynamics/aerodynamicAcceleration.h" #include "tudat/astro/basic_astro/massRateModel.h" diff --git a/include/tudat/astro/earth_orientation/terrestrialTimeScaleConverter.h b/include/tudat/astro/earth_orientation/terrestrialTimeScaleConverter.h index 201d2ebe5d..ae8816f61c 100755 --- a/include/tudat/astro/earth_orientation/terrestrialTimeScaleConverter.h +++ b/include/tudat/astro/earth_orientation/terrestrialTimeScaleConverter.h @@ -241,6 +241,23 @@ class TerrestrialTimeScaleConverter return convertedTimes; } + template< typename TimeType > + std::vector< TimeType > getCurrentTimesFromSinglePosition( + const basic_astrodynamics::TimeScales inputScale, const basic_astrodynamics::TimeScales outputScale, + const std::vector< TimeType >& inputTimeValues, + const Eigen::Vector3d& earthFixedPosition ) + { + std::vector < TimeType > convertedTimes; + convertedTimes.resize( inputTimeValues.size( ) ); + + for ( unsigned int i = 0; i < inputTimeValues.size(); ++i ) + { + convertedTimes [ i ] = + getCurrentTime( inputScale, outputScale, inputTimeValues.at( i ), earthFixedPosition ); + } + return convertedTimes; + } + //! Function to reset all current times at given precision to NaN. template< typename TimeType > void resetTimes( ) diff --git a/include/tudat/astro/ephemerides/tabulatedRotationalEphemeris.h b/include/tudat/astro/ephemerides/tabulatedRotationalEphemeris.h index e122f10bfa..b983ad55e9 100755 --- a/include/tudat/astro/ephemerides/tabulatedRotationalEphemeris.h +++ b/include/tudat/astro/ephemerides/tabulatedRotationalEphemeris.h @@ -261,7 +261,7 @@ std::shared_ptr< RotationalEphemeris > getTabulatedRotationalEphemeris( } -extern template class TabulatedRotationalEphemeris< double, double >; +//extern template class TabulatedRotationalEphemeris< double, double >; bool isTabulatedRotationalEphemeris( const std::shared_ptr< RotationalEphemeris > rotationalEphemeris ); diff --git a/include/tudat/astro/gravitation/centralGravityModel.h b/include/tudat/astro/gravitation/centralGravityModel.h index e76e658bb9..0d333deff3 100644 --- a/include/tudat/astro/gravitation/centralGravityModel.h +++ b/include/tudat/astro/gravitation/centralGravityModel.h @@ -178,7 +178,7 @@ double computeGravitationalPotential( //! Template class for central gravitational acceleration model. /*! - * This template class implements a central gravitational acceleration model, i.e., only the + * This //template class implements a central gravitational acceleration model, i.e., only the * central term of the general spherical harmonics expansion. * \tparam StateMatrix Data type for state matrix (default = Eigen::Vector3d). */ diff --git a/include/tudat/astro/gravitation/polyhedronGravityModel.h b/include/tudat/astro/gravitation/polyhedronGravityModel.h index 0016d33862..c18ceb02ac 100644 --- a/include/tudat/astro/gravitation/polyhedronGravityModel.h +++ b/include/tudat/astro/gravitation/polyhedronGravityModel.h @@ -166,13 +166,66 @@ class PolyhedronGravitationalAccelerationModel: public basic_astrodynamics::Acce updateLaplacianOfPotential_( updateLaplacianOfGravitationalPotential ) { } + ~PolyhedronGravitationalAccelerationModel( ){ } + //! Update class members. /*! * Updates all the base class members to their current values and also updates the class members of this class. * The potential and laplacian of potential are only updated if the associated flags indicate so. * \param currentTime Time at which acceleration model is to be updated. */ - void updateMembers( const double currentTime = TUDAT_NAN ); + void updateMembers( const double currentTime = TUDAT_NAN ) + { + if( !( this->currentTime_ == currentTime ) ) + { + + rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); + + subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); + sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); + currentInertialRelativePosition_ = + positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; + + currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; + + polyhedronCache_->update( currentRelativePosition_ ); + + // Compute the current acceleration + currentAccelerationInBodyFixedFrame_ = basic_mathematics::calculatePolyhedronGradientOfGravitationalPotential( + gravitationalParameterFunction_() / volumeFunction_(), + polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint(), + getVerticesDefiningEachFacet_(), + getVerticesDefiningEachEdge_(), + getFacetDyads_(), + getEdgeDyads_(), + polyhedronCache_->getPerFacetFactor(), + polyhedronCache_->getPerEdgeFactor() ); + + currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; + + // Compute the current gravitational potential + if ( updatePotential_ ) + { + currentPotential_ = basic_mathematics::calculatePolyhedronGravitationalPotential( + gravitationalParameterFunction_( ) / volumeFunction_( ), + polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint( ), + getVerticesDefiningEachFacet_( ), + getVerticesDefiningEachEdge_( ), + getFacetDyads_( ), + getEdgeDyads_( ), + polyhedronCache_->getPerFacetFactor( ), + polyhedronCache_->getPerEdgeFactor( ) ); + } + + // Compute the current laplacian + if ( updateLaplacianOfPotential_ ) + { + currentLaplacianOfPotential_ = basic_mathematics::calculatePolyhedronLaplacianOfGravitationalPotential( + gravitationalParameterFunction_( ) / volumeFunction_( ), + polyhedronCache_->getPerFacetFactor( ) ); + } + } + } //! Function to return current position vector from body exerting acceleration to body undergoing acceleration, in frame //! fixed to body undergoing acceleration diff --git a/include/tudat/astro/gravitation/ringGravityModel.h b/include/tudat/astro/gravitation/ringGravityModel.h index f48bf97f97..79763c7bea 100644 --- a/include/tudat/astro/gravitation/ringGravityModel.h +++ b/include/tudat/astro/gravitation/ringGravityModel.h @@ -139,13 +139,54 @@ class RingGravitationalAccelerationModel: public basic_astrodynamics::Accelerati updatePotential_( updateGravitationalPotential ) { } + ~RingGravitationalAccelerationModel( ){ } + //! Update class members. /*! * Updates all the base class members to their current values and also updates the class members of this class. * The potential and laplacian of potential are only updated if the associated flags indicate so. * \param currentTime Time at which acceleration model is to be updated. */ - void updateMembers( const double currentTime = TUDAT_NAN ); + void updateMembers( const double currentTime = TUDAT_NAN ) + { + if( !( this->currentTime_ == currentTime ) ) + { + + rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); + + subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); + sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); + currentInertialRelativePosition_ = + positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; + + currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; + + ringCache_->setRingRadius( ringRadiusFunction_( ) ); + ringCache_->update( currentRelativePosition_ ); + + // Compute the current acceleration + currentAccelerationInBodyFixedFrame_ = computeRingGravitationalAcceleration( + currentRelativePosition_, + ringRadiusFunction_( ), + gravitationalParameterFunction_(), + ringCache_->getEllipticIntegralB( ), + ringCache_->getEllipticIntegralE( ), + ringCache_->getEllipticIntegralS( ) ); + + currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; + + // Compute the current gravitational potential + if ( updatePotential_ ) + { + currentPotential_ = computeRingGravitationalPotential( + currentRelativePosition_, + ringRadiusFunction_( ), + gravitationalParameterFunction_(), + ringCache_->getEllipticIntegralK( ) ); + } + + } + } //! Function to return current position vector from body exerting acceleration to body undergoing acceleration, in frame //! fixed to body undergoing acceleration diff --git a/include/tudat/astro/gravitation/sphericalHarmonicsGravityModelBase.h b/include/tudat/astro/gravitation/sphericalHarmonicsGravityModelBase.h index bca973c1fe..7ee2b6f92e 100644 --- a/include/tudat/astro/gravitation/sphericalHarmonicsGravityModelBase.h +++ b/include/tudat/astro/gravitation/sphericalHarmonicsGravityModelBase.h @@ -21,7 +21,7 @@ namespace gravitation //! Template base class for spherical harmonics gravitational acceleration models. /*! - * This template class serves as the base class for the + * This //template class serves as the base class for the * SphericalHarmonicsGravitationalAccelerationModel, CentralGravitationalAccelerationModel, * CentralJ2GravitationalAccelerationModel, CentralJ2J3GravitationalAccelerationModel, and * CentralJ2J3J4GravitationalAccelerationModel classes. diff --git a/include/tudat/astro/ground_stations/transmittingFrequencies.h b/include/tudat/astro/ground_stations/transmittingFrequencies.h index 39ac50ccf0..cb7119e18a 100644 --- a/include/tudat/astro/ground_stations/transmittingFrequencies.h +++ b/include/tudat/astro/ground_stations/transmittingFrequencies.h @@ -238,47 +238,22 @@ class PiecewiseLinearFrequencyInterpolator: public StationFrequencyInterpolator { TimeType lookupTime = lookupTimeOriginal; int lowerNearestNeighbour = -1; - try - { - lowerNearestNeighbour = startTimeLookupScheme_->findNearestLowerNeighbour( lookupTime ); - } - catch( const std::exception& caughtException ) - { - std::string exceptionText = std::string( caughtException.what( ) ); - throw std::runtime_error( - "Error when interpolating ramp reference frequency: look up time (" + std::to_string( - static_cast< double >( lookupTime ) ) + ", caught exception: " + exceptionText ); - } - - -// if( lookupTime > endTimes_.at( lowerNearestNeighbour ) || lookupTime < startTimes_.at ( lowerNearestNeighbour ) ) -// { -// throw std::runtime_error( -// "Error when interpolating ramp reference frequency: look up time (" + std::to_string( -// static_cast< double >( lookupTime ) ) + -// ") is outside the ramp table interval (" + std::to_string( double( startTimes_.at( 0 ) ) ) + " to " + -// std::to_string( double( startTimes_.back( ) ) ) + ")." ); -// } - if ( lookupTime > endTimes_.at( lowerNearestNeighbour ) ) - { - lowerNearestNeighbour = endTimes_.size( ) - 1; - } - if ( lookupTime < startTimes_.at ( lowerNearestNeighbour ) ) + if( lookupTimeOriginal < startTimes_.at( 0 ) ) { lowerNearestNeighbour = 0; } - else if ( invalidStartTimeLookupScheme_ != nullptr ) + else { - int invalidLowestNearestNeighbour = invalidStartTimeLookupScheme_->findNearestLowerNeighbour( lookupTime ); - if ( lookupTime > invalidTimeBlocksStartTimes_.at ( invalidLowestNearestNeighbour ) && - lookupTime < invalidTimeBlocksEndTimes_.at ( invalidLowestNearestNeighbour ) ) + try + { + lowerNearestNeighbour = startTimeLookupScheme_->findNearestLowerNeighbour( lookupTime ); + } + catch ( const std::exception &caughtException ) { + std::string exceptionText = std::string( caughtException.what( )); throw std::runtime_error( "Error when interpolating ramp reference frequency: look up time (" + std::to_string( - static_cast< double >( lookupTime ) ) + - ") is in time interval without transmitted frequency (" + - std::to_string( double( invalidTimeBlocksStartTimes_.at ( invalidLowestNearestNeighbour ) ) ) + " to " + - std::to_string( double( invalidTimeBlocksEndTimes_.at ( invalidLowestNearestNeighbour ) ) ) + ")." ); + static_cast< double >( lookupTime )) + ", caught exception: " + exceptionText ); } } diff --git a/include/tudat/astro/observation_models/observationManager.h b/include/tudat/astro/observation_models/observationManager.h index 0261e3354f..440790fc39 100644 --- a/include/tudat/astro/observation_models/observationManager.h +++ b/include/tudat/astro/observation_models/observationManager.h @@ -477,12 +477,12 @@ class ObservationManager: public ObservationManagerBase< ObservationScalarType, }; - -extern template class ObservationManagerBase< double, double >; -extern template class ObservationManager< 1, double, double >; -extern template class ObservationManager< 2, double, double >; -extern template class ObservationManager< 3, double, double >; -extern template class ObservationManager< 6, double, double >; +// +//extern template class ObservationManagerBase< double, double >; +//extern template class ObservationManager< 1, double, double >; +//extern template class ObservationManager< 2, double, double >; +//extern template class ObservationManager< 3, double, double >; +//extern template class ObservationManager< 6, double, double >; } diff --git a/include/tudat/astro/observation_models/observationModel.h b/include/tudat/astro/observation_models/observationModel.h index 08c75deb46..4988739491 100644 --- a/include/tudat/astro/observation_models/observationModel.h +++ b/include/tudat/astro/observation_models/observationModel.h @@ -656,11 +656,11 @@ class ObservationModel //! Pre-define list of states used when calling function returning link-end states/times from interface function. std::vector< Eigen::Matrix< double, 6, 1 > > linkEndStates_; }; - -extern template class ObservationModel< 1, double, double >; -extern template class ObservationModel< 2, double, double >; -extern template class ObservationModel< 3, double, double >; -extern template class ObservationModel< 6, double, double >; +// +//extern template class ObservationModel< 1, double, double >; +//extern template class ObservationModel< 2, double, double >; +//extern template class ObservationModel< 3, double, double >; +//extern template class ObservationModel< 6, double, double >; //! Function to compute an observation of size 1 at double precision, with double precision input /*! diff --git a/include/tudat/astro/orbit_determination/podInputOutputTypes.h b/include/tudat/astro/orbit_determination/podInputOutputTypes.h index 84c03e169c..11d30f6a84 100644 --- a/include/tudat/astro/orbit_determination/podInputOutputTypes.h +++ b/include/tudat/astro/orbit_determination/podInputOutputTypes.h @@ -1144,11 +1144,11 @@ struct EstimationOutput: public CovarianceAnalysisOutput< ObservationScalarType, }; -extern template class CovarianceAnalysisInput< double, double >; -extern template struct CovarianceAnalysisOutput< double >; - -extern template class EstimationInput< double, double >; -extern template struct EstimationOutput< double >; +//extern template class CovarianceAnalysisInput< double, double >; +//extern template struct CovarianceAnalysisOutput< double >; +// +//extern template class EstimationInput< double, double >; +//extern template struct EstimationOutput< double >; } diff --git a/include/tudat/astro/propagators/dynamicsStateDerivativeModel.h b/include/tudat/astro/propagators/dynamicsStateDerivativeModel.h index acba5bcf91..f970fdaa7e 100644 --- a/include/tudat/astro/propagators/dynamicsStateDerivativeModel.h +++ b/include/tudat/astro/propagators/dynamicsStateDerivativeModel.h @@ -737,7 +737,7 @@ class DynamicsStateDerivativeModel std::map< TimeType, unsigned int > cumulativeFunctionEvaluationCounter_; }; -extern template class DynamicsStateDerivativeModel< double, double >; +//extern template class DynamicsStateDerivativeModel< double, double >; inline std::vector< std::shared_ptr< basic_astrodynamics::AccelerationModel3d > > getAccelerationBetweenBodies( const std::string bodyUndergoingAcceleration, diff --git a/include/tudat/astro/propagators/nBodyCowellStateDerivative.h b/include/tudat/astro/propagators/nBodyCowellStateDerivative.h index 1b738c809e..5a693c672a 100644 --- a/include/tudat/astro/propagators/nBodyCowellStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyCowellStateDerivative.h @@ -103,7 +103,7 @@ class NBodyCowellStateDerivative: public NBodyStateDerivative< StateScalarType, }; -extern template class NBodyCowellStateDerivative< double, double >; +//extern template class NBodyCowellStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyEnckeStateDerivative.h b/include/tudat/astro/propagators/nBodyEnckeStateDerivative.h index bf30328657..d2a6ea742d 100644 --- a/include/tudat/astro/propagators/nBodyEnckeStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyEnckeStateDerivative.h @@ -290,7 +290,7 @@ class NBodyEnckeStateDerivative: public NBodyStateDerivative< StateScalarType, T }; -extern template class NBodyEnckeStateDerivative< double, double >; +//extern template class NBodyEnckeStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyGaussKeplerStateDerivative.h b/include/tudat/astro/propagators/nBodyGaussKeplerStateDerivative.h index e92c0de0c8..0cdfd1a13b 100644 --- a/include/tudat/astro/propagators/nBodyGaussKeplerStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyGaussKeplerStateDerivative.h @@ -272,7 +272,7 @@ class NBodyGaussKeplerStateDerivative: public NBodyStateDerivative< StateScalarT }; -extern template class NBodyGaussKeplerStateDerivative< double, double >; +//extern template class NBodyGaussKeplerStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.h b/include/tudat/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.h index 08337474b6..9a2afad3c3 100644 --- a/include/tudat/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.h @@ -220,7 +220,7 @@ class NBodyGaussModifiedEquinictialStateDerivative: public NBodyStateDerivative< }; -extern template class NBodyGaussModifiedEquinictialStateDerivative< double, double >; +//extern template class NBodyGaussModifiedEquinictialStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyStateDerivative.h b/include/tudat/astro/propagators/nBodyStateDerivative.h index 56234f6b8d..0e30e1e7e5 100644 --- a/include/tudat/astro/propagators/nBodyStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyStateDerivative.h @@ -548,7 +548,7 @@ class NBodyStateDerivative: public propagators::SingleStateTypeDerivative< State }; -extern template class NBodyStateDerivative< double, double >; +//extern template class NBodyStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.h b/include/tudat/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.h index a7ef4ea70f..0f747479af 100644 --- a/include/tudat/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.h @@ -285,7 +285,7 @@ class NBodyUnifiedStateModelExponentialMapStateDerivative: public NBodyStateDeri }; -extern template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >; +//extern template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.h b/include/tudat/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.h index 73725c8f32..450193d99a 100644 --- a/include/tudat/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.h @@ -287,7 +287,7 @@ class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative: public N }; -extern template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >; +//extern template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.h b/include/tudat/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.h index fc0c6d8fec..aca574b54f 100644 --- a/include/tudat/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.h +++ b/include/tudat/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.h @@ -282,7 +282,7 @@ class NBodyUnifiedStateModelQuaternionsStateDerivative: public NBodyStateDerivat }; -extern template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >; +//extern template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >; diff --git a/include/tudat/astro/propagators/rotationalMotionExponentialMapStateDerivative.h b/include/tudat/astro/propagators/rotationalMotionExponentialMapStateDerivative.h index 3c55f718da..7884bb4b13 100755 --- a/include/tudat/astro/propagators/rotationalMotionExponentialMapStateDerivative.h +++ b/include/tudat/astro/propagators/rotationalMotionExponentialMapStateDerivative.h @@ -196,7 +196,7 @@ class RotationalMotionExponentialMapStateDerivative: public RotationalMotionStat }; -extern template class RotationalMotionExponentialMapStateDerivative< double, double >; +//extern template class RotationalMotionExponentialMapStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.h b/include/tudat/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.h index b961c6b849..7928a30f3b 100755 --- a/include/tudat/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.h +++ b/include/tudat/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.h @@ -197,7 +197,7 @@ class RotationalMotionModifiedRodriguesParametersStateDerivative: public Rotatio }; -extern template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >; +//extern template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/rotationalMotionQuaternionsStateDerivative.h b/include/tudat/astro/propagators/rotationalMotionQuaternionsStateDerivative.h index e10a144f34..109a2de04a 100755 --- a/include/tudat/astro/propagators/rotationalMotionQuaternionsStateDerivative.h +++ b/include/tudat/astro/propagators/rotationalMotionQuaternionsStateDerivative.h @@ -199,7 +199,7 @@ class RotationalMotionQuaternionsStateDerivative: public RotationalMotionStateDe }; -extern template class RotationalMotionQuaternionsStateDerivative< double, double >; +//extern template class RotationalMotionQuaternionsStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/rotationalMotionStateDerivative.h b/include/tudat/astro/propagators/rotationalMotionStateDerivative.h index dfe10d1490..a566825c01 100755 --- a/include/tudat/astro/propagators/rotationalMotionStateDerivative.h +++ b/include/tudat/astro/propagators/rotationalMotionStateDerivative.h @@ -392,7 +392,7 @@ class RotationalMotionStateDerivative: public propagators::SingleStateTypeDeriva }; -extern template class RotationalMotionStateDerivative< double, double >; +//extern template class RotationalMotionStateDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propagators/singleStateTypeDerivative.h b/include/tudat/astro/propagators/singleStateTypeDerivative.h index 304fc77522..95449fd6dc 100644 --- a/include/tudat/astro/propagators/singleStateTypeDerivative.h +++ b/include/tudat/astro/propagators/singleStateTypeDerivative.h @@ -242,7 +242,7 @@ class SingleStateTypeDerivative Eigen::Matrix< StateScalarType, Eigen::Dynamic, 1 > unprocessedState_; }; -extern template class SingleStateTypeDerivative< double, double >; +//extern template class SingleStateTypeDerivative< double, double >; } // namespace propagators diff --git a/include/tudat/astro/propulsion/thrustAccelerationModel.h b/include/tudat/astro/propulsion/thrustAccelerationModel.h index 7bba6b203a..422d836808 100644 --- a/include/tudat/astro/propulsion/thrustAccelerationModel.h +++ b/include/tudat/astro/propulsion/thrustAccelerationModel.h @@ -109,7 +109,41 @@ class ThrustAcceleration : public basic_astrodynamics::AccelerationModel< Eigen: * compute the acceleration. * \param currentTime Time at which acceleration model is to be updated. */ - void updateMembers( const double currentTime = TUDAT_NAN ); + void updateMembers( const double currentTime = TUDAT_NAN ) + { + // Check if update is needed + if( !( currentTime_ == currentTime ) ) + { + currentMassRate_ = 0.0; + currentMass_ = bodyMassFunction_( ); + currentAcceleration_.setZero( ); + thrustDirectionCalculator_->update( currentTime ); + + for( unsigned int i = 0; i < thrustSources_.size( ); i++ ) + { + thrustSources_.at( i )->updateEngineModel( currentTime ); + if( !saveThrustContributions_ ) + { + currentMassRate_ -= thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); + currentAcceleration_ += ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* + thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ) ; + } + else + { + currentMassRateContributions_[ i ] = thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); + currentMassRate_ -= currentMassRateContributions_[ i ]; + currentThrustAccelerationContributions_[ i ] = ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* + thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ); + currentAcceleration_ += currentThrustAccelerationContributions_[ i ]; + } + } + + // Reset current time. + currentTime_ = currentTime; + + } + } + //! Function to retreieve the current propellant mass rate, as computed by last call to updateMembers function. /*! @@ -122,7 +156,25 @@ class ThrustAcceleration : public basic_astrodynamics::AccelerationModel< Eigen: } Eigen::Vector3d getCurrentThrustAccelerationContribution( - const unsigned int index ); + const unsigned int index ) + { + if( !saveThrustContributions_ ) + { + throw std::runtime_error( "Error when getting single thrust acceleration contribution, separate contributions not saved" ); + } + else if( currentTime_ != currentTime_ ) + { + throw std::runtime_error( "Error when getting single thrust acceleration contribution, thrust model is not updated" ); + } + else if( index >= currentThrustAccelerationContributions_.size( ) ) + { + throw std::runtime_error( "Error when getting single thrust acceleration contribution, requested index is out of bounds" ); + } + else + { + return currentThrustAccelerationContributions_.at( index ); + } + } //! Function to retrieve the list of environment models that are to be updated before computing the acceleration. /*! diff --git a/include/tudat/interface/json/jsonEstimationInterface.h b/include/tudat/interface/json/jsonEstimationInterface.h index 4897dc8464..f2e03200ce 100644 --- a/include/tudat/interface/json/jsonEstimationInterface.h +++ b/include/tudat/interface/json/jsonEstimationInterface.h @@ -185,7 +185,7 @@ class JsonEstimationManager: public JsonVariationalEquationsSimulationManager< T }; -extern template class JsonEstimationManager< double, double >; +//extern template class JsonEstimationManager< double, double >; //#if( BUILD_EXTENDED_PRECISION_PROPAGATION_TOOLS ) //extern template class JsonEstimationManager< Time, long double >; diff --git a/include/tudat/interface/json/jsonInterface.h b/include/tudat/interface/json/jsonInterface.h index d669bcd81d..d1e720b433 100644 --- a/include/tudat/interface/json/jsonInterface.h +++ b/include/tudat/interface/json/jsonInterface.h @@ -650,7 +650,7 @@ class JsonSimulationManager }; -extern template class JsonSimulationManager< double, double >; +//extern template class JsonSimulationManager< double, double >; //! Function to create a `json` object from a Simulation object. template< typename TimeType, typename StateScalarType > diff --git a/include/tudat/interface/json/jsonInterfaceVariational.h b/include/tudat/interface/json/jsonInterfaceVariational.h index 3c09c17e51..5c7136af14 100644 --- a/include/tudat/interface/json/jsonInterfaceVariational.h +++ b/include/tudat/interface/json/jsonInterfaceVariational.h @@ -132,7 +132,7 @@ class JsonVariationalEquationsSimulationManager: public JsonSimulationManager< T }; -extern template class JsonVariationalEquationsSimulationManager< double, double >; +//extern template class JsonVariationalEquationsSimulationManager< double, double >; } // namespace json_interface diff --git a/include/tudat/math/integrators/adamsBashforthMoultonIntegrator.h b/include/tudat/math/integrators/adamsBashforthMoultonIntegrator.h index 3b3b4b96d2..3f5f6dfc0a 100644 --- a/include/tudat/math/integrators/adamsBashforthMoultonIntegrator.h +++ b/include/tudat/math/integrators/adamsBashforthMoultonIntegrator.h @@ -1052,9 +1052,9 @@ class AdamsBashforthMoultonIntegrator StateDerivativeType lastDerivative_; }; -extern template class AdamsBashforthMoultonIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class AdamsBashforthMoultonIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class AdamsBashforthMoultonIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class AdamsBashforthMoultonIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class AdamsBashforthMoultonIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class AdamsBashforthMoultonIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Typedef of Adam-Bashforh-Moulton integrator (state/state derivative = VectorXd, independent variable = double). diff --git a/include/tudat/math/integrators/bulirschStoerVariableStepsizeIntegrator.h b/include/tudat/math/integrators/bulirschStoerVariableStepsizeIntegrator.h index 25e3dc3c02..824b297670 100644 --- a/include/tudat/math/integrators/bulirschStoerVariableStepsizeIntegrator.h +++ b/include/tudat/math/integrators/bulirschStoerVariableStepsizeIntegrator.h @@ -517,9 +517,9 @@ class BulirschStoerVariableStepSizeIntegrator : }; -extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; // Typedef of variable-step size Bulirsch-Stoer integrator (state/state derivative = VectorXd, diff --git a/include/tudat/math/integrators/numericalIntegrator.h b/include/tudat/math/integrators/numericalIntegrator.h index 00a1ab3428..c3dc293982 100644 --- a/include/tudat/math/integrators/numericalIntegrator.h +++ b/include/tudat/math/integrators/numericalIntegrator.h @@ -260,9 +260,9 @@ class NumericalIntegrator }; -extern template class NumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class NumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class NumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class NumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class NumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class NumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Perform an integration to a specified independent variable value. template< typename IndependentVariableType, typename StateType, typename StateDerivativeType, typename TimeStepType > diff --git a/include/tudat/math/integrators/reinitializableNumericalIntegrator.h b/include/tudat/math/integrators/reinitializableNumericalIntegrator.h index ba8542a038..71b4e93476 100644 --- a/include/tudat/math/integrators/reinitializableNumericalIntegrator.h +++ b/include/tudat/math/integrators/reinitializableNumericalIntegrator.h @@ -65,9 +65,9 @@ class ReinitializableNumericalIntegrator : }; -extern template class ReinitializableNumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class ReinitializableNumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class ReinitializableNumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class ReinitializableNumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class ReinitializableNumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class ReinitializableNumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Typedef for shared-pointer to default, re-initializable numerical integrator. /*! diff --git a/include/tudat/math/integrators/rungeKutta4Integrator.h b/include/tudat/math/integrators/rungeKutta4Integrator.h index 92b3e32f1c..400c532814 100644 --- a/include/tudat/math/integrators/rungeKutta4Integrator.h +++ b/include/tudat/math/integrators/rungeKutta4Integrator.h @@ -85,9 +85,9 @@ class RungeKutta4Integrator }; -extern template class RungeKutta4Integrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class RungeKutta4Integrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class RungeKutta4Integrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class RungeKutta4Integrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class RungeKutta4Integrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class RungeKutta4Integrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Typedef of RK4 integrator (state/state derivative = VectorXd, independent variable = double). diff --git a/include/tudat/math/integrators/rungeKuttaFixedStepSizeIntegrator.h b/include/tudat/math/integrators/rungeKuttaFixedStepSizeIntegrator.h index 16b652aee7..35a631ac28 100644 --- a/include/tudat/math/integrators/rungeKuttaFixedStepSizeIntegrator.h +++ b/include/tudat/math/integrators/rungeKuttaFixedStepSizeIntegrator.h @@ -356,9 +356,9 @@ class RungeKuttaFixedStepSizeIntegrator RungeKuttaCoefficients::OrderEstimateToIntegrate orderToUse_; }; -extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Typedef of RK fixed-step integrator (state/state derivative = VectorXd, independent variable = double). diff --git a/include/tudat/math/integrators/rungeKuttaVariableStepSizeIntegrator.h b/include/tudat/math/integrators/rungeKuttaVariableStepSizeIntegrator.h index 54b140092b..c91072bb5f 100644 --- a/include/tudat/math/integrators/rungeKuttaVariableStepSizeIntegrator.h +++ b/include/tudat/math/integrators/rungeKuttaVariableStepSizeIntegrator.h @@ -491,9 +491,9 @@ class RungeKuttaVariableStepSizeIntegrator : }; -extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//extern template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; //! Perform a single integration step. diff --git a/include/tudat/math/interpolators/cubicSplineInterpolator.h b/include/tudat/math/interpolators/cubicSplineInterpolator.h index 84cf82ad4c..89c2e100d6 100644 --- a/include/tudat/math/interpolators/cubicSplineInterpolator.h +++ b/include/tudat/math/interpolators/cubicSplineInterpolator.h @@ -424,9 +424,9 @@ class CubicSplineInterpolator : }; -extern template class CubicSplineInterpolator< double, Eigen::VectorXd >; -extern template class CubicSplineInterpolator< double, Eigen::Vector6d >; -extern template class CubicSplineInterpolator< double, Eigen::MatrixXd >; +//extern template class CubicSplineInterpolator< double, Eigen::VectorXd >; +//extern template class CubicSplineInterpolator< double, Eigen::Vector6d >; +//extern template class CubicSplineInterpolator< double, Eigen::MatrixXd >; //! Typedef for cubic spline interpolator with (in)dependent = double. typedef CubicSplineInterpolator< double, double > CubicSplineInterpolatorDouble; diff --git a/include/tudat/math/interpolators/interpolator.h b/include/tudat/math/interpolators/interpolator.h index 73a2fc6925..8178dfad79 100644 --- a/include/tudat/math/interpolators/interpolator.h +++ b/include/tudat/math/interpolators/interpolator.h @@ -83,9 +83,9 @@ class Interpolator }; -extern template class Interpolator< double, Eigen::VectorXd >; -extern template class Interpolator< double, Eigen::Vector6d >; -extern template class Interpolator< double, Eigen::MatrixXd >; +//extern template class Interpolator< double, Eigen::VectorXd >; +//extern template class Interpolator< double, Eigen::Vector6d >; +//extern template class Interpolator< double, Eigen::MatrixXd >; } // namespace interpolators diff --git a/include/tudat/math/interpolators/lagrangeInterpolator.h b/include/tudat/math/interpolators/lagrangeInterpolator.h index ce4e3df870..5d7b52a0ff 100644 --- a/include/tudat/math/interpolators/lagrangeInterpolator.h +++ b/include/tudat/math/interpolators/lagrangeInterpolator.h @@ -523,9 +523,9 @@ class LagrangeInterpolator : public OneDimensionalInterpolator< IndependentVaria }; -extern template class LagrangeInterpolator< double, Eigen::VectorXd >; -extern template class LagrangeInterpolator< double, Eigen::Vector6d >; -extern template class LagrangeInterpolator< double, Eigen::MatrixXd >; +//extern template class LagrangeInterpolator< double, Eigen::VectorXd >; +//extern template class LagrangeInterpolator< double, Eigen::Vector6d >; +//extern template class LagrangeInterpolator< double, Eigen::MatrixXd >; //! Typedef for LagrangeInterpolator with double as both its dependent and independent data type. typedef LagrangeInterpolator< double, double > LagrangeInterpolatorDouble; diff --git a/include/tudat/math/interpolators/linearInterpolator.h b/include/tudat/math/interpolators/linearInterpolator.h index d8fe7d04ac..2b544585b0 100644 --- a/include/tudat/math/interpolators/linearInterpolator.h +++ b/include/tudat/math/interpolators/linearInterpolator.h @@ -253,9 +253,9 @@ class LinearInterpolator }; -extern template class LinearInterpolator< double, Eigen::VectorXd >; -extern template class LinearInterpolator< double, Eigen::Vector6d >; -extern template class LinearInterpolator< double, Eigen::MatrixXd >; +//extern template class LinearInterpolator< double, Eigen::VectorXd >; +//extern template class LinearInterpolator< double, Eigen::Vector6d >; +//extern template class LinearInterpolator< double, Eigen::MatrixXd >; //! Typedef for linear interpolator with (in)dependent variable = double. diff --git a/include/tudat/math/interpolators/multiLinearInterpolator.h b/include/tudat/math/interpolators/multiLinearInterpolator.h index b1e2e37517..097ef290f0 100644 --- a/include/tudat/math/interpolators/multiLinearInterpolator.h +++ b/include/tudat/math/interpolators/multiLinearInterpolator.h @@ -348,11 +348,11 @@ class MultiLinearInterpolator: public MultiDimensionalInterpolator< IndependentV } }; -extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 1 >; -extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 2 >; -extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 3 >; -extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 4 >; -extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 5 >; +//extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 1 >; +//extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 2 >; +//extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 3 >; +//extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 4 >; +//extern template class MultiLinearInterpolator< double, Eigen::Vector6d, 5 >; } // namespace interpolators diff --git a/include/tudat/simulation/estimation_setup/createEstimatableParameters.h b/include/tudat/simulation/estimation_setup/createEstimatableParameters.h index 45a38556eb..abf142af0b 100644 --- a/include/tudat/simulation/estimation_setup/createEstimatableParameters.h +++ b/include/tudat/simulation/estimation_setup/createEstimatableParameters.h @@ -11,6 +11,7 @@ #ifndef TUDAT_CREATEESTIMATABLEPARAMETERS_H #define TUDAT_CREATEESTIMATABLEPARAMETERS_H +#include "tudat/astro/basic_astro/accelerationModelTypes.h" #include "tudat/astro/basic_astro/accelerationModel.h" #include "tudat/astro/orbit_determination/estimatable_parameters/estimatableParameter.h" diff --git a/include/tudat/simulation/estimation_setup/createStateDerivativePartials.h b/include/tudat/simulation/estimation_setup/createStateDerivativePartials.h index 0b1a23c413..7b61b447af 100644 --- a/include/tudat/simulation/estimation_setup/createStateDerivativePartials.h +++ b/include/tudat/simulation/estimation_setup/createStateDerivativePartials.h @@ -226,10 +226,10 @@ std::map< propagators::IntegratedStateType, orbit_determination::StateDerivative std::string errorMessage = "Cannot yet create state derivative partial models for type " + std::to_string( stateDerivativeIterator->first ); throw std::runtime_error( errorMessage ); + } } -} -return stateDerivativePartials; + return stateDerivativePartials; } // //extern template std::map< propagators::IntegratedStateType, orbit_determination::StateDerivativePartialsMap > createStateDerivativePartials< double, double >( diff --git a/include/tudat/simulation/estimation_setup/observationSimulationSettings.h b/include/tudat/simulation/estimation_setup/observationSimulationSettings.h index a23346f6d2..9ec0743977 100644 --- a/include/tudat/simulation/estimation_setup/observationSimulationSettings.h +++ b/include/tudat/simulation/estimation_setup/observationSimulationSettings.h @@ -737,9 +737,9 @@ std::vector< std::shared_ptr< ObservationSimulationSettings< TimeType > > > get return getObservationSimulationSettings( linkDefsPerObservable, observationTimes, referenceLinkEnd ); } -extern template class ObservationSimulationSettings< double >; -extern template class TabulatedObservationSimulationSettings< double >; -extern template class PerArcObservationSimulationSettings< double >; +//extern template class ObservationSimulationSettings< double >; +//extern template class TabulatedObservationSimulationSettings< double >; +//extern template class PerArcObservationSimulationSettings< double >; } diff --git a/include/tudat/simulation/estimation_setup/observations.h b/include/tudat/simulation/estimation_setup/observations.h index 20fd2d33f7..a27a6de38f 100644 --- a/include/tudat/simulation/estimation_setup/observations.h +++ b/include/tudat/simulation/estimation_setup/observations.h @@ -1139,12 +1139,13 @@ template< typename ObservationScalarType = double, typename TimeType = double, typename std::enable_if< is_state_scalar_and_time_type< ObservationScalarType, TimeType >::value, int >::type = 0 > std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeType > > > splitObservationSet( const std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeType > > observationSet, - const std::shared_ptr< ObservationSetSplitterBase > observationSetSplitter ) + const std::shared_ptr< ObservationSetSplitterBase > observationSetSplitter, + const bool printWarning = true ) { - if ( observationSet->getFilteredObservationSet( ) != nullptr ) + if ( printWarning && observationSet->getFilteredObservationSet( ) != nullptr ) { std::cerr << "Warning when splitting single observation set, the filtered observation set pointer is not empty and " - " any filtered observation will be lost after splitting." ; + " any filtered observation will be lost after splitting." << std::endl; } std::vector< int > rawStartIndicesNewSets = { 0 }; @@ -2226,6 +2227,10 @@ class ObservationCollection // Retrieve single observation sets based on observation parser std::map< ObservableType, std::map< LinkEnds, std::vector< unsigned int > > > singleObsSetsIndices = getSingleObservationSetsIndices( observationParser ); + // Boolean denoting whether the warning about splitting observation sets which contain filtered observations has already been + // printed or not (this warning should only been thrown out once). + bool warningPrinted = false; + for ( auto observableIt : singleObsSetsIndices ) { for ( auto linkEndsIt : observableIt.second ) @@ -2237,7 +2242,8 @@ class ObservationCollection { // Get new observation sets after splitting std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeType > > > newObsSets = - splitObservationSet( singleObsSets.at( indexSetToSplit + obsSetCounter ), observationSetSplitter ); + splitObservationSet( singleObsSets.at( indexSetToSplit + obsSetCounter ), observationSetSplitter, !warningPrinted ); + warningPrinted = true; // Remove original observation set singleObsSets.erase( singleObsSets.begin( ) + ( indexSetToSplit + obsSetCounter ) ); diff --git a/include/tudat/simulation/estimation_setup/orbitDeterminationManager.h b/include/tudat/simulation/estimation_setup/orbitDeterminationManager.h index 1326d135e2..3c4e01ce45 100644 --- a/include/tudat/simulation/estimation_setup/orbitDeterminationManager.h +++ b/include/tudat/simulation/estimation_setup/orbitDeterminationManager.h @@ -1428,7 +1428,7 @@ class OrbitDeterminationManager }; -extern template class OrbitDeterminationManager< double, double >; +//extern template class OrbitDeterminationManager< double, double >; diff --git a/include/tudat/simulation/estimation_setup/processOdfFile.h b/include/tudat/simulation/estimation_setup/processOdfFile.h index ddb87b7d77..66904b4134 100644 --- a/include/tudat/simulation/estimation_setup/processOdfFile.h +++ b/include/tudat/simulation/estimation_setup/processOdfFile.h @@ -1536,19 +1536,14 @@ compressDopplerData( earth_orientation::TerrestrialTimeScaleConverter timeScaleConverter = earth_orientation::TerrestrialTimeScaleConverter( ); - std::vector< Eigen::Vector3d > originalEarthFixedPositions; - for( unsigned int i = 0; i < originalObservationTimesTdb.size( ); ++i ) - { - originalEarthFixedPositions.push_back( - simulation_setup::getCombinedApproximateGroundStationPositions( ).at( - originalDopplerData->getLinkEnds( ).at( receiver ).stationName_ ) ); - } + Eigen::Vector3d stationPosition = simulation_setup::getCombinedApproximateGroundStationPositions( ).at( + originalDopplerData->getLinkEnds( ).at( receiver ).stationName_ ); std::vector< TimeType > originalObservationTimesUtc = - timeScaleConverter.getCurrentTimes< TimeType >( basic_astrodynamics::tdb_scale, + timeScaleConverter.getCurrentTimesFromSinglePosition< TimeType >( basic_astrodynamics::tdb_scale, basic_astrodynamics::utc_scale, originalObservationTimesTdb, - originalEarthFixedPositions ); + stationPosition ); std::vector< Eigen::Matrix< ObservationScalarType, Eigen::Dynamic, 1 > > compressedObservations; std::vector< TimeType > compressedObservationTimesUtc; @@ -1597,8 +1592,6 @@ compressDopplerData( "position for " + stationName ); } - Eigen::Vector3d stationPosition = - simulation_setup::getCombinedApproximateGroundStationPositions( ).at( stationName ); std::vector< Eigen::Vector3d > compressedEarthFixedPositions; for( unsigned int i = 0; i < compressedObservationTimesUtc.size( ); ++i ) @@ -1665,6 +1658,7 @@ createCompressedDopplerCollection( observation_models::SingleObservationSet< ObservationScalarType, TimeType > > compressedDataSet = compressDopplerData< ObservationScalarType, TimeType >( it.second.at( index ), compressionRatio ); + if( compressedDataSet->getObservationTimes( ).size( ) ) { compressedData->replaceSingleObservationSet( compressedDataSet, index ); diff --git a/include/tudat/simulation/estimation_setup/variationalEquationsSolver.h b/include/tudat/simulation/estimation_setup/variationalEquationsSolver.h index 2e42b5271a..f061df742a 100644 --- a/include/tudat/simulation/estimation_setup/variationalEquationsSolver.h +++ b/include/tudat/simulation/estimation_setup/variationalEquationsSolver.h @@ -2207,9 +2207,9 @@ class HybridArcVariationalEquationsSolver: public VariationalEquationsSolver< St }; -extern template class SingleArcVariationalEquationsSolver< double, double >; -extern template class MultiArcVariationalEquationsSolver< double, double >; -extern template class HybridArcVariationalEquationsSolver< double, double >; +//extern template class SingleArcVariationalEquationsSolver< double, double >; +//extern template class MultiArcVariationalEquationsSolver< double, double >; +//extern template class HybridArcVariationalEquationsSolver< double, double >; } // namespace propagators diff --git a/include/tudat/simulation/propagation_setup/dynamicsSimulator.h b/include/tudat/simulation/propagation_setup/dynamicsSimulator.h index 6c3fd4b52a..e45d987d97 100644 --- a/include/tudat/simulation/propagation_setup/dynamicsSimulator.h +++ b/include/tudat/simulation/propagation_setup/dynamicsSimulator.h @@ -2285,7 +2285,7 @@ class HybridArcDynamicsSimulator: public DynamicsSimulator< StateScalarType, Tim * \param propagatorSettings Propagator settings for dynamics (must be of multi arc type) * \param arcStartTimes Times at which the separate arcs start, for the multi-arc case * \param areEquationsOfMotionToBeIntegrated Boolean to denote whether equations of motion should be integrated at - * the end of the contructor or not.extern template class MultiArcDynamicsSimulator< double, double >; + * the end of the contructor or not.//extern template class MultiArcDynamicsSimulator< double, double >; * \param clearNumericalSolutions Boolean to determine whether to clear the raw numerical solution member variables @@ -2520,9 +2520,9 @@ std::shared_ptr< PropagatorSettings< StateScalarType > > validateDeprecatePropag } } -extern template class SingleArcDynamicsSimulator< double, double >; -extern template class MultiArcDynamicsSimulator< double, double >; -extern template class HybridArcDynamicsSimulator< double, double >; +//extern template class SingleArcDynamicsSimulator< double, double >; +//extern template class MultiArcDynamicsSimulator< double, double >; +//extern template class HybridArcDynamicsSimulator< double, double >; diff --git a/include/tudat/simulation/propagation_setup/environmentUpdater.h b/include/tudat/simulation/propagation_setup/environmentUpdater.h index 65ee478f98..8edc7f72c1 100644 --- a/include/tudat/simulation/propagation_setup/environmentUpdater.h +++ b/include/tudat/simulation/propagation_setup/environmentUpdater.h @@ -864,7 +864,7 @@ class EnvironmentUpdater }; -extern template class EnvironmentUpdater< double, double >; +//extern template class EnvironmentUpdater< double, double >; } // namespace propagators diff --git a/include/tudat/simulation/propagation_setup/propagationSettings.h b/include/tudat/simulation/propagation_setup/propagationSettings.h index 65a6b43a00..27ae431a5a 100644 --- a/include/tudat/simulation/propagation_setup/propagationSettings.h +++ b/include/tudat/simulation/propagation_setup/propagationSettings.h @@ -2214,14 +2214,14 @@ inline std::shared_ptr< MultiTypePropagatorSettings< StateScalarType, TimeType > -extern template class PropagatorSettings< double >; -extern template class SingleArcPropagatorSettings< double >; -extern template class MultiArcPropagatorSettings< double >; -extern template class TranslationalStatePropagatorSettings< double >; -extern template class RotationalStatePropagatorSettings< double >; -extern template class MassPropagatorSettings< double >; -extern template class CustomStatePropagatorSettings< double >; -extern template class MultiTypePropagatorSettings< double >; +//extern template class PropagatorSettings< double >; +//extern template class SingleArcPropagatorSettings< double >; +//extern template class MultiArcPropagatorSettings< double >; +//extern template class TranslationalStatePropagatorSettings< double >; +//extern template class RotationalStatePropagatorSettings< double >; +//extern template class MassPropagatorSettings< double >; +//extern template class CustomStatePropagatorSettings< double >; +//extern template class MultiTypePropagatorSettings< double >; //! Function to retrieve list of accelerations from propagator settings diff --git a/src/astro/basic_astro/accelerationModel.cpp b/src/astro/basic_astro/accelerationModel.cpp index 7f3cefdd98..202653b6b9 100644 --- a/src/astro/basic_astro/accelerationModel.cpp +++ b/src/astro/basic_astro/accelerationModel.cpp @@ -5,7 +5,7 @@ namespace tudat namespace basic_astrodynamics { -template class AccelerationModel< Eigen::Vector3d >; +//template class AccelerationModel< Eigen::Vector3d >; } // namespace basic_astrodynamics diff --git a/src/astro/ephemerides/compositeEphemeris.cpp b/src/astro/ephemerides/compositeEphemeris.cpp index 69879c67f8..52abf38eb1 100644 --- a/src/astro/ephemerides/compositeEphemeris.cpp +++ b/src/astro/ephemerides/compositeEphemeris.cpp @@ -6,7 +6,7 @@ namespace tudat namespace ephemerides { -//template class CompositeEphemeris< double, double >; +////template class CompositeEphemeris< double, double >; } // namespace ephemerides diff --git a/src/astro/ephemerides/tabulatedRotationalEphemeris.cpp b/src/astro/ephemerides/tabulatedRotationalEphemeris.cpp index de0f3ba69f..2de916b76a 100644 --- a/src/astro/ephemerides/tabulatedRotationalEphemeris.cpp +++ b/src/astro/ephemerides/tabulatedRotationalEphemeris.cpp @@ -6,7 +6,7 @@ namespace tudat namespace ephemerides { -template class TabulatedRotationalEphemeris< double, double >; +//template class TabulatedRotationalEphemeris< double, double >; //! Function to check whether an ephemeris is a (type of) tabulated ephemeris diff --git a/src/astro/gravitation/polyhedronGravityModel.cpp b/src/astro/gravitation/polyhedronGravityModel.cpp index e1646faa67..074b949cb6 100644 --- a/src/astro/gravitation/polyhedronGravityModel.cpp +++ b/src/astro/gravitation/polyhedronGravityModel.cpp @@ -16,59 +16,59 @@ namespace tudat { namespace gravitation { - -void PolyhedronGravitationalAccelerationModel::updateMembers( const double currentTime ) -{ - if( !( this->currentTime_ == currentTime ) ) - { - - rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); - - subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); - sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); - currentInertialRelativePosition_ = - positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; - - currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; - - polyhedronCache_->update( currentRelativePosition_ ); - - // Compute the current acceleration - currentAccelerationInBodyFixedFrame_ = basic_mathematics::calculatePolyhedronGradientOfGravitationalPotential( - gravitationalParameterFunction_() / volumeFunction_(), - polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint(), - getVerticesDefiningEachFacet_(), - getVerticesDefiningEachEdge_(), - getFacetDyads_(), - getEdgeDyads_(), - polyhedronCache_->getPerFacetFactor(), - polyhedronCache_->getPerEdgeFactor() ); - - currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; - - // Compute the current gravitational potential - if ( updatePotential_ ) - { - currentPotential_ = basic_mathematics::calculatePolyhedronGravitationalPotential( - gravitationalParameterFunction_( ) / volumeFunction_( ), - polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint( ), - getVerticesDefiningEachFacet_( ), - getVerticesDefiningEachEdge_( ), - getFacetDyads_( ), - getEdgeDyads_( ), - polyhedronCache_->getPerFacetFactor( ), - polyhedronCache_->getPerEdgeFactor( ) ); - } - - // Compute the current laplacian - if ( updateLaplacianOfPotential_ ) - { - currentLaplacianOfPotential_ = basic_mathematics::calculatePolyhedronLaplacianOfGravitationalPotential( - gravitationalParameterFunction_( ) / volumeFunction_( ), - polyhedronCache_->getPerFacetFactor( ) ); - } - } -} +// +//void PolyhedronGravitationalAccelerationModel::updateMembers( const double currentTime ) +//{ +// if( !( this->currentTime_ == currentTime ) ) +// { +// +// rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); +// +// subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); +// sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); +// currentInertialRelativePosition_ = +// positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; +// +// currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; +// +// polyhedronCache_->update( currentRelativePosition_ ); +// +// // Compute the current acceleration +// currentAccelerationInBodyFixedFrame_ = basic_mathematics::calculatePolyhedronGradientOfGravitationalPotential( +// gravitationalParameterFunction_() / volumeFunction_(), +// polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint(), +// getVerticesDefiningEachFacet_(), +// getVerticesDefiningEachEdge_(), +// getFacetDyads_(), +// getEdgeDyads_(), +// polyhedronCache_->getPerFacetFactor(), +// polyhedronCache_->getPerEdgeFactor() ); +// +// currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; +// +// // Compute the current gravitational potential +// if ( updatePotential_ ) +// { +// currentPotential_ = basic_mathematics::calculatePolyhedronGravitationalPotential( +// gravitationalParameterFunction_( ) / volumeFunction_( ), +// polyhedronCache_->getVerticesCoordinatesRelativeToFieldPoint( ), +// getVerticesDefiningEachFacet_( ), +// getVerticesDefiningEachEdge_( ), +// getFacetDyads_( ), +// getEdgeDyads_( ), +// polyhedronCache_->getPerFacetFactor( ), +// polyhedronCache_->getPerEdgeFactor( ) ); +// } +// +// // Compute the current laplacian +// if ( updateLaplacianOfPotential_ ) +// { +// currentLaplacianOfPotential_ = basic_mathematics::calculatePolyhedronLaplacianOfGravitationalPotential( +// gravitationalParameterFunction_( ) / volumeFunction_( ), +// polyhedronCache_->getPerFacetFactor( ) ); +// } +// } +//} } // namespace gravitation diff --git a/src/astro/gravitation/ringGravityModel.cpp b/src/astro/gravitation/ringGravityModel.cpp index 99694329e0..ba16de693b 100644 --- a/src/astro/gravitation/ringGravityModel.cpp +++ b/src/astro/gravitation/ringGravityModel.cpp @@ -16,46 +16,46 @@ namespace tudat namespace gravitation { -void RingGravitationalAccelerationModel::updateMembers( const double currentTime ) -{ - if( !( this->currentTime_ == currentTime ) ) - { - - rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); - - subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); - sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); - currentInertialRelativePosition_ = - positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; - - currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; - - ringCache_->setRingRadius( ringRadiusFunction_( ) ); - ringCache_->update( currentRelativePosition_ ); - - // Compute the current acceleration - currentAccelerationInBodyFixedFrame_ = computeRingGravitationalAcceleration( - currentRelativePosition_, - ringRadiusFunction_( ), - gravitationalParameterFunction_(), - ringCache_->getEllipticIntegralB( ), - ringCache_->getEllipticIntegralE( ), - ringCache_->getEllipticIntegralS( ) ); - - currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; - - // Compute the current gravitational potential - if ( updatePotential_ ) - { - currentPotential_ = computeRingGravitationalPotential( - currentRelativePosition_, - ringRadiusFunction_( ), - gravitationalParameterFunction_(), - ringCache_->getEllipticIntegralK( ) ); - } - - } -} +//void RingGravitationalAccelerationModel::updateMembers( const double currentTime ) +//{ +// if( !( this->currentTime_ == currentTime ) ) +// { +// +// rotationToIntegrationFrame_ = rotationFromBodyFixedToIntegrationFrameFunction_( ); +// +// subjectPositionFunction_( positionOfBodySubjectToAcceleration_ ); +// sourcePositionFunction_( positionOfBodyExertingAcceleration_ ); +// currentInertialRelativePosition_ = +// positionOfBodySubjectToAcceleration_ - positionOfBodyExertingAcceleration_ ; +// +// currentRelativePosition_ = rotationToIntegrationFrame_.inverse( ) * currentInertialRelativePosition_; +// +// ringCache_->setRingRadius( ringRadiusFunction_( ) ); +// ringCache_->update( currentRelativePosition_ ); +// +// // Compute the current acceleration +// currentAccelerationInBodyFixedFrame_ = computeRingGravitationalAcceleration( +// currentRelativePosition_, +// ringRadiusFunction_( ), +// gravitationalParameterFunction_(), +// ringCache_->getEllipticIntegralB( ), +// ringCache_->getEllipticIntegralE( ), +// ringCache_->getEllipticIntegralS( ) ); +// +// currentAcceleration_ = rotationToIntegrationFrame_ * currentAccelerationInBodyFixedFrame_; +// +// // Compute the current gravitational potential +// if ( updatePotential_ ) +// { +// currentPotential_ = computeRingGravitationalPotential( +// currentRelativePosition_, +// ringRadiusFunction_( ), +// gravitationalParameterFunction_(), +// ringCache_->getEllipticIntegralK( ) ); +// } +// +// } +//} } // namespace gravitation diff --git a/src/astro/observation_models/observationManager.cpp b/src/astro/observation_models/observationManager.cpp index b6de9115e4..5b977c93a9 100644 --- a/src/astro/observation_models/observationManager.cpp +++ b/src/astro/observation_models/observationManager.cpp @@ -6,11 +6,11 @@ namespace tudat namespace observation_models { -template class ObservationManagerBase< double, double >; -template class ObservationManager< 1, double, double >; -template class ObservationManager< 2, double, double >; -template class ObservationManager< 3, double, double >; -template class ObservationManager< 6, double, double >; +//template class ObservationManagerBase< double, double >; +//template class ObservationManager< 1, double, double >; +//template class ObservationManager< 2, double, double >; +//template class ObservationManager< 3, double, double >; +//template class ObservationManager< 6, double, double >; } diff --git a/src/astro/observation_models/observationModel.cpp b/src/astro/observation_models/observationModel.cpp index bd69792cc7..76844ef45d 100644 --- a/src/astro/observation_models/observationModel.cpp +++ b/src/astro/observation_models/observationModel.cpp @@ -6,10 +6,10 @@ namespace tudat namespace observation_models { -template class ObservationModel< 1, double, double >; -template class ObservationModel< 2, double, double >; -template class ObservationModel< 3, double, double >; -template class ObservationModel< 6, double, double >; +//template class ObservationModel< 1, double, double >; +//template class ObservationModel< 2, double, double >; +//template class ObservationModel< 3, double, double >; +//template class ObservationModel< 6, double, double >; } // namespace observation_models diff --git a/src/astro/orbit_determination/estimatable_parameters/estimatableParameterSet.cpp b/src/astro/orbit_determination/estimatable_parameters/estimatableParameterSet.cpp index 3e44878a96..dda58be1a5 100644 --- a/src/astro/orbit_determination/estimatable_parameters/estimatableParameterSet.cpp +++ b/src/astro/orbit_determination/estimatable_parameters/estimatableParameterSet.cpp @@ -16,10 +16,10 @@ namespace tudat namespace estimatable_parameters { -//template class EstimatableParameterSet< double >; +////template class EstimatableParameterSet< double >; //#if( TUDAT_BUILD_WITH_EXTENDED_PRECISION_PROPAGATION_TOOLS ) -//template class dsdEstimatableParameterSet< long double >; +////template class dsdEstimatableParameterSet< long double >; //#endif } diff --git a/src/astro/orbit_determination/observation_partials/observationPartial.cpp b/src/astro/orbit_determination/observation_partials/observationPartial.cpp index 86b9c17ee1..ba4954eb3d 100644 --- a/src/astro/orbit_determination/observation_partials/observationPartial.cpp +++ b/src/astro/orbit_determination/observation_partials/observationPartial.cpp @@ -6,33 +6,33 @@ namespace tudat namespace observation_partials { -//template class ObservationPartial< 1 >; -//template class ObservationPartial< 2 >; -//template class ObservationPartial< 3 >; +////template class ObservationPartial< 1 >; +////template class ObservationPartial< 2 >; +////template class ObservationPartial< 3 >; -//template class ObservationPartialWrtConstantAbsoluteBias< 1 >; -//template class ObservationPartialWrtConstantAbsoluteBias< 2 >; -//template class ObservationPartialWrtConstantAbsoluteBias< 3 >; +////template class ObservationPartialWrtConstantAbsoluteBias< 1 >; +////template class ObservationPartialWrtConstantAbsoluteBias< 2 >; +////template class ObservationPartialWrtConstantAbsoluteBias< 3 >; -//template class ObservationPartialWrtArcWiseAbsoluteBias< 1 >; -//template class ObservationPartialWrtArcWiseAbsoluteBias< 2 >; -//template class ObservationPartialWrtArcWiseAbsoluteBias< 3 >; +////template class ObservationPartialWrtArcWiseAbsoluteBias< 1 >; +////template class ObservationPartialWrtArcWiseAbsoluteBias< 2 >; +////template class ObservationPartialWrtArcWiseAbsoluteBias< 3 >; -//template class ObservationPartialWrtConstantRelativeBias< 1 >; -//template class ObservationPartialWrtConstantRelativeBias< 2 >; -//template class ObservationPartialWrtConstantRelativeBias< 3 >; +////template class ObservationPartialWrtConstantRelativeBias< 1 >; +////template class ObservationPartialWrtConstantRelativeBias< 2 >; +////template class ObservationPartialWrtConstantRelativeBias< 3 >; -//template class ObservationPartialWrtArcWiseRelativeBias< 1 >; -//template class ObservationPartialWrtArcWiseRelativeBias< 2 >; -//template class ObservationPartialWrtArcWiseRelativeBias< 3 >; +////template class ObservationPartialWrtArcWiseRelativeBias< 1 >; +////template class ObservationPartialWrtArcWiseRelativeBias< 2 >; +////template class ObservationPartialWrtArcWiseRelativeBias< 3 >; // -//template class ObservationPartialWrtConstantTimeDriftBias< 1 >; -//template class ObservationPartialWrtConstantTimeDriftBias< 2 >; -//template class ObservationPartialWrtConstantTimeDriftBias< 3 >; +////template class ObservationPartialWrtConstantTimeDriftBias< 1 >; +////template class ObservationPartialWrtConstantTimeDriftBias< 2 >; +////template class ObservationPartialWrtConstantTimeDriftBias< 3 >; // -//template class ObservationPartialWrtArcWiseTimeDriftBias< 1 >; -//template class ObservationPartialWrtArcWiseTimeDriftBias< 2 >; -//template class ObservationPartialWrtArcWiseTimeDriftBias< 3 >; +////template class ObservationPartialWrtArcWiseTimeDriftBias< 1 >; +////template class ObservationPartialWrtArcWiseTimeDriftBias< 2 >; +////template class ObservationPartialWrtArcWiseTimeDriftBias< 3 >; } diff --git a/src/astro/orbit_determination/podInputOutputTypes.cpp b/src/astro/orbit_determination/podInputOutputTypes.cpp index 02a0ec5be0..7fc41d2131 100644 --- a/src/astro/orbit_determination/podInputOutputTypes.cpp +++ b/src/astro/orbit_determination/podInputOutputTypes.cpp @@ -63,10 +63,10 @@ Eigen::MatrixXd normaliseUnnormaliseInverseCovarianceMatrix( return modifiedInverseCovarianceMatrix; } -template class CovarianceAnalysisInput< double, double >; +//template class CovarianceAnalysisInput< double, double >; template struct CovarianceAnalysisOutput< double >; -template class EstimationInput< double, double >; +//template class EstimationInput< double, double >; template struct EstimationOutput< double >; } diff --git a/src/astro/propagators/dynamicsStateDerivativeModel.cpp b/src/astro/propagators/dynamicsStateDerivativeModel.cpp index 33899e73fc..032c5943dc 100644 --- a/src/astro/propagators/dynamicsStateDerivativeModel.cpp +++ b/src/astro/propagators/dynamicsStateDerivativeModel.cpp @@ -74,7 +74,7 @@ std::shared_ptr< acceleration_partials::AccelerationPartial > getAccelerationPar } #endif -template class DynamicsStateDerivativeModel< double, double >; +//template class DynamicsStateDerivativeModel< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyCowellStateDerivative.cpp b/src/astro/propagators/nBodyCowellStateDerivative.cpp index bf8cd97f78..d331e873dc 100644 --- a/src/astro/propagators/nBodyCowellStateDerivative.cpp +++ b/src/astro/propagators/nBodyCowellStateDerivative.cpp @@ -6,7 +6,7 @@ namespace tudat namespace propagators { -template class NBodyCowellStateDerivative< double, double >; +//template class NBodyCowellStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyEnckeStateDerivative.cpp b/src/astro/propagators/nBodyEnckeStateDerivative.cpp index 550efa2f44..0d20ec5dec 100644 --- a/src/astro/propagators/nBodyEnckeStateDerivative.cpp +++ b/src/astro/propagators/nBodyEnckeStateDerivative.cpp @@ -16,7 +16,7 @@ namespace tudat namespace propagators { -template class NBodyEnckeStateDerivative< double, double >; +//template class NBodyEnckeStateDerivative< double, double >; } diff --git a/src/astro/propagators/nBodyGaussKeplerStateDerivative.cpp b/src/astro/propagators/nBodyGaussKeplerStateDerivative.cpp index b1db3f8f20..442bd49687 100644 --- a/src/astro/propagators/nBodyGaussKeplerStateDerivative.cpp +++ b/src/astro/propagators/nBodyGaussKeplerStateDerivative.cpp @@ -110,7 +110,7 @@ Eigen::Vector6d computeGaussPlanetaryEquationsForKeplerElements( currentCartesianState ) * accelerationsInInertialFrame, centralBodyGravitationalParameter ); } -template class NBodyGaussKeplerStateDerivative< double, double >; +//template class NBodyGaussKeplerStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.cpp b/src/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.cpp index 34dfba7613..69f1a9d893 100644 --- a/src/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.cpp +++ b/src/astro/propagators/nBodyGaussModifiedEquinoctialStateDerivative.cpp @@ -74,7 +74,7 @@ Eigen::Vector6d computeGaussPlanetaryEquationsForModifiedEquinoctialElements( return stateDerivative; } -template class NBodyGaussModifiedEquinictialStateDerivative< double, double >; +//template class NBodyGaussModifiedEquinictialStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyStateDerivative.cpp b/src/astro/propagators/nBodyStateDerivative.cpp index f75e9d4f02..aacf5bedae 100644 --- a/src/astro/propagators/nBodyStateDerivative.cpp +++ b/src/astro/propagators/nBodyStateDerivative.cpp @@ -317,7 +317,7 @@ std::vector< std::string > determineEphemerisUpdateorder( std::vector< std::stri return updateOrder; } -template class NBodyStateDerivative< double, double >; +//template class NBodyStateDerivative< double, double >; } diff --git a/src/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.cpp b/src/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.cpp index f37eefcdde..8d414eb397 100644 --- a/src/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.cpp +++ b/src/astro/propagators/nBodyUnifiedStateModelExponentialMapStateDerivative.cpp @@ -107,7 +107,7 @@ Eigen::Vector7d computeStateDerivativeForUnifiedStateModelExponentialMap( currentCartesianState ) * accelerationsInInertialFrame, centralBodyGravitationalParameter ); } -template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >; +//template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.cpp b/src/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.cpp index 50cfd0ae03..ffea1865ce 100644 --- a/src/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.cpp +++ b/src/astro/propagators/nBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative.cpp @@ -121,7 +121,7 @@ Eigen::Vector7d computeStateDerivativeForUnifiedStateModelModifiedRodriguesParam } -template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >; +//template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.cpp b/src/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.cpp index ebefb190dc..f1bade1a21 100644 --- a/src/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.cpp +++ b/src/astro/propagators/nBodyUnifiedStateModelQuaternionsStateDerivative.cpp @@ -102,7 +102,7 @@ Eigen::Vector7d computeStateDerivativeForUnifiedStateModelQuaternions( currentCartesianState ) * accelerationsInInertialFrame, centralBodyGravitationalParameter ); } -template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >; +//template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/rotationalMotionExponentialMapStateDerivative.cpp b/src/astro/propagators/rotationalMotionExponentialMapStateDerivative.cpp index fff5ff9e1e..6557fc6681 100755 --- a/src/astro/propagators/rotationalMotionExponentialMapStateDerivative.cpp +++ b/src/astro/propagators/rotationalMotionExponentialMapStateDerivative.cpp @@ -59,7 +59,7 @@ Eigen::Vector4d calculateExponentialMapDerivative( const Eigen::Vector4d& curren return exponentialMapDerivative; } -template class RotationalMotionExponentialMapStateDerivative< double, double >; +//template class RotationalMotionExponentialMapStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.cpp b/src/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.cpp index b5c95c734d..a1e0f56ef1 100755 --- a/src/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.cpp +++ b/src/astro/propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.cpp @@ -40,7 +40,7 @@ Eigen::Vector4d calculateModifiedRodriguesParametersDerivative( return modifiedRodriguesParametersDerivative; } -template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >; +//template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >; } // namespace propagators diff --git a/src/astro/propagators/rotationalMotionQuaternionsStateDerivative.cpp b/src/astro/propagators/rotationalMotionQuaternionsStateDerivative.cpp index a5c3978004..013a8098f5 100755 --- a/src/astro/propagators/rotationalMotionQuaternionsStateDerivative.cpp +++ b/src/astro/propagators/rotationalMotionQuaternionsStateDerivative.cpp @@ -75,7 +75,7 @@ Eigen::Vector4d calculateQuaternionDerivative( const Eigen::Vector4d& currentQua return getQuaterionToQuaternionRateMatrix( angularVelocityVectorInBodyFixedFrame ) * currentQuaternionsToBaseFrame; } -template class RotationalMotionQuaternionsStateDerivative< double, double >; +//template class RotationalMotionQuaternionsStateDerivative< double, double >; diff --git a/src/astro/propagators/rotationalMotionStateDerivative.cpp b/src/astro/propagators/rotationalMotionStateDerivative.cpp index ddecfa8285..027ee1bb5b 100644 --- a/src/astro/propagators/rotationalMotionStateDerivative.cpp +++ b/src/astro/propagators/rotationalMotionStateDerivative.cpp @@ -77,7 +77,7 @@ Eigen::Vector3d evaluateRotationalEquationsOfMotion( return inverseInertiaTensor * ( totalTorque ); } -template class RotationalMotionStateDerivative< double, double >; +//template class RotationalMotionStateDerivative< double, double >; } diff --git a/src/astro/propagators/singleStateTypeDerivative.cpp b/src/astro/propagators/singleStateTypeDerivative.cpp index 81c0f7896c..10cac91a04 100644 --- a/src/astro/propagators/singleStateTypeDerivative.cpp +++ b/src/astro/propagators/singleStateTypeDerivative.cpp @@ -119,7 +119,7 @@ int getGeneralizedAccelerationSize( const IntegratedStateType stateType ) } -template class SingleStateTypeDerivative< double, double >; +//template class SingleStateTypeDerivative< double, double >; } diff --git a/src/astro/propulsion/thrustAccelerationModel.cpp b/src/astro/propulsion/thrustAccelerationModel.cpp index ca45c1d3a8..7cbc5cebc2 100644 --- a/src/astro/propulsion/thrustAccelerationModel.cpp +++ b/src/astro/propulsion/thrustAccelerationModel.cpp @@ -6,61 +6,61 @@ namespace tudat namespace propulsion { -void ThrustAcceleration::updateMembers( const double currentTime ) -{ - // Check if update is needed - if( !( currentTime_ == currentTime ) ) - { - currentMassRate_ = 0.0; - currentMass_ = bodyMassFunction_( ); - currentAcceleration_.setZero( ); - thrustDirectionCalculator_->update( currentTime ); - - for( unsigned int i = 0; i < thrustSources_.size( ); i++ ) - { - thrustSources_.at( i )->updateEngineModel( currentTime ); - if( !saveThrustContributions_ ) - { - currentMassRate_ -= thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); - currentAcceleration_ += ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* - thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ) ; - } - else - { - currentMassRateContributions_[ i ] = thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); - currentMassRate_ -= currentMassRateContributions_[ i ]; - currentThrustAccelerationContributions_[ i ] = ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* - thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ); - currentAcceleration_ += currentThrustAccelerationContributions_[ i ]; - } - } - - // Reset current time. - currentTime_ = currentTime; - - } -} - -Eigen::Vector3d ThrustAcceleration::getCurrentThrustAccelerationContribution( - const unsigned int index ) -{ - if( !saveThrustContributions_ ) - { - throw std::runtime_error( "Error when getting single thrust acceleration contribution, separate contributions not saved" ); - } - else if( currentTime_ != currentTime_ ) - { - throw std::runtime_error( "Error when getting single thrust acceleration contribution, thrust model is not updated" ); - } - else if( index >= currentThrustAccelerationContributions_.size( ) ) - { - throw std::runtime_error( "Error when getting single thrust acceleration contribution, requested index is out of bounds" ); - } - else - { - return currentThrustAccelerationContributions_.at( index ); - } -} +//void ThrustAcceleration::updateMembers( const double currentTime ) +//{ +// // Check if update is needed +// if( !( currentTime_ == currentTime ) ) +// { +// currentMassRate_ = 0.0; +// currentMass_ = bodyMassFunction_( ); +// currentAcceleration_.setZero( ); +// thrustDirectionCalculator_->update( currentTime ); +// +// for( unsigned int i = 0; i < thrustSources_.size( ); i++ ) +// { +// thrustSources_.at( i )->updateEngineModel( currentTime ); +// if( !saveThrustContributions_ ) +// { +// currentMassRate_ -= thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); +// currentAcceleration_ += ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* +// thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ) ; +// } +// else +// { +// currentMassRateContributions_[ i ] = thrustSources_.at( i )->getCurrentMassRate( currentMass_ ); +// currentMassRate_ -= currentMassRateContributions_[ i ]; +// currentThrustAccelerationContributions_[ i ] = ( thrustSources_.at( i )->getCurrentThrustAcceleration( currentMass_ ) )* +// thrustDirectionCalculator_->getInertialThrustDirection( thrustSources_.at( i ) ); +// currentAcceleration_ += currentThrustAccelerationContributions_[ i ]; +// } +// } +// +// // Reset current time. +// currentTime_ = currentTime; +// +// } +//} +// +//Eigen::Vector3d ThrustAcceleration::getCurrentThrustAccelerationContribution( +// const unsigned int index ) +//{ +// if( !saveThrustContributions_ ) +// { +// throw std::runtime_error( "Error when getting single thrust acceleration contribution, separate contributions not saved" ); +// } +// else if( currentTime_ != currentTime_ ) +// { +// throw std::runtime_error( "Error when getting single thrust acceleration contribution, thrust model is not updated" ); +// } +// else if( index >= currentThrustAccelerationContributions_.size( ) ) +// { +// throw std::runtime_error( "Error when getting single thrust acceleration contribution, requested index is out of bounds" ); +// } +// else +// { +// return currentThrustAccelerationContributions_.at( index ); +// } +//} } // namespace propulsion diff --git a/src/interface/json/jsonEstimationInterface.cpp b/src/interface/json/jsonEstimationInterface.cpp index 8f149e4c27..761822251b 100644 --- a/src/interface/json/jsonEstimationInterface.cpp +++ b/src/interface/json/jsonEstimationInterface.cpp @@ -18,12 +18,12 @@ namespace tudat namespace json_interface { -template class JsonEstimationManager< double, double >; +//template class JsonEstimationManager< double, double >; //#if( BUILD_EXTENDED_PRECISION_PROPAGATION_TOOLS ) -//template class JsonEstimationManager< Time, long double >; -//template class JsonEstimationManager< double, double >; -//template class JsonEstimationManager< Time, long double >; +////template class JsonEstimationManager< Time, long double >; +////template class JsonEstimationManager< double, double >; +////template class JsonEstimationManager< Time, long double >; //#endif } diff --git a/src/interface/json/jsonInterface.cpp b/src/interface/json/jsonInterface.cpp index 8702245e07..5e51067522 100644 --- a/src/interface/json/jsonInterface.cpp +++ b/src/interface/json/jsonInterface.cpp @@ -18,12 +18,12 @@ namespace tudat namespace json_interface { -template class JsonSimulationManager< double, double >; +//template class JsonSimulationManager< double, double >; #if( TUDAT_BUILD_WITH_EXTENDED_PRECISION_PROPAGATION_TOOLS ) -template class JsonSimulationManager< double, long double >; -//template class JsonSimulationManager< Time, double >; -//template class JsonSimulationManager< Time, long double >; +//template class JsonSimulationManager< double, long double >; +////template class JsonSimulationManager< Time, double >; +////template class JsonSimulationManager< Time, long double >; #endif } diff --git a/src/interface/json/jsonInterfaceVariational.cpp b/src/interface/json/jsonInterfaceVariational.cpp index 9b4dd72422..2e8f8afb75 100644 --- a/src/interface/json/jsonInterfaceVariational.cpp +++ b/src/interface/json/jsonInterfaceVariational.cpp @@ -18,12 +18,12 @@ namespace tudat namespace json_interface { -template class JsonVariationalEquationsSimulationManager< double, double >; +//template class JsonVariationalEquationsSimulationManager< double, double >; #if( TUDAT_BUILD_WITH_EXTENDED_PRECISION_PROPAGATION_TOOLS ) -//template class JsonVariationalEquationsSimulationManager< Time, double >; -template class JsonVariationalEquationsSimulationManager< double, long double >; -//template class JsonVariationalEquationsSimulationManager< Time, long double >; +////template class JsonVariationalEquationsSimulationManager< Time, double >; +//template class JsonVariationalEquationsSimulationManager< double, long double >; +////template class JsonVariationalEquationsSimulationManager< Time, long double >; #endif } diff --git a/src/math/integrators/adamsBashforthMoultonIntegrator.cpp b/src/math/integrators/adamsBashforthMoultonIntegrator.cpp index bae4331f3f..bc94e80d65 100644 --- a/src/math/integrators/adamsBashforthMoultonIntegrator.cpp +++ b/src/math/integrators/adamsBashforthMoultonIntegrator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace numerical_integrators { -template class AdamsBashforthMoultonIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class AdamsBashforthMoultonIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class AdamsBashforthMoultonIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class AdamsBashforthMoultonIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class AdamsBashforthMoultonIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class AdamsBashforthMoultonIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace integrators } // namespace tudat diff --git a/src/math/integrators/bulirschStoerVariableStepsizeIntegrator.cpp b/src/math/integrators/bulirschStoerVariableStepsizeIntegrator.cpp index caea8df8f9..e8f1773f76 100644 --- a/src/math/integrators/bulirschStoerVariableStepsizeIntegrator.cpp +++ b/src/math/integrators/bulirschStoerVariableStepsizeIntegrator.cpp @@ -46,9 +46,9 @@ std::vector< unsigned int > getBulirschStoerStepSequence( return stepSequence; } -template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class BulirschStoerVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace numerical_integrators diff --git a/src/math/integrators/numericalIntegrator.cpp b/src/math/integrators/numericalIntegrator.cpp index 18703e8205..74da2dab51 100644 --- a/src/math/integrators/numericalIntegrator.cpp +++ b/src/math/integrators/numericalIntegrator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace numerical_integrators { -template class NumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class NumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class NumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class NumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class NumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class NumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace numerical_integrators } // namespace tudat diff --git a/src/math/integrators/reinitializableNumericalIntegrator.cpp b/src/math/integrators/reinitializableNumericalIntegrator.cpp index 8a120e75b8..5f5dfc688f 100644 --- a/src/math/integrators/reinitializableNumericalIntegrator.cpp +++ b/src/math/integrators/reinitializableNumericalIntegrator.cpp @@ -6,9 +6,9 @@ namespace numerical_integrators { -template class ReinitializableNumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class ReinitializableNumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class ReinitializableNumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class ReinitializableNumericalIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class ReinitializableNumericalIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class ReinitializableNumericalIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; diff --git a/src/math/integrators/rungeKutta4Integrator.cpp b/src/math/integrators/rungeKutta4Integrator.cpp index 0a62aaeebb..49eb7aeeb0 100644 --- a/src/math/integrators/rungeKutta4Integrator.cpp +++ b/src/math/integrators/rungeKutta4Integrator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace numerical_integrators { -template class RungeKutta4Integrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class RungeKutta4Integrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class RungeKutta4Integrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class RungeKutta4Integrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class RungeKutta4Integrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class RungeKutta4Integrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace numerical_integrators } // namespace tudat diff --git a/src/math/integrators/rungeKuttaFixedStepSizeIntegrator.cpp b/src/math/integrators/rungeKuttaFixedStepSizeIntegrator.cpp index 2b83df178d..365f61813d 100644 --- a/src/math/integrators/rungeKuttaFixedStepSizeIntegrator.cpp +++ b/src/math/integrators/rungeKuttaFixedStepSizeIntegrator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace numerical_integrators { -template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class RungeKuttaFixedStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace numerical_integrators } // namespace tudat diff --git a/src/math/integrators/rungeKuttaVariableStepSizeIntegrator.cpp b/src/math/integrators/rungeKuttaVariableStepSizeIntegrator.cpp index 6a6f95b6e2..f65fa76e8f 100644 --- a/src/math/integrators/rungeKuttaVariableStepSizeIntegrator.cpp +++ b/src/math/integrators/rungeKuttaVariableStepSizeIntegrator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace numerical_integrators { -template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; -template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; -template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; +//template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::VectorXd, Eigen::VectorXd >; +//template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::Vector6d, Eigen::Vector6d >; +//template class RungeKuttaVariableStepSizeIntegrator < double, Eigen::MatrixXd, Eigen::MatrixXd >; } // namespace numerical_integrators } // namespace tudat diff --git a/src/math/interpolators/cubicSplineInterpolator.cpp b/src/math/interpolators/cubicSplineInterpolator.cpp index f0355d4b5d..a0038d2bc2 100644 --- a/src/math/interpolators/cubicSplineInterpolator.cpp +++ b/src/math/interpolators/cubicSplineInterpolator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace interpolators { -template class CubicSplineInterpolator< double, Eigen::VectorXd >; -template class CubicSplineInterpolator< double, Eigen::Vector6d >; -template class CubicSplineInterpolator< double, Eigen::MatrixXd >; +//template class CubicSplineInterpolator< double, Eigen::VectorXd >; +//template class CubicSplineInterpolator< double, Eigen::Vector6d >; +//template class CubicSplineInterpolator< double, Eigen::MatrixXd >; } // namespace interpolators diff --git a/src/math/interpolators/interpolator.cpp b/src/math/interpolators/interpolator.cpp index e8f7311925..0c12c8be4e 100644 --- a/src/math/interpolators/interpolator.cpp +++ b/src/math/interpolators/interpolator.cpp @@ -5,9 +5,9 @@ namespace tudat namespace interpolators { -template class Interpolator< double, Eigen::VectorXd >; -template class Interpolator< double, Eigen::Vector6d >; -template class Interpolator< double, Eigen::MatrixXd >; +//template class Interpolator< double, Eigen::VectorXd >; +//template class Interpolator< double, Eigen::Vector6d >; +//template class Interpolator< double, Eigen::MatrixXd >; } // namespace interpolators diff --git a/src/math/interpolators/lagrangeInterpolator.cpp b/src/math/interpolators/lagrangeInterpolator.cpp index eb105f43a1..8b1abb8bfd 100644 --- a/src/math/interpolators/lagrangeInterpolator.cpp +++ b/src/math/interpolators/lagrangeInterpolator.cpp @@ -6,9 +6,9 @@ namespace tudat namespace interpolators { -template class LagrangeInterpolator< double, Eigen::VectorXd >; -template class LagrangeInterpolator< double, Eigen::Vector6d >; -template class LagrangeInterpolator< double, Eigen::MatrixXd >; +//template class LagrangeInterpolator< double, Eigen::VectorXd >; +//template class LagrangeInterpolator< double, Eigen::Vector6d >; +//template class LagrangeInterpolator< double, Eigen::MatrixXd >; } // namespace interpolators diff --git a/src/math/interpolators/linearInterpolator.cpp b/src/math/interpolators/linearInterpolator.cpp index 3dff417226..e65c585c3f 100644 --- a/src/math/interpolators/linearInterpolator.cpp +++ b/src/math/interpolators/linearInterpolator.cpp @@ -92,13 +92,13 @@ Eigen::VectorXd computeLinearInterpolation( * locationTargetIndependentVariableValueInInterval ); } -template class LinearInterpolator< double, Eigen::VectorXd >; -template class LinearInterpolator< double, Eigen::Vector6d >; -template class LinearInterpolator< double, Eigen::MatrixXd >; +//template class LinearInterpolator< double, Eigen::VectorXd >; +//template class LinearInterpolator< double, Eigen::Vector6d >; +//template class LinearInterpolator< double, Eigen::MatrixXd >; -template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, 1 > >; -template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, 6 > >; -template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, Eigen::Dynamic > >; +//template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, 1 > >; +//template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, 6 > >; +//template class LinearInterpolator< double, Eigen::Matrix< long double, Eigen::Dynamic, Eigen::Dynamic > >; } // namespace interpolators } // mamespace tudat diff --git a/src/math/interpolators/multiLinearInterpolator.cpp b/src/math/interpolators/multiLinearInterpolator.cpp index 0d17063006..bffc46b0be 100644 --- a/src/math/interpolators/multiLinearInterpolator.cpp +++ b/src/math/interpolators/multiLinearInterpolator.cpp @@ -5,11 +5,11 @@ namespace tudat namespace interpolators { -template class MultiLinearInterpolator< double, Eigen::Vector6d, 1 >; -template class MultiLinearInterpolator< double, Eigen::Vector6d, 2 >; -template class MultiLinearInterpolator< double, Eigen::Vector6d, 3 >; -template class MultiLinearInterpolator< double, Eigen::Vector6d, 4 >; -template class MultiLinearInterpolator< double, Eigen::Vector6d, 5 >; +//template class MultiLinearInterpolator< double, Eigen::Vector6d, 1 >; +//template class MultiLinearInterpolator< double, Eigen::Vector6d, 2 >; +//template class MultiLinearInterpolator< double, Eigen::Vector6d, 3 >; +//template class MultiLinearInterpolator< double, Eigen::Vector6d, 4 >; +//template class MultiLinearInterpolator< double, Eigen::Vector6d, 5 >; } // namespace interpolators } // namespace tudat diff --git a/src/simulation/estimation_setup/observationSimulationSettings.cpp b/src/simulation/estimation_setup/observationSimulationSettings.cpp index 1161e420cf..e84c17880e 100644 --- a/src/simulation/estimation_setup/observationSimulationSettings.cpp +++ b/src/simulation/estimation_setup/observationSimulationSettings.cpp @@ -55,9 +55,9 @@ Eigen::VectorXd getIdenticallyAndIndependentlyDistributedNoise( } -template class ObservationSimulationSettings< double >; -template class TabulatedObservationSimulationSettings< double >; -template class PerArcObservationSimulationSettings< double >; +//template class ObservationSimulationSettings< double >; +//template class TabulatedObservationSimulationSettings< double >; +//template class PerArcObservationSimulationSettings< double >; } diff --git a/src/simulation/estimation_setup/orbitDeterminationManager.cpp b/src/simulation/estimation_setup/orbitDeterminationManager.cpp index 8669f67539..c43fb02fd3 100644 --- a/src/simulation/estimation_setup/orbitDeterminationManager.cpp +++ b/src/simulation/estimation_setup/orbitDeterminationManager.cpp @@ -7,7 +7,7 @@ namespace simulation_setup { -template class OrbitDeterminationManager< double, double >; +//template class OrbitDeterminationManager< double, double >; } diff --git a/src/simulation/estimation_setup/variationalEquationsSolver.cpp b/src/simulation/estimation_setup/variationalEquationsSolver.cpp index dc4e81cd48..204c241d6a 100644 --- a/src/simulation/estimation_setup/variationalEquationsSolver.cpp +++ b/src/simulation/estimation_setup/variationalEquationsSolver.cpp @@ -16,24 +16,24 @@ namespace tudat namespace propagators { -template class SingleArcVariationalEquationsSolver< double, double >; -template class MultiArcVariationalEquationsSolver< double, double >; -template class HybridArcVariationalEquationsSolver< double, double >; +//template class SingleArcVariationalEquationsSolver< double, double >; +//template class MultiArcVariationalEquationsSolver< double, double >; +//template class HybridArcVariationalEquationsSolver< double, double >; -//template class VariationalEquationsSolver< double, double >; -//template class VariationalEquationsSolver< long double, double >; -//template class VariationalEquationsSolver< double, Time >; -//template class VariationalEquationsSolver< long double, Time >; +////template class VariationalEquationsSolver< double, double >; +////template class VariationalEquationsSolver< long double, double >; +////template class VariationalEquationsSolver< double, Time >; +////template class VariationalEquationsSolver< long double, Time >; -//template class SingleArcVariationalEquationsSolver< double, double >; -//template class SingleArcVariationalEquationsSolver< long double, double >; -//template class SingleArcVariationalEquationsSolver< double, Time >; -//template class SingleArcVariationalEquationsSolver< long double, Time >; +////template class SingleArcVariationalEquationsSolver< double, double >; +////template class SingleArcVariationalEquationsSolver< long double, double >; +////template class SingleArcVariationalEquationsSolver< double, Time >; +////template class SingleArcVariationalEquationsSolver< long double, Time >; -//template class MultiArcVariationalEquationsSolver< double, double >; -//template class MultiArcVariationalEquationsSolver< long double, double >; -//template class MultiArcVariationalEquationsSolver< double, Time >; -//template class MultiArcVariationalEquationsSolver< long double, Time >; +////template class MultiArcVariationalEquationsSolver< double, double >; +////template class MultiArcVariationalEquationsSolver< long double, double >; +////template class MultiArcVariationalEquationsSolver< double, Time >; +////template class MultiArcVariationalEquationsSolver< long double, Time >; //! Function to create interpolators for state transition and sensitivity matrices from numerical results. void createStateTransitionAndSensitivityMatrixInterpolator( diff --git a/src/simulation/propagation_setup/dynamicsSimulator.cpp b/src/simulation/propagation_setup/dynamicsSimulator.cpp index 4c2377bb75..e0c2a5af23 100644 --- a/src/simulation/propagation_setup/dynamicsSimulator.cpp +++ b/src/simulation/propagation_setup/dynamicsSimulator.cpp @@ -18,9 +18,9 @@ namespace tudat namespace propagators { -template class SingleArcDynamicsSimulator< double, double >; -template class MultiArcDynamicsSimulator< double, double >; -template class HybridArcDynamicsSimulator< double, double >; +//template class SingleArcDynamicsSimulator< double, double >; +//template class MultiArcDynamicsSimulator< double, double >; +//template class HybridArcDynamicsSimulator< double, double >; diff --git a/src/simulation/propagation_setup/environmentUpdater.cpp b/src/simulation/propagation_setup/environmentUpdater.cpp index ca0e5a1bd8..6e15378117 100644 --- a/src/simulation/propagation_setup/environmentUpdater.cpp +++ b/src/simulation/propagation_setup/environmentUpdater.cpp @@ -6,7 +6,7 @@ namespace tudat namespace propagators { -template class EnvironmentUpdater< double, double >; +//template class EnvironmentUpdater< double, double >; } // namespace propagators diff --git a/src/simulation/propagation_setup/propagationSettings.cpp b/src/simulation/propagation_setup/propagationSettings.cpp index fb9f7640b7..150ced2081 100644 --- a/src/simulation/propagation_setup/propagationSettings.cpp +++ b/src/simulation/propagation_setup/propagationSettings.cpp @@ -6,14 +6,14 @@ namespace tudat namespace propagators { -template class PropagatorSettings< double >; -template class SingleArcPropagatorSettings< double >; -template class MultiArcPropagatorSettings< double >; -template class TranslationalStatePropagatorSettings< double >; -template class RotationalStatePropagatorSettings< double >; -template class MassPropagatorSettings< double >; -template class CustomStatePropagatorSettings< double >; -template class MultiTypePropagatorSettings< double >; +//template class PropagatorSettings< double >; +//template class SingleArcPropagatorSettings< double >; +//template class MultiArcPropagatorSettings< double >; +//template class TranslationalStatePropagatorSettings< double >; +//template class RotationalStatePropagatorSettings< double >; +//template class MassPropagatorSettings< double >; +//template class CustomStatePropagatorSettings< double >; +//template class MultiTypePropagatorSettings< double >; //template std::map< IntegratedStateType, std::vector< std::pair< std::string, std::string > > > getIntegratedTypeAndBodyList< double >( diff --git a/tests/src/astro/ground_stations/unitTestTransmittingFrequencies.cpp b/tests/src/astro/ground_stations/unitTestTransmittingFrequencies.cpp index d0a8f36744..be4411e481 100644 --- a/tests/src/astro/ground_stations/unitTestTransmittingFrequencies.cpp +++ b/tests/src/astro/ground_stations/unitTestTransmittingFrequencies.cpp @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE( testPiecewiseLinearFrequencyInterpolator ) { errorThrown = true; } - // BOOST_CHECK( errorThrown ); + BOOST_CHECK( errorThrown ); // Check whether error is thrown for discontinuous start/end times startTimes.pop_back( ); @@ -116,24 +116,8 @@ BOOST_AUTO_TEST_CASE( testPiecewiseLinearFrequencyInterpolator ) { errorThrown = true; } - // BOOST_CHECK( errorThrown ); - - // Check whether error is thrown when accessing an invalid time block - startTimes.pop_back( ); - startTimes.push_back( 10.1 ); - frequencyInterpolator = PiecewiseLinearFrequencyInterpolator( - startTimes, endTimes, rampRates, startFrequency ); - frequencyInterpolator.template getTemplatedCurrentFrequency< >( 10.15 ); - try - { - frequencyInterpolator.template getTemplatedCurrentFrequency< >( 10.05 ); - errorThrown = false; - } - catch( std::runtime_error const& ) - { - errorThrown = true; - } - // BOOST_CHECK( errorThrown ); + BOOST_CHECK( errorThrown ); + } diff --git a/tests/src/astro/orbit_determination/observation_partials/CMakeLists.txt b/tests/src/astro/orbit_determination/observation_partials/CMakeLists.txt index 3e35853619..55b84e2d08 100644 --- a/tests/src/astro/orbit_determination/observation_partials/CMakeLists.txt +++ b/tests/src/astro/orbit_determination/observation_partials/CMakeLists.txt @@ -103,4 +103,4 @@ TUDAT_ADD_TEST_CASE(RelativePositionPartials PRIVATE_LINKS tudat_test_support ${Tudat_ESTIMATION_LIBRARIES} - ) \ No newline at end of file + ) diff --git a/tests/src/astro/orbit_determination/observation_partials/unitTestLightTimePartials.cpp b/tests/src/astro/orbit_determination/observation_partials/unitTestLightTimePartials.cpp index 6736c1c43a..27ce7111ef 100644 --- a/tests/src/astro/orbit_determination/observation_partials/unitTestLightTimePartials.cpp +++ b/tests/src/astro/orbit_determination/observation_partials/unitTestLightTimePartials.cpp @@ -93,162 +93,162 @@ BOOST_AUTO_TEST_CASE( testOneWayRangePartialsWrtLightTimeParameters ) std::shared_ptr< estimatable_parameters::EstimatableParameterSet< double > > parametersToEstimate = createParametersToEstimate( parameterSettings, bodies ); - // Create partial objects. - std::pair< SingleLinkObservationPartialList, std::shared_ptr< PositionPartialScaling > > partialList = - createSingleLinkObservationPartials< double, 1, double >( - oneWayRangeModel, bodies, parametersToEstimate ); - std::shared_ptr< PositionPartialScaling > positionPartialScaler = partialList.second; - - // Compute current observation and link end times/states - std::vector< double > linkEndTimes; - std::vector< Eigen::Matrix< double, 6, 1 > > linkEndStates; - double testTime = 1.1E7; - Eigen::VectorXd currentPositionObservation = - oneWayRangeModel->computeObservationsWithLinkEndData( testTime, transmitter, linkEndTimes, linkEndStates ); - - // Update position partial scaler for current observation - positionPartialScaler->update( linkEndStates, linkEndTimes, transmitter, currentPositionObservation ); - - - // Define numerical partial settings - std::vector< double > perturbations = { 1.0E16, 1.0E8 }; - std::vector< double > tolerances = { 1.0E-4, 10E-4 }; - - // Compute numerical partials for each parameter and compare to analytical result. - std::function< double( const double ) > observationFunction = std::bind( - &ObservationModel< 1, double, double >::computeObservationEntry, - oneWayRangeModel, std::placeholders::_1, transmitter, 0, nullptr ); - for( SingleLinkObservationPartialList::iterator partialIterator = partialList.first.begin( ); partialIterator != partialList.first.end( ); - partialIterator++ ) - { - // Compute total analytical partial - std::vector< std::pair< Eigen::Matrix< double, 1, Eigen::Dynamic >, double > > calculatedPartial = - partialIterator->second->calculatePartial( linkEndStates, linkEndTimes, transmitter ); - Eigen::Matrix< double, 1, Eigen::Dynamic > totalPartial = Eigen::Matrix< double, 1, Eigen::Dynamic >::Zero( 1, 1 ); - for( unsigned int j = 0; j < calculatedPartial.size( ); j++ ) - { - totalPartial += calculatedPartial.at( j ).first; - } - - // Compute numerical partial and compare to analytical result. - BOOST_CHECK_CLOSE_FRACTION( - calculateNumericalObservationParameterPartial( - parametersToEstimate->getDoubleParameters( )[ partialIterator->first.first ], - perturbations.at( partialIterator->first.first ), observationFunction, testTime ).x( ), totalPartial.x( ), - tolerances.at( partialIterator->first.first ) ); - } + // Create partial objects. + std::pair< SingleLinkObservationPartialList, std::shared_ptr< PositionPartialScaling > > partialList = + createSingleLinkObservationPartials< double, 1, double >( + oneWayRangeModel, bodies, parametersToEstimate ); + std::shared_ptr< PositionPartialScaling > positionPartialScaler = partialList.second; + + // Compute current observation and link end times/states + std::vector< double > linkEndTimes; + std::vector< Eigen::Matrix< double, 6, 1 > > linkEndStates; + double testTime = 1.1E7; + Eigen::VectorXd currentPositionObservation = + oneWayRangeModel->computeObservationsWithLinkEndData( testTime, transmitter, linkEndTimes, linkEndStates ); + + // Update position partial scaler for current observation + positionPartialScaler->update( linkEndStates, linkEndTimes, transmitter, currentPositionObservation ); + + + // Define numerical partial settings + std::vector< double > perturbations = { 1.0E16, 1.0E8 }; + std::vector< double > tolerances = { 1.0E-4, 10E-4 }; + + // Compute numerical partials for each parameter and compare to analytical result. + std::function< double( const double ) > observationFunction = std::bind( + &ObservationModel< 1, double, double >::computeObservationEntry, + oneWayRangeModel, std::placeholders::_1, transmitter, 0, nullptr ); + for( SingleLinkObservationPartialList::iterator partialIterator = partialList.first.begin( ); partialIterator != partialList.first.end( ); + partialIterator++ ) + { + // Compute total analytical partial + std::vector< std::pair< Eigen::Matrix< double, 1, Eigen::Dynamic >, double > > calculatedPartial = + partialIterator->second->calculatePartial( linkEndStates, linkEndTimes, transmitter ); + Eigen::Matrix< double, 1, Eigen::Dynamic > totalPartial = Eigen::Matrix< double, 1, Eigen::Dynamic >::Zero( 1, 1 ); + for( unsigned int j = 0; j < calculatedPartial.size( ); j++ ) + { + totalPartial += calculatedPartial.at( j ).first; + } + + // Compute numerical partial and compare to analytical result. + BOOST_CHECK_CLOSE_FRACTION( + calculateNumericalObservationParameterPartial( + parametersToEstimate->getDoubleParameters( )[ partialIterator->first.first ], + perturbations.at( partialIterator->first.first ), observationFunction, testTime ).x( ), totalPartial.x( ), + tolerances.at( partialIterator->first.first ) ); + } } - { - - // Define and create ground stations. - std::vector< std::pair< std::string, std::string > > groundStations; - groundStations.resize( 2 ); - groundStations[ 0 ] = std::make_pair( "Earth", "Graz" ); - groundStations[ 1 ] = std::make_pair( "Mars", "MSL" ); - - // Create environment - SystemOfBodies bodies = setupEnvironment( groundStations, 1.0E7, 1.2E7, 1.65E7 ); - - - // Set link ends for observation model - LinkEnds linkEnds; - linkEnds[ transmitter ] = groundStations[ 1 ]; - linkEnds[ receiver ] = groundStations[ 0 ]; - - // Generate one-way range model - std::vector< std::shared_ptr< LightTimeCorrectionSettings > > lightTimeCorrections; - std::vector< std::string > perturbingBodyList = { "Earth", "Sun" }; - lightTimeCorrections.push_back( std::make_shared< FirstOrderRelativisticLightTimeCorrectionSettings >( - perturbingBodyList ) ); - std::shared_ptr< ObservationModelSettings > observationSettings = std::make_shared< - ObservationModelSettings >( one_way_range, linkEnds, lightTimeCorrections ); - std::shared_ptr< ObservationModel< 1 > > oneWayRangeModel = - observation_models::ObservationModelCreator< 1, double, double >::createObservationModel( - observationSettings, bodies ); - - // Create parameter objects. - std::vector< std::shared_ptr< EstimatableParameterSettings > > parameterNames; - parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Sun", gravitational_parameter ) ); - parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Earth", gravitational_parameter ) ); - parameterNames.push_back( std::make_shared< estimatable_parameters::EstimatableParameterSettings >( - "global_metric", ppn_parameter_gamma ) ); - parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Mars", gravitational_parameter ) ); - std::shared_ptr< estimatable_parameters::EstimatableParameterSet< double > > parametersToEstimate = - createParametersToEstimate< double >( parameterNames, bodies ); - std::vector< std::shared_ptr< EstimatableParameter< double > > > doubleParameterVector = - parametersToEstimate->getEstimatedDoubleParameters( ); - - // Create observation partials. - std::pair< std::map< std::pair< int, int >, std::shared_ptr< ObservationPartial< 1 > > >, - std::shared_ptr< PositionPartialScaling > > fullAnalyticalPartialSet = - ObservationPartialCreator<1, double, double>::createObservationPartials( - oneWayRangeModel, bodies, parametersToEstimate ); - - - - std::shared_ptr< PositionPartialScaling > positionPartialScaler = fullAnalyticalPartialSet.second; - - // Compute partials for each refernce link end. - for( LinkEnds::const_iterator linkEndIterator = linkEnds.begin( ); linkEndIterator != linkEnds.end( ); - linkEndIterator++ ) - { - // Evaluate nominal observation values - std::vector< Eigen::Vector6d > vectorOfStates; - std::vector< double > vectorOfTimes; - double observationTime = 1.1E7; - Eigen::VectorXd currentRangeObservation = oneWayRangeModel->computeObservationsWithLinkEndData( - observationTime, linkEndIterator->first, vectorOfTimes, vectorOfStates ); - - // Calculate analytical observation partials. - positionPartialScaler->update( vectorOfStates, vectorOfTimes, static_cast< LinkEndType >( linkEndIterator->first ), - currentRangeObservation ); - typedef std::vector< std::pair< Eigen::Matrix< double, 1, Eigen::Dynamic >, double > > ObservationPartialReturnType; - std::vector< ObservationPartialReturnType > analyticalObservationPartials = - calculateAnalyticalPartials( - fullAnalyticalPartialSet.first, vectorOfStates, vectorOfTimes, linkEndIterator->first ); - - // Test evaliuuation time of partials - for( unsigned int i = 0; i < analyticalObservationPartials.size( ); i++ ) - { - for( unsigned int j = 0; j < analyticalObservationPartials.at( i ).size( ); j++ ) - { - BOOST_CHECK_CLOSE_FRACTION( analyticalObservationPartials.at( i ).at( j ).second, - ( vectorOfTimes.at( 0 ) + vectorOfTimes.at( 1 ) ) / 2.0, - std::numeric_limits< double >::epsilon( ) ); - } - - } - - // Settings for body state partials - std::function< Eigen::VectorXd( const double ) > observationFunction = std::bind( - &ObservationModel< 1, double, double >::computeObservations, oneWayRangeModel, std::placeholders::_1, - linkEndIterator->first, nullptr ); - - // Settings for parameter partial functions. - std::vector< double > parameterPerturbations = { 1.0E19, 1.0E16, 1.0E15, 1.0E8 }; - std::vector< std::function< void( ) > > updateFunctionList; - updateFunctionList.push_back( emptyVoidFunction ); - updateFunctionList.push_back( emptyVoidFunction ); - updateFunctionList.push_back( emptyVoidFunction ); - updateFunctionList.push_back( emptyVoidFunction ); - - // Calculate and test analytical against numerical partials. - std::vector< Eigen::VectorXd > numericalPartialsWrtDoubleParameters = calculateNumericalPartialsWrtDoubleParameters( - doubleParameterVector, updateFunctionList, parameterPerturbations, observationFunction, observationTime ); - - // Compare analytical and numerical partials - for( unsigned int i = 0; i < analyticalObservationPartials.size( ); i++ ) - { + { + + // Define and create ground stations. + std::vector< std::pair< std::string, std::string > > groundStations; + groundStations.resize( 2 ); + groundStations[ 0 ] = std::make_pair( "Earth", "Graz" ); + groundStations[ 1 ] = std::make_pair( "Mars", "MSL" ); + + // Create environment + SystemOfBodies bodies = setupEnvironment( groundStations, 1.0E7, 1.2E7, 1.65E7 ); + + + // Set link ends for observation model + LinkEnds linkEnds; + linkEnds[ transmitter ] = groundStations[ 1 ]; + linkEnds[ receiver ] = groundStations[ 0 ]; + + // Generate one-way range model + std::vector< std::shared_ptr< LightTimeCorrectionSettings > > lightTimeCorrections; + std::vector< std::string > perturbingBodyList = { "Earth", "Sun" }; + lightTimeCorrections.push_back( std::make_shared< FirstOrderRelativisticLightTimeCorrectionSettings >( + perturbingBodyList ) ); + std::shared_ptr< ObservationModelSettings > observationSettings = std::make_shared< + ObservationModelSettings >( one_way_range, linkEnds, lightTimeCorrections ); + std::shared_ptr< ObservationModel< 1 > > oneWayRangeModel = + observation_models::ObservationModelCreator< 1, double, double >::createObservationModel( + observationSettings, bodies ); + + // Create parameter objects. + std::vector< std::shared_ptr< EstimatableParameterSettings > > parameterNames; + parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Sun", gravitational_parameter ) ); + parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Earth", gravitational_parameter ) ); + parameterNames.push_back( std::make_shared< estimatable_parameters::EstimatableParameterSettings >( + "global_metric", ppn_parameter_gamma ) ); + parameterNames.push_back( std::make_shared< EstimatableParameterSettings >( "Mars", gravitational_parameter ) ); + std::shared_ptr< estimatable_parameters::EstimatableParameterSet< double > > parametersToEstimate = + createParametersToEstimate< double >( parameterNames, bodies ); + std::vector< std::shared_ptr< EstimatableParameter< double > > > doubleParameterVector = + parametersToEstimate->getEstimatedDoubleParameters( ); + + // Create observation partials. + std::pair< std::map< std::pair< int, int >, std::shared_ptr< ObservationPartial< 1 > > >, + std::shared_ptr< PositionPartialScaling > > fullAnalyticalPartialSet = + ObservationPartialCreator<1, double, double>::createObservationPartials( + oneWayRangeModel, bodies, parametersToEstimate ); - double currentParameterPartial = 0.0; - for( unsigned int j = 0; j < analyticalObservationPartials.at( i ).size( ); j++ ) - { - currentParameterPartial += analyticalObservationPartials.at( i ).at( j ).first.x( ); - } - BOOST_CHECK_CLOSE_FRACTION( currentParameterPartial, numericalPartialsWrtDoubleParameters.at( i ).x( ), 1.0E-4 ); + std::shared_ptr< PositionPartialScaling > positionPartialScaler = fullAnalyticalPartialSet.second; + + // Compute partials for each refernce link end. + for( LinkEnds::const_iterator linkEndIterator = linkEnds.begin( ); linkEndIterator != linkEnds.end( ); + linkEndIterator++ ) + { + // Evaluate nominal observation values + std::vector< Eigen::Vector6d > vectorOfStates; + std::vector< double > vectorOfTimes; + double observationTime = 1.1E7; + Eigen::VectorXd currentRangeObservation = oneWayRangeModel->computeObservationsWithLinkEndData( + observationTime, linkEndIterator->first, vectorOfTimes, vectorOfStates ); + + // Calculate analytical observation partials. + positionPartialScaler->update( vectorOfStates, vectorOfTimes, static_cast< LinkEndType >( linkEndIterator->first ), + currentRangeObservation ); + typedef std::vector< std::pair< Eigen::Matrix< double, 1, Eigen::Dynamic >, double > > ObservationPartialReturnType; + std::vector< ObservationPartialReturnType > analyticalObservationPartials = + calculateAnalyticalPartials( + fullAnalyticalPartialSet.first, vectorOfStates, vectorOfTimes, linkEndIterator->first ); + + // Test evaliuuation time of partials + for( unsigned int i = 0; i < analyticalObservationPartials.size( ); i++ ) + { + for( unsigned int j = 0; j < analyticalObservationPartials.at( i ).size( ); j++ ) + { + BOOST_CHECK_CLOSE_FRACTION( analyticalObservationPartials.at( i ).at( j ).second, + ( vectorOfTimes.at( 0 ) + vectorOfTimes.at( 1 ) ) / 2.0, + std::numeric_limits< double >::epsilon( ) ); + } + + } + + // Settings for body state partials + std::function< Eigen::VectorXd( const double ) > observationFunction = std::bind( + &ObservationModel< 1, double, double >::computeObservations, oneWayRangeModel, std::placeholders::_1, + linkEndIterator->first, nullptr ); + + // Settings for parameter partial functions. + std::vector< double > parameterPerturbations = { 1.0E19, 1.0E16, 1.0E15, 1.0E8 }; + std::vector< std::function< void( ) > > updateFunctionList; + updateFunctionList.push_back( emptyVoidFunction ); + updateFunctionList.push_back( emptyVoidFunction ); + updateFunctionList.push_back( emptyVoidFunction ); + updateFunctionList.push_back( emptyVoidFunction ); + + // Calculate and test analytical against numerical partials. + std::vector< Eigen::VectorXd > numericalPartialsWrtDoubleParameters = calculateNumericalPartialsWrtDoubleParameters( + doubleParameterVector, updateFunctionList, parameterPerturbations, observationFunction, observationTime ); + + // Compare analytical and numerical partials + for( unsigned int i = 0; i < analyticalObservationPartials.size( ); i++ ) + { + + double currentParameterPartial = 0.0; + for( unsigned int j = 0; j < analyticalObservationPartials.at( i ).size( ); j++ ) + { + currentParameterPartial += analyticalObservationPartials.at( i ).at( j ).first.x( ); + + } + + BOOST_CHECK_CLOSE_FRACTION( currentParameterPartial, numericalPartialsWrtDoubleParameters.at( i ).x( ), 1.0E-4 ); } BOOST_CHECK_EQUAL( numericalPartialsWrtDoubleParameters[ 3 ].x( ), 0.0 ); diff --git a/version b/version index 8f6a4c6a84..75ee565499 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.13.0.dev35 +2.13.0.dev41