private static StructuresClosureVerticalWallCalculationInput CreateClosureVerticalWallCalculationInput(
     ClosingStructuresInput structureInput,
     GeneralClosingStructuresInput generalInput)
 {
     return(new StructuresClosureVerticalWallCalculationInput(
                structureInput.HydraulicBoundaryLocation.Id,
                structureInput.StructureNormalOrientation,
                HydraRingInputParser.ParseForeshore(structureInput),
                HydraRingInputParser.ParseBreakWater(structureInput),
                generalInput.GravitationalAcceleration,
                structureInput.FactorStormDurationOpenStructure,
                structureInput.FailureProbabilityOpenStructure,
                structureInput.FailureProbabilityReparation,
                structureInput.IdenticalApertures,
                structureInput.AllowedLevelIncreaseStorage.Mean, structureInput.AllowedLevelIncreaseStorage.StandardDeviation,
                generalInput.ModelFactorStorageVolume.Mean, generalInput.ModelFactorStorageVolume.StandardDeviation,
                structureInput.StorageStructureArea.Mean, structureInput.StorageStructureArea.CoefficientOfVariation,
                generalInput.ModelFactorInflowVolume,
                structureInput.FlowWidthAtBottomProtection.Mean, structureInput.FlowWidthAtBottomProtection.StandardDeviation,
                structureInput.CriticalOvertoppingDischarge.Mean, structureInput.CriticalOvertoppingDischarge.CoefficientOfVariation,
                structureInput.FailureProbabilityStructureWithErosion,
                structureInput.StormDuration.Mean, structureInput.StormDuration.CoefficientOfVariation,
                structureInput.ProbabilityOpenStructureBeforeFlooding,
                generalInput.ModelFactorOvertoppingFlow.Mean, generalInput.ModelFactorOvertoppingFlow.StandardDeviation,
                structureInput.StructureNormalOrientation,
                structureInput.ModelFactorSuperCriticalFlow.Mean, structureInput.ModelFactorSuperCriticalFlow.StandardDeviation,
                structureInput.LevelCrestStructureNotClosing.Mean, structureInput.LevelCrestStructureNotClosing.StandardDeviation,
                structureInput.WidthFlowApertures.Mean, structureInput.WidthFlowApertures.StandardDeviation,
                structureInput.DeviationWaveDirection));
 }
示例#2
0
        public void ParseForeshore_Use_ReturnCollection()
        {
            // Setup
            var mockRepository = new MockRepository();
            var foreshore      = mockRepository.Stub <IUseForeshore>();

            foreshore.UseForeshore = true;

            var pointOne = new Point2D(1, 1);
            var pointTwo = new Point2D(2, 2);

            foreshore.Stub(call => call.ForeshoreGeometry).Return(new RoundedPoint2DCollection(2, new[]
            {
                pointOne,
                pointTwo
            }));
            mockRepository.ReplayAll();

            // Call
            IEnumerable <HydraRingForelandPoint> parsedForeshore = HydraRingInputParser.ParseForeshore(foreshore);

            // Assert
            HydraRingForelandPoint[] actualForelandPoints = parsedForeshore.ToArray();
            Assert.AreEqual(pointOne.X, actualForelandPoints[0].X);
            Assert.AreEqual(pointOne.Y, actualForelandPoints[0].Z);
            Assert.AreEqual(pointTwo.X, actualForelandPoints[1].X);
            Assert.AreEqual(pointTwo.Y, actualForelandPoints[1].Z);

            mockRepository.VerifyAll();
        }
        /// <summary>
        /// Creates the input for a calculation for the given <paramref name="waterLevel"/>.
        /// </summary>
        /// <param name="waterLevel">The level of the water.</param>
        /// <param name="a">The 'a' factor decided on failure mechanism level.</param>
        /// <param name="b">The 'b' factor decided on failure mechanism level.</param>
        /// <param name="c">The 'c' factor decided on failure mechanism level.</param>
        /// <param name="targetProbability">The target probability to use.</param>
        /// <param name="input">The input that is different per calculation.</param>
        /// <param name="calculationSettings">The <see cref="HydraulicBoundaryCalculationSettings"/> containing all data
        /// to perform a hydraulic boundary calculation.</param>
        /// <returns>A <see cref="WaveConditionsCalculationInput"/>.</returns>
        /// <exception cref="ArgumentException">Thrown when the hydraulic boundary database file path.
        /// contains invalid characters.</exception>
        /// <exception cref="CriticalFileReadException">Thrown when:
        /// <list type="bullet">
        /// <item>No settings database file could be found at the location of the hydraulic boundary database file path
        /// with the same name.</item>
        /// <item>Unable to open settings database file.</item>
        /// <item>Unable to read required data from database file.</item>
        /// </list>
        /// </exception>
        private static WaveConditionsCosineCalculationInput CreateInput(RoundedDouble waterLevel,
                                                                        RoundedDouble a,
                                                                        RoundedDouble b,
                                                                        RoundedDouble c,
                                                                        double targetProbability,
                                                                        WaveConditionsInput input,
                                                                        HydraulicBoundaryCalculationSettings calculationSettings)
        {
            var waveConditionsCosineCalculationInput = new WaveConditionsCosineCalculationInput(
                1,
                input.Orientation,
                input.HydraulicBoundaryLocation.Id,
                targetProbability,
                HydraRingInputParser.ParseForeshore(input),
                HydraRingInputParser.ParseBreakWater(input),
                waterLevel,
                a,
                b,
                c);

            HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(waveConditionsCosineCalculationInput,
                                                                       calculationSettings.HydraulicBoundaryDatabaseFilePath,
                                                                       !string.IsNullOrEmpty(calculationSettings.PreprocessorDirectory));

            return(waveConditionsCosineCalculationInput);
        }
