Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/UpliftVanCalculationGrid.cs =================================================================== diff -u -r3042 -r3046 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/UpliftVanCalculationGrid.cs (.../UpliftVanCalculationGrid.cs) (revision 3042) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/UpliftVanCalculationGrid.cs (.../UpliftVanCalculationGrid.cs) (revision 3046) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; + namespace Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon { /// Parameters for the UpliftVan Macrostability kernel; used for IO @@ -63,17 +65,22 @@ /// Gets or sets the right grid z count. /// The right grid z count. public int RightGridZCount { get; set; } + /// Gets or sets the tangent line z top. /// The tangent line z top. + /// Gets or sets the tangent line creation automatic or specified. + /// The tangent line creation setting . + public bool IsTangentLinesAutomatic { get; set; } public double TangentLineZTop { get; set; } /// Gets or sets the tangent line z bottom. /// The tangent line z bottom. public double TangentLineZBottom { get; set; } /// Gets or sets the tangent line count. /// The tangent line count. public int TangentLineCount { get; set; } - /// Gets or sets the tangent line setting automatic at boundaries. - /// The tangent line setting automatic at boundaries. - public bool IsTangentLinesAutomatic { get; set; } + + /// Gets or sets the tangent line levels. + /// The tangent line levels. + public ListTangentLineLevels { get; set; } = new List(); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/UpliftVanGridCreator.cs =================================================================== diff -u -r3042 -r3046 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/UpliftVanGridCreator.cs (.../UpliftVanGridCreator.cs) (revision 3042) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/UpliftVanGridCreator.cs (.../UpliftVanGridCreator.cs) (revision 3046) @@ -106,31 +106,40 @@ DetermineTangentLinesOnBoundaryLines(upliftVanCalculationGrid, slipCircleDefinition, soilProfile1D, minimumCircleDepth); break; case TangentLinesDefinition.Specified: - DetermineTangentLinesSpecified(upliftVanCalculationGrid, slipCircleDefinition, soilProfile1D, minimumCircleDepth); + DetermineTangentLinesSpecified(upliftVanCalculationGrid, soilProfile1D, + slipCircleDefinition.UpliftVanTangentLinesDistance, minimumCircleDepth); break; } } private static void DetermineTangentLinesOnBoundaryLines(UpliftVanCalculationGrid upliftVanCalculationGrid, - SlipCircleDefinition slipCircleDefinition, SoilProfile1D soilProfile1D, double minimumCircleDepth) + SoilProfile1D soilProfile1D) { upliftVanCalculationGrid.IsTangentLinesAutomatic = false; - throw new NotImplementedException(); + upliftVanCalculationGrid.TangentLineLevels.Clear(); + for (int i = 0; i < soilProfile1D.LayerCount; i++) + { + upliftVanCalculationGrid.TangentLineLevels.Add(soilProfile1D.Layers[i].TopLevel); + } } private static void DetermineTangentLinesSpecified(UpliftVanCalculationGrid upliftVanCalculationGrid, - SlipCircleDefinition slipCircleDefinition, SoilProfile1D soilProfile1D, double minimumCircleDepth) + SoilProfile1D soilProfile1D, double distance, double minimumCircleDepth) { + if (!(distance > 0)) + { + throw new ArgumentException(String.Format("Vertical distance should be > 0 but is {0}", distance)); + } double topOfBottomLayer = soilProfile1D.Layers.Last().TopLevel; double surfaceLevel = soilProfile1D.Layers.First().TopLevel; - double bottomTangentLines = topOfBottomLayer - slipCircleDefinition.UpliftVanTangentLinesDistance; + double bottomTangentLines = topOfBottomLayer - distance; bottomTangentLines = Math.Min(bottomTangentLines, surfaceLevel - minimumCircleDepth); double topTangentLines = bottomTangentLines; int tangentLinesCount = 1; while (topTangentLines < surfaceLevel) { - topTangentLines += slipCircleDefinition.UpliftVanTangentLinesDistance; + topTangentLines += distance; tangentLinesCount++; }