Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed extern templates #261

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/tudat/astro/basic_astro/accelerationModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions include/tudat/astro/basic_astro/accelerationModelTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion include/tudat/astro/gravitation/centralGravityModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down
55 changes: 54 additions & 1 deletion include/tudat/astro/gravitation/polyhedronGravityModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion include/tudat/astro/gravitation/ringGravityModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions include/tudat/astro/observation_models/observationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;

}

Expand Down
10 changes: 5 additions & 5 deletions include/tudat/astro/observation_models/observationModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,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
/*!
Expand Down
10 changes: 5 additions & 5 deletions include/tudat/astro/orbit_determination/podInputOutputTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class NBodyCowellStateDerivative: public NBodyStateDerivative< StateScalarType,

};

extern template class NBodyCowellStateDerivative< double, double >;
//extern template class NBodyCowellStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class NBodyEnckeStateDerivative: public NBodyStateDerivative< StateScalarType, T

};

extern template class NBodyEnckeStateDerivative< double, double >;
//extern template class NBodyEnckeStateDerivative< double, double >;


} // namespace propagators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class NBodyGaussKeplerStateDerivative: public NBodyStateDerivative< StateScalarT

};

extern template class NBodyGaussKeplerStateDerivative< double, double >;
//extern template class NBodyGaussKeplerStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class NBodyGaussModifiedEquinictialStateDerivative: public NBodyStateDerivative<

};

extern template class NBodyGaussModifiedEquinictialStateDerivative< double, double >;
//extern template class NBodyGaussModifiedEquinictialStateDerivative< double, double >;

} // namespace propagators

Expand Down
2 changes: 1 addition & 1 deletion include/tudat/astro/propagators/nBodyStateDerivative.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ class NBodyStateDerivative: public propagators::SingleStateTypeDerivative< State

};

extern template class NBodyStateDerivative< double, double >;
//extern template class NBodyStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class NBodyUnifiedStateModelExponentialMapStateDerivative: public NBodyStateDeri

};

extern template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >;
//extern template class NBodyUnifiedStateModelExponentialMapStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative: public N

};

extern template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >;
//extern template class NBodyUnifiedStateModelModifiedRodriguesParametersStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class NBodyUnifiedStateModelQuaternionsStateDerivative: public NBodyStateDerivat
};


extern template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >;
//extern template class NBodyUnifiedStateModelQuaternionsStateDerivative< double, double >;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class RotationalMotionExponentialMapStateDerivative: public RotationalMotionStat

};

extern template class RotationalMotionExponentialMapStateDerivative< double, double >;
//extern template class RotationalMotionExponentialMapStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class RotationalMotionModifiedRodriguesParametersStateDerivative: public Rotatio

};

extern template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >;
//extern template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class RotationalMotionQuaternionsStateDerivative: public RotationalMotionStateDe
};


extern template class RotationalMotionQuaternionsStateDerivative< double, double >;
//extern template class RotationalMotionQuaternionsStateDerivative< double, double >;

} // namespace propagators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class RotationalMotionStateDerivative: public propagators::SingleStateTypeDeriva
};


extern template class RotationalMotionStateDerivative< double, double >;
//extern template class RotationalMotionStateDerivative< double, double >;


} // namespace propagators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading