public void Convert_MacroStabilityInwardsGridDeterminationTypeAutomatic_ReturnUpliftVanSlipPlane()
        {
            // Setup
            var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties
            {
                TangentLineZTop    = 1,
                TangentLineZBottom = 0
            })
            {
                GridDeterminationType        = MacroStabilityInwardsGridDeterminationType.Automatic,
                TangentLineDeterminationType = MacroStabilityInwardsTangentLineDeterminationType.Specified,
                TangentLineNumber            = 10
            };

            // Precondition
            Assert.IsNotNull(input.LeftGrid);
            Assert.IsNotNull(input.RightGrid);

            // Call
            UpliftVanSlipPlane slipPlane = UpliftVanSlipPlaneConverter.Convert(input);

            // Assert
            Assert.IsTrue(slipPlane.GridAutomaticDetermined);
            Assert.IsNull(slipPlane.LeftGrid);
            Assert.IsNull(slipPlane.RightGrid);
            Assert.IsTrue(slipPlane.TangentLinesAutomaticAtBoundaries);
            Assert.IsNaN(slipPlane.TangentZTop);
            Assert.IsNaN(slipPlane.TangentZBottom);
            Assert.AreEqual(0, slipPlane.TangentLineNumber);
        }
        public void Convert_InputNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => UpliftVanSlipPlaneConverter.Convert(null);

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(call);

            Assert.AreEqual("input", exception.ParamName);
        }
        public void Convert_MacroStabilityInwardsGridDeterminationTypeManualAndTangentLineDeterminationTypeLayerSeparated_ReturnUpliftVanSlipPlane()
        {
            // Setup
            var random = new Random(11);
            var input  = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties
            {
                LeftGridXLeft   = random.NextRoundedDouble(0.0, 1.0),
                LeftGridXRight  = random.NextRoundedDouble(2.0, 3.0),
                LeftGridZTop    = random.NextRoundedDouble(2.0, 3.0),
                LeftGridZBottom = random.NextRoundedDouble(0.0, 1.0),

                RightGridXLeft   = random.NextRoundedDouble(0.0, 1.0),
                RightGridXRight  = random.NextRoundedDouble(2.0, 3.0),
                RightGridZTop    = random.NextRoundedDouble(2.0, 3.0),
                RightGridZBottom = random.NextRoundedDouble(0.0, 1.0),

                TangentLineZTop    = 1,
                TangentLineZBottom = 0
            })
            {
                GridDeterminationType = MacroStabilityInwardsGridDeterminationType.Manual,
                LeftGrid =
                {
                    NumberOfVerticalPoints   = random.Next(1, 100),
                    NumberOfHorizontalPoints = random.Next(1, 100)
                },
                RightGrid =
                {
                    NumberOfVerticalPoints   = random.Next(1, 100),
                    NumberOfHorizontalPoints = random.Next(1, 100)
                },
                TangentLineDeterminationType = MacroStabilityInwardsTangentLineDeterminationType.LayerSeparated,
                TangentLineNumber            = 10
            };

            // Call
            UpliftVanSlipPlane slipPlane = UpliftVanSlipPlaneConverter.Convert(input);

            // Assert
            Assert.IsFalse(slipPlane.GridAutomaticDetermined);
            AssertGrid(input.LeftGrid, slipPlane.LeftGrid);
            AssertGrid(input.RightGrid, slipPlane.RightGrid);
            Assert.IsTrue(slipPlane.TangentLinesAutomaticAtBoundaries);
            Assert.IsNaN(slipPlane.TangentZTop);
            Assert.IsNaN(slipPlane.TangentZBottom);
            Assert.AreEqual(0, slipPlane.TangentLineNumber);
        }
Exemple #4
0
        private static UpliftVanCalculatorInput CreateInputFromData(MacroStabilityInwardsInput inputParameters, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel)
        {
            RoundedDouble effectiveAssessmentLevel = GetEffectiveAssessmentLevel(inputParameters, normativeAssessmentLevel);

            return(new UpliftVanCalculatorInput(
                       new UpliftVanCalculatorInput.ConstructionProperties
            {
                AssessmentLevel = effectiveAssessmentLevel,
                SurfaceLine = inputParameters.SurfaceLine,
                SoilProfile = SoilProfileConverter.Convert(inputParameters.SoilProfileUnderSurfaceLine),
                DrainageConstruction = DrainageConstructionConverter.Convert(inputParameters),
                PhreaticLineOffsetsExtreme = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputExtreme),
                PhreaticLineOffsetsDaily = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputDaily),
                SlipPlane = UpliftVanSlipPlaneConverter.Convert(inputParameters),
                SlipPlaneConstraints = UpliftVanSlipPlaneConstraintsConverter.Convert(inputParameters),
                DikeSoilScenario = inputParameters.DikeSoilScenario,
                WaterLevelRiverAverage = inputParameters.WaterLevelRiverAverage,
                WaterLevelPolderExtreme = inputParameters.LocationInputExtreme.WaterLevelPolder,
                WaterLevelPolderDaily = inputParameters.LocationInputDaily.WaterLevelPolder,
                MinimumLevelPhreaticLineAtDikeTopRiver = inputParameters.MinimumLevelPhreaticLineAtDikeTopRiver,
                MinimumLevelPhreaticLineAtDikeTopPolder = inputParameters.MinimumLevelPhreaticLineAtDikeTopPolder,
                LeakageLengthOutwardsPhreaticLine3 = inputParameters.LeakageLengthOutwardsPhreaticLine3,
                LeakageLengthInwardsPhreaticLine3 = inputParameters.LeakageLengthInwardsPhreaticLine3,
                LeakageLengthOutwardsPhreaticLine4 = inputParameters.DikeSoilScenario != MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand
                                                             ? inputParameters.LeakageLengthOutwardsPhreaticLine4
                                                             : 1.0,
                LeakageLengthInwardsPhreaticLine4 = inputParameters.DikeSoilScenario != MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand
                                                            ? inputParameters.LeakageLengthInwardsPhreaticLine4
                                                            : 1.0,
                PiezometricHeadPhreaticLine2Outwards = inputParameters.PiezometricHeadPhreaticLine2Outwards,
                PiezometricHeadPhreaticLine2Inwards = inputParameters.PiezometricHeadPhreaticLine2Inwards,
                PenetrationLengthExtreme = inputParameters.LocationInputExtreme.PenetrationLength,
                PenetrationLengthDaily = inputParameters.LocationInputDaily.PenetrationLength,
                AdjustPhreaticLine3And4ForUplift = inputParameters.AdjustPhreaticLine3And4ForUplift,
                MoveGrid = inputParameters.MoveGrid,
                MaximumSliceWidth = inputParameters.MaximumSliceWidth,
                WaterVolumetricWeight = generalInput.WaterVolumetricWeight
            }));
        }