コード例 #1
0
        /// <summary>
        /// Gets a <see cref="MacroStabilityInwardsCalculationScenario"/> with <c>double.NaN</c> values set.
        /// </summary>
        /// <returns>A <see cref="MacroStabilityInwardsCalculationScenario"/> with <c>double.NaN</c> values.</returns>
        public static MacroStabilityInwardsCalculationScenario GetMacroStabilityInwardsCalculationScenarioWithNaNs()
        {
            MacroStabilityInwardsCalculationScenario calculation = GetMacroStabilityInwardsCalculationScenarioWithAssessmentLevel();

            MacroStabilityInwardsInput input = calculation.InputParameters;

            input.WaterLevelRiverAverage          = RoundedDouble.NaN;
            input.XCoordinateDrainageConstruction = RoundedDouble.NaN;
            input.ZCoordinateDrainageConstruction = RoundedDouble.NaN;

            input.MinimumLevelPhreaticLineAtDikeTopPolder = RoundedDouble.NaN;
            input.MinimumLevelPhreaticLineAtDikeTopRiver  = RoundedDouble.NaN;

            input.LeakageLengthInwardsPhreaticLine3    = RoundedDouble.NaN;
            input.LeakageLengthOutwardsPhreaticLine3   = RoundedDouble.NaN;
            input.LeakageLengthInwardsPhreaticLine4    = RoundedDouble.NaN;
            input.LeakageLengthOutwardsPhreaticLine4   = RoundedDouble.NaN;
            input.PiezometricHeadPhreaticLine2Inwards  = RoundedDouble.NaN;
            input.PiezometricHeadPhreaticLine2Outwards = RoundedDouble.NaN;

            input.AssessmentLevel        = RoundedDouble.NaN;
            input.SlipPlaneMinimumDepth  = RoundedDouble.NaN;
            input.SlipPlaneMinimumLength = RoundedDouble.NaN;
            input.MaximumSliceWidth      = RoundedDouble.NaN;

            input.TangentLineZTop    = RoundedDouble.NaN;
            input.TangentLineZBottom = RoundedDouble.NaN;

            input.LeftGrid.XLeft   = RoundedDouble.NaN;
            input.LeftGrid.XRight  = RoundedDouble.NaN;
            input.LeftGrid.ZTop    = RoundedDouble.NaN;
            input.LeftGrid.ZBottom = RoundedDouble.NaN;

            input.RightGrid.XLeft   = RoundedDouble.NaN;
            input.RightGrid.XRight  = RoundedDouble.NaN;
            input.RightGrid.ZTop    = RoundedDouble.NaN;
            input.RightGrid.ZBottom = RoundedDouble.NaN;

            IMacroStabilityInwardsLocationInputDaily inputDaily = input.LocationInputDaily;

            inputDaily.WaterLevelPolder = RoundedDouble.NaN;
            inputDaily.PhreaticLineOffsetBelowDikeTopAtRiver     = RoundedDouble.NaN;
            inputDaily.PhreaticLineOffsetBelowDikeTopAtPolder    = RoundedDouble.NaN;
            inputDaily.PhreaticLineOffsetBelowShoulderBaseInside = RoundedDouble.NaN;
            inputDaily.PhreaticLineOffsetBelowDikeToeAtPolder    = RoundedDouble.NaN;

            IMacroStabilityInwardsLocationInputExtreme inputExtreme = input.LocationInputExtreme;

            inputExtreme.PenetrationLength = RoundedDouble.NaN;
            inputExtreme.WaterLevelPolder  = RoundedDouble.NaN;
            inputExtreme.PhreaticLineOffsetBelowDikeTopAtRiver     = RoundedDouble.NaN;
            inputExtreme.PhreaticLineOffsetBelowDikeTopAtPolder    = RoundedDouble.NaN;
            inputExtreme.PhreaticLineOffsetBelowShoulderBaseInside = RoundedDouble.NaN;
            inputExtreme.PhreaticLineOffsetBelowDikeToeAtPolder    = RoundedDouble.NaN;

            input.ZoneBoundaryLeft  = RoundedDouble.NaN;
            input.ZoneBoundaryRight = RoundedDouble.NaN;

            return(calculation);
        }
        private static void SetLocationInputDailyToInput(IMacroStabilityInwardsLocationInputDaily inputDaily,
                                                         MacroStabilityInwardsCalculationEntity entity)
        {
            inputDaily.WaterLevelPolder  = (RoundedDouble)entity.LocationInputDailyWaterLevelPolder.ToNullAsNaN();
            inputDaily.UseDefaultOffsets = Convert.ToBoolean(entity.LocationInputDailyUseDefaultOffsets);

            inputDaily.PhreaticLineOffsetBelowDikeTopAtRiver     = (RoundedDouble)entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver.ToNullAsNaN();
            inputDaily.PhreaticLineOffsetBelowDikeTopAtPolder    = (RoundedDouble)entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder.ToNullAsNaN();
            inputDaily.PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble)entity.LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside.ToNullAsNaN();
            inputDaily.PhreaticLineOffsetBelowDikeToeAtPolder    = (RoundedDouble)entity.LocationInputDailyPhreaticLineOffsetDikeToeAtPolder.ToNullAsNaN();
        }
        private static void SetLocationInputDailyParametersToEntity(MacroStabilityInwardsCalculationEntity entity,
                                                                    IMacroStabilityInwardsLocationInputDaily inputParameters)
        {
            entity.LocationInputDailyWaterLevelPolder  = inputParameters.WaterLevelPolder.ToNaNAsNull();
            entity.LocationInputDailyUseDefaultOffsets = Convert.ToByte(inputParameters.UseDefaultOffsets);

            entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver     = inputParameters.PhreaticLineOffsetBelowDikeTopAtRiver.ToNaNAsNull();
            entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder    = inputParameters.PhreaticLineOffsetBelowDikeTopAtPolder.ToNaNAsNull();
            entity.LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside = inputParameters.PhreaticLineOffsetBelowShoulderBaseInside.ToNaNAsNull();
            entity.LocationInputDailyPhreaticLineOffsetDikeToeAtPolder         = inputParameters.PhreaticLineOffsetBelowDikeToeAtPolder.ToNaNAsNull();
        }
