Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismExtensions.cs
===================================================================
diff -u -r330f2e86f2fb575c436cdbb46b6d31bc246ef6fc -r430632f92b4e3ca3f4634108e2e30a36d26befe9
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismExtensions.cs (.../DuneErosionFailureMechanismExtensions.cs) (revision 330f2e86f2fb575c436cdbb46b6d31bc246ef6fc)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismExtensions.cs (.../DuneErosionFailureMechanismExtensions.cs) (revision 430632f92b4e3ca3f4634108e2e30a36d26befe9)
@@ -20,6 +20,10 @@
// All rights reserved.
using System;
+using System.ComponentModel;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Util;
namespace Ringtoets.DuneErosion.Data
{
@@ -28,22 +32,34 @@
///
public static class DuneErosionFailureMechanismExtensions
{
+ private const double failureMechanismSpecificNormFactor = 2.15;
+
///
- /// Gets the norm which is needed in the calculations within .
+ /// Gets the norm based on .
///
- /// The to get the failure mechanism norm for.
- /// The assessment section norm.
- /// The value of the failure mechanism norm.
- /// Thrown when any parameter is null.
- public static double GetMechanismSpecificNorm(this DuneErosionFailureMechanism failureMechanism, double norm)
+ /// The failure mechanism to get the norm from.
+ /// The assessment section to get the norm from.
+ /// The category type to use while obtaining the norm.
+ /// The norm corresponding to the provided category type.
+ /// Thrown when
+ /// or is null.
+ /// Thrown when
+ /// is an invalid .
+ /// Thrown when
+ /// is a valid but unsupported .
+ public static double GetNorm(this DuneErosionFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection,
+ FailureMechanismCategoryType categoryType)
{
if (failureMechanism == null)
{
throw new ArgumentNullException(nameof(failureMechanism));
}
- return 2.15 * (failureMechanism.Contribution / 100)
- * norm / failureMechanism.GeneralInput.N;
+ return failureMechanismSpecificNormFactor * FailureMechanismNormHelper.GetNorm(assessmentSection,
+ categoryType,
+ failureMechanism.Contribution,
+ failureMechanism.GeneralInput.N);
}
}
}
\ No newline at end of file