示例#4
0
        protected override StructuresOvertoppingCalculationInput CreateInput(HeightStructuresInput structureInput,
                                                                             GeneralHeightStructuresInput generalInput,
                                                                             string hydraulicBoundaryDatabaseFilePath,
                                                                             bool usePreprocessor)
        {
            var structuresOvertoppingCalculationInput = new StructuresOvertoppingCalculationInput(
                structureInput.HydraulicBoundaryLocation.Id,
                structureInput.StructureNormalOrientation,
                HydraRingInputParser.ParseForeshore(structureInput),
                HydraRingInputParser.ParseBreakWater(structureInput),
                generalInput.GravitationalAcceleration,
                generalInput.ModelFactorOvertoppingFlow.Mean, generalInput.ModelFactorOvertoppingFlow.StandardDeviation,
                structureInput.LevelCrestStructure.Mean, structureInput.LevelCrestStructure.StandardDeviation,
                structureInput.StructureNormalOrientation,
                structureInput.ModelFactorSuperCriticalFlow.Mean, structureInput.ModelFactorSuperCriticalFlow.StandardDeviation,
                structureInput.AllowedLevelIncreaseStorage.Mean, structureInput.AllowedLevelIncreaseStorage.StandardDeviation,
                generalInput.ModelFactorStorageVolume.Mean, generalInput.ModelFactorStorageVolume.StandardDeviation,
                structureInput.StorageStructureArea.Mean, structureInput.StorageStructureArea.CoefficientOfVariation,
                generalInput.ModelFactorInflowVolume,
                structureInput.FlowWidthAtBottomProtection.Mean, structureInput.FlowWidthAtBottomProtection.StandardDeviation,
                structureInput.CriticalOvertoppingDischarge.Mean, structureInput.CriticalOvertoppingDischarge.CoefficientOfVariation,
                structureInput.FailureProbabilityStructureWithErosion,
                structureInput.WidthFlowApertures.Mean, structureInput.WidthFlowApertures.StandardDeviation,
                structureInput.DeviationWaveDirection,
                structureInput.StormDuration.Mean, structureInput.StormDuration.CoefficientOfVariation);

            HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(structuresOvertoppingCalculationInput, hydraulicBoundaryDatabaseFilePath, usePreprocessor);

            return(structuresOvertoppingCalculationInput);
        }
