Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -r6194c57c89be64b33e5b9b0e35b8672edda0f162 -r62492ce3e891365124204d4b570917c4ee298a41 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 6194c57c89be64b33e5b9b0e35b8672edda0f162) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 62492ce3e891365124204d4b570917c4ee298a41) @@ -169,24 +169,24 @@ return; } - HydraulicLoadsOutput dikeHeightOutput = CalculateDikeHeight(calculation, - assessmentSection, - generalInput, - failureMechanismContribution, - hydraulicBoundaryDatabaseFilePath, - numberOfCalculators); + DikeHeightOutput dikeHeightOutput = CalculateDikeHeight(calculation, + assessmentSection, + generalInput, + failureMechanismContribution, + hydraulicBoundaryDatabaseFilePath, + numberOfCalculators); if (canceled) { return; } - HydraulicLoadsOutput overtoppingRateOutput = CalculateOvertoppingRate(calculation, - assessmentSection, - generalInput, - failureMechanismContribution, - hydraulicBoundaryDatabaseFilePath, - numberOfCalculators); + OvertoppingRateOutput overtoppingRateOutput = CalculateOvertoppingRate(calculation, + assessmentSection, + generalInput, + failureMechanismContribution, + hydraulicBoundaryDatabaseFilePath, + numberOfCalculators); if (canceled) { @@ -261,12 +261,12 @@ Resources.GrassCoverErosionInwardsCalculationService_Overtopping); } - private HydraulicLoadsOutput CalculateDikeHeight(GrassCoverErosionInwardsCalculation calculation, - IAssessmentSection assessmentSection, - GeneralGrassCoverErosionInwardsInput generalInput, - double failureMechanismContribution, - string hydraulicBoundaryDatabaseFilePath, - int numberOfCalculators) + private DikeHeightOutput CalculateDikeHeight(GrassCoverErosionInwardsCalculation calculation, + IAssessmentSection assessmentSection, + GeneralGrassCoverErosionInwardsInput generalInput, + double failureMechanismContribution, + string hydraulicBoundaryDatabaseFilePath, + int numberOfCalculators) { if (dikeHeightCalculator == null) { @@ -308,19 +308,19 @@ return null; } - return CreateHydraulicLoadsAssessmentOutput(dikeHeightCalculator, - calculation.Name, - Resources.GrassCoverErosionInwardsCalculationService_DikeHeight, - dikeHeightCalculationInput.Beta, - norm); + return CreateDikeHeightOutput(dikeHeightCalculator, + calculation.Name, + Resources.GrassCoverErosionInwardsCalculationService_DikeHeight, + dikeHeightCalculationInput.Beta, + norm); } - private HydraulicLoadsOutput CalculateOvertoppingRate(GrassCoverErosionInwardsCalculation calculation, - IAssessmentSection assessmentSection, - GeneralGrassCoverErosionInwardsInput generalInput, - double failureMechanismContribution, - string hydraulicBoundaryDatabaseFilePath, - int numberOfCalculators) + private OvertoppingRateOutput CalculateOvertoppingRate(GrassCoverErosionInwardsCalculation calculation, + IAssessmentSection assessmentSection, + GeneralGrassCoverErosionInwardsInput generalInput, + double failureMechanismContribution, + string hydraulicBoundaryDatabaseFilePath, + int numberOfCalculators) { if (overtoppingRateCalculator == null) { @@ -362,11 +362,11 @@ return null; } - return CreateHydraulicLoadsAssessmentOutput(overtoppingRateCalculator, - calculation.Name, - Resources.GrassCoverErosionInwardsCalculationService_OvertoppingRate, - overtoppingRateCalculationInput.Beta, - norm); + return CreateOvertoppingRateOutput(overtoppingRateCalculator, + calculation.Name, + Resources.GrassCoverErosionInwardsCalculationService_OvertoppingRate, + overtoppingRateCalculationInput.Beta, + norm); } /// @@ -603,23 +603,23 @@ } /// - /// Creates the output of a hydraulic loads calculation. + /// Creates the output of a dike height calculation. /// - /// The calculator to used for performing the calculation. + /// The calculator used for performing the calculation. /// The name of the calculation. /// The name of the step that is performed. /// The target reliability for the calculation. /// The target probability for the calculation. - /// A . + /// A . /// Thrown when /// or the calculated probability falls outside the [0.0, 1.0] range and is not . - private static HydraulicLoadsOutput CreateHydraulicLoadsAssessmentOutput(IHydraulicLoadsCalculator calculator, - string calculationName, - string stepName, - double targetReliability, - double targetProbability) + private static DikeHeightOutput CreateDikeHeightOutput(IHydraulicLoadsCalculator calculator, + string calculationName, + string stepName, + double targetReliability, + double targetProbability) { - double value = calculator.Value; + double dikeHeight = calculator.Value; double reliability = calculator.ReliabilityIndex; double probability = StatisticsConverter.ReliabilityToProbability(reliability); @@ -633,11 +633,47 @@ calculationName)); } - return new HydraulicLoadsOutput(value, targetProbability, - targetReliability, probability, reliability, - converged); + return new DikeHeightOutput(dikeHeight, targetProbability, + targetReliability, probability, reliability, + converged); } + /// + /// Creates the output of an overtopping rate calculation. + /// + /// The calculator used for performing the calculation. + /// The name of the calculation. + /// The name of the step that is performed. + /// The target reliability for the calculation. + /// The target probability for the calculation. + /// A . + /// Thrown when + /// or the calculated probability falls outside the [0.0, 1.0] range and is not . + private static OvertoppingRateOutput CreateOvertoppingRateOutput(IHydraulicLoadsCalculator calculator, + string calculationName, + string stepName, + double targetReliability, + double targetProbability) + { + double overtoppingRate = calculator.Value; + double reliability = calculator.ReliabilityIndex; + double probability = StatisticsConverter.ReliabilityToProbability(reliability); + + CalculationConvergence converged = RingtoetsCommonDataCalculationService.GetCalculationConvergence(calculator.Converged); + + if (converged != CalculationConvergence.CalculatedConverged) + { + log.Warn( + string.Format(Resources.GrassCoverErosionInwardsCalculationService_Calculation_of_type_0_for_calculation_with_name_1_not_converged, + stepName, + calculationName)); + } + + return new OvertoppingRateOutput(overtoppingRate, targetProbability, + targetReliability, probability, reliability, + converged); + } + private static IEnumerable ParseProfilePoints(RoughnessPoint[] roughnessProfilePoints) { return roughnessProfilePoints.Select(roughnessPoint => new HydraRingRoughnessProfilePoint(roughnessPoint.Point.X, roughnessPoint.Point.Y, roughnessPoint.Roughness));