Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs =================================================================== diff -u -r4628 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 4628) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 5416) @@ -27,6 +27,7 @@ using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Calculation; using Deltares.DamEngine.Data.Standard.Logging; using Deltares.DamEngine.TestHelpers.Factories; @@ -47,25 +48,30 @@ // FoSbe = Hcbe / reducedFall = 2.25 / 0.5 const double diff = 0.0001; + + var subSoilScenario = new SoilGeometryProbability + { + SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(out SoilList soilList), + SegmentFailureMechanismType = SegmentFailureMechanismType.Piping + }; var location = new Location("Location 1") { SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(), ModelFactors = { UpliftCriterionPiping = 1.0 - } + }, + CurrentScenario = new DesignScenario(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList }; - location.CurrentScenario = new DesignScenario(); var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = FailureMechanismSystemType.Piping, PipingModelType = PipingModelType.Bligh }; - var subSoilScenario = new SoilGeometryProbability(); - subSoilScenario.SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(); - subSoilScenario.SegmentFailureMechanismType = SegmentFailureMechanismType.Piping; - + var damKernelInput = new DamKernelInput { Location = location, @@ -124,14 +130,25 @@ public void TestPrepare() { const double diff = 0.0001; + + var subSoilScenario = new SoilGeometryProbability + { + SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(out SoilList soilList), + SegmentFailureMechanismType = SegmentFailureMechanismType.Piping + }; - var location = new Location(); - location.SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - location.ModelFactors.UpliftCriterionPiping = 1.0; - location.CurrentScenario = new DesignScenario(); - var subSoilScenario = new SoilGeometryProbability(); - subSoilScenario.SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(); - subSoilScenario.SegmentFailureMechanismType = SegmentFailureMechanismType.Piping; + var location = new Location + { + SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(), + ModelFactors = + { + UpliftCriterionPiping = 1.0 + }, + CurrentScenario = new DesignScenario(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList + }; + var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = FailureMechanismSystemType.Piping, @@ -189,9 +206,11 @@ { var kernelWrapper = new DamPipingBlighKernelWrapper(); - var subSoilScenario = new SoilGeometryProbability(); - subSoilScenario.SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(); - subSoilScenario.SegmentFailureMechanismType = SegmentFailureMechanismType.Piping; + var subSoilScenario = new SoilGeometryProbability + { + SoilProfile1D = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(out _), + SegmentFailureMechanismType = SegmentFailureMechanismType.Piping + }; var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = FailureMechanismSystemType.Piping, Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs =================================================================== diff -u -r5012 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 5012) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 5416) @@ -38,28 +38,36 @@ { // expected values retrieved from debugging Dam Classic (rev.663) // test CanCalculateThePipingFactorUsingSellmeijer4Forces - var location = new Location(); - location.CurrentScenario = new DesignScenario(); - location.SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); + SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList); + var location = new Location + { + CurrentScenario = new DesignScenario(), + SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList + }; + var riverLevel = 1.0; var timeStepDateTime = new DateTime(); PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel); - Assert.That(plLines.PlLineCount, Is.EqualTo(4)); - Assert.That(plLines.Lines[PlLineType.Pl1].Points.Count, Is.EqualTo(8)); - Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); - Assert.That(new PlLinePoint(14.900, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); - Assert.That(new PlLinePoint(34.500, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); - Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); - Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); - Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); - Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); - Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl2].Points.Count, Is.EqualTo(0)); - Assert.That(plLines.Lines[PlLineType.Pl3].Points.Count, Is.EqualTo(2)); - Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); - Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl4].Points.Count, Is.EqualTo(0)); + Assert.Multiple(() => + { + Assert.That(plLines.PlLineCount, Is.EqualTo(4)); + Assert.That(plLines.Lines[PlLineType.Pl1].Points, Has.Count.EqualTo(8)); + Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); + Assert.That(new PlLinePoint(14.900, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); + Assert.That(new PlLinePoint(34.500, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); + Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); + Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); + Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); + Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); + Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl2].Points, Is.Empty); + Assert.That(plLines.Lines[PlLineType.Pl3].Points, Has.Count.EqualTo(2)); + Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); + Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl4].Points, Is.Empty); + }); } [Test] @@ -69,28 +77,36 @@ // test CanCalculateThePipingFactorUsingSellmeijer4Forces // Same as TestCreatePlLinesNoHydraulicShortcut because HeadInPlLine3 is not given. - var location = new Location(); - location.CurrentScenario = new DesignScenario(); - location.SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); + SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList); + var location = new Location + { + CurrentScenario = new DesignScenario(), + SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList + }; + var riverLevel = 1.0; var timeStepDateTime = new DateTime(); PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel); - Assert.That(plLines.PlLineCount, Is.EqualTo(4)); - Assert.That(plLines.Lines[PlLineType.Pl1].Points.Count, Is.EqualTo(8)); - Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); - Assert.That(new PlLinePoint(14.900, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); - Assert.That(new PlLinePoint(34.500, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); - Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); - Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); - Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); - Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); - Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl2].Points.Count, Is.EqualTo(0)); - Assert.That(plLines.Lines[PlLineType.Pl3].Points.Count, Is.EqualTo(2)); - Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); - Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl4].Points.Count, Is.EqualTo(0)); + Assert.Multiple(() => + { + Assert.That(plLines.PlLineCount, Is.EqualTo(4)); + Assert.That(plLines.Lines[PlLineType.Pl1].Points, Has.Count.EqualTo(8)); + Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); + Assert.That(new PlLinePoint(14.900, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); + Assert.That(new PlLinePoint(34.500, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); + Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); + Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); + Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); + Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); + Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl2].Points, Is.Empty); + Assert.That(plLines.Lines[PlLineType.Pl3].Points, Has.Count.EqualTo(2)); + Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); + Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl4].Points, Is.Empty); + }); } [Test] @@ -103,39 +119,48 @@ // PL3 is same as TestCreatePlLinesNoHydraulicShortcut because HeadInPlLine3 is given with value 1 and there is a // in between aquifer so Head (1.0) is used instead of riverlevel. // PL2 and PL4 now generated at riverlevel. - var location = new Location(); + SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList); + AddLayerToSoilProfile(soilProfile1D, -4, false); + AddLayerToSoilProfile(soilProfile1D, -5, true); + var scenario = new DesignScenario { HeadPl3 = 1.0 }; - location.CurrentScenario = scenario; - location.SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); - AddLayerToSoilProfile(soilProfile1D, -4, false); - AddLayerToSoilProfile(soilProfile1D, -5, true); + var location = new Location + { + CurrentScenario = scenario, + SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList + }; + var riverLevel = 0.5; var timeStepDateTime = new DateTime(); PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel); - Assert.That(plLines.PlLineCount, Is.EqualTo(4)); - Assert.That(plLines.Lines[PlLineType.Pl1].Points.Count, Is.EqualTo(8)); - Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); - Assert.That(new PlLinePoint(12.450, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); - Assert.That(new PlLinePoint(34.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); - Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); - Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); - Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); - Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); - Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl2].Points.Count, Is.EqualTo(2)); - Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl2].Points[0]), Is.True); - Assert.That(new PlLinePoint(75.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl2].Points[1]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl3].Points.Count, Is.EqualTo(2)); - Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); - Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); - Assert.That(plLines.Lines[PlLineType.Pl4].Points.Count, Is.EqualTo(2)); - Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl4].Points[0]), Is.True); - Assert.That(new PlLinePoint(75.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl4].Points[1]), Is.True); + Assert.Multiple(() => + { + Assert.That(plLines.PlLineCount, Is.EqualTo(4)); + Assert.That(plLines.Lines[PlLineType.Pl1].Points, Has.Count.EqualTo(8)); + Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]), Is.True); + Assert.That(new PlLinePoint(12.450, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[1]), Is.True); + Assert.That(new PlLinePoint(34.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[2]), Is.True); + Assert.That(new PlLinePoint(40.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[3]), Is.True); + Assert.That(new PlLinePoint(50.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[4]), Is.True); + Assert.That(new PlLinePoint(58.500, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[5]), Is.True); + Assert.That(new PlLinePoint(61.510, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[6]), Is.True); + Assert.That(new PlLinePoint(75.000, 0.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[7]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl2].Points, Has.Count.EqualTo(2)); + Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl2].Points[0]), Is.True); + Assert.That(new PlLinePoint(75.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl2].Points[1]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl3].Points, Has.Count.EqualTo(2)); + Assert.That(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[0]), Is.True); + Assert.That(new PlLinePoint(75.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl3].Points[1]), Is.True); + Assert.That(plLines.Lines[PlLineType.Pl4].Points, Has.Count.EqualTo(2)); + Assert.That(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl4].Points[0]), Is.True); + Assert.That(new PlLinePoint(75.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl4].Points[1]), Is.True); + }); } private void AddLayerToSoilProfile(SoilProfile1D soilProfile, double topLevel, bool isAquifer) Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs =================================================================== diff -u -r5265 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs (.../PlLinesCreatorTest.cs) (revision 5265) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/PlLinesCreator/PlLinesCreatorTest.cs (.../PlLinesCreatorTest.cs) (revision 5416) @@ -599,7 +599,7 @@ { var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), WaterLevelRiverHigh = 2.5, ModelParametersForPlLines = { @@ -656,7 +656,7 @@ var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { SurfaceLine = surfaceLine, - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), WaterLevelRiverHigh = 3.0, ModelParametersForPlLines = { @@ -715,7 +715,7 @@ var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { SurfaceLine = surfaceLine, - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), WaterLevelRiverHigh = 3.0, ModelParametersForPlLines = { @@ -779,7 +779,7 @@ var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { SurfaceLine = surfaceLine, - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), WaterLevelRiverHigh = 3.0, ModelParametersForPlLines = { @@ -842,7 +842,7 @@ var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { SurfaceLine = surfaceLine, - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), WaterLevelRiverHigh = 3.0, ModelParametersForPlLines = { @@ -1063,7 +1063,7 @@ var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { SurfaceLine = surfaceLine, - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), ModelParametersForPlLines = { PenetrationLength = cPenetrationLength @@ -1220,7 +1220,8 @@ WaterLevelRiverHigh = 4.0, WaterLevelPolder = -0.5, SoilProfile = FactoryForSoilProfiles.CreateClaySandClaySandProfile(10, -0.5, -1.5, -5), - SurfaceLine = surfaceLineTutorial1 + SurfaceLine = surfaceLineTutorial1, + DikeEmbankmentMaterial = new Soil() }; var location = new Location(); @@ -1448,7 +1449,7 @@ SurfaceLine2 surfaceLineTutorial1 = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator { - SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(), + SoilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out _), SurfaceLine = surfaceLineTutorial1, WaterLevelRiverHigh = 4.0, WaterLevelPolder = -0.5, Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs =================================================================== diff -u -r4718 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs (.../WtiPipingSellmeijerRevisedKernelWrapperTests.cs) (revision 4718) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs (.../WtiPipingSellmeijerRevisedKernelWrapperTests.cs) (revision 5416) @@ -77,7 +77,7 @@ var subSoilScenario = new SoilGeometryProbability { - SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(), + SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out _), SegmentFailureMechanismType = SegmentFailureMechanismType.Piping }; var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification @@ -221,7 +221,7 @@ { const double diff = 0.0001; var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); - SoilProfile1D profile = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); + SoilProfile1D profile = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out _); PipingProfile profilePiping = kernelWrapper.ConvertToPipingProfile(profile); Assert.That(profilePiping.Layers.Count, Is.EqualTo(2)); @@ -346,6 +346,12 @@ // as performed in the Wti kernel itself. const double diff = 0.0001; + + var subSoilScenario = new SoilGeometryProbability + { + SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList), + SegmentFailureMechanismType = SegmentFailureMechanismType.Piping + }; var location = new Location("Location 1") { @@ -359,7 +365,9 @@ { DampingFactorPl3 = 0.25, DampingFactorPl4 = 0.10 - } + }, + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList }; var designScenario = new DesignScenario @@ -368,11 +376,7 @@ LocationName = location.Name }; location.CurrentScenario = designScenario; - var subSoilScenario = new SoilGeometryProbability - { - SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(), - SegmentFailureMechanismType = SegmentFailureMechanismType.Piping - }; + var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = FailureMechanismSystemType.Piping, @@ -454,13 +458,18 @@ [TestCase(0, 49.5)] [TestCase(10, 59.5)] [TestCase(-10, 39.5)] - public void TestPrepareWithInfluenceOfDistanceToEntryPoint(double distanceToEnrtyPoint, double expectedSeepageLength) + public void TestPrepareWithInfluenceOfDistanceToEntryPoint(double distanceToEntryPoint, double expectedSeepageLength) { const double diff = 0.0001; + var subSoilScenario = new SoilGeometryProbability + { + SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList), + SegmentFailureMechanismType = SegmentFailureMechanismType.Piping + }; var location = new Location { - DistanceToEntryPoint = distanceToEnrtyPoint, + DistanceToEntryPoint = distanceToEntryPoint, SurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineForWtiPiping(), ModelFactors = { @@ -470,14 +479,11 @@ { DampingFactorPl3 = 0.25, DampingFactorPl4 = 0.10 - } + }, + CurrentScenario = new DesignScenario(), + DikeEmbankmentMaterial = soilList.Soils[0].Name, + SoilList = soilList }; - location.CurrentScenario = new DesignScenario(); - var subSoilScenario = new SoilGeometryProbability - { - SoilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(), - SegmentFailureMechanismType = SegmentFailureMechanismType.Piping - }; var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification { FailureMechanismSystemType = FailureMechanismSystemType.Piping, Index: DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs =================================================================== diff -u -r5404 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs (.../FactoryForSoilProfiles.cs) (revision 5404) +++ DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs (.../FactoryForSoilProfiles.cs) (revision 5416) @@ -95,47 +95,34 @@ /// Create two layer soil profile with pleistocene sand layer only /// /// soil profile - public static SoilProfile1D CreateHeavyClaySandProfileForHydraulicShortcutEvaluator() + public static SoilProfile1D CreateClaySandProfile(out SoilList soilList, double topLevelSandLayer = -5) { - SoilProfile1D soilProfile = CreateClaySandProfile(); - soilProfile.Layers[0].Soil.BelowPhreaticLevel = 22.0; - soilProfile.Layers[0].Soil.AbovePhreaticLevel = 20.0; - foreach (SoilLayer1D layer in soilProfile.Layers) - { - layer.Soil.DryUnitWeight = layer.Soil.AbovePhreaticLevel - 2; - } - - return soilProfile; - } - - /// - /// Create two layer soil profile with pleistocene sand layer only - /// - /// soil profile - public static SoilProfile1D CreateClaySandProfile(double topLevelSandLayer = -5) - { var soilProfile = new SoilProfile1D(); - + + var soil1 = new Soil("HW-OBO", 12.0, 10.0); + soil1.DryUnitWeight = 0.01; + var soil2 = new Soil("Alg-zand (0-30)", 22.0, 20.0); + soil2.DryUnitWeight = 0.01; + soilList = new SoilList(); + soilList.Add(soil1); + soilList.Add(soil2); + var layer = new SoilLayer1D { Name = GetNewUniqueLayerId(soilProfile) }; layer.TopLevel = 10.0; - layer.Soil = new Soil("HW-OBO", 12.0, 10.0); - layer.Soil.DryUnitWeight = 0.01; + layer.Soil = soil1; layer.IsAquifer = false; soilProfile.Layers.Add(layer); - layer = new SoilLayer1D { Name = GetNewUniqueLayerId(soilProfile) }; layer.TopLevel = topLevelSandLayer; layer.Soil = new Soil("Alg-zand (0-30)", 22.0, 20.0); - layer.Soil.DryUnitWeight = 0.01; layer.IsAquifer = true; soilProfile.Layers.Add(layer); - soilProfile.BottomLevel = -10.0; return soilProfile; @@ -162,9 +149,9 @@ /// Creates the clay sand profile for piping bligh. /// /// soil profile - public static SoilProfile1D CreateClaySandProfileForPipingBligh() + public static SoilProfile1D CreateClaySandProfileForPipingBligh(out SoilList soilList) { - SoilProfile1D soilProfile = CreateClaySandProfile(); + SoilProfile1D soilProfile = CreateClaySandProfile(out soilList); foreach (SoilLayer1D layer in soilProfile.Layers) { layer.Soil.BelowPhreaticLevel = 1; @@ -588,43 +575,49 @@ } /// - /// Create two layer soil profile with pleistocene sand layer (no intermediate layer + /// Create two layer soil profile with pleistocene sand layer (no intermediate layer) /// /// soil profile - public static SoilProfile1D CreatePipingSellmeijerProfileWithOneSandlayer() + public static SoilProfile1D CreatePipingSellmeijerProfileWithOneSandLayer(out SoilList soilList) { var soilProfile = new SoilProfile1D(); - - var layer = new SoilLayer1D + + var topMaterial = new Soil("Topmaterial", 14, 11) { - Name = GetNewUniqueLayerId(soilProfile) - }; - layer.TopLevel = 10.0; - layer.Soil = new Soil("Topmaterial", 14, 11) - { PermeabKx = 0.0003, DiameterD70 = Physics.FactorMicroMeterToMeter * 300.0, WhitesConstant = 0.5, BeddingAngle = 57.0 }; - layer.IsAquifer = false; - soilProfile.Layers.Add(layer); - - layer = new SoilLayer1D + var sand = new Soil("Sand", 22.0, 20.0) { - Name = GetNewUniqueLayerId(soilProfile) - }; - layer.TopLevel = -2.0; - layer.Soil = new Soil("Sand", 22.0, 20.0) - { PermeabKx = 0.0001, DiameterD70 = Physics.FactorMicroMeterToMeter * 200.0, WhitesConstant = 0.25, BeddingAngle = 37.0 }; - layer.IsAquifer = true; + soilList = new SoilList(); + soilList.Add(topMaterial); + soilList.Add(sand); + + var layer = new SoilLayer1D + { + Name = GetNewUniqueLayerId(soilProfile), + TopLevel = 10.0, + Soil = topMaterial, + IsAquifer = false + }; soilProfile.Layers.Add(layer); + layer = new SoilLayer1D + { + Name = GetNewUniqueLayerId(soilProfile), + TopLevel = -2.0, + Soil = sand, + IsAquifer = true + }; + soilProfile.Layers.Add(layer); + soilProfile.BottomLevel = -10.0; return soilProfile; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Uplift/UpliftLocationDeterminatorTest.cs =================================================================== diff -u -r4627 -r5416 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Uplift/UpliftLocationDeterminatorTest.cs (.../UpliftLocationDeterminatorTest.cs) (revision 4627) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Uplift/UpliftLocationDeterminatorTest.cs (.../UpliftLocationDeterminatorTest.cs) (revision 5416) @@ -89,8 +89,8 @@ // Set required upliftcalculator variables const double cRiverlevel = 4; SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfile(); - PlLines plLines = CreatePlLines(surfaceLine, soilProfile, cRiverlevel, false); + SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfile(out SoilList soilList); + PlLines plLines = CreatePlLines(surfaceLine, soilProfile, soilList, cRiverlevel, false); var upliftLocationDeterminator = new UpliftLocationDeterminator { @@ -113,8 +113,8 @@ // Set required upliftcalculator variables const double cRiverlevel = 4; SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(); - PlLines plLines = CreatePlLines(surfaceLine, soilProfile, cRiverlevel, false); + SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(out SoilList soilList); + PlLines plLines = CreatePlLines(surfaceLine, soilProfile, soilList, cRiverlevel, false); var upliftLocationDeterminator = new UpliftLocationDeterminator { @@ -139,14 +139,14 @@ // Set required upliftcalculator variables const double cRiverlevel = 4; SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); - SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(); + SoilProfile1D soilProfile = FactoryForSoilProfiles.CreateClaySandProfileForPipingBligh(out SoilList soilList); foreach (SoilLayer1D layer in soilProfile.Layers) { layer.Soil.DryUnitWeight = layer.Soil.AbovePhreaticLevel; layer.Soil.AbovePhreaticLevel = layer.Soil.AbovePhreaticLevel + 1.0; } - PlLines plLines = CreatePlLines(surfaceLine, soilProfile, cRiverlevel, false); + PlLines plLines = CreatePlLines(surfaceLine, soilProfile, soilList, cRiverlevel, false); var upliftLocationDeterminator = new UpliftLocationDeterminator { @@ -161,17 +161,24 @@ Assert.That(upliftLocationAndResult.UpliftFactor.Value, Is.EqualTo(cExpectedUpliftFactor).Within(cTolerance)); } - private static PlLines CreatePlLines(SurfaceLine2 surfaceLine, SoilProfile1D soilProfile, double riverLevel, bool isUseOvenDryUnitWeight) + private static PlLines CreatePlLines(SurfaceLine2 surfaceLine, SoilProfile1D soilProfile, SoilList soilList, double riverLevel, bool isUseOvenDryUnitWeight) { - var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator(); - plLineCreator.SoilProfile = soilProfile; - plLineCreator.SurfaceLine = surfaceLine; - plLineCreator.WaterLevelRiverHigh = riverLevel; - plLineCreator.WaterLevelPolder = -0.5; - plLineCreator.ModelParametersForPlLines.DampingFactorPl3 = 0.3; - plLineCreator.ModelParametersForPlLines.DampingFactorPl4 = 0.4; - plLineCreator.ModelParametersForPlLines.PenetrationLength = 1.5; - plLineCreator.IsAdjustPL3AndPL4SoNoUpliftWillOccurEnabled = false; // for piping this must be set to false + var plLineCreator = new Calculators.PlLinesCreator.PlLinesCreator + { + SoilProfile = soilProfile, + SurfaceLine = surfaceLine, + SoilList = soilList, + DikeEmbankmentMaterial = soilList.Soils[0], + WaterLevelRiverHigh = riverLevel, + WaterLevelPolder = -0.5, + ModelParametersForPlLines = + { + DampingFactorPl3 = 0.3, + DampingFactorPl4 = 0.4, + PenetrationLength = 1.5 + }, + IsAdjustPL3AndPL4SoNoUpliftWillOccurEnabled = false // for piping this must be set to false + }; var location = new Location(); return plLineCreator.CreateAllPlLines(location); }