コード例 #1
0
        /// <summary>
        /// Creates <see cref="MacroStabilityInput"/> objects based on the given input for the Uplift Van calculation.
        /// </summary>
        /// <param name="upliftVanInput">The <see cref="UpliftVanCalculatorInput"/> containing all the values required
        /// for performing the Uplift Van calculation.</param>
        /// <param name="soils">The collection of <see cref="Soil"/>.</param>
        /// <param name="layerLookup">The lookup between <see cref="Soil"/> and <see cref="SoilLayer"/>.</param>
        /// <param name="surfaceLine">The <see cref="SurfaceLine"/>.</param>
        /// <param name="soilProfile">The <see cref="SoilProfile"/>.</param>
        /// <param name="dailyWaternet">The calculated <see cref="Waternet"/> for daily circumstances.</param>
        /// <param name="extremeWaternet">The calculated <see cref="Waternet"/> for extreme circumstances.</param>
        /// <returns>The created <see cref="MacroStabilityInput"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static MacroStabilityInput CreateUpliftVan(UpliftVanCalculatorInput upliftVanInput, ICollection <Soil> soils,
                                                          IDictionary <SoilLayer, LayerWithSoil> layerLookup, SurfaceLine surfaceLine,
                                                          SoilProfile soilProfile, Waternet dailyWaternet, Waternet extremeWaternet)
        {
            if (upliftVanInput == null)
            {
                throw new ArgumentNullException(nameof(upliftVanInput));
            }

            if (soils == null)
            {
                throw new ArgumentNullException(nameof(soils));
            }

            if (layerLookup == null)
            {
                throw new ArgumentNullException(nameof(layerLookup));
            }

            if (surfaceLine == null)
            {
                throw new ArgumentNullException(nameof(surfaceLine));
            }

            if (soilProfile == null)
            {
                throw new ArgumentNullException(nameof(soilProfile));
            }

            if (dailyWaternet == null)
            {
                throw new ArgumentNullException(nameof(dailyWaternet));
            }

            if (extremeWaternet == null)
            {
                throw new ArgumentNullException(nameof(extremeWaternet));
            }

            var macroStabilityInput = new MacroStabilityInput
            {
                StabilityModel =
                {
                    Orientation        = Orientation.Inwards,
                    SearchAlgorithm    = SearchAlgorithm.Grid,
                    ModelOption        = StabilityModelOptionType.UpliftVan,
                    ConstructionStages =
                    {
                        AddConstructionStage(soilProfile,                                                                                         dailyWaternet, FixedSoilStressCreator.Create(layerLookup).ToList(),
                                             PreconsolidationStressCreator.Create(upliftVanInput.SoilProfile.PreconsolidationStresses).ToList()),
                        AddConstructionStage(soilProfile,                                                                                         extremeWaternet)
                    },
                    Soils                           = soils,
                    MoveGrid                        = upliftVanInput.MoveGrid,
                    MaximumSliceWidth               = upliftVanInput.MaximumSliceWidth,
                    UpliftVanCalculationGrid        = UpliftVanCalculationGridCreator.Create(upliftVanInput.SlipPlane),
                    SlipPlaneConstraints            = SlipPlaneConstraintsCreator.Create(upliftVanInput.SlipPlaneConstraints),
                    NumberOfRefinementsGrid         = upliftVanInput.SlipPlane.GridNumberOfRefinements,
                    NumberOfRefinementsTangentLines = upliftVanInput.SlipPlane.TangentLineNumberOfRefinements
                },
                PreprocessingInput =
                {
                    SearchAreaConditions            =
                    {
                        MaxSpacingBetweenBoundaries =                                                        0.8,
                        OnlyAbovePleistoceen        = true,
                        AutoSearchArea          = upliftVanInput.SlipPlane.GridAutomaticDetermined,
                        AutoTangentLines        = upliftVanInput.SlipPlane.TangentLinesAutomaticAtBoundaries,
                        AutomaticForbiddenZones = upliftVanInput.SlipPlaneConstraints.AutomaticForbiddenZones
                    },
                    PreConstructionStages           =
                    {
                        AddPreConstructionStage(surfaceLine),
                        AddPreConstructionStage(surfaceLine)
                    }
                }
            };

            SetTangentLineProperties(upliftVanInput, macroStabilityInput);

            return(macroStabilityInput);
        }