示例#5
0
        public void ParseForeshore_DoesNotUse_ReturnEmptyCollection()
        {
            // Setup
            var mockRepository = new MockRepository();
            var foreshore      = mockRepository.Stub <IUseForeshore>();

            foreshore.UseForeshore = false;
            mockRepository.ReplayAll();

            // Call
            IEnumerable <HydraRingForelandPoint> parsedForeshore = HydraRingInputParser.ParseForeshore(foreshore);

            // Assert
            CollectionAssert.IsEmpty(parsedForeshore);
            mockRepository.VerifyAll();
        }
        /// <summary>
        /// Creates an instance of <see cref="DikeHeightCalculationInput"/> for calculation purposes.
        /// </summary>
        /// <param name="calculation">The calculation containing the input for the dike height calculation.</param>
        /// <param name="generalInput">The general grass cover erosion inwards calculation input parameters.</param>
        /// <param name="hydraulicBoundaryDatabaseFilePath">The path which points to the hydraulic boundary database file.</param>
        /// <param name="usePreprocessor">Indicator whether to use the preprocessor in the calculation.</param>
        /// <returns>A new <see cref="DikeHeightCalculationInput"/> instance.</returns>
        /// <exception cref="ArgumentException">Thrown when the <paramref name="hydraulicBoundaryDatabaseFilePath"/>
        /// contains invalid characters.</exception>
        /// <exception cref="CriticalFileReadException">Thrown when:
        /// <list type="bullet">
        /// <item>No settings database file could be found at the location of <paramref name="hydraulicBoundaryDatabaseFilePath"/>
        /// with the same name.</item>
        /// <item>Unable to open settings database file.</item>
        /// <item>Unable to read required data from database file.</item>
        /// </list>
        /// </exception>
        private static DikeHeightCalculationInput CreateDikeHeightInput(GrassCoverErosionInwardsCalculation calculation,
                                                                        GeneralGrassCoverErosionInwardsInput generalInput,
                                                                        string hydraulicBoundaryDatabaseFilePath,
                                                                        bool usePreprocessor)
        {
            var dikeHeightCalculationInput = new DikeHeightCalculationInput(calculation.InputParameters.HydraulicBoundaryLocation.Id,
                                                                            calculation.InputParameters.DikeHeightTargetProbability,
                                                                            calculation.InputParameters.Orientation,
                                                                            ParseProfilePoints(calculation.InputParameters.DikeGeometry),
                                                                            HydraRingInputParser.ParseForeshore(calculation.InputParameters),
                                                                            HydraRingInputParser.ParseBreakWater(calculation.InputParameters),
                                                                            generalInput.CriticalOvertoppingModelFactor,
                                                                            generalInput.FbFactor.Mean,
                                                                            generalInput.FbFactor.StandardDeviation,
                                                                            generalInput.FbFactor.LowerBoundary,
                                                                            generalInput.FbFactor.UpperBoundary,
                                                                            generalInput.FnFactor.Mean,
                                                                            generalInput.FnFactor.StandardDeviation,
                                                                            generalInput.FnFactor.LowerBoundary,
                                                                            generalInput.FnFactor.UpperBoundary,
                                                                            generalInput.OvertoppingModelFactor,
                                                                            calculation.InputParameters.CriticalFlowRate.Mean,
                                                                            calculation.InputParameters.CriticalFlowRate.StandardDeviation,
                                                                            generalInput.FrunupModelFactor.Mean,
                                                                            generalInput.FrunupModelFactor.StandardDeviation,
                                                                            generalInput.FrunupModelFactor.LowerBoundary,
                                                                            generalInput.FrunupModelFactor.UpperBoundary,
                                                                            generalInput.FshallowModelFactor.Mean,
                                                                            generalInput.FshallowModelFactor.StandardDeviation,
                                                                            generalInput.FshallowModelFactor.LowerBoundary,
                                                                            generalInput.FshallowModelFactor.UpperBoundary);

            HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(dikeHeightCalculationInput, hydraulicBoundaryDatabaseFilePath, usePreprocessor);

            return(dikeHeightCalculationInput);
        }
