We're updating the issue view to help you get more done. 

OptimalControlFunction objects in UserPointFunctionManager are not reinitialized for mesh refinement


The list of OptimalControlFunction objects that UserPointFunctionManager uses for sparsity and Jacobian calculations are not reinitialized when mesh refinement happens. This led to UserPointFunctionManager using its finite differencing rather than OptimalControlFunction's numjac method. The numjac method should be used instead as it is more robust.

[JJR] Determine Root cause: The object vector optControlFuncVec in UserPointObjectManager is not reinitialized after mesh refinement has happened, leaving it empty

[JJR] Identify Scope of change (can include any or all of Reqts, functional spec, UI spec, code, test cases, documentation – either new or updated)

  • The optControlFuncVec parameter will be reinitialized with the OptimalControlFunction objects that UserPointFunction has, tests will be updated as Jacobian values will have changed slightly causing changes to numeric solutions

[JJR] Edit list of items to be changed under heading "implement fix"

Implement fix - delete any row that doesn't apply, add identifying information where needed

[JJR] Requirements

  • N/A

[JJR] Functional specification(s) – list all features that change

  • N/A

[JJR] User Interface Specification

  • N/A

[JJR] Code – list all files that change

  • UserPointFunctionManager.cpp

[JJR] Test case(s) -list each case modified

  • CelestialBodyRendezvous_Venus

  • CustomLinkageConstraint_SeparatedLinkages_TwoPhases_NoRefinement_Local_WithMass

  • CustomLinkageConstraint_TwoPhases_NoRefinement_Local_WithMass

  • EMTGSpacecraft_SCOpt_BusPowerType0

  • EMTGSpacecraft_SCOpt_BusPowerType1

  • EMTGSpacecraft_SCOpt_PowerSupplyCurve1

  • EMTGSpacecraft_SCOpt_ThrottleTable_Empty_Prop_Mode_ConstThrustIsp

  • EMTGSpacecraft_SCOpt_ThrottleTable_File_Prop_Mode_ConstThrustIsp

  • EMTGSpacecraft_SCOpt_ThrottleTable_None_Prop_Mode_ConstThrustIsp

  • EMTGSpacecraft_SCOpt_ThrottleTable_None_Prop_Mode_Poly1D

  • EMTGSpacecraft_SCOpt_ThrottleTableEmpty

  • EMTGSpacecraft_SCOpt_ThrustType0

  • EMTGSpacecraft_SCOpt_ThrustType1

  • EMTGSpacecraft_SCOpt_ThrustType3

  • EMTGSpacecraft_SCOpt_ThrustType4

  • EMTGSpacecraft_SCOpt_ThrustType5

  • EMTGSpacecraft_StageListTooLong

  • EMTGSpacecraft_StageListTooShort

  • OCPropTest_Jupiter_AllPlanets_SRP

  • OCPropTest_LUNA_LP165

  • OCPropTest_LUNA_LP165P_SRP

  • Phase_Bound_EpochLowerBound

  • Phase_Bound_Epochs

  • Phase_Bounds_ControlMagLower

  • Phase_Bounds_ControlMagUpper

  • Phase_BuiltInCost_MaxTotalMass

  • Phase_EpochFormat_TAIGregorian

  • Phase_MaxRelativeErrorTolerance_IRK_Tight

  • Phase_MaxRelativeErrorTolerance_Radau_Loose

  • Phase_MaxRelativeErrorTolerance_Radau_Tight

  • Phase_PointsPerSubPhase_ImplicitRKOrder6

  • Phase_PointsPerSubPhase_Radau

  • Phase_Type_HermiteSimpson

  • Phase_Type_ImplicitRKOrder4

  • Phase_Type_ImplicitRKOrder6

  • Phase_Type_ImplicitRKOrder8

  • Phase_Type_Radau

  • RHS_System_RHS_In_CommandMode

  • Trajectory_System_GuessSource

  • Trajectory_System_GuessSource_PhaseNoTraj

  • Trajectory_System_GuessSource_TrajNoPhase

  • Trajectory_System_MassScaleFactor

  • Trajectory_System_MeshGuessMode_BestAnyMesh

  • Trajectory_System_MeshGuessMode_BestMostRecentMesh

  • Trajectory_System_MeshGuessMode_Curr

  • Trajectory_System_OptimizationMode

  • Trajectory_System_OutputCoordSys

  • Trajectory_System_SolnFname_Undeclared

  • Trajectory_System_SolutionFile_ExitConditions

  • Trajectory_System_SolutionFile_FeasibleSolution

  • Trajectory_System_SolutionFile_SmallestFeasibilityMetricSolution

  • Trajectory_System_StateScaleMode

  • Trajectory_System_TotalIterationsLimits_Long

  • IntegratedFlyby_MarsFlyby

  • IntegratedFlyby_VenusFlyby

  • RHS_System_RHS_In_ObjectMode

  • RHS_System_StandAloneNumber

[JJR] Documentation – list any other affected document (e.g., User Guide, Mathematical Specification, Architecture Specification)

  • N/A

Test fix - delete any that don't apply, smoke test is mandatory

[JJR] Unit test corrections

[JJR] Script test

[JJR] Smoke Test




Joshua Raymond
November 3, 2020, 7:51 PM

11/3/20: Tests updated on Windows for bug fix. Branch with fix has been sent to DJC and WS to get Mac and Linux test results to update truth files.

Joshua Raymond
November 10, 2020, 7:44 PM

11/10/20: I have received the test results from DJC and WS. The plan is to have the truth updates ready on 11/12 and send a new rundef out to make sure these updates also work for the dependency mapping changes made to OptimalControlFunction.

Joshua Raymond
November 17, 2020, 7:44 PM

11/17/20: Awaiting confirmation that test updates are synced so a rundef can be sent out to rerun tests and make sure they pass on Mac and Linux.


Joshua Raymond


Joshua Raymond


Development Build



Fix versions

Affects versions