Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs =================================================================== diff -u -rd485f27eb5a6d688406882dce60c3229e22f2ac2 -rb8d457155428231c23023eea8dc805225bd2c95f --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs (.../UpliftVanStabilityLocationCreator.cs) (revision d485f27eb5a6d688406882dce60c3229e22f2ac2) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs (.../UpliftVanStabilityLocationCreator.cs) (revision b8d457155428231c23023eea8dc805225bd2c95f) @@ -52,33 +52,16 @@ throw new ArgumentNullException(nameof(input)); } - return new StabilityLocation - { - DikeSoilScenario = StabilityLocationCreatorHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), - WaternetCreationMode = StabilityLocationCreatorHelper.ConvertWaternetCreationMode(input.WaternetCreationMode), - PlLineCreationMethod = StabilityLocationCreatorHelper.ConvertPlLineCreationMethod(input.PlLineCreationMethod), - WaterLevelRiver = input.AssessmentLevel, - WaterLevelRiverAverage = input.WaterLevelRiverAverage, - WaterLevelPolder = input.WaterLevelPolderExtreme, - DrainageConstructionPresent = input.DrainageConstruction.IsPresent, - XCoordMiddleDrainageConstruction = input.DrainageConstruction.XCoordinate, - ZCoordMiddleDrainageConstruction = input.DrainageConstruction.ZCoordinate, - MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver, - MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder, - UseDefaultOffsets = input.PhreaticLineOffsetsExtreme.UseDefaults, - PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtRiver, - PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtPolder, - PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsExtreme.BelowShoulderBaseInside, - PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeToeAtPolder, - AdjustPl3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift, - LeakageLengthOutwardsPl3 = input.LeakageLengthOutwardsPhreaticLine3, - LeakageLengthInwardsPl3 = input.LeakageLengthInwardsPhreaticLine3, - LeakageLengthOutwardsPl4 = input.LeakageLengthOutwardsPhreaticLine4, - LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4, - HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, - HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, - PenetrationLength = input.PenetrationLengthExtreme - }; + StabilityLocation location = CreateBaseLocation(input); + location.WaterLevelRiver = input.AssessmentLevel; + location.WaterLevelPolder = input.WaterLevelPolderExtreme; + location.UseDefaultOffsets = input.PhreaticLineOffsetsExtreme.UseDefaults; + location.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtRiver; + location.PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtPolder; + location.PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsExtreme.BelowShoulderBaseInside; + location.PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeToeAtPolder; + location.PenetrationLength = input.PenetrationLengthExtreme; + return location; } /// @@ -101,32 +84,38 @@ throw new ArgumentNullException(nameof(input)); } + StabilityLocation location = CreateBaseLocation(input); + location.WaterLevelRiver = input.WaterLevelRiverAverage; + location.WaterLevelPolder = input.WaterLevelPolderDaily; + location.UseDefaultOffsets = input.PhreaticLineOffsetsDaily.UseDefaults; + location.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsDaily.BelowDikeTopAtRiver; + location.PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeTopAtPolder; + location.PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsDaily.BelowShoulderBaseInside; + location.PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeToeAtPolder; + location.PenetrationLength = input.PenetrationLengthDaily; + return location; + } + + private static StabilityLocation CreateBaseLocation(UpliftVanCalculatorInput input) + { return new StabilityLocation { DikeSoilScenario = StabilityLocationCreatorHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), WaternetCreationMode = StabilityLocationCreatorHelper.ConvertWaternetCreationMode(input.WaternetCreationMode), PlLineCreationMethod = StabilityLocationCreatorHelper.ConvertPlLineCreationMethod(input.PlLineCreationMethod), - WaterLevelRiver = input.WaterLevelRiverAverage, WaterLevelRiverAverage = input.WaterLevelRiverAverage, - WaterLevelPolder = input.WaterLevelPolderDaily, DrainageConstructionPresent = input.DrainageConstruction.IsPresent, XCoordMiddleDrainageConstruction = input.DrainageConstruction.XCoordinate, ZCoordMiddleDrainageConstruction = input.DrainageConstruction.ZCoordinate, MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver, MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder, - UseDefaultOffsets = input.PhreaticLineOffsetsDaily.UseDefaults, - PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsDaily.BelowDikeTopAtRiver, - PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeTopAtPolder, - PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsDaily.BelowShoulderBaseInside, - PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeToeAtPolder, AdjustPl3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift, LeakageLengthOutwardsPl3 = input.LeakageLengthOutwardsPhreaticLine3, LeakageLengthInwardsPl3 = input.LeakageLengthInwardsPhreaticLine3, LeakageLengthOutwardsPl4 = input.LeakageLengthOutwardsPhreaticLine4, LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4, HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, - HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, - PenetrationLength = input.PenetrationLengthDaily + HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards }; } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanStabilityLocationCreatorTest.cs =================================================================== diff -u -rd485f27eb5a6d688406882dce60c3229e22f2ac2 -rb8d457155428231c23023eea8dc805225bd2c95f --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanStabilityLocationCreatorTest.cs (.../UpliftVanStabilityLocationCreatorTest.cs) (revision d485f27eb5a6d688406882dce60c3229e22f2ac2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanStabilityLocationCreatorTest.cs (.../UpliftVanStabilityLocationCreatorTest.cs) (revision b8d457155428231c23023eea8dc805225bd2c95f) @@ -266,33 +266,18 @@ StabilityLocation location = UpliftVanStabilityLocationCreator.CreateExtreme(input); // Assert - Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario); - Assert.AreEqual(WtiStabilityWaternetCreationMethod.CreateWaternet, location.WaternetCreationMode); - Assert.AreEqual(WtiStabilityPlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); - Assert.AreEqual(assessmentLevel, location.WaterLevelRiver); - Assert.AreEqual(assessmentLevel, location.HeadInPlLine3); - Assert.AreEqual(assessmentLevel, location.HeadInPlLine4); - Assert.AreEqual(waterLevelRiverAverage, location.WaterLevelRiverAverage); - Assert.AreEqual(waterLevelPolderExtreme, location.WaterLevelPolder); - Assert.AreEqual(drainageConstruction.IsPresent, location.DrainageConstructionPresent); - Assert.AreEqual(drainageConstruction.XCoordinate, location.XCoordMiddleDrainageConstruction); - Assert.AreEqual(drainageConstruction.ZCoordinate, location.ZCoordMiddleDrainageConstruction); - Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopRiver, location.MinimumLevelPhreaticLineAtDikeTopRiver); - Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopPolder, location.MinimumLevelPhreaticLineAtDikeTopPolder); - Assert.AreEqual(phreaticLineOffsets.UseDefaults, location.UseDefaultOffsets); - Assert.AreEqual(phreaticLineOffsets.BelowDikeTopAtRiver, location.PlLineOffsetBelowPointBRingtoetsWti2017); - Assert.AreEqual(phreaticLineOffsets.BelowDikeTopAtPolder, location.PlLineOffsetBelowDikeTopAtPolder); - Assert.AreEqual(phreaticLineOffsets.BelowShoulderBaseInside, location.PlLineOffsetBelowShoulderBaseInside); - Assert.AreEqual(phreaticLineOffsets.BelowDikeToeAtPolder, location.PlLineOffsetBelowDikeToeAtPolder); - Assert.AreEqual(adjustPhreaticLine3And4ForUplift, location.AdjustPl3And4ForUplift); - Assert.AreEqual(leakageLengthOutwardsPhreaticLine3, location.LeakageLengthOutwardsPl3); - Assert.AreEqual(leakageLengthInwardsPhreaticLine3, location.LeakageLengthInwardsPl3); - Assert.AreEqual(leakageLengthOutwardsPhreaticLine4, location.LeakageLengthOutwardsPl4); - Assert.AreEqual(leakageLengthInwardsPhreaticLine4, location.LeakageLengthInwardsPl4); - Assert.AreEqual(piezometricHeadPhreaticLine2Outwards, location.HeadInPlLine2Outwards); - Assert.AreEqual(piezometricHeadPhreaticLine2Inwards, location.HeadInPlLine2Inwards); - Assert.AreEqual(penetrationLengthExtreme, location.PenetrationLength); + Assert.AreEqual(input.AssessmentLevel, location.HeadInPlLine3); + Assert.AreEqual(input.AssessmentLevel, location.HeadInPlLine4); + Assert.AreEqual(input.AssessmentLevel, location.WaterLevelRiver); + Assert.AreEqual(input.WaterLevelPolderExtreme, location.WaterLevelPolder); + Assert.AreEqual(input.PhreaticLineOffsetsExtreme.UseDefaults, location.UseDefaultOffsets); + Assert.AreEqual(input.PhreaticLineOffsetsExtreme.BelowDikeTopAtRiver, location.PlLineOffsetBelowPointBRingtoetsWti2017); + Assert.AreEqual(input.PhreaticLineOffsetsExtreme.BelowDikeTopAtPolder, location.PlLineOffsetBelowDikeTopAtPolder); + Assert.AreEqual(input.PhreaticLineOffsetsExtreme.BelowShoulderBaseInside, location.PlLineOffsetBelowShoulderBaseInside); + Assert.AreEqual(input.PhreaticLineOffsetsExtreme.BelowDikeToeAtPolder, location.PlLineOffsetBelowDikeToeAtPolder); + Assert.AreEqual(input.PenetrationLengthExtreme, location.PenetrationLength); + AssertGeneralLocationValues(input, location); AssertIrrelevantValues(location); } @@ -522,34 +507,39 @@ StabilityLocation location = UpliftVanStabilityLocationCreator.CreateDaily(input); // Assert + Assert.AreEqual(input.WaterLevelRiverAverage, location.HeadInPlLine3); + Assert.AreEqual(input.WaterLevelRiverAverage, location.HeadInPlLine4); + Assert.AreEqual(input.WaterLevelRiverAverage, location.WaterLevelRiver); + Assert.AreEqual(input.WaterLevelPolderDaily, location.WaterLevelPolder); + Assert.AreEqual(input.PhreaticLineOffsetsDaily.UseDefaults, location.UseDefaultOffsets); + Assert.AreEqual(input.PhreaticLineOffsetsDaily.BelowDikeTopAtRiver, location.PlLineOffsetBelowPointBRingtoetsWti2017); + Assert.AreEqual(input.PhreaticLineOffsetsDaily.BelowDikeTopAtPolder, location.PlLineOffsetBelowDikeTopAtPolder); + Assert.AreEqual(input.PhreaticLineOffsetsDaily.BelowShoulderBaseInside, location.PlLineOffsetBelowShoulderBaseInside); + Assert.AreEqual(input.PhreaticLineOffsetsDaily.BelowDikeToeAtPolder, location.PlLineOffsetBelowDikeToeAtPolder); + Assert.AreEqual(input.PenetrationLengthDaily, location.PenetrationLength); + + AssertGeneralLocationValues(input, location); + AssertIrrelevantValues(location); + } + + private static void AssertGeneralLocationValues(UpliftVanCalculatorInput input, Location location) + { + Assert.AreEqual(input.WaterLevelRiverAverage, location.WaterLevelRiverAverage); + Assert.AreEqual(input.DrainageConstruction.IsPresent, location.DrainageConstructionPresent); + Assert.AreEqual(input.DrainageConstruction.XCoordinate, location.XCoordMiddleDrainageConstruction); + Assert.AreEqual(input.DrainageConstruction.ZCoordinate, location.ZCoordMiddleDrainageConstruction); + Assert.AreEqual(input.MinimumLevelPhreaticLineAtDikeTopRiver, location.MinimumLevelPhreaticLineAtDikeTopRiver); + Assert.AreEqual(input.MinimumLevelPhreaticLineAtDikeTopPolder, location.MinimumLevelPhreaticLineAtDikeTopPolder); Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario); Assert.AreEqual(WtiStabilityWaternetCreationMethod.CreateWaternet, location.WaternetCreationMode); Assert.AreEqual(WtiStabilityPlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); - Assert.AreEqual(waterLevelRiverAverage, location.WaterLevelRiver); - Assert.AreEqual(waterLevelRiverAverage, location.HeadInPlLine3); - Assert.AreEqual(waterLevelRiverAverage, location.HeadInPlLine4); - Assert.AreEqual(waterLevelRiverAverage, location.WaterLevelRiverAverage); - Assert.AreEqual(waterLevelPolderDaily, location.WaterLevelPolder); - Assert.AreEqual(drainageConstruction.IsPresent, location.DrainageConstructionPresent); - Assert.AreEqual(drainageConstruction.XCoordinate, location.XCoordMiddleDrainageConstruction); - Assert.AreEqual(drainageConstruction.ZCoordinate, location.ZCoordMiddleDrainageConstruction); - Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopRiver, location.MinimumLevelPhreaticLineAtDikeTopRiver); - Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopPolder, location.MinimumLevelPhreaticLineAtDikeTopPolder); - Assert.AreEqual(phreaticLineOffsets.UseDefaults, location.UseDefaultOffsets); - Assert.AreEqual(phreaticLineOffsets.BelowDikeTopAtRiver, location.PlLineOffsetBelowPointBRingtoetsWti2017); - Assert.AreEqual(phreaticLineOffsets.BelowDikeTopAtPolder, location.PlLineOffsetBelowDikeTopAtPolder); - Assert.AreEqual(phreaticLineOffsets.BelowShoulderBaseInside, location.PlLineOffsetBelowShoulderBaseInside); - Assert.AreEqual(phreaticLineOffsets.BelowDikeToeAtPolder, location.PlLineOffsetBelowDikeToeAtPolder); - Assert.AreEqual(adjustPhreaticLine3And4ForUplift, location.AdjustPl3And4ForUplift); - Assert.AreEqual(leakageLengthOutwardsPhreaticLine3, location.LeakageLengthOutwardsPl3); - Assert.AreEqual(leakageLengthInwardsPhreaticLine3, location.LeakageLengthInwardsPl3); - Assert.AreEqual(leakageLengthOutwardsPhreaticLine4, location.LeakageLengthOutwardsPl4); - Assert.AreEqual(leakageLengthInwardsPhreaticLine4, location.LeakageLengthInwardsPl4); - Assert.AreEqual(piezometricHeadPhreaticLine2Outwards, location.HeadInPlLine2Outwards); - Assert.AreEqual(piezometricHeadPhreaticLine2Inwards, location.HeadInPlLine2Inwards); - Assert.AreEqual(penetrationLengthDaily, location.PenetrationLength); - - AssertIrrelevantValues(location); + Assert.AreEqual(input.AdjustPhreaticLine3And4ForUplift, location.AdjustPl3And4ForUplift); + Assert.AreEqual(input.LeakageLengthOutwardsPhreaticLine3, location.LeakageLengthOutwardsPl3); + Assert.AreEqual(input.LeakageLengthInwardsPhreaticLine3, location.LeakageLengthInwardsPl3); + Assert.AreEqual(input.LeakageLengthOutwardsPhreaticLine4, location.LeakageLengthOutwardsPl4); + Assert.AreEqual(input.LeakageLengthInwardsPhreaticLine4, location.LeakageLengthInwardsPl4); + Assert.AreEqual(input.PiezometricHeadPhreaticLine2Outwards, location.HeadInPlLine2Outwards); + Assert.AreEqual(input.PiezometricHeadPhreaticLine2Inwards, location.HeadInPlLine2Inwards); } private static void AssertIrrelevantValues(Location location)