Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs =================================================================== diff -u -rb85e9f01322d9f98777fa8d2ce0f37683666805a -rc5b9477d76b5e2b63716c238029161230ba645f8 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision b85e9f01322d9f98777fa8d2ce0f37683666805a) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision c5b9477d76b5e2b63716c238029161230ba645f8) @@ -170,6 +170,10 @@ .Distinct() .ToArray(); + geometry.Left = geometry.Points.Min(p => p.X); + geometry.Right = geometry.Points.Max(p => p.X); + geometry.Bottom = geometry.Points.Min(p => p.Z); + return geometry; } } Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs =================================================================== diff -u -rca2e4b3a0824dd8b142fae068b29ee2fbbd1069e -rc5b9477d76b5e2b63716c238029161230ba645f8 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs (.../LayerWithSoilCreatorTest.cs) (revision ca2e4b3a0824dd8b142fae068b29ee2fbbd1069e) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs (.../LayerWithSoilCreatorTest.cs) (revision c5b9477d76b5e2b63716c238029161230ba645f8) @@ -25,11 +25,15 @@ using System.Linq; using Core.Common.TestUtil; using Deltares.MacroStability.CSharpWrapper; +using Deltares.MacroStability.CSharpWrapper.Input; using NUnit.Framework; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input; using CSharpWrapperWaterPressureInterpolationModel = Deltares.MacroStability.CSharpWrapper.Input.WaterPressureInterpolationModel; using Point2D = Core.Common.Base.Geometry.Point2D; +using PreconsolidationStress = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.PreconsolidationStress; +using SoilProfile = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilProfile; +using WaterPressureInterpolationModel = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.WaterPressureInterpolationModel; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Test.Creators.Input { @@ -250,8 +254,20 @@ Assert.AreEqual(soilLayer.ShearStrengthRatio, layerWithSoil.Soil.RatioCuPc); Assert.AreEqual(soilLayer.StrengthIncreaseExponent, layerWithSoil.Soil.StrengthIncreaseExponent); Assert.AreEqual(soilLayer.Dilatancy, layerWithSoil.Soil.Dilatancy); + + AssertIrrelevantValues(layerWithSoil); } + private static void AssertIrrelevantValues(LayerWithSoil layerWithSoil) + { + CollectionAssert.IsEmpty(layerWithSoil.Soil.BondStressCurve); // Irrelevant + Assert.AreEqual(0, layerWithSoil.Soil.RRatio); // Irrelevant + Assert.AreEqual(0, layerWithSoil.Soil.RheologicalCoefficient); // Irrelevant + CollectionAssert.IsEmpty(layerWithSoil.Soil.SuTable); // Irrelevant + Assert.IsFalse(layerWithSoil.Soil.UseSoilClassification); // Irrelevant + Assert.AreEqual(SoilClassification.Sand, layerWithSoil.Soil.SoilClassification); // Irrelevant + } + private static SoilLayer.ConstructionProperties CreateRandomConstructionProperties(int seed, string materialName) { var random = new Random(seed); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/MacroStabilityInputCreatorTest.cs =================================================================== diff -u -rc31f143df1707d110bd716a1dbc81b1b2d143c1b -rc5b9477d76b5e2b63716c238029161230ba645f8 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/MacroStabilityInputCreatorTest.cs (.../MacroStabilityInputCreatorTest.cs) (revision c31f143df1707d110bd716a1dbc81b1b2d143c1b) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/MacroStabilityInputCreatorTest.cs (.../MacroStabilityInputCreatorTest.cs) (revision c5b9477d76b5e2b63716c238029161230ba645f8) @@ -197,6 +197,8 @@ Assert.AreSame(surfaceLine, preConstructionStage.SurfaceLine); Assert.IsNull(preConstructionStage.WaternetCreatorInput); // Not needed as Waternet is already calculated } + + AssertIrrelevantValues(stabilityModel, searchAreaConditions); } [Test] @@ -245,13 +247,15 @@ CollectionAssert.AreEqual(PreconsolidationStressCreator.Create(input.SoilProfile.PreconsolidationStresses), dailyConstructionStage.PreconsolidationStresses, new PreconsolidationStressComparer()); AssertMultiplicationFactors(dailyConstructionStage.MultiplicationFactorsCPhiForUplift.Single()); + AssertIrrelevantValues(dailyConstructionStage); ConstructionStage extremeConstructionStage = stabilityModel.ConstructionStages.ElementAt(1); Assert.AreSame(soilProfile, extremeConstructionStage.SoilProfile); Assert.AreSame(extremeWaternet, extremeConstructionStage.Waternet); CollectionAssert.IsEmpty(extremeConstructionStage.FixedSoilStresses); CollectionAssert.IsEmpty(extremeConstructionStage.PreconsolidationStresses); AssertMultiplicationFactors(extremeConstructionStage.MultiplicationFactorsCPhiForUplift.Single()); + AssertIrrelevantValues(extremeConstructionStage); } private static void AssertMultiplicationFactors(MultiplicationFactorsCPhiForUplift multiplicationFactors) @@ -260,6 +264,40 @@ Assert.AreEqual(1.2, multiplicationFactors.UpliftFactor); } + private static void AssertIrrelevantValues(ConstructionStage constructionStage) + { + CollectionAssert.IsEmpty(constructionStage.ConsolidationValues); // Irrelevant + Assert.IsNotNull(constructionStage.Earthquake); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.ForbiddenLines); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.Geotextiles); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.LineLoads); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.Nails); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.TreesOnSlope); // Irrelevant + CollectionAssert.IsEmpty(constructionStage.UniformLoads); // Irrelevant + Assert.IsNotNull(constructionStage.YieldStressField); // Irrelevant + } + + private static void AssertIrrelevantValues(StabilityInput stabilityModel, SearchAreaConditions searchAreaConditions) + { + Assert.AreEqual(50, stabilityModel.MaxGridMoves); // Irrelevant + + Assert.IsNotNull(stabilityModel.BishopCalculationCircle); // Irrelevant - Only for Bishop + + Assert.IsNotNull(stabilityModel.BeeswarmAlgorithmOptions); // Irrelevant - Only for Beeswarm + + Assert.IsNotNull(stabilityModel.GeneticAlgorithmOptions); // Irrelevant - Only for Genetic Algorithm + Assert.IsFalse(searchAreaConditions.AutoGeneticAlgorithmOptions); // Irrelevant - Only for Genetic Algorithm + + Assert.IsNull(stabilityModel.LevenbergMarquardtOptions); // Irrelevant - Only for Levenberg Marquardt + + Assert.AreEqual(0, stabilityModel.MaxAllowedAngleBetweenSlices); // Irrelevant - Only for Spencer + Assert.AreEqual(0, stabilityModel.RequiredForcePointsInSlices); // Irrelevant - Only for Spencer + Assert.IsNotNull(stabilityModel.SpencerSlipPlanes); // Irrelevant - Only for Spencer + Assert.AreEqual(2, stabilityModel.TraversalGridPoints); // Irrelevant - Only for Spencer + Assert.AreEqual(0, stabilityModel.TraversalRefinements); // Irrelevant - Only for Spencer + Assert.AreEqual(SearchAreaConditionsSlipPlanePosition.High, searchAreaConditions.SlipPlanePosition); // Irrelevant - Only for Spencer + } + #endregion #region CreateDailyWaternetForUpliftVan Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs =================================================================== diff -u -r44e8b00d548969e48987e6d3227c02e6555b2767 -rc5b9477d76b5e2b63716c238029161230ba645f8 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision c5b9477d76b5e2b63716c238029161230ba645f8) @@ -279,6 +279,10 @@ .Select(s => s.Surface), profile.Geometry.Surfaces); + Assert.AreEqual(profile.Geometry.Points.Min(p => p.X), profile.Geometry.Left); + Assert.AreEqual(profile.Geometry.Points.Max(p => p.X), profile.Geometry.Right); + Assert.AreEqual(profile.Geometry.Points.Min(p => p.Z), profile.Geometry.Bottom); + #endregion #region Surfaces @@ -568,6 +572,10 @@ .Select(s => s.Surface), profile.Geometry.Surfaces); + Assert.AreEqual(profile.Geometry.Points.Min(p => p.X), profile.Geometry.Left); + Assert.AreEqual(profile.Geometry.Points.Max(p => p.X), profile.Geometry.Right); + Assert.AreEqual(profile.Geometry.Points.Min(p => p.Z), profile.Geometry.Bottom); + #endregion #region Surfaces Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs =================================================================== diff -u -rca2e4b3a0824dd8b142fae068b29ee2fbbd1069e -rc5b9477d76b5e2b63716c238029161230ba645f8 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs (.../UpliftVanCalculationGridCreatorTest.cs) (revision ca2e4b3a0824dd8b142fae068b29ee2fbbd1069e) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs (.../UpliftVanCalculationGridCreatorTest.cs) (revision c5b9477d76b5e2b63716c238029161230ba645f8) @@ -80,7 +80,7 @@ Assert.AreEqual(rightGridZBottom, upliftVanCalculationGrid.RightGrid.GridZBottom); Assert.AreEqual(rightGridXNumber, upliftVanCalculationGrid.RightGrid.GridXNumber); Assert.AreEqual(rightGridZNumber, upliftVanCalculationGrid.RightGrid.GridZNumber); - Assert.IsNull(upliftVanCalculationGrid.TangentLines); + Assert.IsNull(upliftVanCalculationGrid.TangentLines); // Only for output } [Test] @@ -107,7 +107,7 @@ Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridZBottom); Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridXNumber); Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridZNumber); - Assert.IsNull(upliftVanCalculationGrid.TangentLines); + Assert.IsNull(upliftVanCalculationGrid.TangentLines); // Only for output } } } \ No newline at end of file