示例#7
0
 private static StructuresStabilityPointFloodedCulvertQuadraticCalculationInput CreateFloodedCulvertQuadraticCalculationInput(
     StabilityPointStructuresInput structureInput,
     GeneralStabilityPointStructuresInput generalInput)
 {
     return(new StructuresStabilityPointFloodedCulvertQuadraticCalculationInput(
                structureInput.HydraulicBoundaryLocation.Id,
                structureInput.StructureNormalOrientation,
                HydraRingInputParser.ParseForeshore(structureInput),
                HydraRingInputParser.ParseBreakWater(structureInput),
                structureInput.VolumicWeightWater,
                generalInput.GravitationalAcceleration,
                structureInput.LevelCrestStructure.Mean,
                structureInput.LevelCrestStructure.StandardDeviation,
                structureInput.StructureNormalOrientation,
                structureInput.FactorStormDurationOpenStructure,
                structureInput.ThresholdHeightOpenWeir.Mean,
                structureInput.ThresholdHeightOpenWeir.StandardDeviation,
                structureInput.InsideWaterLevelFailureConstruction.Mean,
                structureInput.InsideWaterLevelFailureConstruction.StandardDeviation,
                structureInput.FailureProbabilityRepairClosure,
                structureInput.FailureCollisionEnergy.Mean,
                structureInput.FailureCollisionEnergy.CoefficientOfVariation,
                generalInput.ModelFactorCollisionLoad.Mean,
                generalInput.ModelFactorCollisionLoad.CoefficientOfVariation,
                structureInput.ShipMass.Mean,
                structureInput.ShipMass.CoefficientOfVariation,
                structureInput.ShipVelocity.Mean,
                structureInput.ShipVelocity.CoefficientOfVariation,
                structureInput.LevellingCount,
                structureInput.ProbabilityCollisionSecondaryStructure,
                structureInput.FlowVelocityStructureClosable.Mean,
                structureInput.FlowVelocityStructureClosable.CoefficientOfVariation,
                structureInput.InsideWaterLevel.Mean,
                structureInput.InsideWaterLevel.StandardDeviation,
                structureInput.AllowedLevelIncreaseStorage.Mean,
                structureInput.AllowedLevelIncreaseStorage.StandardDeviation,
                generalInput.ModelFactorStorageVolume.Mean,
                generalInput.ModelFactorStorageVolume.StandardDeviation,
                structureInput.StorageStructureArea.Mean,
                structureInput.StorageStructureArea.CoefficientOfVariation,
                generalInput.ModelFactorInflowVolume,
                structureInput.FlowWidthAtBottomProtection.Mean,
                structureInput.FlowWidthAtBottomProtection.StandardDeviation,
                structureInput.CriticalOvertoppingDischarge.Mean,
                structureInput.CriticalOvertoppingDischarge.CoefficientOfVariation,
                structureInput.FailureProbabilityStructureWithErosion,
                structureInput.StormDuration.Mean,
                structureInput.StormDuration.CoefficientOfVariation,
                generalInput.ModelFactorLongThreshold.Mean,
                generalInput.ModelFactorLongThreshold.StandardDeviation,
                structureInput.BankWidth.Mean,
                structureInput.BankWidth.StandardDeviation,
                structureInput.EvaluationLevel,
                generalInput.ModelFactorLoadEffect.Mean,
                generalInput.ModelFactorLoadEffect.StandardDeviation,
                generalInput.WaveRatioMaxHN,
                generalInput.WaveRatioMaxHStandardDeviation,
                structureInput.VerticalDistance,
                generalInput.ModificationFactorWavesSlowlyVaryingPressureComponent,
                generalInput.ModificationFactorDynamicOrImpulsivePressureComponent,
                structureInput.DrainCoefficient.Mean,
                structureInput.DrainCoefficient.StandardDeviation,
                structureInput.AreaFlowApertures.Mean,
                structureInput.AreaFlowApertures.StandardDeviation,
                structureInput.ConstructiveStrengthQuadraticLoadModel.Mean,
                structureInput.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation,
                structureInput.StabilityQuadraticLoadModel.Mean,
                structureInput.StabilityQuadraticLoadModel.CoefficientOfVariation));
 }