Exemple #1
0
        /// <summary>
        /// Sets random values to all setters, including the nested ones,
        /// of the <see cref="MacroStabilityInwardsInput"/>.
        /// </summary>
        /// <param name="input">The input to set the random data to.</param>
        public static void SetRandomMacroStabilityInwardsInput(MacroStabilityInwardsInput input)
        {
            var random = new Random(21);

            var surfaceLine = new MacroStabilityInwardsSurfaceLine("Surface line");

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0, 0, 0),
                new Point3D(1, 1, 1)
            });

            MacroStabilityInwardsStochasticSoilModel   stochasticSoilModel   = MacroStabilityInwardsStochasticSoilModelTestFactory.CreateValidStochasticSoilModel();
            MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = stochasticSoilModel.StochasticSoilProfiles.First();

            input.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
            input.StochasticSoilModel       = stochasticSoilModel;
            input.StochasticSoilProfile     = stochasticSoilProfile;
            input.SurfaceLine = surfaceLine;
            input.UseAssessmentLevelManualInput = random.NextBoolean();
            input.AssessmentLevel        = random.NextRoundedDouble();
            input.SlipPlaneMinimumDepth  = random.NextRoundedDouble();
            input.SlipPlaneMinimumLength = random.NextRoundedDouble();
            input.MaximumSliceWidth      = random.NextRoundedDouble();
            input.MoveGrid                                = random.NextBoolean();
            input.DikeSoilScenario                        = random.NextEnumValue <MacroStabilityInwardsDikeSoilScenario>();
            input.WaterLevelRiverAverage                  = random.NextRoundedDouble();
            input.DrainageConstructionPresent             = random.NextBoolean();
            input.XCoordinateDrainageConstruction         = random.NextRoundedDouble();
            input.ZCoordinateDrainageConstruction         = random.NextRoundedDouble();
            input.MinimumLevelPhreaticLineAtDikeTopRiver  = random.NextRoundedDouble();
            input.MinimumLevelPhreaticLineAtDikeTopPolder = random.NextRoundedDouble();

            input.LocationInputExtreme.WaterLevelPolder  = random.NextRoundedDouble();
            input.LocationInputExtreme.UseDefaultOffsets = random.NextBoolean();
            input.LocationInputExtreme.PhreaticLineOffsetBelowDikeTopAtRiver     = random.NextRoundedDouble();
            input.LocationInputExtreme.PhreaticLineOffsetBelowDikeTopAtPolder    = random.NextRoundedDouble();
            input.LocationInputExtreme.PhreaticLineOffsetBelowShoulderBaseInside = random.NextRoundedDouble();
            input.LocationInputExtreme.PhreaticLineOffsetBelowDikeToeAtPolder    = random.NextRoundedDouble();
            input.LocationInputExtreme.PenetrationLength = random.NextRoundedDouble();

            input.LocationInputDaily.WaterLevelPolder  = random.NextRoundedDouble();
            input.LocationInputDaily.UseDefaultOffsets = random.NextBoolean();
            input.LocationInputDaily.PhreaticLineOffsetBelowDikeTopAtRiver     = random.NextRoundedDouble();
            input.LocationInputDaily.PhreaticLineOffsetBelowDikeTopAtPolder    = random.NextRoundedDouble();
            input.LocationInputDaily.PhreaticLineOffsetBelowShoulderBaseInside = random.NextRoundedDouble();
            input.LocationInputDaily.PhreaticLineOffsetBelowDikeToeAtPolder    = random.NextRoundedDouble();

            input.AdjustPhreaticLine3And4ForUplift     = random.NextBoolean();
            input.LeakageLengthOutwardsPhreaticLine3   = random.NextRoundedDouble();
            input.LeakageLengthInwardsPhreaticLine3    = random.NextRoundedDouble();
            input.LeakageLengthOutwardsPhreaticLine4   = random.NextRoundedDouble();
            input.LeakageLengthInwardsPhreaticLine4    = random.NextRoundedDouble();
            input.PiezometricHeadPhreaticLine2Outwards = random.NextRoundedDouble();
            input.PiezometricHeadPhreaticLine2Inwards  = random.NextRoundedDouble();
            input.GridDeterminationType        = random.NextEnumValue <MacroStabilityInwardsGridDeterminationType>();
            input.TangentLineDeterminationType = random.NextEnumValue <MacroStabilityInwardsTangentLineDeterminationType>();
            input.TangentLineZTop    = random.NextRoundedDouble();
            input.TangentLineZBottom = random.NextRoundedDouble();
            input.TangentLineNumber  = random.Next(1, 50);

            input.LeftGrid.XLeft  = random.NextRoundedDouble(0.0, 1.0);
            input.LeftGrid.XRight = random.NextRoundedDouble(2.0, 3.0);
            input.LeftGrid.NumberOfHorizontalPoints = random.Next(1, 100);
            input.LeftGrid.ZTop    = random.NextRoundedDouble(2.0, 3.0);
            input.LeftGrid.ZBottom = random.NextRoundedDouble(0.0, 1.0);
            input.LeftGrid.NumberOfVerticalPoints = random.Next(1, 100);

            input.RightGrid.XLeft  = random.NextRoundedDouble(0.0, 1.0);
            input.RightGrid.XRight = random.NextRoundedDouble(2.0, 3.0);
            input.RightGrid.NumberOfHorizontalPoints = random.Next(1, 100);
            input.RightGrid.ZTop    = random.NextRoundedDouble(2.0, 3.0);
            input.RightGrid.ZBottom = random.NextRoundedDouble(0.0, 1.0);
            input.RightGrid.NumberOfVerticalPoints = random.Next(1, 100);

            input.CreateZones = random.NextBoolean();
            input.ZoningBoundariesDeterminationType = random.NextEnumValue <MacroStabilityInwardsZoningBoundariesDeterminationType>();
            input.ZoneBoundaryLeft  = random.NextRoundedDouble();
            input.ZoneBoundaryRight = random.NextRoundedDouble();
        }
