Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj =================================================================== diff -u -r1601 -r1641 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1601) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1641) @@ -69,6 +69,8 @@ + + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Sensors/TimeSerieCalculationHelper.cs =================================================================== diff -u -r1591 -r1641 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Sensors/TimeSerieCalculationHelper.cs (.../TimeSerieCalculationHelper.cs) (revision 1591) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Sensors/TimeSerieCalculationHelper.cs (.../TimeSerieCalculationHelper.cs) (revision 1641) @@ -74,7 +74,7 @@ internal static IEnumerable GetStabilityModels(bool isCombinedBishopUpliftVan, Location location, PlLines PlLines, string soilGeometry2DName, MStabModelType defaultModel) { double? upliftFactor = GetLowestUpliftFactor(location.SurfaceLine, - location.Segment.GetMostProbableProfile(FailureMechanismSystemType.StabilityInside), soilGeometry2DName, PlLines, location); + location.Segment.GetMostProbableProfile1D(FailureMechanismSystemType.StabilityInside), soilGeometry2DName, PlLines, location); return !isCombinedBishopUpliftVan ? new List { defaultModel } : GetMStabModelsToCalculate(upliftFactor); } @@ -117,7 +117,7 @@ // SurfaceLine = location.LocalXZSurfaceLine2, // PlLines = PlLines, // DupuitPlLines = dupuitPlLines, -// SoilProfile = location.Segment.GetMostProbableProfile(FailureMechanismSystemType.StabilityInside), +// SoilProfile = location.Segment.GetMostProbableProfile1D(FailureMechanismSystemType.StabilityInside), // TrafficLoad = location.TrafficLoad, // MStabParameters = // new MStabParameters @@ -184,7 +184,7 @@ // // Determine right side of slip plane grid (right grid) // // This is the location with the lowest uplift factor or, if present, the second NWO point // SurfaceLine2 surfaceLine = location.SurfaceLine; -// var upliftLocationAndResult = GetLocationWithLowestUpliftFactor(surfaceLine, location.Segment.GetMostProbableProfile(FailureMechanismSystemType.StabilityInside), soilGeometry2DName, PlLines, location); +// var upliftLocationAndResult = GetLocationWithLowestUpliftFactor(surfaceLine, location.Segment.GetMostProbableProfile1D(FailureMechanismSystemType.StabilityInside), soilGeometry2DName, PlLines, location); // double upliftCriterion = location.UpliftCriterionStability.Value; // bool isUplift = !(upliftLocationAndResult == null) && (upliftLocationAndResult.UpliftFactor < upliftCriterion); // double xCoordinateLastUpliftPoint = isUplift ? upliftLocationAndResult.X : surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; @@ -389,7 +389,7 @@ HeadInPlLine3 = null, HeadInPlLine4 = null, ModelParametersForPlLines = location.CreateModelParametersForPlLines(), - SoilProfile = location.Segment.GetMostProbableProfile(FailureMechanismSystemType.StabilityInside), + SoilProfile = location.Segment.GetMostProbableProfile1D(FailureMechanismSystemType.StabilityInside), SoilGeometry2DName = soilGeometry2DName, SoilProfileType = soilGeometryType, GaugePlLines = location.GaugePlLines, @@ -476,8 +476,8 @@ /// Name of the soil geometry2 D. internal static void DetermineSoilGeometryType(Location location, out SoilProfileType soilGeometryType, out string soilGeometry2DName) { - SoilProfile1D soilProfile = location.Segment.GetMostProbableProfile(FailureMechanismSystemType.StabilityInside); - soilGeometry2DName = location.Segment.GetMostProbableGeometry2DName(FailureMechanismSystemType.StabilityInside); + SoilProfile1D soilProfile = location.Segment.GetMostProbableProfile1D(FailureMechanismSystemType.StabilityInside); + soilGeometry2DName = location.Segment.GetMostProbableProfile2DStiFileName(FailureMechanismSystemType.StabilityInside); string mapForSoilGeometries2D = location.StabilityOptions.SoilGeometries2DPath; if ((soilGeometry2DName != null) && (mapForSoilGeometries2D != null)) { Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs =================================================================== diff -u -r1007 -r1641 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1007) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1641) @@ -58,31 +58,31 @@ /// /// Type of the segment failure mechanism. /// - public SoilProfile1D GetMostProbableProfile(FailureMechanismSystemType? segmentFailureMechanismType) + public SoilProfile1D GetMostProbableProfile1D(FailureMechanismSystemType? segmentFailureMechanismType) { - IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities - where !spp.SegmentFailureMechanismType.HasValue || !segmentFailureMechanismType.HasValue || spp.SegmentFailureMechanismType == segmentFailureMechanismType - orderby spp.Probability descending - select spp; - if (spps.Any()) - return spps.First().SoilProfile1D; - else - return null; + var mostProbableSoilGeometryProbability = GetMostProbableSoilGeometryProbability(segmentFailureMechanismType); + return mostProbableSoilGeometryProbability?.SoilProfile1D; } /// - /// Gets the name of the most probable geometry2dname (name of profile2D). + /// Gets the name of the most probable sti filename (name of MStab .sti file). /// /// Type of the segment failure mechanism. /// - public string GetMostProbableGeometry2DName(FailureMechanismSystemType? segmentFailureMechanismType) + public string GetMostProbableProfile2DStiFileName(FailureMechanismSystemType? segmentFailureMechanismType) { + var mostProbableSoilGeometryProbability = GetMostProbableSoilGeometryProbability(segmentFailureMechanismType); + return mostProbableSoilGeometryProbability?.FullStiFileName; + } + + public SoilGeometryProbability GetMostProbableSoilGeometryProbability(FailureMechanismSystemType? segmentFailureMechanismType) + { IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities where !spp.SegmentFailureMechanismType.HasValue || !segmentFailureMechanismType.HasValue || spp.SegmentFailureMechanismType == segmentFailureMechanismType orderby spp.Probability descending select spp; if (spps.Any()) - return spps.First().FullStiFileName; + return spps.First(); else return null; } Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Deltares.DamEngine.Data.Tests.csproj =================================================================== diff -u -r1497 -r1641 --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Deltares.DamEngine.Data.Tests.csproj (.../Deltares.DamEngine.Data.Tests.csproj) (revision 1497) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/Deltares.DamEngine.Data.Tests.csproj (.../Deltares.DamEngine.Data.Tests.csproj) (revision 1641) @@ -46,6 +46,7 @@ + Index: DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/General/SegmentTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/General/SegmentTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Data.Tests/General/SegmentTests.cs (revision 1641) @@ -0,0 +1,19 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Deltares.DamEngine.Data.Tests.General +{ + [TestFixture] + public class SegmentTests + { + [Test] + public void GetMostProbableSoilGeometryProbability() + { + + } + } +}