Index: DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardPostProcessRelativeProfilesTest.cs =================================================================== diff -u -r3703 -r3767 --- DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardPostProcessRelativeProfilesTest.cs (.../WaterBoardPostProcessRelativeProfilesTest.cs) (revision 3703) +++ DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardPostProcessRelativeProfilesTest.cs (.../WaterBoardPostProcessRelativeProfilesTest.cs) (revision 3767) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Linq; using Deltares.Dam.Data; using Deltares.Geotechnics.GeotechnicalGeometry; @@ -90,9 +91,20 @@ private static void AssertSoilProfile1D(double offset, SoilProfile1D soilProfile1D) { - Assert.AreEqual(1.0 + offset, soilProfile1D.TopLevel, CTolerance); - Assert.AreEqual(-1.0 + offset, soilProfile1D.Layers[1].TopLevel, CTolerance); - Assert.AreEqual(-10.0 + offset, soilProfile1D.BottomLevel, CTolerance); + // If there is no move, than there is no added layer + if (Math.Abs(offset) < CTolerance) + { + Assert.AreEqual(1.0 + offset, soilProfile1D.TopLevel, CTolerance); + Assert.AreEqual(-1.0 + offset, soilProfile1D.Layers[1].TopLevel, CTolerance); + Assert.AreEqual(-10.0 + offset, soilProfile1D.BottomLevel, CTolerance); + } + else + { + // If there is a move, than there is one added (top) layer + Assert.AreEqual(2.0 + offset, soilProfile1D.TopLevel, CTolerance); + Assert.AreEqual(-1.0 + offset, soilProfile1D.Layers[2].TopLevel, CTolerance); + Assert.AreEqual(-10.0 + offset, soilProfile1D.BottomLevel, CTolerance); + } } [Test] Index: DamClients/DamUI/branches/DamUI 19.3/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardPostProcessRelativeProfiles.cs =================================================================== diff -u -r3766 -r3767 --- DamClients/DamUI/branches/DamUI 19.3/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardPostProcessRelativeProfiles.cs (.../WaterBoardPostProcessRelativeProfiles.cs) (revision 3766) +++ DamClients/DamUI/branches/DamUI 19.3/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardPostProcessRelativeProfiles.cs (.../WaterBoardPostProcessRelativeProfiles.cs) (revision 3767) @@ -101,7 +101,7 @@ // If the top of the profile is moved below the top of the surface level, a gap appears which will be filled in later in the UI // to the combined 2D. However, for Piping calculation the 1D profile itself needs to start at least at the top of the surface line // too in order to perform a correct calculation. So extend the 1D profile here too! - if (profileTopLevel < topSurfaceline) + if (Math.Abs(deltaZ) > 1e-6 && profileTopLevel < topSurfaceline) { var newTopLayer = new SoilLayer1D {