Index: dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs =================================================================== diff -u -r758 -r789 --- dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 758) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 789) @@ -749,5 +749,35 @@ return translationTable[soilDilatancyType]; } + /// + /// Converts the input StabilityDesignMethod to the Dam StabilityDesignMethod. + /// + /// The stability design method. + /// + public static StabilityDesignMethod ConvertToDamStabilityDesignMethod(LocationDesignOptionsStabilityDesignMethod stabilityDesignMethod) + { + var translationTable = new Dictionary() + { + {LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption}, + {LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption} + }; + return translationTable[stabilityDesignMethod]; + } + + /// + /// Converts the Dam StabilityDesignMethod to the input StabilityDesignMethod. + /// + /// The stability design method. + /// + public static LocationDesignOptionsStabilityDesignMethod ConvertToInputStabilityDesignMethod(StabilityDesignMethod stabilityDesignMethod) + { + var translationTable = new Dictionary() + { + {StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption}, + {StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption} + }; + return translationTable[stabilityDesignMethod]; + } + } } \ No newline at end of file Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs =================================================================== diff -u -r758 -r789 --- dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 758) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 789) @@ -324,6 +324,7 @@ var location = new Location(); var inputLocation = inputLocations[i]; location.Name = inputLocation.Name; + // Waternet options var waternetOptions = inputLocation.WaternetOptions; location.ModelParametersForPLLines.PLLineCreationMethod = ConversionHelper.ConvertToPhreaticLineCreationMethod(waternetOptions.PhreaticLineCreationMethod); location.IntrusionVerticalWaterPressure = ConversionHelper.ConvertToIntrusionVerticalWaterPressure(waternetOptions.IntrusionVerticalWaterPressure); @@ -345,6 +346,29 @@ location.PlLineOffsetBelowDikeTopAtPolder = waternetOptions.Pl1BelowCrestPolderside; location.PlLineOffsetBelowShoulderBaseInside = waternetOptions.Pl1BelowShoulderCrestPolderside; location.PlLineOffsetBelowDikeToeAtPolder = waternetOptions.Pl1BelowToeDikePolderside; + // Design options + var designOptions = inputLocation.DesignOptions; + location.RedesignDikeHeight = designOptions.RedesignDikeHeight; + location.RedesignDikeShoulder = designOptions.RedesignDikeShoulder; + location.ShoulderEmbankmentMaterial = designOptions.ShoulderEmbankmentMaterial; + location.StabilityShoulderGrowSlope = designOptions.StabilityShoulderGrowSlope; + location.StabilityShoulderGrowDeltaX = designOptions.StabilityShoulderGrowDeltaX; + location.StabilitySlopeAdaptionDeltaX = designOptions.StabilitySlopeAdaptionDeltaX; + location.SlopeAdaptionStartCotangent = designOptions.SlopeAdaptionStartCotangent; + location.SlopeAdaptionEndCotangent = designOptions.SlopeAdaptionEndCotangent; + location.SlopeAdaptionStepCotangent = designOptions.SlopeAdaptionStepCotangent; + if (designOptions.NewDikeTopWidthSpecified) location.NewDikeTopWidth = designOptions.NewDikeTopWidth; + if (designOptions.NewDikeSlopeInsideSpecified) location.NewDikeSlopeInside = designOptions.NewDikeSlopeInside; + if (designOptions.NewDikeSlopeOutsideSpecified) location.NewDikeSlopeOutside = designOptions.NewDikeSlopeOutside; + if (designOptions.NewShoulderTopSlopeSpecified) location.NewShoulderTopSlope = designOptions.NewShoulderTopSlope; + if (designOptions.NewShoulderBaseSlopeSpecified) location.NewShoulderBaseSlope = designOptions.NewShoulderBaseSlope; + if (designOptions.NewMaxHeightShoulderAsFractionSpecified) location.NewMaxHeightShoulderAsFraction = designOptions.NewMaxHeightShoulderAsFraction; + if (designOptions.NewMinDistanceDikeToeStartDitchSpecified) location.NewMinDistanceDikeToeStartDitch = designOptions.NewMinDistanceDikeToeStartDitch; + location.UseNewDitchDefinition = designOptions.UseNewDitchDefinition; + if (designOptions.NewWidthDitchBottomSpecified) location.NewWidthDitchBottom = designOptions.NewWidthDitchBottom; + if (designOptions.NewSlopeAngleDitchSpecified) location.NewSlopeAngleDitch = designOptions.NewSlopeAngleDitch; + if (designOptions.NewDepthDitchSpecified) location.NewDepthDitch = designOptions.NewDepthDitch; + location.StabilityDesignMethod = ConversionHelper.ConvertToDamStabilityDesignMethod(designOptions.StabilityDesignMethod); SurfaceLine2 surfaceLine = dikeSurfaceLines.First(n => n.Name.Equals(inputLocation.SurfaceLineName)); location.SurfaceLine = surfaceLine; Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs =================================================================== diff -u -r734 -r789 --- dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 734) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 789) @@ -311,7 +311,43 @@ waternetOptions.Pl1BelowCrestPolderside = location.PlLineOffsetBelowDikeTopAtPolder; waternetOptions.Pl1BelowShoulderCrestPolderside = location.PlLineOffsetBelowShoulderBaseInside; waternetOptions.Pl1BelowToeDikePolderside = location.PlLineOffsetBelowDikeToeAtPolder; + inputLocation.WaternetOptions = waternetOptions; + // Design options + var designOptions = new LocationDesignOptions(); + designOptions.RedesignDikeHeight = location.RedesignDikeHeight; + designOptions.RedesignDikeShoulder = location.RedesignDikeShoulder; + designOptions.ShoulderEmbankmentMaterial = location.ShoulderEmbankmentMaterial; + designOptions.StabilityShoulderGrowSlope = location.StabilityShoulderGrowSlope; + designOptions.StabilityShoulderGrowDeltaX = location.StabilityShoulderGrowDeltaX; + designOptions.StabilitySlopeAdaptionDeltaX = location.StabilitySlopeAdaptionDeltaX; + designOptions.SlopeAdaptionStartCotangent = location.SlopeAdaptionStartCotangent; + designOptions.SlopeAdaptionEndCotangent = location.SlopeAdaptionEndCotangent; + designOptions.SlopeAdaptionStepCotangent = location.SlopeAdaptionStepCotangent; + designOptions.NewDikeTopWidthSpecified = true; + designOptions.NewDikeTopWidth = location.NewDikeTopWidth; + designOptions.NewDikeSlopeInsideSpecified = true; + designOptions.NewDikeSlopeInside = location.NewDikeSlopeInside; + designOptions.NewDikeSlopeInsideSpecified = true; + designOptions.NewDikeSlopeOutside = location.NewDikeSlopeOutside; + designOptions.NewDikeSlopeOutsideSpecified = true; + designOptions.NewShoulderTopSlope = location.NewShoulderTopSlope; + designOptions.NewShoulderTopSlopeSpecified = true; + designOptions.NewShoulderBaseSlope = location.NewShoulderBaseSlope; + designOptions.NewShoulderBaseSlopeSpecified = true; + designOptions.NewMaxHeightShoulderAsFraction = location.NewMaxHeightShoulderAsFraction; + designOptions.NewMaxHeightShoulderAsFractionSpecified = true; + designOptions.NewMinDistanceDikeToeStartDitch = location.NewMinDistanceDikeToeStartDitch; + designOptions.NewMinDistanceDikeToeStartDitchSpecified = true; + designOptions.UseNewDitchDefinition = location.UseNewDitchDefinition; + designOptions.NewWidthDitchBottomSpecified = true; + designOptions.NewWidthDitchBottom = location.NewWidthDitchBottom; + designOptions.NewSlopeAngleDitchSpecified = true; + designOptions.NewSlopeAngleDitch = location.NewSlopeAngleDitch; + designOptions.NewDepthDitchSpecified = true; + designOptions.NewDepthDitch = location.NewDepthDitch; + designOptions.StabilityDesignMethod = ConversionHelper.ConvertToInputStabilityDesignMethod(location.StabilityDesignMethod); + inputLocation.DesignOptions = designOptions; inputLocation.DesignScenarios = new LocationDesignScenario[location.Scenarios.Count]; for (int j = 0; j < location.Scenarios.Count; j++) Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs =================================================================== diff -u -r730 -r789 --- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 730) +++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 789) @@ -371,5 +371,20 @@ Assert.AreEqual(dilatancyType, ConversionHelper.ConvertToDilatancyType(soilDilatancyType)); } + [Test] + [TestCase(LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption)] + [TestCase(LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption)] + public void CanConvertToDilatancyType(LocationDesignOptionsStabilityDesignMethod inputStabilityDesignMethod, StabilityDesignMethod stabilityDesignMethod) + { + Assert.AreEqual(stabilityDesignMethod, ConversionHelper.ConvertToDamStabilityDesignMethod(inputStabilityDesignMethod)); + } + + [Test] + [TestCase(StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption)] + [TestCase(StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption)] + public void CanConvertToSDamStabilityDesignMethod(StabilityDesignMethod stabilityDesignMethod, LocationDesignOptionsStabilityDesignMethod inputStabilityDesignMethod) + { + Assert.AreEqual(inputStabilityDesignMethod, ConversionHelper.ConvertToInputStabilityDesignMethod(stabilityDesignMethod)); + } } } Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs =================================================================== diff -u -r773 -r789 --- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs (.../FillDamFromXmlInputTests.cs) (revision 773) +++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs (.../FillDamFromXmlInputTests.cs) (revision 789) @@ -274,6 +274,27 @@ TrafficLoad = 11.11, MinimalCircleDepth = 1.21 }; + location.RedesignDikeHeight = false; + location.RedesignDikeShoulder = false; + location.ShoulderEmbankmentMaterial = "ShoulderMat" + (i + 1).ToString(); ; + location.StabilityShoulderGrowSlope = 10.0 * i + 0.10; + location.StabilityShoulderGrowDeltaX = 10.0 * i + 0.11; + location.StabilitySlopeAdaptionDeltaX = 10.0 * i + 0.12; + location.SlopeAdaptionStartCotangent = 10.0 * i + 0.13; + location.SlopeAdaptionEndCotangent = 10.0 * i + 0.14; + location.SlopeAdaptionStepCotangent = 10.0 * i + 0.15; + location.NewDikeTopWidth = 10.0 * i + 0.16; + location.NewDikeSlopeInside = 10.0 * i + 0.17; + location.NewDikeSlopeOutside = 10.0 * i + 0.18; + location.NewShoulderTopSlope = 10.0 * i + 0.19; + location.NewShoulderBaseSlope = 10.0 * i + 0.20; + location.NewMaxHeightShoulderAsFraction = 10.0 * i + 0.21; + location.NewMinDistanceDikeToeStartDitch = 10.0 * i + 0.22; + location.UseNewDitchDefinition = true; + location.NewWidthDitchBottom = 10.0 * i + 0.23; + location.NewSlopeAngleDitch = 10.0 * i + 0.24; + location.NewDepthDitch = 10.0 * i + 0.25; + location.StabilityDesignMethod = StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption; location.SoilList = dike.SoilList; dike.Locations.Add(location); }