Index: DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs =================================================================== diff -u -r5111 -r5119 --- DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs (.../FactoryForSoilProfiles.cs) (revision 5111) +++ DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForSoilProfiles.cs (.../FactoryForSoilProfiles.cs) (revision 5119) @@ -1094,14 +1094,19 @@ Bottom = -15 } }; + var soil1 = new Soil("Soil1"); + SoilLayer2D soilLayer1 = CreateRectangularSoilLayer2D(10, 0, -50, -20, soil1, soilProfile2D); + var soil2 = new Soil("Soil2"); + SoilLayer2D soilLayer2 = CreatePentagonSoilLayer2D(new Point2D(-20, 10), new Point2D(0, 10), new Point2D(0, 0), new Point2D(-10, 0), new Point2D(-20, 0), soil2, soilProfile2D); + var soil3 = new Soil("Soil3"); + SoilLayer2D soilLayer3 = CreatePentagonSoilLayer2D(new Point2D(0, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(35, 0), new Point2D(0, 0), soil3, soilProfile2D); + var soil4 = new Soil("Soil"); + SoilLayer2D soilLayer4 = CreatePentagonSoilLayer2D(new Point2D(-50, 0), new Point2D(-20, 0), new Point2D(-10, 0), new Point2D(-10, -15), new Point2D(-50, -15), soil4, soilProfile2D); + var soil5 = new Soil("Soil5"); + SoilLayer2D soilLayer5 = CreatePentagonSoilLayer2D(new Point2D(-10, 0), new Point2D(0, 0), new Point2D(35, 0), new Point2D(35, -15), new Point2D(-10, -15), soil5, soilProfile2D); + var soil6 = new Soil("Soil6"); + SoilLayer2D soilLayer6 = CreateRectangularSoilLayer2D(0, -15, 35, 60, soil6, soilProfile2D, true); - SoilLayer2D soilLayer1 = CreateRectangularSoilLayer2D(10, 0, -50, -20, "Surface 1", soilProfile2D); - SoilLayer2D soilLayer2 = CreatePentagonSoilLayer2D(new Point2D(-20, 10), new Point2D(0, 10), new Point2D(0, 0), new Point2D(-10, 0), new Point2D(-20, 0), "Surface 2", soilProfile2D); - SoilLayer2D soilLayer3 = CreatePentagonSoilLayer2D(new Point2D(0, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(35, 0), new Point2D(0, 0), "Surface 3", soilProfile2D); - SoilLayer2D soilLayer4 = CreatePentagonSoilLayer2D(new Point2D(-50, 0), new Point2D(-20, 0), new Point2D(-10, 0), new Point2D(-10, -15), new Point2D(-50, -15), "Surface 4", soilProfile2D); - SoilLayer2D soilLayer5 = CreatePentagonSoilLayer2D(new Point2D(-10, 0), new Point2D(0, 0), new Point2D(35, 0), new Point2D(35, -15), new Point2D(-10, -15), "Surface 5", soilProfile2D); - SoilLayer2D soilLayer6 = CreateRectangularSoilLayer2D(0, -15, 35, 60, "Surface 6", soilProfile2D); - soilProfile2D.Surfaces.Add(soilLayer1); soilProfile2D.Surfaces.Add(soilLayer2); soilProfile2D.Surfaces.Add(soilLayer3); @@ -1137,10 +1142,11 @@ return id; } - public static SoilLayer2D CreateRectangularSoilLayer2D(double topCoord, double bottomCoord, double leftCoord, double rightCoord, string soilName, SoilProfile2D soilProfile2D = null) + public static SoilLayer2D CreateRectangularSoilLayer2D(double topCoord, double bottomCoord, double leftCoord, + double rightCoord, Soil soil = null, SoilProfile2D soilProfile2D = null, bool isAquifer = false) { var topLeftPoint = new Point2D(leftCoord, topCoord); - var topRightPoint = new Point2D(rightCoord, topCoord); + var topRightPoint = new Point2D(rightCoord, topCoord); var bottomRightPoint = new Point2D(rightCoord, bottomCoord); var bottomLeftPoint = new Point2D(leftCoord, bottomCoord); var curve1 = new GeometryCurve(topLeftPoint, topRightPoint); @@ -1175,11 +1181,12 @@ } } }, - SoilName = soilName + Soil = soil, + IsAquifer = isAquifer }; } - public static SoilLayer2D CreateTriangularSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, string soilName) + public static SoilLayer2D CreateTriangularSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Soil soil = null, bool isAquifer = false) { return new SoilLayer2D { @@ -1195,11 +1202,12 @@ } } }, - SoilName = soilName + Soil = soil, + IsAquifer = isAquifer }; } - public static SoilLayer2D CreateQuadrilateralSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, string soilName) + public static SoilLayer2D CreateQuadrilateralSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Soil soil = null, bool isAquifer = false) { return new SoilLayer2D { @@ -1216,12 +1224,13 @@ } } }, - SoilName = soilName, - IsAquifer = false + Soil = soil, + IsAquifer = isAquifer }; } - public static SoilLayer2D CreatePentagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, string soilName, SoilProfile2D soilProfile2D = null) + public static SoilLayer2D CreatePentagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, + Point2D point5, Soil soil = null, SoilProfile2D soilProfile2D = null, bool isAquifer = false) { var curve1 = new GeometryCurve(point1, point2); var curve2 = new GeometryCurve(point2, point3); @@ -1260,11 +1269,12 @@ } } }, - SoilName = soilName + Soil = soil, + IsAquifer = isAquifer }; } - public static SoilLayer2D CreateHexagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, Point2D point6, string soilName) + public static SoilLayer2D CreateHexagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, Point2D point6, Soil soil, bool isAquifer = false) { return new SoilLayer2D { @@ -1283,11 +1293,12 @@ } } }, - SoilName = soilName + Soil = soil, + IsAquifer = isAquifer }; } - public static SoilLayer2D CreateHeptagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, Point2D point6, Point2D point7, string soilName) + public static SoilLayer2D CreateHeptagonSoilLayer2D(Point2D point1, Point2D point2, Point2D point3, Point2D point4, Point2D point5, Point2D point6, Point2D point7, Soil soil = null, bool isAquifer = false) { return new SoilLayer2D { @@ -1307,7 +1318,8 @@ } } }, - SoilName = soilName + Soil = soil, + IsAquifer = isAquifer }; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs =================================================================== diff -u -r4540 -r5119 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 4540) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 5119) @@ -225,7 +225,7 @@ var damKernelInput = new DamKernelInput(); damKernelInput.ProjectDir = projectPath; damKernelInput.CalculationDir = Path.Combine(projectPath, calculationMap); - damKernelInput.Location = location; + damKernelInput.Location = location; //.Copy(); #Bka should be a copy but now impossible due to the dictionary used for SensorLocation damKernelInput.SubSoilScenario = soiProfileProbability.Copy(); damKernelInput.TimeStepDateTime = timeSerieEntry.DateTime.Copy(); damKernelInput.DamFailureMechanismeCalculationSpecification = damFailureMechanismCalculationSpecification; Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs =================================================================== diff -u -r5111 -r5119 --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs (.../SoilProfile2DSurfaceLineHelperTests.cs) (revision 5111) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs (.../SoilProfile2DSurfaceLineHelperTests.cs) (revision 5119) @@ -99,25 +99,35 @@ { get { + var soil1 = new Soil("Soil1"); + var soil2 = new Soil("Soil2"); + var soil3 = new Soil("Soil3"); + var soil4 = new Soil("Soil4"); + var soil5 = new Soil("Soil5"); + var soil6 = new Soil("Soil6"); + var soil7 = new Soil("Soil7"); + var soil8 = new Soil("Soil8"); + var soil9 = new Soil("Soil9"); + var soil10 = new Soil("Soil10"); yield return new TestCaseData( new TestCaseZigZagSurfaceLine { TestNumber = 1, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 10), ExpectedSurfaceCount = 10, // 4 extra surfaces created : 2 below the highest corners of the "zigzag" surface line + 2 on the left side (between Z=60 and 70) - ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-50, 10), new Point2D(-30, 12), new Point2D(-10, 10), "Filling material"), - ExpectedFilling2 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(350, 10), new Point2D(50, 12), new Point2D(60, 11), new Point2D(60, 10), "Filling material"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-50, 10), new Point2D(-30, 12), new Point2D(-10, 10), soil10), + ExpectedFilling2 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(350, 10), new Point2D(50, 12), new Point2D(60, 11), new Point2D(60, 10), soil10), ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70, "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70), ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, "Surface 6"), - ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -50, -20, "Surface 1"), - ExpectedSurface2 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-20, 10), new Point2D(-10, 10), new Point2D(0, 9), new Point2D(0, 0), new Point2D(-20, 0), "Surface 2"), - ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(0, 9), new Point2D(10, 8), new Point2D(30, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(0, 0), "Surface 3"), - ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 4"), - ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 5"), - ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, "Surface 6") + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -50, -20, soil1), + ExpectedSurface2 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-20, 10), new Point2D(-10, 10), new Point2D(0, 9), new Point2D(0, 0), new Point2D(-20, 0), soil2), + ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(0, 9), new Point2D(10, 8), new Point2D(30, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(0, 0), soil3), + ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil4), + ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil5), + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, soil6) }).SetName("Test 1: Surface line intersects the original surface line of soil profile (and shift = 0)"); @@ -128,18 +138,18 @@ GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 13), ExpectedSurfaceCount = 9, // 3 extra surfaces created: 1 below the "zigzag" surface line + 2 on the left side (between Z=60 and 70) - ExpectedFilling1 = FactoryForSoilProfiles.CreateHeptagonSoilLayer2D(new Point2D(-50, 13), new Point2D(-30, 15), new Point2D(10, 11), new Point2D(50, 15), new Point2D(70, 13), new Point2D(70, 10), new Point2D(-50, 10), "Filling material"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateHeptagonSoilLayer2D(new Point2D(-50, 13), new Point2D(-30, 15), new Point2D(10, 11), new Point2D(50, 15), new Point2D(70, 13), new Point2D(70, 10), new Point2D(-50, 10), soil10), ExpectedFilling2 = null, ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70, "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70, soil3), ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, "Surface 6"), - ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -50, -20, "Surface 1"), - ExpectedSurface2 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -20, 0, "Surface 2"), - ExpectedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 0, 60, "Surface 3"), - ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 4"), - ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 5"), - ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, "Surface 6") + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -50, -20, soil1), + ExpectedSurface2 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -20, 0, soil2), + ExpectedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 0, 60, soil3), + ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil4), + ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil5), + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, soil6) }).SetName("Test 2: Surface line is completely above original surface line of soil profile (and shift = 0)"); yield return new TestCaseData( @@ -152,15 +162,15 @@ ExpectedFilling1 = null, ExpectedFilling2 = null, ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70, "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 70, soil3), ExpectedExtendedSurface4= null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, "Surface 6"), - ExpectedSurface1 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-50, 5), new Point2D(-30, 7), new Point2D(-20, 6), new Point2D(-20, 0), new Point2D(-50, 0),"Surface 1"), - ExpectedSurface2 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(-20, 6), new Point2D(0, 4), new Point2D(0, 0), new Point2D(-20, 0), "Surface 2"), - ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(0, 4), new Point2D(10, 3), new Point2D(50, 7), new Point2D(60, 6), new Point2D(60, 0), new Point2D(0, 0), "Surface 3"), - ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 4"), - ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 5"), - ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, "Surface 6") + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-50, 5), new Point2D(-30, 7), new Point2D(-20, 6), new Point2D(-20, 0), new Point2D(-50, 0),soil1), + ExpectedSurface2 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(-20, 6), new Point2D(0, 4), new Point2D(0, 0), new Point2D(-20, 0), soil2), + ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(0, 4), new Point2D(10, 3), new Point2D(50, 7), new Point2D(60, 6), new Point2D(60, 0), new Point2D(0, 0), soil3), + ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil4), + ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil5), + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, soil6) }).SetName("Test 3: Surface line is completely in the top layer of the soil profile (and shift = 0)"); yield return new TestCaseData( @@ -173,15 +183,15 @@ ExpectedFilling1 = null, ExpectedFilling2 = null, ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(60, 1), new Point2D(70, 0), new Point2D(60, 0), "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(60, 1), new Point2D(70, 0), new Point2D(60, 0), soil3), ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, "Surface 6"), - ExpectedSurface1 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-50, 5), new Point2D(-30, 7), new Point2D(-20, 6), new Point2D(-20, 0), new Point2D(-50, 0),"Surface 1"), - ExpectedSurface2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-20, 1), new Point2D(-10, 0), new Point2D(-20, 0), "Surface 2"), - ExpectedSurface3 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(35, 0), new Point2D(50, 2), new Point2D(60, 1), new Point2D(60, 0), "Surface 3"), - ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, "Surface 4"), - ExpectedSurface5 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-10, 0), new Point2D(10, -2), new Point2D(35, 0), new Point2D(35, -15), new Point2D(-10, -15), "Surface 5"), - ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, "Surface 6") + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 70, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-50, 5), new Point2D(-30, 7), new Point2D(-20, 6), new Point2D(-20, 0), new Point2D(-50, 0),soil1), + ExpectedSurface2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-20, 1), new Point2D(-10, 0), new Point2D(-20, 0), soil2), + ExpectedSurface3 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(35, 0), new Point2D(50, 2), new Point2D(60, 1), new Point2D(60, 0), soil3), + ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -50, -10, soil4), + ExpectedSurface5 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-10, 0), new Point2D(10, -2), new Point2D(35, 0), new Point2D(35, -15), new Point2D(-10, -15), soil5), + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 600, soil6) }).SetName("Test 4: Surface line intersects the original layer separation of soil profile (and shift = 0)"); yield return new TestCaseData( @@ -207,16 +217,16 @@ GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-40, 10), ExpectedSurfaceCount = 10, // Only few surfaces are tested - ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-60, 10), new Point2D(-40, 12), new Point2D(-20, 10), "Filling material"), - ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(40, 10), new Point2D(60, 12), new Point2D(80, 10), "Filling material"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-60, 10), new Point2D(-40, 12), new Point2D(-20, 10), soil10), + ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(40, 10), new Point2D(60, 12), new Point2D(80, 10), soil10), ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 80, "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 80, soil3), ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 80, "Surface 6"), - ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -40, -20, "Surface 1"), + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 80, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -40, -20, soil1), ExpectedSurface2 = null, // not null but not tested ExpectedSurface3 = null, // not null but not tested - ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -40, -10, "Surface 4"), + ExpectedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -40, -10, soil4), ExpectedSurface5 = null, // not null but not tested ExpectedSurface6 = null // not null but not tested }).SetName("Test 7: Surface line intersects the original surface line of soil profile (and shift = +10)"); @@ -228,17 +238,17 @@ GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(10, 10), ExpectedSurfaceCount = 7, // Only few surfaces are tested - ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(10, 10), new Point2D(30, 12), new Point2D(50, 10), "Filling material"), - ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(90, 10), new Point2D(110, 12), new Point2D(130, 10), "Filling material"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(10, 10), new Point2D(30, 12), new Point2D(50, 10), soil10), + ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(90, 10), new Point2D(110, 12), new Point2D(130, 10), soil10), ExpectedExtendedSurface1 = null, - ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 120, "Surface 3"), + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 60, 120, soil3), ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 120, "Surface 6"), + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 60, 120, soil6), ExpectedSurface1 = null, ExpectedSurface2 = null, - ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(10, 9), new Point2D(20, 8), new Point2D(40, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(10, 0), "Surface 3"), + ExpectedSurface3 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(10, 9), new Point2D(20, 8), new Point2D(40, 10), new Point2D(60, 10), new Point2D(60, 0), new Point2D(10, 0), soil3), ExpectedSurface4 = null, - ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 10, 35, "Surface 5"), + ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 10, 35, soil5), ExpectedSurface6 = null // not null but not tested }).SetName("Test 8: Surface line intersects the original surface line of soil profile (and shift = +60)"); @@ -249,18 +259,18 @@ GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-60, 10), ExpectedSurfaceCount = 10, // Only few surfaces are tested - ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-60, 10), new Point2D(-40, 12), new Point2D(-20, 10), "Filling material"), - ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(20, 10), new Point2D(40, 12), new Point2D(60, 10), "Filling material"), - ExpectedExtendedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -60, -50, "Surface 1"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-60, 10), new Point2D(-40, 12), new Point2D(-20, 10), soil10), + ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(20, 10), new Point2D(40, 12), new Point2D(60, 10), soil10), + ExpectedExtendedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -60, -50, soil1), ExpectedExtendedSurface3 = null, - ExpectedExtendedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -60, -50, "Surface 4"), + ExpectedExtendedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -60, -50, soil4), ExpectedExtendedSurface6 = null, ExpectedSurface1 = null, // not null but not tested ExpectedSurface2 = null, // not null but not tested ExpectedSurface3 = null, // not null but not tested ExpectedSurface4 = null, // not null but not tested ExpectedSurface5 = null, // not null but not tested - ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 60, "Surface 6") + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 35, 60, soil6) }).SetName("Test 9: Surface line intersects the original surface line of soil profile (and shift = -10)"); yield return new TestCaseData( @@ -270,17 +280,17 @@ GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-60, 10), ExpectedSurfaceCount = 9, // Only few surfaces are tested - ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-110, 10), new Point2D(-90, 11), new Point2D(-70, 10), "Filling material"), - ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-30, 10), new Point2D(-10, 12), new Point2D(10, 10), "Filling material"), - ExpectedExtendedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -110, -50, "Surface 1"), + ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-110, 10), new Point2D(-90, 11), new Point2D(-70, 10), soil10), + ExpectedFilling2 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-30, 10), new Point2D(-10, 12), new Point2D(10, 10), soil10), + ExpectedExtendedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -110, -50, soil1), ExpectedExtendedSurface3 = null, - ExpectedExtendedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -110, -50, "Surface 4"), + ExpectedExtendedSurface4 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -110, -50, soil4), ExpectedExtendedSurface6 = null, ExpectedSurface1 = null, // not null but not tested ExpectedSurface2 = null, // not null but not tested ExpectedSurface3 = null, // not null but not tested ExpectedSurface4 = null, //not null but not tested - ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -10, 10, "Surface 5"), + ExpectedSurface5 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, -10, 10, soil5), ExpectedSurface6 = null }).SetName("Test 10: Surface line intersects the original surface line of soil profile (and shift = -60)"); @@ -295,13 +305,13 @@ ExpectedExtendedSurface1 = null, ExpectedExtendedSurface3 = null, ExpectedExtendedSurface4 = null, - ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateHeptagonSoilLayer2D(new Point2D(60, -4), new Point2D(70, -3), new Point2D(110, -5), new Point2D(150, -3), new Point2D(190, -5), new Point2D(190, -15), new Point2D(60, -15),"Surface 6"), + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateHeptagonSoilLayer2D(new Point2D(60, -4), new Point2D(70, -3), new Point2D(110, -5), new Point2D(150, -3), new Point2D(190, -5), new Point2D(190, -15), new Point2D(60, -15),soil6), ExpectedSurface1 = null, ExpectedSurface2 = null, ExpectedSurface3 = null, ExpectedSurface4 = null, ExpectedSurface5 = null, - ExpectedSurface6 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(50, -5), new Point2D(60, -4), new Point2D(60, -15), new Point2D(50, -15), "Surface 6") + ExpectedSurface6 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(50, -5), new Point2D(60, -4), new Point2D(60, -15), new Point2D(50, -15), soil6) }).SetName("Test 11: Surface line starts inside surface line 6 (right bottom) of soil profile"); } } @@ -362,8 +372,8 @@ SoilProfile2D newSoilProfile2D = SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D( testCaseSurfaceLine.GivenZigZagSurfaceLine.Geometry, soilProfile2D, defaultSoil, 0); // For debugging purposes - // GeometryExporter.ExportToFile(newSoilProfile2D.Geometry, visualizationFolder + "Geometry" + testCaseSurfaceLine.TestNumber + ".txt"); - // GeometryExporter.ExportToJsonFile(newSoilProfile2D.Geometry, visualizationFolder + "Geometry" + testCaseSurfaceLine.TestNumber + ".json"); + GeometryExporter.ExportToFile(newSoilProfile2D.Geometry, visualizationFolder + "Geometry" + testCaseSurfaceLine.TestNumber + ".txt"); + GeometryExporter.ExportToJsonFile(newSoilProfile2D.Geometry, visualizationFolder + "Geometry" + testCaseSurfaceLine.TestNumber + ".json"); // Then if (testCaseSurfaceLine.ExpectedSurfaceCount == 0) {