Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r1368 -r1371 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1368) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1371) @@ -154,6 +154,7 @@ { // During the design calculation the location.SurfaceLine is adapted; so store a copy to restore it after the calculation Location location = damKernelInput.Location; + SoilGeometryProbability subSoilScenario = damKernelInput.SubSoilScenario; SurfaceLine2 orgLocationSurfaceLine = location.SurfaceLine.FullDeepClone(); try { @@ -167,7 +168,7 @@ // Redesign the surfaceline to the desired Dike Tabel Height var surfaceLineHeightAdapter = new SurfaceLineHeightAdapter(location.SurfaceLine, location); SurfaceLine2 adaptedSurfaceLine = surfaceLineHeightAdapter.ConstructNewSurfaceLine(designScenario.DikeTableHeight ?? location.SurfaceLine.GetDefaultDikeTableHeight() ?? 0); - location.SurfaceLine = adaptedSurfaceLine; + designScenario.SetRedesignedSurfaceLine(subSoilScenario.SoilProfile1D, subSoilScenario.StiFileName, adaptedSurfaceLine); } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1349 -r1371 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1349) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1371) @@ -570,16 +570,24 @@ if (iterationIndex < 1) { // In the first prepareDesign, the initial geometry filename is determined and should be stored in the embankmentDesignParameters + // In the first iteration (height adaption), the embankment material is DikeEmbankmentMaterial embankmentDesignParameters = new EmbankmentDesignParameters() { - EmbankmentMaterialname = location.ShoulderEmbankmentMaterial, + EmbankmentMaterialname = location.DikeEmbankmentMaterial, PreviousGeometry2DFilename = mstabProjectFilename }; FailureMechanismParametersMStab.EmbankmentDesignParameters = embankmentDesignParameters; embankmentDesignParametersForCreatingMstabFile = null; } else { + // Iteration 1 = initial geometry + // Iteration 2 = height adaption + // The following iterations are shoulder/slope adjustement): the embankment material is ShoulderEmbankmentMaterial + if (iterationIndex == 3) + { + FailureMechanismParametersMStab.EmbankmentDesignParameters.EmbankmentMaterialname = location.ShoulderEmbankmentMaterial; + } // In the following prepareDesign calls just return the stored embankmentDesignParameters embankmentDesignParameters = FailureMechanismParametersMStab.EmbankmentDesignParameters; embankmentDesignParametersForCreatingMstabFile = embankmentDesignParameters; @@ -605,6 +613,11 @@ { throw new MacroStabilityException(Resources.DamMacroStabilityKernelWrapper_CannotCreateInitialGeometryFile); } + if (iterationIndex == 2) + { + // The height adapted geometry should be the previous geometry when doing shoulder/slope adaption + FailureMechanismParametersMStab.EmbankmentDesignParameters.PreviousGeometry2DFilename = mstabProjectFilename; + } } private DesignResult NewDesignResult(DamKernelInput damKernelInput, DesignScenario designScenario, DamMacroStabilityOutputItem macroStabilityOutputItem) Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs =================================================================== diff -u -r1363 -r1371 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 1363) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 1371) @@ -71,7 +71,7 @@ EmbankmentDesignParameters embankmentDesignParameters; kernelWrapper.PrepareDesign(kernelDataInput, kernelDataOutput, damKernelInput, iterationIndex, out embankmentDesignParameters); SurfaceLine2 surfaceLine = designScenario.GetMostRecentSurfaceLine(subSoilScenario.SoilProfile1D, subSoilScenario.StiFileName).FullDeepClone(); - // During the calculation the location.SurfaceLine is adapted; so store a copy to restor it after the calculation + // During the calculation the location.SurfaceLine is adapted; so store a copy to restore it after the calculation SurfaceLine2 orgLocationSurfaceLine = location.SurfaceLine.FullDeepClone(); try {