//----------------------------------------------------------------------- // // Copyright (c) 2011 Deltares. All rights reserved. // // B.S.T. The // tom.the@deltares.nl // 06-01-2011 // Class to calculate the probability of uplift from upliftfactor //----------------------------------------------------------------------- namespace Deltares.Dam.Data { using System; /// /// Exception class for UpliftFactorToBetaCalculator /// public class UpliftFactorToBetaCalculatorException : ApplicationException { public UpliftFactorToBetaCalculatorException(string message) : base(message) { } } /// /// Class to calculate the probability of uplift from upliftfactor /// public class UpliftFactorToBetaCalculator { /// /// Compute the Beta from the Upliftfactor /// /// /// static public double ComputeBetaFromUpliftFactor(double upliftFactor) { ThrowWhenUpliftFactorOutOfRange(upliftFactor); return ((upliftFactor - 1) * 18.0); } /// /// Check if upliftfactor in correct range /// /// /// static public void ThrowWhenUpliftFactorOutOfRange(double upliftFactor) { if (upliftFactor < 0) { throw new UpliftFactorToBetaCalculatorException(String.Format("Upliftfactor of {0} is < 0.0 not allowed", upliftFactor)); } } } }