Skip to content

Commit

Permalink
Corrected memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Apr 13, 2024
1 parent bd3c6f8 commit 6afd96d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
10 changes: 4 additions & 6 deletions include/tudat/math/interpolators/oneDimensionalInterpolator.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,15 @@ class OneDimensionalInterpolator : public Interpolator< IndependentVariableType,
case binarySearch:
{
// Create binary search look up scheme.
lookUpScheme_ = std::shared_ptr< LookUpScheme< IndependentVariableType > >
( new BinarySearchLookupScheme< IndependentVariableType >
( independentValues_ ) );
lookUpScheme_ = std::make_shared< BinarySearchLookupScheme< IndependentVariableType > >
( independentValues_ );
break;
}
case huntingAlgorithm:
{
// Create hunting scheme, which uses an intial guess from previous look-ups.
lookUpScheme_ = std::shared_ptr< LookUpScheme< IndependentVariableType > >
( new HuntingAlgorithmLookupScheme< IndependentVariableType >
( independentValues_ ) );
lookUpScheme_ = std::make_shared< HuntingAlgorithmLookupScheme< IndependentVariableType > >
( independentValues_ );
break;
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ executeHybridArcMarsAndOrbiterSensitivitySimulation(
double radiationPressureCoefficient = 1.2;
std::vector< std::string > occultingBodies;
occultingBodies.push_back( "Earth" );
std::shared_ptr< RadiationPressureInterfaceSettings > orbiterRadiationPressureSettings =
std::make_shared< CannonBallRadiationPressureInterfaceSettings >(
"Sun", referenceAreaRadiation, radiationPressureCoefficient, occultingBodies );
std::shared_ptr< RadiationPressureTargetModelSettings > orbiterRadiationPressureSettings =
cannonballRadiationPressureTargetModelSettings(
referenceAreaRadiation, radiationPressureCoefficient, occultingBodies );

// Create and set radiation pressure settings
bodies.at( "Orbiter" )->setRadiationPressureInterface(
"Sun", createRadiationPressureInterface(
orbiterRadiationPressureSettings, "Orbiter", bodies ) );

bodies.at( "Orbiter" )->setRadiationPressureTargetModel(
createRadiationPressureTargetModel( orbiterRadiationPressureSettings, "Orbiter", bodies ) );


// Set accelerations between bodies that are to be taken into account.
Expand Down Expand Up @@ -141,7 +139,7 @@ executeHybridArcMarsAndOrbiterSensitivitySimulation(
std::map< std::string, std::vector< std::shared_ptr< AccelerationSettings > > > accelerationsOfOrbiter;
accelerationsOfOrbiter[ "Mars" ].push_back( std::make_shared< SphericalHarmonicAccelerationSettings >( 2, 2 ) );
accelerationsOfOrbiter[ "Sun" ].push_back( std::make_shared< AccelerationSettings >( point_mass_gravity ) );
accelerationsOfOrbiter[ "Sun" ].push_back( std::make_shared< AccelerationSettings >( cannon_ball_radiation_pressure ) );
accelerationsOfOrbiter[ "Sun" ].push_back( std::make_shared< AccelerationSettings >( radiation_pressure ) );
accelerationsOfOrbiter[ "Jupiter" ].push_back( std::make_shared< AccelerationSettings >( point_mass_gravity ) );
multiArcAccelerationMap[ "Orbiter" ] = accelerationsOfOrbiter;

Expand Down

0 comments on commit 6afd96d

Please sign in to comment.