Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/MacroStabilityInwardsSoilCreator.cs
===================================================================
diff -u -r0ecc2eb11789b230484e87fd6109bc61dc8d9b2d -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/MacroStabilityInwardsSoilCreator.cs (.../MacroStabilityInwardsSoilCreator.cs) (revision 0ecc2eb11789b230484e87fd6109bc61dc8d9b2d)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/MacroStabilityInwardsSoilCreator.cs (.../MacroStabilityInwardsSoilCreator.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -32,7 +32,7 @@
internal static class MacroStabilityInwardsSoilCreator
{
///
- /// Creates a based on information contained in the profiled ,
+ /// Creates a based on information contained in the profile ,
/// which can be used in the .
///
/// The from
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/StabilityLocationCreator.cs (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -0,0 +1,114 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.ComponentModel;
+using Deltares.WaternetCreator;
+using Deltares.WTIStability;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators
+{
+ ///
+ /// Creates instances which are required by the .
+ ///
+ internal static class StabilityLocationCreator
+ {
+ ///
+ /// Creates a based on the given ,
+ /// which can be used in the .
+ ///
+ /// The to get the information from.
+ /// A new with the given information from .
+ /// Thrown when is null.
+ /// Thrown when
+ /// is an invalid value.
+ /// Thrown when
+ /// is a valid value but unsupported.
+ public static StabilityLocation Create(MacroStabilityInwardsCalculatorInput input)
+ {
+ if (input == null)
+ {
+ throw new ArgumentNullException(nameof(input));
+ }
+
+ return new StabilityLocation
+ {
+ DikeSoilScenario = ConvertDikeSoilScenario(input.DikeSoilScenario),
+ WaterLevelRiver = input.AssessmentLevel,
+ WaterLevelRiverAverage = input.WaterLevelRiverAverage,
+ WaterLevelPolder = input.WaterLevelPolder,
+ WaterLevelRiverLow = double.NaN,
+ DrainageConstructionPresent = input.DrainageConstructionPresent,
+ XCoordMiddleDrainageConstruction = input.XCoordinateDrainageConstruction,
+ ZCoordMiddleDrainageConstruction = input.ZCoordinateDrainageConstruction,
+ MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver,
+ MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder,
+ UseDefaultOffsets = input.UseDefaultOffsets,
+ PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetBelowDikeTopAtRiver,
+ PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetBelowDikeTopAtPolder,
+ PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetBelowShoulderBaseInside,
+ PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetBelowDikeToeAtPolder,
+ HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards,
+ HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards,
+ AdjustPl3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift,
+ PenetrationLength = input.PenetrationLength,
+ LeakageLengthOutwardsPl3 = input.LeakageLengthOutwardsPhreaticLine3,
+ LeakageLengthInwardsPl3 = input.LeakageLengthInwardsPhreaticLine3,
+ LeakageLengthOutwardsPl4 = input.LeakageLengthOutwardsPhreaticLine4,
+ LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4
+ };
+ }
+
+ ///
+ /// Converts a to a .
+ ///
+ /// The to convert.
+ /// A based on the information of .
+ /// Thrown when
+ /// is an invalid value.
+ /// Thrown when
+ /// is a valid value but unsupported.
+ private static DikeSoilScenario ConvertDikeSoilScenario(MacroStabilityInwardsDikeSoilScenario dikeSoilScenario)
+ {
+ if (!Enum.IsDefined(typeof(MacroStabilityInwardsDikeSoilScenario), dikeSoilScenario))
+ {
+ throw new InvalidEnumArgumentException(nameof(dikeSoilScenario),
+ (int) dikeSoilScenario,
+ typeof(MacroStabilityInwardsDikeSoilScenario));
+ }
+
+ switch (dikeSoilScenario)
+ {
+ case MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay:
+ return DikeSoilScenario.ClayDikeOnClay;
+ case MacroStabilityInwardsDikeSoilScenario.SandDikeOnClay:
+ return DikeSoilScenario.SandDikeOnClay;
+ case MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand:
+ return DikeSoilScenario.ClayDikeOnSand;
+ case MacroStabilityInwardsDikeSoilScenario.SandDikeOnSand:
+ return DikeSoilScenario.SandDikeOnSand;
+ default:
+ throw new NotSupportedException();
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs
===================================================================
diff -u -r781d2d7c3f272d8984e21f3885cf236ae0b5c61a -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs (.../MacroStabilityInwardsCalculatorInput.cs) (revision 781d2d7c3f272d8984e21f3885cf236ae0b5c61a)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculatorInput.cs (.../MacroStabilityInwardsCalculatorInput.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -66,6 +66,8 @@
DrainageConstructionPresent = properties.DrainageConstructionPresent;
AdjustPhreaticLine3And4ForUplift = properties.AdjustPhreaticLine3And4ForUplift;
UseDefaultOffsets = properties.UseDefaultOffsets;
+
+ DikeSoilScenario = properties.DikeSoilScenario;
}
public class ConstructionProperties
@@ -94,6 +96,8 @@
PiezometricHeadPhreaticLine2Outwards = double.NaN;
PiezometricHeadPhreaticLine2Inwards = double.NaN;
PenetrationLength = double.NaN;
+
+ DikeSoilScenario = MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay;
}
#region properties
@@ -115,6 +119,11 @@
public MacroStabilityInwardsSoilProfileUnderSurfaceLine SoilProfile { internal get; set; }
///
+ /// Gets or sets the dike soil scenario.
+ ///
+ public MacroStabilityInwardsDikeSoilScenario DikeSoilScenario { internal get; set; }
+
+ ///
/// Gets or sets the average river water level.
/// [m+NAP]
///
@@ -240,134 +249,139 @@
/// Gets the outside high water level.
/// [m]
///
- public double AssessmentLevel { get; private set; }
+ public double AssessmentLevel { get; }
///
/// Gets the surface line.
///
- public MacroStabilityInwardsSurfaceLine SurfaceLine { get; private set; }
+ public MacroStabilityInwardsSurfaceLine SurfaceLine { get; }
///
/// Gets the profile which contains a definition of soil layers with properties.
///
- public MacroStabilityInwardsSoilProfileUnderSurfaceLine SoilProfile { get; private set; }
+ public MacroStabilityInwardsSoilProfileUnderSurfaceLine SoilProfile { get; }
///
+ /// Gets or sets the dike soil scenario.
+ ///
+ public MacroStabilityInwardsDikeSoilScenario DikeSoilScenario { get; }
+
+ ///
/// Gets or sets the average river water level.
/// [m+NAP]
///
- public double WaterLevelRiverAverage { get; set; }
+ public double WaterLevelRiverAverage { get; }
///
/// Gets or sets the polder water level.
/// [m+NAP]
///
- public double WaterLevelPolder { get; set; }
+ public double WaterLevelPolder { get; }
///
/// Gets or sets whether a drainage construction is present.
///
- public bool DrainageConstructionPresent { get; set; }
+ public bool DrainageConstructionPresent { get; }
///
/// Gets or sets the x coordinate of the drainage construction.
/// [m]
///
- public double XCoordinateDrainageConstruction { get; set; }
+ public double XCoordinateDrainageConstruction { get; }
///
/// Gets or sets the z coordinate of the drainage construction.
/// [m+NAP]
///
- public double ZCoordinateDrainageConstruction { get; set; }
+ public double ZCoordinateDrainageConstruction { get; }
///
/// Gets or sets the minimum level phreatic line at dike top river.
/// [m+NAP]
///
- public double MinimumLevelPhreaticLineAtDikeTopRiver { get; set; }
+ public double MinimumLevelPhreaticLineAtDikeTopRiver { get; }
///
/// Gets or sets the minimum level phreatic line at dike top polder.
/// [m+NAP]
///
- public double MinimumLevelPhreaticLineAtDikeTopPolder { get; set; }
+ public double MinimumLevelPhreaticLineAtDikeTopPolder { get; }
///
/// Gets or sets whether the default offset should be used.
///
- public bool UseDefaultOffsets { get; set; }
+ public bool UseDefaultOffsets { get; }
///
/// Gets or sets the offset of the phreatic line below dike top at river.
/// [m]
///
- public double PhreaticLineOffsetBelowDikeTopAtRiver { get; set; }
+ public double PhreaticLineOffsetBelowDikeTopAtRiver { get; }
///
/// Gets or sets the offset of the phreatic line below dike top at polder.
/// [m]
///
- public double PhreaticLineOffsetBelowDikeTopAtPolder { get; set; }
+ public double PhreaticLineOffsetBelowDikeTopAtPolder { get; }
///
/// Gets or sets the offset of the phreatic line below shoulder base inside.
/// [m]
///
- public double PhreaticLineOffsetBelowShoulderBaseInside { get; set; }
+ public double PhreaticLineOffsetBelowShoulderBaseInside { get; }
///
/// Gets or sets the offset of the phreatic line below dike toe at polder.
/// [m]
///
- public double PhreaticLineOffsetBelowDikeToeAtPolder { get; set; }
+ public double PhreaticLineOffsetBelowDikeToeAtPolder { get; }
///
/// Gets or sets whether phreatic line 3 and 4 should be adjusted for uplift.
///
- public bool AdjustPhreaticLine3And4ForUplift { get; set; }
+ public bool AdjustPhreaticLine3And4ForUplift { get; }
///
/// Gets or sets the leakage length outwards of phreatic line 3.
/// [m]
///
- public double LeakageLengthOutwardsPhreaticLine3 { get; set; }
+ public double LeakageLengthOutwardsPhreaticLine3 { get; }
///
/// Gets or sets the leakage length inwards of phreatic line 3.
/// [m]
///
- public double LeakageLengthInwardsPhreaticLine3 { get; set; }
+ public double LeakageLengthInwardsPhreaticLine3 { get; }
///
/// Gets or sets the leakage length outwards of phreatic line 4.
/// [m]
///
- public double LeakageLengthOutwardsPhreaticLine4 { get; set; }
+ public double LeakageLengthOutwardsPhreaticLine4 { get; }
///
/// Gets or sets the leakage length inwards of phreatic line 4.
/// [m]
///
- public double LeakageLengthInwardsPhreaticLine4 { get; set; }
+ public double LeakageLengthInwardsPhreaticLine4 { get; }
///
/// Gets or sets the piezometric head of the phreatic line 2 outwards.
/// [m+NAP]
///
- public double PiezometricHeadPhreaticLine2Outwards { get; set; }
+ public double PiezometricHeadPhreaticLine2Outwards { get; }
///
/// Gets or sets the piezometric head of the phreatic line 2 inwards.
/// [m+NAP]
///
- public double PiezometricHeadPhreaticLine2Inwards { get; set; }
+ public double PiezometricHeadPhreaticLine2Inwards { get; }
///
/// Gets or sets the penetration length.
/// [m]
///
- public double PenetrationLength { get; set; }
+ public double PenetrationLength { get; }
#endregion
}
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj
===================================================================
diff -u -re0472e1b583bd29a675a1dff5ff95e0ffdd0bb82 -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision e0472e1b583bd29a675a1dff5ff95e0ffdd0bb82)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -44,6 +44,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs
===================================================================
diff -u -re53ef4c278a378cb5b3973dc939a19896f94b1cc -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision e53ef4c278a378cb5b3973dc939a19896f94b1cc)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/IUpliftVanCalculator.cs (.../IUpliftVanCalculator.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -19,8 +19,8 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using Deltares.WTIStability;
using Deltares.WTIStability.Data.Geo;
-using Ringtoets.MacroStabilityInwards.Primitives;
namespace Ringtoets.MacroStabilityInwards.KernelWrapper.SubCalculator
{
@@ -43,5 +43,10 @@
/// Sets the soil profile.
///
SoilProfile2D SoilProfile { set; }
+
+ ///
+ /// Sets the location.
+ ///
+ StabilityLocation Location { set; }
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs
===================================================================
diff -u -r8df0c1c5344a84bd7aa0a1f660e3a0adacc47bc7 -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision 8df0c1c5344a84bd7aa0a1f660e3a0adacc47bc7)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/SubCalculator/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Deltares.WaternetCreator;
using Deltares.WTIStability;
using Deltares.WTIStability.Calculation.Wrapper;
using Deltares.WTIStability.Data.Geo;
@@ -78,5 +79,13 @@
calculatorInput.SoilProfile = value;
}
}
+
+ public StabilityLocation Location
+ {
+ set
+ {
+ calculatorInput.Location = value;
+ }
+ }
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/StabilityLocationCreatorTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/StabilityLocationCreatorTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/StabilityLocationCreatorTest.cs (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -0,0 +1,172 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.ComponentModel;
+using Core.Common.TestUtil;
+using Deltares.WaternetCreator;
+using Deltares.WTIStability;
+using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
+namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Creators
+{
+ [TestFixture]
+ public class StabilityLocationCreatorTest
+ {
+ [Test]
+ public void Create_InputNull_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate call = () => StabilityLocationCreator.Create(null);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("input", exception.ParamName);
+ }
+
+ [Test]
+ public void Create_InvalidDikeSoilScenario_ThrowInvalidEnumArgumentException()
+ {
+ // Setup
+ var input = new MacroStabilityInwardsCalculatorInput(
+ new MacroStabilityInwardsCalculatorInput.ConstructionProperties
+ {
+ DikeSoilScenario = (MacroStabilityInwardsDikeSoilScenario) 99
+ });
+
+ // Call
+ TestDelegate test = () => StabilityLocationCreator.Create(input);
+
+ // Assert
+ string message = $"The value of argument 'dikeSoilScenario' ({99}) is invalid for Enum type '{typeof(MacroStabilityInwardsDikeSoilScenario).Name}'.";
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
+ }
+
+ [Test]
+ [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay, DikeSoilScenario.ClayDikeOnClay)]
+ [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand, DikeSoilScenario.ClayDikeOnSand)]
+ [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnClay, DikeSoilScenario.SandDikeOnClay)]
+ [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnSand, DikeSoilScenario.SandDikeOnSand)]
+ public void Create_ValidDikeSoilScenario_ReturnStabilityLocationWithDikeSoilScenario(MacroStabilityInwardsDikeSoilScenario macroStabilityInwardsDikeSoilScenario,
+ DikeSoilScenario dikeSoilScenario)
+ {
+ // Setup
+ var input = new MacroStabilityInwardsCalculatorInput(
+ new MacroStabilityInwardsCalculatorInput.ConstructionProperties
+ {
+ DikeSoilScenario = macroStabilityInwardsDikeSoilScenario
+ });
+
+ // Call
+ StabilityLocation location = StabilityLocationCreator.Create(input);
+
+ // Assert
+ Assert.AreEqual(dikeSoilScenario, location.DikeSoilScenario);
+ }
+
+ [Test]
+ public void Create_WithInput_ReturnStabilityLocation()
+ {
+ // Setup
+ var random = new Random(21);
+ double assessmentLevel = random.Next();
+ double waterLevelRiverAverage = random.Next();
+ double waterLevelPolder = random.Next();
+ bool drainageConstructionPresent = random.NextBoolean();
+ double xCoordinateDrainageConstruction = random.Next();
+ double zCoordinateDrainageConstruction = random.Next();
+ double minimumLevelPhreaticLineAtDikeTopRiver = random.Next();
+ double minimumLevelPhreaticLineAtDikeTopPolder = random.Next();
+ bool useDefaultOffsets = random.NextBoolean();
+ double phreaticLineOffsetBelowDikeTopAtRiver = random.Next();
+ double phreaticLineOffsetBelowDikeTopAtPolder = random.Next();
+ double phreaticLineOffsetBelowShoulderBaseInside = random.Next();
+ double phreaticLineOffsetBelowDikeToeAtPolder = random.Next();
+ double piezometricHeadPhreaticLine2Outwards = random.Next();
+ double piezometricHeadPhreaticLine2Inwards = random.Next();
+ bool adjustPhreaticLine3And4ForUplift = random.NextBoolean();
+ double penetrationLength = random.Next();
+ double leakageLengthOutwardsPhreaticLine3 = random.Next();
+ double leakageLengthInwardsPhreaticLine3 = random.Next();
+ double leakageLengthOutwardsPhreaticLine4 = random.Next();
+ double leakageLengthInwardsPhreaticLine4 = random.Next();
+
+ var input = new MacroStabilityInwardsCalculatorInput(
+ new MacroStabilityInwardsCalculatorInput.ConstructionProperties
+ {
+ DikeSoilScenario = MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay,
+ AssessmentLevel = assessmentLevel,
+ WaterLevelRiverAverage = waterLevelRiverAverage,
+ WaterLevelPolder = waterLevelPolder,
+ DrainageConstructionPresent = drainageConstructionPresent,
+ XCoordinateDrainageConstruction = xCoordinateDrainageConstruction,
+ ZCoordinateDrainageConstruction = zCoordinateDrainageConstruction,
+ MinimumLevelPhreaticLineAtDikeTopRiver = minimumLevelPhreaticLineAtDikeTopRiver,
+ MinimumLevelPhreaticLineAtDikeTopPolder = minimumLevelPhreaticLineAtDikeTopPolder,
+ UseDefaultOffsets = useDefaultOffsets,
+ PhreaticLineOffsetBelowDikeTopAtRiver = phreaticLineOffsetBelowDikeTopAtRiver,
+ PhreaticLineOffsetBelowDikeTopAtPolder = phreaticLineOffsetBelowDikeTopAtPolder,
+ PhreaticLineOffsetBelowShoulderBaseInside = phreaticLineOffsetBelowShoulderBaseInside,
+ PhreaticLineOffsetBelowDikeToeAtPolder = phreaticLineOffsetBelowDikeToeAtPolder,
+ PiezometricHeadPhreaticLine2Outwards = piezometricHeadPhreaticLine2Outwards,
+ PiezometricHeadPhreaticLine2Inwards = piezometricHeadPhreaticLine2Inwards,
+ AdjustPhreaticLine3And4ForUplift = adjustPhreaticLine3And4ForUplift,
+ PenetrationLength = penetrationLength,
+ LeakageLengthOutwardsPhreaticLine3 = leakageLengthOutwardsPhreaticLine3,
+ LeakageLengthInwardsPhreaticLine3 = leakageLengthInwardsPhreaticLine3,
+ LeakageLengthOutwardsPhreaticLine4 = leakageLengthOutwardsPhreaticLine4,
+ LeakageLengthInwardsPhreaticLine4 = leakageLengthInwardsPhreaticLine4,
+ });
+
+ // Call
+ StabilityLocation location = StabilityLocationCreator.Create(input);
+
+ // Assert
+ Assert.AreEqual(DikeSoilScenario.ClayDikeOnClay, location.DikeSoilScenario);
+ Assert.AreEqual(assessmentLevel, location.WaterLevelRiver);
+ Assert.AreEqual(assessmentLevel, location.HeadInPlLine3);
+ Assert.AreEqual(assessmentLevel, location.HeadInPlLine4);
+ Assert.AreEqual(waterLevelRiverAverage, location.WaterLevelRiverAverage);
+ Assert.AreEqual(waterLevelPolder, location.WaterLevelPolder);
+ Assert.IsNaN(location.WaterLevelRiverLow);
+ Assert.AreEqual(drainageConstructionPresent, location.DrainageConstructionPresent);
+ Assert.AreEqual(xCoordinateDrainageConstruction, location.XCoordMiddleDrainageConstruction);
+ Assert.AreEqual(zCoordinateDrainageConstruction, location.ZCoordMiddleDrainageConstruction);
+ Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopRiver, location.MinimumLevelPhreaticLineAtDikeTopRiver);
+ Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopPolder, location.MinimumLevelPhreaticLineAtDikeTopPolder);
+ Assert.AreEqual(useDefaultOffsets, location.UseDefaultOffsets);
+ Assert.AreEqual(phreaticLineOffsetBelowDikeTopAtRiver, location.PlLineOffsetBelowPointBRingtoetsWti2017);
+ Assert.AreEqual(phreaticLineOffsetBelowDikeTopAtPolder, location.PlLineOffsetBelowDikeTopAtPolder);
+ Assert.AreEqual(phreaticLineOffsetBelowShoulderBaseInside, location.PlLineOffsetBelowShoulderBaseInside);
+ Assert.AreEqual(phreaticLineOffsetBelowDikeToeAtPolder, location.PlLineOffsetBelowDikeToeAtPolder);
+ Assert.AreEqual(piezometricHeadPhreaticLine2Outwards, location.HeadInPlLine2Outwards);
+ Assert.AreEqual(piezometricHeadPhreaticLine2Inwards, location.HeadInPlLine2Inwards);
+ Assert.AreEqual(adjustPhreaticLine3And4ForUplift, location.AdjustPl3And4ForUplift);
+ Assert.AreEqual(penetrationLength, location.PenetrationLength);
+ Assert.AreEqual(leakageLengthOutwardsPhreaticLine3, location.LeakageLengthOutwardsPl3);
+ Assert.AreEqual(leakageLengthInwardsPhreaticLine3, location.LeakageLengthInwardsPl3);
+ Assert.AreEqual(leakageLengthOutwardsPhreaticLine4, location.LeakageLengthOutwardsPl4);
+ Assert.AreEqual(leakageLengthInwardsPhreaticLine4, location.LeakageLengthInwardsPl4);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs
===================================================================
diff -u -r781d2d7c3f272d8984e21f3885cf236ae0b5c61a -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs (.../MacroStabilityInwardsCalculatorInputTest.cs) (revision 781d2d7c3f272d8984e21f3885cf236ae0b5c61a)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/MacroStabilityInwardsCalculatorInputTest.cs (.../MacroStabilityInwardsCalculatorInputTest.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -78,6 +78,7 @@
bool useDefaultOffsets = random.NextBoolean();
bool adjustPhreaticLine3And4ForUplift = random.NextBoolean();
bool drainageConstructionPresent = random.NextBoolean();
+ var dikeSoilScenario = random.NextEnumValue();
// Call
var input = new MacroStabilityInwardsCalculatorInput(
@@ -105,7 +106,8 @@
PenetrationLength = penetrationLength,
UseDefaultOffsets = useDefaultOffsets,
AdjustPhreaticLine3And4ForUplift = adjustPhreaticLine3And4ForUplift,
- DrainageConstructionPresent = drainageConstructionPresent
+ DrainageConstructionPresent = drainageConstructionPresent,
+ DikeSoilScenario = dikeSoilScenario
});
// Assert
@@ -133,6 +135,8 @@
Assert.AreEqual(useDefaultOffsets, input.UseDefaultOffsets);
Assert.AreEqual(adjustPhreaticLine3And4ForUplift, input.AdjustPhreaticLine3And4ForUplift);
Assert.AreEqual(drainageConstructionPresent, input.DrainageConstructionPresent);
+
+ Assert.AreEqual(dikeSoilScenario, input.DikeSoilScenario);
}
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj
===================================================================
diff -u -re0472e1b583bd29a675a1dff5ff95e0ffdd0bb82 -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision e0472e1b583bd29a675a1dff5ff95e0ffdd0bb82)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -61,6 +61,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs
===================================================================
diff -u -re53ef4c278a378cb5b3973dc939a19896f94b1cc -r2e4a7f40ff810375ec45120f7e3ff41b417dea67
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs (.../UpliftVanCalculatorStub.cs) (revision e53ef4c278a378cb5b3973dc939a19896f94b1cc)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil/SubCalculator/UpliftVanCalculatorStub.cs (.../UpliftVanCalculatorStub.cs) (revision 2e4a7f40ff810375ec45120f7e3ff41b417dea67)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using Deltares.WTIStability;
using Deltares.WTIStability.Data.Geo;
using Ringtoets.MacroStabilityInwards.KernelWrapper.SubCalculator;
@@ -38,6 +39,8 @@
public SoilProfile2D SoilProfile { get; set; }
+ public StabilityLocation Location { get; set; }
+
public void Calculate()
{
Calculated = true;