コード例 #4
0
        /// <summary>
        /// Configure a new <see cref="MacroStabilityInwardsLocationInputConfiguration"/> with
        /// values taken from <paramref name="inputDaily"/>.
        /// </summary>
        /// <param name="inputDaily">The input to take the values from.</param>
        /// <returns>A new <see cref="MacroStabilityInwardsLocationInputConfiguration"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="inputDaily"/> is <c>null</c>.</exception>
        public static MacroStabilityInwardsLocationInputConfiguration ToMacroStabilityInwardsLocationInputConfiguration(
            this IMacroStabilityInwardsLocationInputDaily inputDaily)
        {
            if (inputDaily == null)
            {
                throw new ArgumentNullException(nameof(inputDaily));
            }

            var configuration = new MacroStabilityInwardsLocationInputConfiguration();

            SetMacroStabilityInwardsLocationInputParameters(configuration, inputDaily);

            return(configuration);
        }
コード例 #5
0
        private static void AssertLocationInputs(IMacroStabilityInwardsLocationInputExtreme locationInputExtreme,
                                                 IMacroStabilityInwardsLocationInputDaily locationInputDaily,
                                                 MacroStabilityInwardsCalculationEntity entity)
        {
            AssertAreEqual(locationInputExtreme.WaterLevelPolder, entity.LocationInputExtremeWaterLevelPolder);
            Assert.AreEqual(Convert.ToByte(locationInputExtreme.UseDefaultOffsets), entity.LocationInputExtremeUseDefaultOffsets);
            AssertAreEqual(locationInputExtreme.PhreaticLineOffsetBelowDikeTopAtRiver, entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver);
            AssertAreEqual(locationInputExtreme.PhreaticLineOffsetBelowDikeTopAtPolder, entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder);
            AssertAreEqual(locationInputExtreme.PhreaticLineOffsetBelowShoulderBaseInside, entity.LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside);
            AssertAreEqual(locationInputExtreme.PhreaticLineOffsetBelowDikeToeAtPolder, entity.LocationInputExtremePhreaticLineOffsetDikeToeAtPolder);
            AssertAreEqual(locationInputExtreme.PenetrationLength, entity.LocationInputExtremePenetrationLength);

            AssertAreEqual(locationInputDaily.WaterLevelPolder, entity.LocationInputDailyWaterLevelPolder);
            Assert.AreEqual(Convert.ToByte(locationInputDaily.UseDefaultOffsets), entity.LocationInputDailyUseDefaultOffsets);
            AssertAreEqual(locationInputDaily.PhreaticLineOffsetBelowDikeTopAtRiver, entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver);
            AssertAreEqual(locationInputDaily.PhreaticLineOffsetBelowDikeTopAtPolder, entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder);
            AssertAreEqual(locationInputDaily.PhreaticLineOffsetBelowShoulderBaseInside, entity.LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside);
            AssertAreEqual(locationInputDaily.PhreaticLineOffsetBelowDikeToeAtPolder, entity.LocationInputDailyPhreaticLineOffsetDikeToeAtPolder);
        }