// Copyright (C) Stichting Deltares 2017. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using Ringtoets.Common.Data.Probabilistics; namespace Ringtoets.MacroStabilityInwards.Data { /// /// Factory for creating design variables based on probabilistic distributions. /// public static class PipingSemiProbabilisticDesignValueFactory { private static DesignVariable CreateDesignVariable(NormalDistribution distribution, double percentile) { return new NormalDistributionDesignVariable(distribution) { Percentile = percentile }; } private static DesignVariable CreateDesignVariable(LogNormalDistribution distribution, double percentile) { return new LogNormalDistributionDesignVariable(distribution) { Percentile = percentile }; } private static VariationCoefficientDesignVariable CreateDesignVariable( VariationCoefficientLogNormalDistribution distribution, double percentile) { return new VariationCoefficientLogNormalDistributionDesignVariable(distribution) { Percentile = percentile }; } private static DesignVariable CreateDeterministicDesignVariable(LogNormalDistribution distribution, double deterministicValue) { return new DeterministicDesignVariable(distribution, deterministicValue); } #region General parameters /// /// Creates the design variable for . /// public static DesignVariable GetSaturatedVolumicWeightOfCoverageLayer(PipingInput parameters) { if (double.IsNaN(parameters.ThicknessCoverageLayer.Mean)) { return CreateDeterministicDesignVariable(parameters.SaturatedVolumicWeightOfCoverageLayer, 0); } return CreateDesignVariable(parameters.SaturatedVolumicWeightOfCoverageLayer, 0.05); } /// /// Creates the design variable for . /// public static DesignVariable GetThicknessCoverageLayer(PipingInput parameters) { if (double.IsNaN(parameters.ThicknessCoverageLayer.Mean)) { return CreateDeterministicDesignVariable(parameters.ThicknessCoverageLayer, 0); } return CreateDesignVariable(parameters.ThicknessCoverageLayer, 0.05); } /// /// Creates the design variable for . /// public static DesignVariable GetEffectiveThicknessCoverageLayer(PipingInput parameters) { if (double.IsNaN(parameters.ThicknessCoverageLayer.Mean)) { return CreateDeterministicDesignVariable(parameters.EffectiveThicknessCoverageLayer, 0); } return CreateDesignVariable(parameters.EffectiveThicknessCoverageLayer, 0.05); } /// /// Creates the design variable for . /// public static DesignVariable GetPhreaticLevelExit(PipingInput parameters) { return CreateDesignVariable(parameters.PhreaticLevelExit, 0.05); } /// /// Creates the design variable for . /// public static DesignVariable GetDampingFactorExit(PipingInput parameters) { return CreateDesignVariable(parameters.DampingFactorExit, 0.95); } #endregion #region Piping parameters /// /// Creates the design variable for . /// public static VariationCoefficientDesignVariable GetSeepageLength(PipingInput parameters) { return CreateDesignVariable(parameters.SeepageLength, 0.05); } /// /// Creates the design variable for . /// public static VariationCoefficientDesignVariable GetDiameter70(PipingInput parameters) { return CreateDesignVariable(parameters.Diameter70, 0.05); } /// /// Creates the design variable for . /// public static VariationCoefficientDesignVariable GetDarcyPermeability(PipingInput parameters) { return CreateDesignVariable(parameters.DarcyPermeability, 0.95); } /// /// Creates the design variable for . /// public static DesignVariable GetThicknessAquiferLayer(PipingInput parameters) { return CreateDesignVariable(parameters.ThicknessAquiferLayer, 0.95); } #endregion } }