Exemple #2
0
        /// <summary>
        /// Gets a <see cref="MacroStabilityInwardsCalculationScenario"/>.
        /// </summary>
        /// <returns>A <see cref="MacroStabilityInwardsCalculationScenario"/>.</returns>
        public static MacroStabilityInwardsCalculationScenario GetMacroStabilityInwardsCalculationScenario()
        {
            var surfaceLine = new MacroStabilityInwardsSurfaceLine("PK001_0001")
            {
                ReferenceLineIntersectionWorldPoint = new Point2D(0, 5)
            };

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0, 0, 0),
                new Point3D(0, 10, 0)
            });

            var calculation = new MacroStabilityInwardsCalculationScenario
            {
                Name            = "PK001_0001 W1-6_0_1D1",
                InputParameters =
                {
                    HydraulicBoundaryLocation                     = new HydraulicBoundaryLocation(1,                                                                                   "PUNT_KAT_18",                                       0, 0),
                    SurfaceLine           = surfaceLine,
                    StochasticSoilModel   = MacroStabilityInwardsStochasticSoilModelTestFactory.CreateValidStochasticSoilModel("PK001_0001_Macrostabiliteit"),
                    StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0,                                                                  new MacroStabilityInwardsSoilProfile1D("W1-6_0_1D1", 0, new[]
                    {
                        new MacroStabilityInwardsSoilLayer1D(0)
                    })),
                    LocationInputDaily                            =
                    {
                        UseDefaultOffsets = true,
                        WaterLevelPolder  = (RoundedDouble)2.2,
                        PhreaticLineOffsetBelowDikeTopAtRiver     = (RoundedDouble)2.21,
                        PhreaticLineOffsetBelowDikeTopAtPolder    = (RoundedDouble)2.22,
                        PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble)2.23,
                        PhreaticLineOffsetBelowDikeToeAtPolder    = (RoundedDouble)2.24
                    },
                    LocationInputExtreme                          =
                    {
                        UseDefaultOffsets = false,
                        PenetrationLength = (RoundedDouble)16.2,
                        WaterLevelPolder  = (RoundedDouble)15.2,
                        PhreaticLineOffsetBelowDikeTopAtRiver     = (RoundedDouble)15.21,
                        PhreaticLineOffsetBelowDikeTopAtPolder    = (RoundedDouble)15.22,
                        PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble)15.23,
                        PhreaticLineOffsetBelowDikeToeAtPolder    = (RoundedDouble)15.24
                    },
                    WaterLevelRiverAverage                  = (RoundedDouble)10.5,
                    DrainageConstructionPresent             = true,
                    XCoordinateDrainageConstruction         = (RoundedDouble)10.6,
                    ZCoordinateDrainageConstruction         = (RoundedDouble)10.7,
                    MinimumLevelPhreaticLineAtDikeTopPolder = (RoundedDouble)10.8,
                    MinimumLevelPhreaticLineAtDikeTopRiver  = (RoundedDouble)10.9,
                    LeakageLengthInwardsPhreaticLine3       = (RoundedDouble)10.1,
                    LeakageLengthOutwardsPhreaticLine3      = (RoundedDouble)10.2,
                    LeakageLengthInwardsPhreaticLine4       = (RoundedDouble)10.3,
                    LeakageLengthOutwardsPhreaticLine4      = (RoundedDouble)10.4,
                    PiezometricHeadPhreaticLine2Inwards     = (RoundedDouble)20.1,
                    PiezometricHeadPhreaticLine2Outwards    = (RoundedDouble)20.2,
                    SlipPlaneMinimumDepth             = (RoundedDouble)0.4,
                    SlipPlaneMinimumLength            = (RoundedDouble)0.5,
                    MaximumSliceWidth                 = (RoundedDouble)0.6,
                    TangentLineZTop                   = (RoundedDouble)10,
                    TangentLineZBottom                = (RoundedDouble)1,
                    TangentLineNumber                 =                                                                                                                 5,
                    CreateZones                       = true,
                    ZoningBoundariesDeterminationType = MacroStabilityInwardsZoningBoundariesDeterminationType.Manual,
                    ZoneBoundaryLeft                  = (RoundedDouble)0,
                    ZoneBoundaryRight                 = (RoundedDouble)100
                }
            };

            return(calculation);
        }