Exemplo n.º 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 SetLocationInputExtremeToInput(IMacroStabilityInwardsLocationInputExtreme inputExtreme,
                                                           MacroStabilityInwardsCalculationEntity entity)
        {
            inputExtreme.WaterLevelPolder  = (RoundedDouble)entity.LocationInputExtremeWaterLevelPolder.ToNullAsNaN();
            inputExtreme.UseDefaultOffsets = Convert.ToBoolean(entity.LocationInputExtremeUseDefaultOffsets);

            inputExtreme.PhreaticLineOffsetBelowDikeTopAtRiver     = (RoundedDouble)entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver.ToNullAsNaN();
            inputExtreme.PhreaticLineOffsetBelowDikeTopAtPolder    = (RoundedDouble)entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder.ToNullAsNaN();
            inputExtreme.PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble)entity.LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside.ToNullAsNaN();
            inputExtreme.PhreaticLineOffsetBelowDikeToeAtPolder    = (RoundedDouble)entity.LocationInputExtremePhreaticLineOffsetDikeToeAtPolder.ToNullAsNaN();
            inputExtreme.PenetrationLength = (RoundedDouble)entity.LocationInputExtremePenetrationLength.ToNullAsNaN();
        }
        private static void SetLocationInputExtremeParametersToEntity(MacroStabilityInwardsCalculationEntity entity,
                                                                      IMacroStabilityInwardsLocationInputExtreme inputParameters)
        {
            entity.LocationInputExtremeWaterLevelPolder  = inputParameters.WaterLevelPolder.ToNaNAsNull();
            entity.LocationInputExtremeUseDefaultOffsets = Convert.ToByte(inputParameters.UseDefaultOffsets);

            entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver     = inputParameters.PhreaticLineOffsetBelowDikeTopAtRiver.ToNaNAsNull();
            entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder    = inputParameters.PhreaticLineOffsetBelowDikeTopAtPolder.ToNaNAsNull();
            entity.LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside = inputParameters.PhreaticLineOffsetBelowShoulderBaseInside.ToNaNAsNull();
            entity.LocationInputExtremePhreaticLineOffsetDikeToeAtPolder         = inputParameters.PhreaticLineOffsetBelowDikeToeAtPolder.ToNaNAsNull();
            entity.LocationInputExtremePenetrationLength = inputParameters.PenetrationLength.ToNaNAsNull();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Assigns the read location input configuration to the of <paramref name="locationInput"/>.
        /// </summary>
        /// <param name="configurationLocationInput">The location input configuration read from the imported file.</param>
        /// <param name="locationInput">The location input to configure.</param>
        private static void SetMacroStabilityInwardsLocationInputExtreme(MacroStabilityInwardsLocationInputExtremeConfiguration configurationLocationInput,
                                                                         IMacroStabilityInwardsLocationInputExtreme locationInput)
        {
            if (configurationLocationInput == null)
            {
                return;
            }

            if (configurationLocationInput.PenetrationLength.HasValue)
            {
                locationInput.PenetrationLength = (RoundedDouble)configurationLocationInput.PenetrationLength.Value;
            }

            SetMacroStabilityInwardsLocationInput(configurationLocationInput, locationInput);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Configure a new <see cref="MacroStabilityInwardsLocationInputExtremeConfiguration"/> with
        /// values taken from <paramref name="inputExtreme"/>.
        /// </summary>
        /// <param name="inputExtreme">The input to take the values from.</param>
        /// <returns>A new <see cref="MacroStabilityInwardsLocationInputExtremeConfiguration"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="inputExtreme"/> is <c>null</c>.</exception>
        public static MacroStabilityInwardsLocationInputExtremeConfiguration ToMacroStabilityInwardsLocationInputExtremeConfiguration(
            this IMacroStabilityInwardsLocationInputExtreme inputExtreme)
        {
            if (inputExtreme == null)
            {
                throw new ArgumentNullException(nameof(inputExtreme));
            }

            var configuration = new MacroStabilityInwardsLocationInputExtremeConfiguration
            {
                PenetrationLength = inputExtreme.PenetrationLength
            };

            SetMacroStabilityInwardsLocationInputParameters(configuration, inputExtreme);

            return(configuration);
        }
Exemplo n.º 6
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);
        }