Exemple #1
0
        /// <summary>
        /// This method sets random data values to all properties of <paramref name="input"/>.
        /// </summary>
        /// <param name="input">The input to set the random data values to.</param>
        public static void SetRandomDataToPipingInput(PipingInput input)
        {
            var random = new Random(21);

            var surfaceLine = new PipingSurfaceLine(string.Empty);

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

            input.EntryPointL           = random.NextRoundedDouble();
            input.ExitPointL            = random.NextRoundedDouble();
            input.SurfaceLine           = surfaceLine;
            input.StochasticSoilModel   = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("model");
            input.StochasticSoilProfile = new PipingStochasticSoilProfile(random.NextDouble(),
                                                                          PipingSoilProfileTestFactory.CreatePipingSoilProfile());
            input.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
            input.PhreaticLevelExit         = new NormalDistribution
            {
                Mean = random.NextRoundedDouble(),
                StandardDeviation = random.NextRoundedDouble()
            };
            input.DampingFactorExit = new LogNormalDistribution
            {
                Mean = random.NextRoundedDouble(),
                StandardDeviation = random.NextRoundedDouble()
            };
        }
Exemple #2
0
        /// <summary>
        /// Gets a <typeparamref name="TCalculationScenario"/>.
        /// </summary>
        /// <typeparam name="TCalculationScenario">The type of the calculation scenario.</typeparam>
        /// <returns>A <typeparamref name="TCalculationScenario"/>.</returns>
        public static TCalculationScenario GetPipingCalculationScenario <TCalculationScenario>()
            where TCalculationScenario : IPipingCalculationScenario <PipingInput>, new()
        {
            var surfaceLine = new PipingSurfaceLine("PK001_0001")
            {
                ReferenceLineIntersectionWorldPoint = new Point2D(0, 5)
            };

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

            var calculation = new TCalculationScenario
            {
                Name            = "PK001_0001 W1-6_0_1D1",
                InputParameters =
                {
                    HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1,                                                           "PUNT_KAT_18", 0, 0),
                    SurfaceLine           = surfaceLine,
                    StochasticSoilModel   = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("PK001_0001_Piping"),
                    StochasticSoilProfile = new PipingStochasticSoilProfile(
                        0, new PipingSoilProfile("W1-6_0_1D1", 0, new[]
                    {
                        new PipingSoilLayer(0)
                    }, SoilProfileType.SoilProfile1D)),
                    PhreaticLevelExit         =
                    {
                        Mean                  = (RoundedDouble)0,
                        StandardDeviation     = (RoundedDouble)0.1
                    },
                    DampingFactorExit         =
                    {
                        Mean                  = (RoundedDouble)0.7,
                        StandardDeviation     = (RoundedDouble)0.1
                    }
                }
            };

            return(calculation);
        }
        /// <summary>
        /// Creates a new instance of a <see cref="TestPipingFailureMechanism"/> with sections and a surface line.
        /// </summary>
        /// <returns>A new instance of <see cref="TestPipingFailureMechanism"/>.</returns>
        public static TestPipingFailureMechanism GetFailureMechanismWithSurfaceLinesAndStochasticSoilModels()
        {
            var surfaceLine = new PipingSurfaceLine(string.Empty)
            {
                ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0)
            };

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0.0, 5.0, 0.0),
                new Point3D(0.0, 0.0, 1.0),
                new Point3D(0.0, -5.0, 0.0)
            });

            var failureMechanism = new TestPipingFailureMechanism();

            failureMechanism.SurfaceLines.AddRange(new[]
            {
                surfaceLine
            }, "path/to/surfaceLines");
            failureMechanism.StochasticSoilModels.AddRange(new[]
            {
                PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel()
            }, "path/to/stochasticSoilModels");

            failureMechanism.SetSections(new[]
            {
                new FailureMechanismSection("Section", new[]
                {
                    new Point2D(0.0, 0.0),
                    new Point2D(5.0, 0.0)
                })
            }, "path/to/sections");

            return(failureMechanism);
        }