Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs =================================================================== diff -u -r5523 -r5534 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 5523) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityInwardsTests.cs (.../MacroStabilityInwardsTests.cs) (revision 5534) @@ -964,10 +964,10 @@ }); } - [TestCase("DWP_1", "SlopeAdaptionBeforeShoulderAdaption", CalculationResult.Succeeded, 1.4, 1.476, 5)] - [TestCase("DWP_1", "OptimizedSlopeAndShoulderAdaption",CalculationResult.Succeeded, 1.4, 1.581, 4)] - [TestCase("DWP_2", "SlopeAdaptionBeforeShoulderAdaption", CalculationResult.RunFailed, 1.5, 1.365, 14)] - [TestCase("DWP_2", "OptimizedSlopeAndShoulderAdaption", CalculationResult.RunFailed, 1.5, 1.113, 17)] + [TestCase("DWP_1", "SlopeAdaptionBeforeShoulderAdaption", CalculationResult.Succeeded, 1.4, 1.539, 5)] + [TestCase("DWP_1", "OptimizedSlopeAndShoulderAdaption",CalculationResult.Succeeded, 1.4, 1.589, 4)] + [TestCase("DWP_2", "SlopeAdaptionBeforeShoulderAdaption", CalculationResult.RunFailed, 1.5, 1.364, 14)] + [TestCase("DWP_2", "OptimizedSlopeAndShoulderAdaption", CalculationResult.RunFailed, 1.5, 1.114, 17)] public void GivenTutorialDesign_WhenSpecifiedLocationRunWithGeometryAdaption_ThenGivesExpectedResults(string locationId, string designMethod, CalculationResult calculationResult, double requiredSafetyFactor, double actualSafetyFactor, int iterationCount) { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r5466 -r5534 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 5466) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 5534) @@ -270,6 +270,7 @@ { orgLocationSurfaceLine = AdaptSurfaceLineWhenNeededForDesign(location, analysisType, damKernelInput); damKernelInput.CurrentEmbankmentSoil = location.GetDikeEmbankmentSoil(); + damKernelInput.OriginalSoilProfile2D = damKernelInput.SubSoilScenario.SoilProfile2D.Clone(); PrepareResult prepareResult = kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs =================================================================== diff -u -r5466 -r5534 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 5466) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 5534) @@ -103,4 +103,10 @@ /// The current embankment soil. /// public Soil CurrentEmbankmentSoil { get; set; } + + /// + /// Gets or sets the original soil profile 2D. + /// Used during the design process to restore the original soil profile 2D. + /// + public SoilProfile2D OriginalSoilProfile2D { get; set; } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs =================================================================== diff -u -r5471 -r5534 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 5471) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 5534) @@ -108,12 +108,11 @@ double maxFractionOfDikeHeightForShoulderHeight = location.UseNewMaxHeightShoulderAsFraction ? location.NewMaxHeightShoulderAsFraction : defaultMaxFractionOfDikeHeightForShoulderHeight; double maxShoulderLevel = DesignCalculatorUtils.CalculateMaximumShoulderLevel(surfaceLine, maxFractionOfDikeHeightForShoulderHeight); - var orgSoilProfile2D = damKernelInput.SubSoilScenario.SoilProfile2D.Clone(); - damKernelInput.CurrentEmbankmentSoil = location.GetDikeEmbankmentSoil(); + damKernelInput.CurrentEmbankmentSoil = location.GetShoulderEmbankmentSoil(); while (isRedesignRequired && surfaceLine != null) { // Always start with the original soil profile - damKernelInput.SubSoilScenario.SoilProfile2D = orgSoilProfile2D; + damKernelInput.SubSoilScenario.SoilProfile2D = damKernelInput.OriginalSoilProfile2D; iterationIndex++; DesignCalculatorUtils.ThrowWhenMaxIterationsExceeded(iterationIndex, maxRedesignIterations); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorFirstSlopeAdaptionThenShoulderAdaption.cs =================================================================== diff -u -r5466 -r5534 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorFirstSlopeAdaptionThenShoulderAdaption.cs (.../DesignCalculatorFirstSlopeAdaptionThenShoulderAdaption.cs) (revision 5466) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorFirstSlopeAdaptionThenShoulderAdaption.cs (.../DesignCalculatorFirstSlopeAdaptionThenShoulderAdaption.cs) (revision 5534) @@ -80,7 +80,7 @@ } surfaceLine = surfaceLine.FullDeepClone(); - damKernelInput.CurrentEmbankmentSoil = location.GetDikeEmbankmentSoil(); + damKernelInput.CurrentEmbankmentSoil = location.GetShoulderEmbankmentSoil(); try { iterationIndex = 1; @@ -117,11 +117,10 @@ } // Design for slope adaption - var orgSoilProfile2D = damKernelInput.SubSoilScenario.SoilProfile2D.Clone(); while (isRedesignRequired && (coTangent < endCoTangent)) { // Always start with the original soil profile - damKernelInput.SubSoilScenario.SoilProfile2D = orgSoilProfile2D; + damKernelInput.SubSoilScenario.SoilProfile2D = damKernelInput.OriginalSoilProfile2D; iterationIndex++; DesignCalculatorUtils.ThrowWhenMaxIterationsExceeded(iterationIndex, maxRedesignIterations); @@ -151,12 +150,10 @@ } // Then shoulder adaption - orgSoilProfile2D = damKernelInput.SubSoilScenario.SoilProfile2D.Clone(); - damKernelInput.CurrentEmbankmentSoil = location.GetShoulderEmbankmentSoil(); while (isRedesignRequired && surfaceLine != null) { // Always start with the original soil profile - damKernelInput.SubSoilScenario.SoilProfile2D = orgSoilProfile2D; + damKernelInput.SubSoilScenario.SoilProfile2D = damKernelInput.OriginalSoilProfile2D; iterationIndex++; DesignCalculatorUtils.ThrowWhenMaxIterationsExceeded(iterationIndex, maxRedesignIterations);