Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs =================================================================== diff -u -r5565 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 5565) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2D.cs (.../SoilProfile2D.cs) (revision 5755) @@ -152,21 +152,9 @@ /// /// /// - /// The 2D soil layer - public static SoilLayer2D DetermineOriginalLayerFromOldSurfaces(GeometrySurface geometrySurface, - IEnumerable oldSurfaces) - { - return DetermineOriginalLayerFromOldSurfaces(geometrySurface, oldSurfaces, 0.0); - } - - /// - /// Get the soil layer from the old surfaces - /// - /// - /// /// /// The 2D soil layer - private static SoilLayer2D DetermineOriginalLayerFromOldSurfaces(GeometrySurface geometrySurface, IEnumerable oldSurfaces, + public static SoilLayer2D DetermineOriginalLayerFromOldSurfaces(GeometrySurface geometrySurface, IEnumerable oldSurfaces, double shift) { Point2D point = new Point2D(0.0, 0.0); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs =================================================================== diff -u -r5534 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 5534) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculatorCombinedSlopeAndShoulderAdaption.cs (.../DesignCalculatorCombinedSlopeAndShoulderAdaption.cs) (revision 5755) @@ -173,7 +173,7 @@ Soil embankmentSoil = location.SoilList.GetSoilByName(embankmentDesignParameters.EmbankmentMaterialname); subSoilScenario.SoilProfile2D = - MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(subSoilScenario, surfaceLine, embankmentSoil); + MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(subSoilScenario, surfaceLine, embankmentSoil, location.XSoilGeometry2DOrigin); } DesignCalculatorUtils.KernelCalculate(out kernelDataInput, kernelWrapper, out kernelDataOutput, damKernelInput, Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs =================================================================== diff -u -r5696 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs (.../SoilProfile2DSurfaceLineHelperTests.cs) (revision 5696) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Geotechnics/SoilProfile2DSurfaceLineHelperTests.cs (.../SoilProfile2DSurfaceLineHelperTests.cs) (revision 5755) @@ -103,6 +103,7 @@ { TestNumber = 1, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 10), + GivenShift = 0, 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.CreateQuadrilateralSoilLayer2D(new Point2D(-50, 10), new Point2D(-30, 12), new Point2D(-10, 10), new Point2D(-20, 10), soilFilling), @@ -125,6 +126,7 @@ { TestNumber = 2, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 13), + GivenShift = 0, ExpectedSurfaceCount = 9, // 3 extra surfaces created: 1 below the "zigzag" surface line + 2 on the left side (between Z=60 and 70) ExpectedFilling1 = FactoryForSoilProfiles.CreatePolygoneSoilLayer2D([ @@ -160,6 +162,7 @@ { TestNumber = 3, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 5), + GivenShift = 0, ExpectedSurfaceCount = 8, // 2 extra surfaces created on the left side (between Z=60 and 70) ExpectedFilling1 = null, @@ -181,6 +184,7 @@ { TestNumber = 4, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-50, 0), + GivenShift = 0, ExpectedSurfaceCount = 8, // 2 extra surfaces created on the left side (between Z=60 and 70) ExpectedFilling1 = null, @@ -202,6 +206,7 @@ { TestNumber = 5, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-40, 10), + GivenShift = 0, ExpectedSurfaceCount = 10, // Only few surfaces are tested ExpectedFilling1 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(-40, 10), new Point2D(-20, 12), new Point2D(0, 10), new Point2D(-20, 10), soilFilling), @@ -223,6 +228,7 @@ { TestNumber = 6, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(10, 10), + GivenShift = 0, ExpectedSurfaceCount = 7, // Only few surfaces are tested ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(10, 10), new Point2D(30, 12), new Point2D(50, 10), soilFilling), @@ -244,6 +250,7 @@ { TestNumber = 7, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-60, 10), + GivenShift = 0, ExpectedSurfaceCount = 10, // Only few surfaces are tested ExpectedFilling1 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(-60, 10), new Point2D(-40, 12), new Point2D(-20, 10), new Point2D(-50, 10), soilFilling), @@ -265,6 +272,7 @@ { TestNumber = 8, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-110, 10), + GivenShift = 0, ExpectedSurfaceCount = 9, // Only few surfaces are tested ExpectedFilling1 = FactoryForSoilProfiles.CreateTriangularSoilLayer2D(new Point2D(-110, 10), new Point2D(-90, 12), new Point2D(-70, 10), soilFilling), @@ -286,6 +294,7 @@ { TestNumber = 9, GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(50, -5), + GivenShift = 0, ExpectedSurfaceCount = 2, ExpectedFilling1 = null, ExpectedFilling2 = null, @@ -300,6 +309,31 @@ ExpectedSurface5 = null, ExpectedSurface6 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(50, -5), new Point2D(60, -4), new Point2D(60, -15), new Point2D(50, -15), soil6) }).SetName("Test 9: Surface line starts inside surface line 6 (right bottom) of soil profile"); + + yield return new TestCaseData( + new TestCaseZigZagSurfaceLine + { + TestNumber = 10, + GivenZigZagSurfaceLine = FactoryForSurfaceLines.CreateSurfaceLineInZigZag(-40, 10), + GivenShift = 10, + ExpectedSurfaceCount = 10, + // 4 extra surfaces created : 2 below the highest corners of the "zigzag" surface line + 2 on the left side (between Z=70 and 80) + ExpectedFilling1 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(-40, 10), new Point2D(-20, 12), new Point2D(0, 10), new Point2D(-10, 10), soilFilling), + ExpectedFilling2 = FactoryForSoilProfiles.CreateQuadrilateralSoilLayer2D(new Point2D(40, 10), new Point2D(60, 12), new Point2D(80, 10), new Point2D(70, 10), soilFilling), + ExpectedExtendedSurface1 = null, + ExpectedExtendedSurface3 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, 70, 80, soil3), + ExpectedExtendedSurface4 = null, + ExpectedExtendedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 70, 80, soil6), + ExpectedSurface1 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(10, 0, -40, -10, soil1), + ExpectedSurface2 = FactoryForSoilProfiles.CreateHexagonSoilLayer2D(new Point2D(-10, 10), new Point2D(0, 10), new Point2D(10, 9), new Point2D(10, 0),new Point2D(0, 0), new Point2D(-10, 0), soil2), + ExpectedSurface3 = FactoryForSoilProfiles.CreateHeptagonSoilLayer2D(new Point2D(10, 9), new Point2D(20, 8), new Point2D(40, 10), new Point2D(70, 10), new Point2D(70, 0), new Point2D(45, 0), new Point2D(10, 0), soil3), + ExpectedSurface4 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(-40, 0), new Point2D(-10, 0), new Point2D(0, 0), new Point2D(0, -15), new Point2D(-40, -15), soil4), + ExpectedSurface5 = FactoryForSoilProfiles.CreatePentagonSoilLayer2D(new Point2D(0, 0), new Point2D(10, 0), new Point2D(45, 0), new Point2D(45, -15), new Point2D(0, -15), soil5), + ExpectedSurface6 = FactoryForSoilProfiles.CreateRectangularSoilLayer2D(0, -15, 45, 70, soil6) + + }).SetName("Test 10: Surface line is shifted by +10 m compared to the original surface line and the geometry " + + "is shifted with 10 m. So the expected soil profile should be identical to test case 1 " + + "but should start at -40 instead of -50."); } } @@ -344,7 +378,7 @@ }; // When SoilProfile2D newSoilProfile2D = SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D( - testCaseSurfaceLine.GivenZigZagSurfaceLine.Geometry, soilProfile2D, defaultSoil, 0); + testCaseSurfaceLine.GivenZigZagSurfaceLine.Geometry, soilProfile2D, defaultSoil, testCaseSurfaceLine.GivenShift); // Then if (testCaseSurfaceLine.ExpectedSurfaceCount == 0) @@ -372,6 +406,7 @@ // New surface line is checked only for test case 6 if (testCaseSurfaceLine.TestNumber == 6) { + Assert.That(newSoilProfile2D, Is.Not.Null); Assert.That(newSoilProfile2D.Geometry.SurfaceLine.Points, Has.Count.EqualTo(8)); Assert.Multiple(() => { @@ -412,9 +447,8 @@ /// public class TestCaseSurfaceLine { - public SurfaceLine2 SurfaceLine { get; set; } - public int SurfaceCount { get; set; } - + public SurfaceLine2 SurfaceLine { get; init; } + public int SurfaceCount { get; init; } public int TestNumber { get; set; } } @@ -424,6 +458,7 @@ public class TestCaseZigZagSurfaceLine { public SurfaceLine2 GivenZigZagSurfaceLine { get; init; } + public double GivenShift { get; init; } public int ExpectedSurfaceCount { get; init; } public SoilLayer2D ExpectedSurface1 { get; init; } public SoilLayer2D ExpectedSurface2 { get; init; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs =================================================================== diff -u -r5702 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs (.../MacroStabilityCommonHelper.cs) (revision 5702) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelper.cs (.../MacroStabilityCommonHelper.cs) (revision 5755) @@ -54,23 +54,24 @@ public class MacroStabilityCommonHelper { /// - /// Combines the surfaceline with the SoilProfile1D or the SoilProfile2D. + /// Combines the surface line with the SoilProfile1D or the SoilProfile2D. /// /// The sub soil scenario. - /// The surfaceline. + /// The surface line. /// The dike embankment soil. + /// The required shift of the geometry so it will fit the surface line. /// Thrown when subSoilScenario.SoilProfileType is ProfileTypeStiFile /// /// The combined profile as full SoilProfile2D - public static SoilProfile2D CombineSoilProfileWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, Soil dikeEmbankmentSoil) + public static SoilProfile2D CombineSoilProfileWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, Soil dikeEmbankmentSoil, double shift) { switch (subSoilScenario.SoilProfileType) { case SoilProfileType.ProfileType1D: CombineSoilProfile1DWithSurfaceLine(subSoilScenario, surfaceLine2, dikeEmbankmentSoil); break; case SoilProfileType.ProfileType2D: - CombineSoilProfile2DWithSurfaceLine(subSoilScenario, surfaceLine2, dikeEmbankmentSoil); + CombineSoilProfile2DWithSurfaceLine(subSoilScenario, surfaceLine2, dikeEmbankmentSoil, shift); break; default: throw new NotImplementedException(); @@ -446,13 +447,14 @@ /// The sub soil scenario. /// The surface line. /// The dike embankment soil. + /// The required shift of the geometry so it will fit the surface line. /// Thrown when no SoilProfile2D is defined private static void CombineSoilProfile2DWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, - Soil dikeEmbankmentSoil) + Soil dikeEmbankmentSoil, double shift) { ValidateForCombineSoilProfile2DWithSurfaceLine(subSoilScenario, surfaceLine2, dikeEmbankmentSoil); - subSoilScenario.SoilProfile2D = SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D(surfaceLine2.Geometry, subSoilScenario.SoilProfile2D, dikeEmbankmentSoil, 0); + subSoilScenario.SoilProfile2D = SoilProfile2DSurfaceLineHelper.CombineSurfaceLineWithSoilProfile2D(surfaceLine2.Geometry, subSoilScenario.SoilProfile2D, dikeEmbankmentSoil, shift); } private static void ValidateForCombineSoilProfile2DWithSurfaceLine(SoilGeometryProbability subSoilScenario, SurfaceLine2 surfaceLine2, Soil dikeEmbankmentSoil) Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelperTests.cs =================================================================== diff -u -r5446 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelperTests.cs (.../MacroStabilityCommonHelperTests.cs) (revision 5446) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityCommonHelperTests.cs (.../MacroStabilityCommonHelperTests.cs) (revision 5755) @@ -41,7 +41,7 @@ { SoilGeometryProbability soilGeometryProbability = FactoryForSoilGeometryProbabilities.CreateSoilGeometryProbabilityWithSoilProfile1D(); SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineWithDikeAndDitch(); - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => @@ -65,7 +65,7 @@ // Create the same surfaceline as is used for creating the SoilProfile2D in the SoilGeometryProbability SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineWithDikeAndDitch(); // Now combine the soilGeometryProbability with the same SurfaceLine2 which should result in the same SoilProfile2D - MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = soilGeometryProbability.SoilProfile2D.Geometry; Assert.Multiple(() => @@ -94,7 +94,7 @@ surfaceLine.Geometry.SyncCalcPoints(); // Now combine the soilGeometryProbability with the same SurfaceLine2 which should result the SoilProfile2D // being cut on the left with 5.0 meters - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => { @@ -122,7 +122,7 @@ surfaceLine.Geometry.SyncCalcPoints(); // Now combine the soilGeometryProbability with the same SurfaceLine2 which should result the SoilProfile2D // being extended to the left with 5.0 meters - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => { @@ -146,7 +146,7 @@ surfaceLine.Geometry.SyncCalcPoints(); // Now combine the soilGeometryProbability with the same SurfaceLine2 which should result the SoilProfile2D // being cut on the right with 5.0 meters - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => @@ -175,7 +175,7 @@ surfaceLine.Geometry.SyncCalcPoints(); // Now combine the soilGeometryProbability with the same SurfaceLine2 which should result the SoilProfile2D // being extended to the right with 5.0 meters - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => @@ -195,7 +195,7 @@ SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineAboveSurfaceLineDikeAndDitch(); // Now combine the soilGeometryProbability with the surfaceLine which should result that a layer is added on // top of the SoilProfile2D - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; // For debugging purposes // GeometryExporter.ExportToFile(geometry, GeometryExporter.VisualizationFolder + "Geometry.txt"); @@ -219,7 +219,7 @@ SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineBelowSurfaceLineDikeAndDitch(); // Now combine the soilGeometryProbability with the surfaceLine which should result that the top part of the // SoilProfile2D is removed (between top boundary of the SoilProfile2D and the surfaceLine) - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => @@ -240,7 +240,7 @@ SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineCuttingSurfaceLineDikeAndDitch(); // Now combine the soilGeometryProbability with the surfaceLine which should result that the top part of the // SoilProfile2D is removed (between top boundary of the SoilProfile2D and the surfaceLine) - var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + var combinedProfile = MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); GeometryData geometry = combinedProfile.Geometry; Assert.Multiple(() => @@ -261,24 +261,24 @@ SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineDike(-22.0, "PartlyBelowBottom"); // Now combine the soilGeometryProbability with the surfaceLine which should in an exception, because the surfaceLine // is partly below the bottom of the SoilProfile2D - Assert.Throws(() => { MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); }); + Assert.Throws(() => { MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); }); } [Test] - public void GivenSoilGeometryProbabilityWithSoilProfile2DAndSurfaceLineNonSscanedingWhenCombiningThenExceptionIsRaised() + public void GivenSoilGeometryProbabilityWithSoilProfile2DAndSurfaceLineNonAscendingWhenCombiningThenExceptionIsRaised() { SoilGeometryProbability soilGeometryProbability = CreateSoilGeometryProbabilityWithSoilProfile2DWithSurfaceLineDitchDike(); SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineDikeNonStrictAscending(); // Now combine the soilGeometryProbability with the surfaceLine which should in an exception, because the surfaceLine // is not strictly ascending - Assert.Throws(() => { MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); }); + Assert.Throws(() => { MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); }); } private static SoilGeometryProbability CreateSoilGeometryProbabilityWithSoilProfile2DWithSurfaceLineDitchDike() { SoilGeometryProbability soilGeometryProbability = FactoryForSoilGeometryProbabilities.CreateSoilGeometryProbabilityWithSoilProfile1D(); SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineWithDikeAndDitch(); - MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil()); + MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(soilGeometryProbability, surfaceLine, new Soil(), 0); return soilGeometryProbability; } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityOutwards/MacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r5466 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityOutwards/MacroStabilityOutwardsKernelWrapper.cs (.../MacroStabilityOutwardsKernelWrapper.cs) (revision 5466) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityOutwards/MacroStabilityOutwardsKernelWrapper.cs (.../MacroStabilityOutwardsKernelWrapper.cs) (revision 5755) @@ -100,7 +100,7 @@ } MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(damKernelInput.SubSoilScenario, damKernelInput.Location.SurfaceLine, - damKernelInput.CurrentEmbankmentSoil); + damKernelInput.CurrentEmbankmentSoil, damKernelInput.Location.XSoilGeometry2DOrigin); const bool useRiverLevelLow = true; // Determine PL-lines and create waternet Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs =================================================================== diff -u -r5691 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs (.../SoilProfile2DSurfaceLineHelper.cs) (revision 5691) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SoilProfile2DSurfaceLineHelper.cs (.../SoilProfile2DSurfaceLineHelper.cs) (revision 5755) @@ -67,8 +67,8 @@ /// /// The surface line. /// The SoilProfile2D. - /// The default soil. - /// The required shift of the geometry so it will fit the surface line + /// The dike embankment soil. + /// The required shift of the geometry so it will fit the surface line. /// public static SoilProfile2D CombineSurfaceLineWithSoilProfile2D(GeometryPointString surfaceLine, SoilProfile2D soilProfile2D, Soil defaultSoil, double shift) @@ -104,7 +104,7 @@ BuildGeometryModel(clonedSurfaceLine, clonedProfile, ref result); RemoveGeometryDataOfSoilProfileAboveSurfaceLine(clonedSurfaceLine, ref result); - ReconstructSurfaces(ref result, clonedProfile, oldSurfaces, defaultSoil); + ReconstructSurfaces(ref result, clonedProfile, oldSurfaces, defaultSoil, shift); ReconstructPreConsolidations(ref result, clonedProfile, shift); result.Geometry.Rebox(); result.Geometry.UpdateSurfaceLine(); @@ -315,7 +315,7 @@ } private static void ReconstructSurfaces(ref SoilProfile2D result, SoilProfile2D soilProfile2D, List oldSurfaces, - Soil defaultSoil) + Soil defaultSoil, double shift) { result.Surfaces.Clear(); result.Name = soilProfile2D.Name; @@ -327,7 +327,7 @@ Soil = defaultSoil }; SoilLayer2D soilLayer2D2 = soilLayer2D1; - SoilLayer2D layerFromOldSurfaces = SoilProfile2D.DetermineOriginalLayerFromOldSurfaces(surface, (IEnumerable) oldSurfaces); + SoilLayer2D layerFromOldSurfaces = SoilProfile2D.DetermineOriginalLayerFromOldSurfaces(surface, (IEnumerable) oldSurfaces, shift); if (layerFromOldSurfaces != null && layerFromOldSurfaces.Soil != null) { soilLayer2D2.Soil = layerFromOldSurfaces.Soil; @@ -341,7 +341,7 @@ bool isDefaultLayer = IsLayerAboveOriginalSurfaceLine(soilLayer2D2, soilProfile2D.Geometry.SurfaceLine); if (!isDefaultLayer) { - oldLayer = DetermineLayerIfSurfaceIsLeftOrRightOfOldSurfaces(surface, oldSurfaces); + oldLayer = DetermineLayerIfSurfaceIsLeftOrRightOfOldSurfaces(surface, oldSurfaces, shift); isDefaultLayer = oldLayer == null; } if (!isDefaultLayer) @@ -382,13 +382,13 @@ } } - private static SoilLayer2D DetermineLayerIfSurfaceIsLeftOrRightOfOldSurfaces(GeometrySurface surface, List oldSurfaces) + private static SoilLayer2D DetermineLayerIfSurfaceIsLeftOrRightOfOldSurfaces(GeometrySurface surface, List oldSurfaces, double shift) { double[] xMin = surface.OuterLoop.CalcPoints.Select(p => p.X).OrderBy(x => x).Distinct().ToArray(); double[] zMin = surface.OuterLoop.CalcPoints.Select(p => p.Z).OrderBy(z => z).Distinct().ToArray(); var leftPoint = new Point2D { - X = xMin[0] - 0.1, + X = xMin[0] - shift - 0.1, Z = zMin[0] + 0.1 }; @@ -400,7 +400,7 @@ var rightPoint = new Point2D { - X = xMin[^1] + 0.1, + X = xMin[^1] - shift + 0.1, Z = zMin[0] + 0.1 }; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r5627 -r5755 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 5627) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 5755) @@ -105,7 +105,7 @@ } MacroStabilityCommonHelper.CombineSoilProfileWithSurfaceLine(damKernelInput.SubSoilScenario, damKernelInput.Location.SurfaceLine, - damKernelInput.CurrentEmbankmentSoil); + damKernelInput.CurrentEmbankmentSoil, damKernelInput.Location.XSoilGeometry2DOrigin); const bool useRiverLevelLow = false; // Determine whether there is uplift