Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs
===================================================================
diff -u -rb97a663a2997575c7c2cdabc4172866b4e6597f3 -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision b97a663a2997575c7c2cdabc4172866b4e6597f3)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2)
@@ -19,10 +19,73 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
+using Ringtoets.MacroStabilityInwards.CalculatedInput.Converters;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output;
+using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels;
+using Ringtoets.MacroStabilityInwards.Primitives;
+
namespace Ringtoets.MacroStabilityInwards.CalculatedInput
{
///
- /// This class can be used to calculate Waternet for a macro stability inwards calculation based on other input parameters.
+ /// This class can be used to calculate Waternet for a macro stability inwards
+ /// calculation based on other input parameters.
///
- public static class WaternetCalculationService {}
+ public static class WaternetCalculationService
+ {
+ ///
+ /// Calculated the Waternet with extreme circumstances based on the values
+ /// of the .
+ ///
+ /// The input to get the values from.
+ /// A calculated ,
+ /// or null when the Waternet could be calculated.
+ /// Thrown when
+ /// is null.
+ public static MacroStabilityInwardsWaternet CalculateExtreme(IMacroStabilityInwardsWaternetInput input)
+ {
+ if (input == null)
+ {
+ throw new ArgumentNullException(nameof(input));
+ }
+
+ var calculatorInput = new WaternetCalculatorInput(new WaternetCalculatorInput.ConstructionProperties
+ {
+ WaternetCreationMode = WaternetCreationMode.CreateWaternet,
+ PlLineCreationMethod = PlLineCreationMethod.RingtoetsWti2017,
+ AssessmentLevel = input.AssessmentLevel,
+ LandwardDirection = LandwardDirection.PositiveX,
+ SurfaceLine = input.SurfaceLine,
+ SoilProfile = SoilProfileConverter.Convert(input.SoilProfileUnderSurfaceLine),
+ DrainageConstruction = DrainageConstructionConverter.Convert(input),
+ PhreaticLineOffsets = PhreaticLineOffsetsConverter.Convert(input.LocationInputExtreme),
+ DikeSoilScenario = input.DikeSoilScenario,
+ WaterLevelRiverAverage = input.WaterLevelRiverAverage,
+ WaterLevelPolder = input.LocationInputExtreme.WaterLevelPolder,
+ MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver,
+ MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder,
+ LeakageLengthOutwardsPhreaticLine3 = input.LeakageLengthOutwardsPhreaticLine3,
+ LeakageLengthInwardsPhreaticLine3 = input.LeakageLengthInwardsPhreaticLine3,
+ LeakageLengthOutwardsPhreaticLine4 = input.LeakageLengthOutwardsPhreaticLine4,
+ LeakageLengthInwardsPhreaticLine4 = input.LeakageLengthInwardsPhreaticLine4,
+ PiezometricHeadPhreaticLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards,
+ PiezometricHeadPhreaticLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards,
+ PenetrationLength = input.LocationInputExtreme.PenetrationLength,
+ AdjustPhreaticLine3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift,
+ });
+
+ IWaternetCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance
+ .CreateWaternetExtremeCalculator(
+ calculatorInput,
+ MacroStabilityInwardsKernelWrapperFactory.Instance);
+
+ WaternetCalculatorResult result = calculator.Calculate();
+
+ return null;
+ }
+ }
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/SoilProfileConverterTest.cs
===================================================================
diff -u -rcfa7dc2bce5e37f5677d9c8772b68599f9e26a0c -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/SoilProfileConverterTest.cs (.../SoilProfileConverterTest.cs) (revision cfa7dc2bce5e37f5677d9c8772b68599f9e26a0c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Converters/SoilProfileConverterTest.cs (.../SoilProfileConverterTest.cs) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2)
@@ -119,7 +119,7 @@
SoilProfile soilProfile = SoilProfileConverter.Convert(profile);
// Assert
- UpliftVanCalculatorInputAssert.AssertSoilProfile(profile, soilProfile);
+ CalculatorInputAssert.AssertSoilProfile(profile, soilProfile);
}
[Test]
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj
===================================================================
diff -u -rcfa7dc2bce5e37f5677d9c8772b68599f9e26a0c -rb976e43b1c5480a6bcb004c58c307d69ebe9f4a2
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj) (revision cfa7dc2bce5e37f5677d9c8772b68599f9e26a0c)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj (.../Ringtoets.MacroStabilityInwards.CalculatedInput.Test.csproj) (revision b976e43b1c5480a6bcb004c58c307d69ebe9f4a2)
@@ -98,6 +98,14 @@
{53F7C73E-6D85-4B90-A6A8-DAA7F4BCB071}
Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil
+
+ {2B78CF04-4785-4F27-A6E5-45BDDBB7BF04}
+ Ringtoets.MacroStabilityInwards.Data.TestUtil
+
+
+ {3810D738-6412-47D1-8BC0-729D55BC951F}
+ Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil
+