Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r1105 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 1105) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 1137) @@ -108,7 +108,6 @@ var damKernelInput = new DamKernelInput(); damKernelInput.Location = location; - damKernelInput.DesignScenario = scenario; damKernelInput.SubSoilScenario = subSoilScenario; damKernelInput.ProjectDir = projectPath; damKernelInput.CalculationDir = workingDir; @@ -152,7 +151,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, null, "", out results); Assert.AreEqual(expectedOutputValues.Count, results.Count); for (int index = 0; index < expectedOutputValues.Count; index++) { @@ -284,7 +283,7 @@ failureMechanismParametersMStab.MStabParameters.CalculationOptions.MinimalCircleDepth = 1.0; failureMechanismParametersMStab.MStabParameters.Model = MStabModelType.Bishop; kernelWrapper.FailureMechanismParametersMStab = failureMechanismParametersMStab; - kernelWrapper.PostProcess(damKernelInput, output, "", out results); + kernelWrapper.PostProcess(damKernelInput, output, null, "", out results); Assert.AreEqual(1.1, results[0].StabilityDesignResults.SafetyFactor); Assert.AreEqual(1.1, results[0].StabilityDesignResults.Zone1SafetyFactor); Assert.AreEqual(1.2, results[0].StabilityDesignResults.LocalZone1EntryPointX); @@ -317,7 +316,7 @@ { var kernelWrapper = new DamMacroStabilityInwardsKernelWrapper(); List results; - kernelWrapper.PostProcess(new DamKernelInput(), null, "", out results); + kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs =================================================================== diff -u -r1133 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1133) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1137) @@ -142,7 +142,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, null, "", out results); Assert.AreEqual(2.935, results[0].StabilityDesignResults.SafetyFactor, diff); Assert.AreEqual("", results[0].StabilityDesignResults.ResultMessage); Assert.AreEqual(CalculationResult.Succeeded, results[0].CalculationResult); @@ -163,10 +163,10 @@ var damKernelInput = CreateDamKernelInput(true); damKernelInput.ProjectDir = absoluteFolder; damKernelInput.CalculationDir = workingDir; - damKernelInput.DesignScenario.Location.DikeEmbankmentMaterial = "Del_Ppp"; - damKernelInput.DesignScenario.Location.ShoulderEmbankmentMaterial = "Del_Ppp"; - damKernelInput.DesignScenario.Location.StabilityOptions.MinimalCircleDepth = 1.0; - damKernelInput.DesignScenario.Location.StabilityOptions.StabilityZoneType = MStabZonesType.ZoneAreas; + damKernelInput.Location.DikeEmbankmentMaterial = "Del_Ppp"; + damKernelInput.Location.ShoulderEmbankmentMaterial = "Del_Ppp"; + damKernelInput.Location.StabilityOptions.MinimalCircleDepth = 1.0; + damKernelInput.Location.StabilityOptions.StabilityZoneType = MStabZonesType.ZoneAreas; var failureMechanismParametersMStab = new FailureMechanismParametersMStab { MStabParameters = @@ -245,7 +245,6 @@ { DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification, Location = location, - DesignScenario = scenario, SubSoilScenario = subSoilScenario }; return damKernelInput; @@ -357,7 +356,7 @@ } }; List results; - kernelWrapper.PostProcess(damKernelInput, output, "", out results); + kernelWrapper.PostProcess(damKernelInput, output, null, "", out results); Assert.AreEqual(0.9, results[0].StabilityDesignResults.SafetyFactor); Assert.AreEqual(1.1, results[0].StabilityDesignResults.Zone1SafetyFactor); Assert.AreEqual(1.3, results[0].StabilityDesignResults.LocalZone1EntryPointX); @@ -390,7 +389,7 @@ { var kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper(); List results; - kernelWrapper.PostProcess(null, null, "", out results); + kernelWrapper.PostProcess(null, null, null, "", out results); } [Test] @@ -401,7 +400,7 @@ var kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper(); List results; var damKernelInput = CreateDamKernelInput(); - kernelWrapper.PostProcess(damKernelInput, null, "", out results); + kernelWrapper.PostProcess(damKernelInput, null, null, "", out results); } [Test] @@ -472,7 +471,6 @@ var damKernelInput = new DamKernelInput { Location = location, - DesignScenario = scenario, SubSoilScenario = subSoilScenario, ProjectDir = absoluteFolder, CalculationDir = workingDir Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapperTests.cs =================================================================== diff -u -r1128 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapperTests.cs (.../DamMacroStabilityHorizontalBalanceKernelWrapperTests.cs) (revision 1128) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapperTests.cs (.../DamMacroStabilityHorizontalBalanceKernelWrapperTests.cs) (revision 1137) @@ -134,7 +134,6 @@ { DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification, Location = location, - DesignScenario = scenario, SubSoilScenario = subSoilScenario, CalculationDir = workingDir }; @@ -162,7 +161,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damMacroStabilityOutput, null, "", out results); Assert.AreEqual(10.169, results[0].StabilityDesignResults.SafetyFactor, cToleranceSafetyFactor); Assert.AreEqual("", results[0].StabilityDesignResults.ResultMessage); Assert.AreEqual(CalculationResult.Succeeded, results[0].CalculationResult); @@ -207,7 +206,7 @@ { var kernelWrapper = new DamMacroStabilityHorizontalBalanceKernelWrapper(); List results; - kernelWrapper.PostProcess(null, null, "", out results); + kernelWrapper.PostProcess(null, null, null, "", out results); } [Test] @@ -218,7 +217,7 @@ var kernelWrapper = new DamMacroStabilityHorizontalBalanceKernelWrapper(); List results; var damKernelInput = CreateDamKernelInput(); - kernelWrapper.PostProcess(damKernelInput, null, "", out results); + kernelWrapper.PostProcess(damKernelInput, null, null, "", out results); } [Test] @@ -243,7 +242,7 @@ } }; List results; - kernelWrapper.PostProcess(damKernelInput, output, "", out results); + kernelWrapper.PostProcess(damKernelInput, output, null, "", out results); Assert.AreEqual(1.1, results[0].StabilityDesignResults.SafetyFactor); Assert.AreEqual(1.1, results[0].StabilityDesignResults.Zone1SafetyFactor); // Horizontal Balance does not have results for zone 2 @@ -292,7 +291,6 @@ { DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification, Location = location, - DesignScenario = scenario, SubSoilScenario = subSoilScenario }; return damKernelInput; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs =================================================================== diff -u -r1122 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 1122) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 1137) @@ -65,9 +65,12 @@ /// /// /// - public static XDocument CreateMStabXmlDoc(string mstabProjectFilename, DesignScenario scenario, - SoilGeometryProbability subSoilScenario, - MStabDesignEmbankment mstabDesignEmbankment, + public static XDocument CreateMStabXmlDoc(string mstabProjectFilename, + Location location, + double riverLevelHigh, + double? riverLevelLow, + SoilGeometryProbability subSoilScenario, + MStabDesignEmbankment mstabDesignEmbankment, double requiredSafetyFactor, FailureMechanismParametersMStab inputFailureMechanismParametersMStab, out List errorMessages) { @@ -76,10 +79,10 @@ var profile1D = subSoilScenario.SoilProfile1D; var soilGeometry2DName = subSoilScenario.FullStiFileName; - ConsistencyCheck(scenario, profile1D); + ConsistencyCheck(profile1D); var failureMechanismParametersMStab = inputFailureMechanismParametersMStab.Clone(); - failureMechanismParametersMStab.Location = scenario.Location; + failureMechanismParametersMStab.Location = location; if (profile1D != null) { failureMechanismParametersMStab.SoilProfile = profile1D; @@ -98,33 +101,32 @@ soilGeometry2DName; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.MaterialForDike = - scenario.Location.DikeEmbankmentMaterial; + location.DikeEmbankmentMaterial; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.MaterialForShoulder = - scenario.Location.ShoulderEmbankmentMaterial; + location.ShoulderEmbankmentMaterial; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.IsUseOriginalPlLineAssignments = - scenario.Location.IsUseOriginalPlLineAssignments; + location.IsUseOriginalPlLineAssignments; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.IsDesign = (mstabDesignEmbankment != null); failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.XOffsetSoilGeometry2DOrigin = - -scenario.Location.XSoilGeometry2DOrigin; + -location.XSoilGeometry2DOrigin; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.PlLineAssignment = - CalculationHelper.PlLineCreationMethod2PlLineAssignment(scenario.Location.ModelParametersForPlLines.PlLineCreationMethod); - if (scenario.Location.IntrusionVerticalWaterPressure != null) + CalculationHelper.PlLineCreationMethod2PlLineAssignment(location.ModelParametersForPlLines.PlLineCreationMethod); + if (location.IntrusionVerticalWaterPressure != null) failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.IntrusionVerticalWaterPressureType = - scenario.Location.IntrusionVerticalWaterPressure.Value; + location.IntrusionVerticalWaterPressure.Value; failureMechanismParametersMStab.MStabParameters.GeometryCreationOptions.PenetrationLength = - scenario.Location.ModelParametersForPlLines.PenetrationLength; + location.ModelParametersForPlLines.PenetrationLength; // End of Geometry Creation Options // Design options failureMechanismParametersMStab.Design = mstabDesignEmbankment; - failureMechanismParametersMStab.SurfaceLine = scenario.Location.SurfaceLine; - failureMechanismParametersMStab.RiverLevel = scenario.RiverLevel; - failureMechanismParametersMStab.DikeTableHeight = - scenario.DikeTableHeight ?? scenario.Location.SurfaceLine.GetDefaultDikeTableHeight() ?? 0; - failureMechanismParametersMStab.TrafficLoad = scenario.Location.StabilityOptions.TrafficLoad ?? 0; + failureMechanismParametersMStab.SurfaceLine = location.SurfaceLine; + failureMechanismParametersMStab.RiverLevel = riverLevelHigh; + failureMechanismParametersMStab.DikeTableHeight = location.SurfaceLine.GetDefaultDikeTableHeight() ?? 0; + failureMechanismParametersMStab.TrafficLoad = location.StabilityOptions.TrafficLoad ?? 0; // Horizontal balance; TODO: Combine with code in StabilityCalculation if (failureMechanismParametersMStab.MStabParameters.Model == MStabModelType.HorizontalBalance) @@ -136,9 +138,9 @@ } failureMechanismParametersMStab.MStabParameters.HorizontalBalanceArea = new HorizontalBalanceArea { - XLeft = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X, - XRight = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X, - YTop = scenario.RiverLevel, + XLeft = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X, + XRight = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X, + YTop = riverLevelHigh, YBottom = profile1D.InBetweenAquiferLayer?.TopLevel ?? profile1D.BottomAquiferLayer.TopLevel }; int planeCount = @@ -149,16 +151,16 @@ } failureMechanismParametersMStab.MStabParameters.CalculationOptions.MinimalCircleDepth = - scenario.Location.StabilityOptions.MinimalCircleDepth ?? 0.0; + location.StabilityOptions.MinimalCircleDepth ?? 0.0; failureMechanismParametersMStab.MStabParameters.CalculationOptions.ZonesType = - scenario.Location.StabilityOptions.StabilityZoneType; + location.StabilityOptions.StabilityZoneType; // Zonestype is ZoneAreas; TODO: Combine with code in StabilityCalculation if (failureMechanismParametersMStab.MStabParameters.CalculationOptions.ZonesType.Equals(MStabZonesType.ZoneAreas)) { - var dikeTopAtPolder = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder); - double? dikeTableHeight = scenario.DikeTableHeight ?? scenario.Location.SurfaceLine.GetDefaultDikeTableHeight(); + var dikeTopAtPolder = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder); + double? dikeTableHeight = location.SurfaceLine.GetDefaultDikeTableHeight(); if (!dikeTableHeight.HasValue) throw new MStabXmlDocException("Surface line has no dike table height."); failureMechanismParametersMStab.MStabParameters.ZoneAreas = new MStabZoneAreas @@ -167,28 +169,28 @@ SafetyFactorZone1A = requiredSafetyFactor, SafetyFactorZone1B = requiredSafetyFactor, XCoordinateDikeTopAtPolder = dikeTopAtPolder.X, - XCoordinateDikeTopAtRiver = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X, - XCoordinateStartRestProfile = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X + XCoordinateDikeTopAtRiver = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X, + XCoordinateStartRestProfile = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X }; - if (scenario.Location.StabilityOptions?.ZoneAreaRestSlopeCrestWidth != null) + if (location.StabilityOptions?.ZoneAreaRestSlopeCrestWidth != null) { - failureMechanismParametersMStab.MStabParameters.ZoneAreas.DikeTableWidth = scenario.Location.StabilityOptions.ZoneAreaRestSlopeCrestWidth.Value; + failureMechanismParametersMStab.MStabParameters.ZoneAreas.DikeTableWidth = location.StabilityOptions.ZoneAreaRestSlopeCrestWidth.Value; } } if (failureMechanismParametersMStab.MStabParameters.CalculationOptions.ZonesType.Equals(MStabZonesType.ForbiddenZone)) { - failureMechanismParametersMStab.MStabParameters.ForbiddenZone = CreateForbiddenZone(scenario, scenario.Location.SurfaceLine); + failureMechanismParametersMStab.MStabParameters.ForbiddenZone = CreateForbiddenZone(location, location.SurfaceLine); } // Make sure riverlevel is correct with respect to surfaceline - double? riverLevelLow = null; - if (failureMechanismParametersMStab.MStabParameters.GridPosition == MStabGridPosition.Left && scenario.RiverLevelLow.HasValue) - { - riverLevelLow = scenario.RiverLevelLow.Value; - } - double? riverLevelHigh = scenario.RiverLevel; - var surfaceLevelOutside = scenario.Location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside); + // double? riverLevelLow = null; +// if (failureMechanismParametersMStab.MStabParameters.GridPosition == MStabGridPosition.Left && riverLevelLow.HasValue) +// { +// riverLevelLow = scenario.RiverLevelLow.Value; +// } + // double? riverLevelHigh = scenario.RiverLevel; + var surfaceLevelOutside = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside); if (riverLevelHigh < surfaceLevelOutside.Z) { var riverLevelHighIsBelowSurfaceLevelOutside = Path.GetFileName(mstabProjectFilename) + ": " + @@ -198,16 +200,18 @@ errorMessages.Add(logMessage); } - var currentSurfaceLine = scenario.GetMostRecentSurfaceLine(subSoilScenario.SoilProfile1D, Path.GetFileName(soilGeometry2DName)); + // TODO #The folloing line shoukld be resolved for design + // var currentSurfaceLine = scenario.GetMostRecentSurfaceLine(subSoilScenario.SoilProfile1D, Path.GetFileName(soilGeometry2DName)); + SurfaceLine2 currentSurfaceLine = null; if (currentSurfaceLine == null) { - currentSurfaceLine = scenario.Location.SurfaceLine; + currentSurfaceLine = location.SurfaceLine; } - var waterLevel = riverLevelHigh.Value; + var waterLevel = riverLevelHigh; UpliftSituation upliftSituation; failureMechanismParametersMStab.PlLines = PlLinesHelper.CreatePlLinesForStability( - scenario.Location, subSoilScenario, waterLevel, soilGeometry2DName, riverLevelLow, out upliftSituation); + location, subSoilScenario, waterLevel, soilGeometry2DName, riverLevelLow, out upliftSituation); // Slip circle definition for Uplift Van; TODO: Combine with code in StabilityCalculation if (failureMechanismParametersMStab.MStabParameters.Model == MStabModelType.UpliftVan) @@ -216,9 +220,8 @@ // This is the location with the lowest uplift factor var upliftLocationAndResult = CalculationHelper.GetLocationWithLowestUpliftFactor(currentSurfaceLine, subSoilScenario.SoilProfile1D, soilGeometry2DName, failureMechanismParametersMStab.PlLines, - scenario.Location); - double upliftCriterion = - scenario.GetUpliftCriterionStability(scenario.Location.ModelFactors.UpliftCriterionStability); + location); + double upliftCriterion = location.ModelFactors.UpliftCriterionStability.Value; bool isUplift = !(upliftLocationAndResult == null) && (upliftLocationAndResult.UpliftFactor < upliftCriterion); double xCoordinateLastUpliftPoint = isUplift @@ -229,7 +232,7 @@ } failureMechanismParametersMStab.MStabParameters.ProjectFileName = mstabProjectFilename; - failureMechanismParametersMStab.MStabParameters.SoilDatabaseName = scenario.Location.StabilityOptions.SoilDatabaseName; + failureMechanismParametersMStab.MStabParameters.SoilDatabaseName = location.StabilityOptions.SoilDatabaseName; if (!failureMechanismParametersMStab.IsComplete) { @@ -241,14 +244,14 @@ return mstabXml; } - private static MStabForbiddenZone CreateForbiddenZone(DesignScenario scenario, SurfaceLine2 surfaceLine) + private static MStabForbiddenZone CreateForbiddenZone(Location location, SurfaceLine2 surfaceLine) { var dikeTopAtPolder = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder); // Zonestype is ForbiddenZone; TODO: Combine with code in StabilityCalculator? var zoneFactor = 1.0; - if (scenario.Location.StabilityOptions?.ForbiddenZoneFactor != null) + if (location.StabilityOptions?.ForbiddenZoneFactor != null) { - zoneFactor = scenario.Location.StabilityOptions.ForbiddenZoneFactor.Value; + zoneFactor = location.StabilityOptions.ForbiddenZoneFactor.Value; } double maxZoneX = dikeTopAtPolder.X + zoneFactor * (surfaceLine.GetDikeToeInward().X - dikeTopAtPolder.X); @@ -261,15 +264,13 @@ }; } - private static void ConsistencyCheck(DesignScenario scenario, SoilProfile1D soilProfile) + private static void ConsistencyCheck(SoilProfile1D soilProfile) { if (soilProfile != null) { if (soilProfile.BottomAquiferLayer == null) { - throw new MStabXmlDocException(String.Format( - "Scenario {0}: Soilprofile '{1}' does not contain aquifer layers.", - scenario.LocationScenarioID, soilProfile.Name)); + throw new MStabXmlDocException(String.Format( "Soilprofile '{0}' does not contain aquifer layers.", soilProfile.Name)); } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapperTests.cs =================================================================== diff -u -r1027 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapperTests.cs (.../DamPipingSellmeijerVnkKernelWrapperTests.cs) (revision 1027) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapperTests.cs (.../DamPipingSellmeijerVnkKernelWrapperTests.cs) (revision 1137) @@ -100,7 +100,6 @@ }; var damKernelInput = new DamKernelInput { - DesignScenario = designScenario, Location = location, SubSoilScenario = subSoilScenario, RiverLevelHigh = 1.0, @@ -128,7 +127,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damPipingOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damPipingOutput, null, "", out results); foreach (var result in results) { Assert.AreEqual(FailureMechanismSystemType.Piping, result.DamFailureMechanismeCalculation.FailureMechanismSystemType); @@ -170,7 +169,6 @@ }; var damKernelInput = new DamKernelInput { - DesignScenario = designScenario, Location = location, SubSoilScenario = subSoilScenario, RiverLevelHigh = 1.0, @@ -250,12 +248,11 @@ }; var input = new DamKernelInput { - DesignScenario = new DesignScenario(), Location = new Location(), SubSoilScenario = subSoilScenario, DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification }; - input.DesignScenario.Location = new Location(); + input.Location = new Location(); var upliftSituation = new UpliftSituation(); upliftSituation.IsUplift = true; @@ -272,7 +269,7 @@ }; List results; - kernelWrapper.PostProcess(input, output, "", out results); + kernelWrapper.PostProcess(input, output, null, "", out results); foreach (var result in results) { Assert.AreEqual(output.FoSp, result.PipingDesignResults.SellmeijerVnkFactor); @@ -314,7 +311,7 @@ { var kernelWrapper = new DamPipingSellmeijerVnkKernelWrapper(); List results; - kernelWrapper.PostProcess(new DamKernelInput(), null, "", out results); + kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results); } [Test] @@ -324,7 +321,7 @@ { var kernelWrapper = new DamPipingSellmeijerVnkKernelWrapper(); List results; - kernelWrapper.PostProcess(null, new DamPipingSellmeijerVnkOutput(), "", out results); + kernelWrapper.PostProcess(null, new DamPipingSellmeijerVnkOutput(), null, "", out results); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs =================================================================== diff -u -r1075 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 1075) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 1137) @@ -74,7 +74,6 @@ var damKernelInput = new DamKernelInput { - DesignScenario = designScenario, Location = location, SubSoilScenario = subSoilScenario, RiverLevelHigh = 2.0, @@ -102,7 +101,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damPipingOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damPipingOutput, null, "", out results); foreach (var result in results) { Assert.AreEqual(FailureMechanismSystemType.Piping, result.DamFailureMechanismeCalculation.FailureMechanismSystemType); @@ -202,12 +201,11 @@ }; var input = new DamKernelInput { - DesignScenario = new DesignScenario(), Location = new Location(), SubSoilScenario = subSoilScenario, DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification }; - input.DesignScenario.Location = new Location(); + input.Location = new Location(); var upliftSituation = new UpliftSituation(); upliftSituation.IsUplift = true; @@ -223,7 +221,7 @@ }; List results; - kernelWrapper.PostProcess(input, output, "", out results); + kernelWrapper.PostProcess(input, output, null, "", out results); foreach (var result in results) { Assert.AreEqual(output.FoSp, result.PipingDesignResults.BlighFactor); @@ -265,7 +263,7 @@ { var kernelWrapper = new DamPipingBlighKernelWrapper(); List results; - kernelWrapper.PostProcess(new DamKernelInput(), null, "", out results); + kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results); } [Test] @@ -275,7 +273,7 @@ { var kernelWrapper = new DamPipingBlighKernelWrapper(); List results; - kernelWrapper.PostProcess(null, new DamPipingBlighOutput(), "", out results); + kernelWrapper.PostProcess(null, new DamPipingBlighOutput(), null, "", out results); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1137) @@ -26,6 +26,7 @@ using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Calculators.Uplift; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; @@ -75,7 +76,7 @@ DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin }; - var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(damKernelInput.DesignScenario.GetUpliftCriterionPiping(null)); + var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(damKernelInput.Location.ModelFactors.UpliftCriterionPiping.Value); upliftSituation.IsUplift = (upliftLocationAndResult != null); var xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; var xExit = 0.0; @@ -227,7 +228,8 @@ /// The result message. /// The design results. /// No input or output object defined - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, + string resultMessage, out List designResults) { DamPipingSellmeijer4ForcesOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijer4ForcesOutput; if (damPipingOutput == null) @@ -241,7 +243,7 @@ designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, DamProjectCalculationSpecification.SelectedAnalysisType) { CalculationResult = damPipingOutput.CalculationResult Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs =================================================================== diff -u -r1027 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs (.../DamPipingSellmeijer4ForcesKernelWrapperTests.cs) (revision 1027) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs (.../DamPipingSellmeijer4ForcesKernelWrapperTests.cs) (revision 1137) @@ -77,7 +77,6 @@ }; var damKernelInput = new DamKernelInput { - DesignScenario = designScenario, Location = location, SubSoilScenario = subSoilScenario, RiverLevelHigh = 1.0, @@ -105,7 +104,7 @@ // Fill the design results List results; - kernelWrapper.PostProcess(damKernelInput, damPipingOutput, "", out results); + kernelWrapper.PostProcess(damKernelInput, damPipingOutput, null, "", out results); foreach (var result in results) { Assert.AreEqual(FailureMechanismSystemType.Piping, result.DamFailureMechanismeCalculation.FailureMechanismSystemType); @@ -147,7 +146,6 @@ }; var damKernelInput = new DamKernelInput { - DesignScenario = designScenario, Location = location, SubSoilScenario = subSoilScenario, RiverLevelHigh = 1.0, @@ -218,12 +216,11 @@ }; var input = new DamKernelInput { - DesignScenario = new DesignScenario(), Location = new Location(), SubSoilScenario = subSoilScenario, DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification }; - input.DesignScenario.Location = new Location(); + input.Location = new Location(); var upliftSituation = new UpliftSituation(); upliftSituation.IsUplift = true; @@ -239,7 +236,7 @@ }; List results; - kernelWrapper.PostProcess(input, output, "", out results); + kernelWrapper.PostProcess(input, output, null, "", out results); foreach (var result in results) { Assert.AreEqual(output.FoSp, result.PipingDesignResults.Sellmeijer4ForcesFactor); @@ -281,7 +278,7 @@ { var kernelWrapper = new DamPipingSellmeijer4ForcesKernelWrapper(); List results; - kernelWrapper.PostProcess(new DamKernelInput(), null, "", out results); + kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results); } [Test] @@ -291,7 +288,7 @@ { var kernelWrapper = new DamPipingSellmeijer4ForcesKernelWrapper(); List results; - kernelWrapper.PostProcess(null, new DamPipingSellmeijer4ForcesOutput(), "", out results); + kernelWrapper.PostProcess(null, new DamPipingSellmeijer4ForcesOutput(), null, "", out results); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r1131 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1131) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1137) @@ -74,18 +74,20 @@ { // Prepare input + DesignScenario designScenario = location.Scenarios[designScenarioIndex]; var damKernelInput = new DamKernelInput(); var projectPath = damProjectData.ProjectPath != "" ? damProjectData.ProjectPath : Directory.GetCurrentDirectory(); damKernelInput.ProjectDir = projectPath; damKernelInput.CalculationDir = Path.Combine(projectPath, damProjectData.CalculationMap); damKernelInput.Location = location; damKernelInput.SubSoilScenario = soiProfileProbability; - damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; + //damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; damKernelInput.DamFailureMechanismeCalculationSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification; - damKernelInput.RiverLevelHigh = damKernelInput.DesignScenario.RiverLevel; - damKernelInput.RiverLevelLow = damKernelInput.DesignScenario.RiverLevelLow; + damKernelInput.RiverLevelHigh = designScenario.RiverLevel; + damKernelInput.RiverLevelLow = designScenario.RiverLevelLow; + damKernelInput.FilenamePrefix = String.Format("Loc({0})_Sce({1})", designScenario.Location.Name, designScenario.LocationScenarioID); AnalysisType analysisType = DamProjectCalculationSpecification.SelectedAnalysisType; - SynchronizeDesignScenarioDataWithLocationData(damKernelInput.DesignScenario, damKernelInput.Location); + SynchronizeScenarioDataWithLocationData(designScenario, location); IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; PrepareResult prepareResult = kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput); @@ -98,11 +100,11 @@ { case AnalysisType.AdaptGeometry: PerformDesignCalculationShoulderIterativePerPoint(kernelWrapper, kernelDataInput, kernelDataOutput, - damKernelInput, calculationMessages, damProjectData.DesignCalculations); + damKernelInput, designScenario, calculationMessages, damProjectData.DesignCalculations); break; case AnalysisType.NoAdaption: PerformSingleCalculation(kernelWrapper, kernelDataInput, kernelDataOutput, - damKernelInput, calculationMessages, damProjectData.DesignCalculations); + damKernelInput, designScenario, calculationMessages, damProjectData.DesignCalculations); break; } @@ -112,18 +114,16 @@ if (prepareResult == PrepareResult.NotRelevant) { calculationMessages.Add(new LogMessage(LogMessageType.Info, null, - string.Format(Resources.DesignCalculatorIrrelevant, - location.Name, - soiProfileProbability.ToString(), - damKernelInput.DesignScenario.LocationScenarioID))); + string.Format(Resources.DesignCalculatorIrrelevant, + location.Name, + soiProfileProbability.ToString()))); } if (prepareResult == PrepareResult.Failed) { calculationMessages.Add(new LogMessage(LogMessageType.Error, null, - string.Format(Resources.DesignCalculatorPrepareError, - location.Name, - soiProfileProbability.ToString(), - damKernelInput.DesignScenario.LocationScenarioID))); + string.Format(Resources.DesignCalculatorPrepareError, + location.Name, + soiProfileProbability.ToString()))); } } @@ -137,12 +137,11 @@ /// Synchronizes the scenario data with location data. /// Note that scenario data is leading when available. /// - /// The design scenario. + /// The scenario. /// The location. - private void SynchronizeDesignScenarioDataWithLocationData(DesignScenario designScenario, Location location) + private void SynchronizeScenarioDataWithLocationData(DesignScenario designScenario, Location location) { - // Synchronize PlLinescreator parameters if (designScenario.PlLineOffsetBelowDikeToeAtPolder.HasValue) { location.PlLineOffsetBelowDikeToeAtPolder = designScenario.PlLineOffsetBelowDikeToeAtPolder.Value; @@ -193,10 +192,25 @@ { location.ModelFactors.RequiredSafetyFactorPiping = designScenario.RequiredSafetyFactorPiping.Value; } + + // Synchronize stability design parameters + if (designScenario.UpliftCriterionStability.HasValue) + { + location.UpliftCriterionStability = designScenario.UpliftCriterionStability.Value; + } + if (designScenario.RequiredSafetyFactorStabilityInnerSlope.HasValue) + { + location.ModelFactors.RequiredSafetyFactorStabilityInnerSlope = designScenario.RequiredSafetyFactorStabilityInnerSlope.Value; + } + if (designScenario.RequiredSafetyFactorStabilityOuterSlope.HasValue) + { + location.ModelFactors.RequiredSafetyFactorStabilityOuterSlope = designScenario.RequiredSafetyFactorStabilityOuterSlope.Value; + } } - private static void PerformSingleCalculation(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, - List calculationMessages, List designCalculations) + private static void PerformSingleCalculation(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, + DamKernelInput damKernelInput, DesignScenario designScenario, + List calculationMessages, List designCalculations) { // Perform validation var designResults = new List(); @@ -210,8 +224,7 @@ locationCalculationMessages.Add(new LogMessage(LogMessageType.Error, null, string.Format(Resources.DesignCalculatorValidationFailed, damKernelInput.Location.Name, - damKernelInput.SubSoilScenario.ToString(), - damKernelInput.DesignScenario.LocationScenarioID))); + damKernelInput.SubSoilScenario.ToString()))); locationCalculationMessages.AddRange(validationMessages); } else @@ -226,15 +239,14 @@ { sb.Append(message.Message + Environment.NewLine); } - string resultMessage = sb.ToString(); - kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, resultMessage, out designResults); + kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, designScenario, resultMessage, out designResults); } catch (Exception exception) { string resultMessage = exception.Message; - kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, resultMessage, out designResults); + kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, designScenario, resultMessage, out designResults); } finally { @@ -304,8 +316,9 @@ /// The calculation messages. /// The design calculations. /// - private static void PerformDesignCalculationShoulderIterativePerPoint(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, - List calculationMessages, List designCalculations) + private static void PerformDesignCalculationShoulderIterativePerPoint(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, + DamKernelInput damKernelInput, DesignScenario designScenario, + List calculationMessages, List designCalculations) { var designResults = new List(); var location = damKernelInput.Location; @@ -383,12 +396,12 @@ sb.Append(message.Message + Environment.NewLine); } string resultMessage = sb.ToString(); - kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, resultMessage, out designResults); + kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, designScenario, resultMessage, out designResults); } catch (Exception exception) { string resultMessage = exception.Message; - kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, resultMessage, out designResults); + kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, designScenario, resultMessage, out designResults); } finally { @@ -403,7 +416,7 @@ bool designSuccessful = kernelWrapper.EvaluateDesign(damKernelInput, kernelDataInput, kernelDataOutput, out evaluationMessage); if (!designSuccessful) { - throw new DesignCalculatorException(String.Format(Resources.DesignUnsuccessful, + throw new DesignCalculatorException(String.Format(Resources.DesignUnsuccessful, damKernelInput.Location.Name, damKernelInput.SubSoilScenario) + ", " + evaluationMessage); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1137) @@ -190,7 +190,7 @@ } /// - /// Looks up a localized string similar to Location {0}, subsoil scenario '{1}', design scenario '{2}': This calculation in not relevant and thus skipped.. + /// Looks up a localized string similar to Location {0}, subsoil scenario '{1}': This calculation in not relevant and thus skipped.. /// internal static string DesignCalculatorIrrelevant { get { @@ -208,7 +208,7 @@ } /// - /// Looks up a localized string similar to Location {0}, subsoil scenario '{1}', design scenario '{2}': The preparation for this calculation failed.. + /// Looks up a localized string similar to Location {0}, subsoil scenario '{1}'': The preparation for this calculation failed.. /// internal static string DesignCalculatorPrepareError { get { @@ -217,7 +217,7 @@ } /// - /// Looks up a localized string similar to Validation failed for location '{0}', subsoil scenario '{1}', design scenario '{2}'. + /// Looks up a localized string similar to Validation failed for location '{0}', subsoil scenario '{1}'. /// internal static string DesignCalculatorValidationFailed { get { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs =================================================================== diff -u -r1012 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 1012) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 1137) @@ -50,27 +50,23 @@ soilGeometryName = damKernelInput.SubSoilScenario.SoilProfile1DName; } - string calculationName = DetermineCalculationFilename(damKernelInput.DesignScenario.Location.Name, - damKernelInput.DesignScenario.LocationScenarioID, soilGeometryName, iterationIndex); + string calculationName = DetermineCalculationFilename(damKernelInput.FilenamePrefix, soilGeometryName, iterationIndex); const string filenameExtension = ".sti"; string fileName = calculationName + filenameExtension; string stabilityDirectory = GetStabilityCalculationDirectory(model, projectWorkingPath); return Path.Combine(stabilityDirectory, fileName); } - private static string DetermineCalculationFilename(string locationName, string scenarioName, - string soilGeometryName, int iterationIndex) + private static string DetermineCalculationFilename(string filenamePrefix, string soilGeometryName, int iterationIndex) { string calculationName; if (iterationIndex <= 0) { - calculationName = String.Format("Loc({0})_Sce({1})_Pro({2})", locationName, scenarioName, - soilGeometryName); + calculationName = String.Format("{0}_Pro({1})", filenamePrefix, soilGeometryName); } else { - calculationName = String.Format("Loc({0})_Sce({1})_Pro({2})_Ite({3})", locationName, scenarioName, - soilGeometryName, iterationIndex); + calculationName = String.Format("{0}_Pro({1})_Ite({2})", filenamePrefix, soilGeometryName, iterationIndex); } return Regex.Replace(calculationName, @"[\\\/:\*\?""'<>|.]", "_"); } Index: DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs =================================================================== diff -u -r1120 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 1120) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 1137) @@ -227,7 +227,7 @@ { // Calculation results (per location) damProjectData.LocationJobs = new List(); - var jobtel = 0; +// var jobtel = 0; // foreach (var outputLocationResult in output.Results.CalculationResults.LocationResults) // { // var locationJob = new LocationJob("hh"); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/UpliftHelper.cs =================================================================== diff -u -r1123 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/UpliftHelper.cs (.../UpliftHelper.cs) (revision 1123) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/UpliftHelper.cs (.../UpliftHelper.cs) (revision 1137) @@ -34,12 +34,12 @@ public static UpliftSituation DetermineStabilityUplift(DamKernelInput damKernelInput, bool useRivelLevelLow) { var location = damKernelInput.Location; - var upliftCriterion = damKernelInput.DesignScenario.GetUpliftCriterionStability(location.ModelFactors.UpliftCriterionStability); - var riverLevel = damKernelInput.DesignScenario.RiverLevel; + var upliftCriterion = damKernelInput.Location.ModelFactors.UpliftCriterionStability; + var riverLevel = damKernelInput.RiverLevelHigh; double? riverLevelLow = null; if (useRivelLevelLow) { - riverLevelLow = damKernelInput.DesignScenario.RiverLevelLow; + riverLevelLow = damKernelInput.RiverLevelLow; } var soilGeometry2DName = damKernelInput.SubSoilScenario.FullStiFileName; UpliftSituation upliftSituation; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs =================================================================== diff -u -r1120 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs (.../RegionalScenariosCalculation.cs) (revision 1120) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs (.../RegionalScenariosCalculation.cs) (revision 1137) @@ -90,8 +90,6 @@ damKernelInput.SubSoilScenario = soilGeometryProbability; //damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; damKernelInput.DamFailureMechanismeCalculationSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification; - damKernelInput.RiverLevelHigh = damKernelInput.DesignScenario.RiverLevel;// #Bka hier geen Dscen - damKernelInput.RiverLevelLow = damKernelInput.DesignScenario.RiverLevelLow;// #Bka hier geen Dscen AnalysisType analysisType = DamProjectCalculationSpecification.SelectedAnalysisType; // SynchronizeDesignScenarioDataWithLocationData(damKernelInput.DesignScenario, damKernelInput.Location); // IKernelDataInput kernelDataInput; @@ -122,16 +120,14 @@ calculationMessages.Add(new LogMessage(LogMessageType.Info, null, string.Format(Resources.DesignCalculatorIrrelevant, location.Name, - soilGeometryProbability.ToString(), - damKernelInput.DesignScenario.LocationScenarioID))); // #Bka hier geen Dscen + soilGeometryProbability.ToString()))); } if (prepareResult == PrepareResult.Failed) { calculationMessages.Add(new LogMessage(LogMessageType.Error, null, string.Format(Resources.DesignCalculatorPrepareError, location.Name, - soilGeometryProbability.ToString(), - damKernelInput.DesignScenario.LocationScenarioID)));// #Bka hier geen Dscen + soilGeometryProbability.ToString()))); } } return kernelWrapper;//calculationMessages; @@ -632,7 +628,7 @@ string resultMessage = ""; List results; var input = (DamKernelInput) kernelDataInput; - calculator.PostProcess(input, kernelDataOutput, resultMessage, out results); + calculator.PostProcess(input, kernelDataOutput, null, resultMessage, out results); //string results = ""; job.SafetyFactor = results[0].SafetyFactor.Value; job.CalculationResult = results[0].CalculationResult; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs =================================================================== diff -u -r1040 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 1137) @@ -52,15 +52,14 @@ /// The location. /// public Location Location { get; set; } - + /// - /// Gets or sets the design scenario. + /// Gets or sets the filename prefix. /// /// - /// The design scenario. + /// The filename prefix. /// - public DesignScenario DesignScenario { get; set; } - + public string FilenamePrefix { get; set; } /// /// Gets or sets the sub soil scenario. /// Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1137) @@ -26,6 +26,7 @@ using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Calculators.Uplift; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.PlLines; using Deltares.DamEngine.Data.General.Results; @@ -233,18 +234,21 @@ /// /// The dam kernel input. /// The kernel data output. + /// The design scenario. /// The result message. /// The design results. /// No output object defined for Bligh - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, + DesignScenario designScenario, string resultMessage, + out List designResults) { DamPipingBlighOutput damPipingBlighOutput = kernelDataOutput as DamPipingBlighOutput; ThrowWhenDamKernelInputNull(damKernelInput); ThrowWhenKernelOutputNull(damPipingBlighOutput); designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, DamProjectCalculationSpecification.SelectedAnalysisType) { CalculationResult = damPipingBlighOutput.CalculationResult Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1137) @@ -136,7 +136,7 @@ Requested kernel not implemented yet - Validation failed for location '{0}', subsoil scenario '{1}', design scenario '{2}' + Validation failed for location '{0}', subsoil scenario '{1}' No input object defined for Bligh @@ -157,10 +157,10 @@ Required safety factor must be specified - Location {0}, subsoil scenario '{1}', design scenario '{2}': This calculation in not relevant and thus skipped. + Location {0}, subsoil scenario '{1}': This calculation in not relevant and thus skipped. - Location {0}, subsoil scenario '{1}', design scenario '{2}': The preparation for this calculation failed. + Location {0}, subsoil scenario '{1}'': The preparation for this calculation failed. The use of Zone Areas is not allowed for stability outside. Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapper.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapper.cs (.../DamMacroStabilityHorizontalBalanceKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityHorizontalBalance/DamMacroStabilityHorizontalBalanceKernelWrapper.cs (.../DamMacroStabilityHorizontalBalanceKernelWrapper.cs) (revision 1137) @@ -27,6 +27,7 @@ using Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityCommon; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; @@ -153,7 +154,7 @@ /// The design results /// /// - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, string resultMessage, out List designResults) { DamMacroStabilityOutput damMacroStabilityOutput = kernelDataOutput as DamMacroStabilityOutput; if (damKernelInput == null) @@ -169,7 +170,7 @@ designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, DamProjectCalculationSpecification.SelectedAnalysisType) { // Initialize result as failed @@ -235,13 +236,17 @@ internal XDocument CreateMstabDamXmlDocument(DamKernelInput damKernelInput, DamMacroStabilityInput kernelDataInput) { var stabilityProjectFilename = kernelDataInput.DGeoStabilityInputFileName; - var scenario = damKernelInput.DesignScenario; var subSoilScenario = damKernelInput.SubSoilScenario; // There is no required safety for Horizontal Balannce (not used in design as of yet) so just use 1.0 instead. var requiredSafetyFactor = 1.0; List errorMessages; - XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, + XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc( + stabilityProjectFilename, + damKernelInput.Location, + damKernelInput.RiverLevelHigh, + damKernelInput.RiverLevelLow, + subSoilScenario, null, requiredSafetyFactor, kernelDataInput.FailureMechanismParametersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs =================================================================== diff -u -r1007 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 1007) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 1137) @@ -76,13 +76,17 @@ var failureMechanismParametersMStab = new FailureMechanismParametersMStab(); failureMechanismParametersMStab.MStabParameters.GridPosition = MStabGridPosition.Right; failureMechanismParametersMStab.MStabParameters.SearchMethod = MStabSearchMethod.GeneticAlgorithm; + double riverLevelLow = 0.0; - MStabDesignEmbankment mStabDesignEmbankment = null; + XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc( + stabilityProjectFilename, + location, + location.RiverLevel, + riverLevelLow, + subSoilScenario, + null, requiredSafetyFactor, + failureMechanismParametersMStab, out errorMessages); - XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - mStabDesignEmbankment, requiredSafetyFactor, failureMechanismParametersMStab, - out errorMessages); - mstabXml.Save(xmlFileName); Assert.IsTrue(File.Exists(xmlFileName)); CompareByLine(ModifiedXmlDocument(expectedxmlFileName), ModifiedXmlDocument(xmlFileName)); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs (.../IKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs (.../IKernelWrapper.cs) (revision 1137) @@ -21,6 +21,7 @@ using System.Collections.Generic; using Deltares.DamEngine.Calculators.KernelWrappers.Common; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; @@ -83,9 +84,10 @@ /// /// The dam kernel input. /// The kernel data output. + /// The design scenario. /// The result message. /// The design results - void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults); + void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, string resultMessage, out List designResults); /// /// Calculates the design at point. Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r1129 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1137) @@ -31,6 +31,7 @@ using Deltares.DamPiping.SellmeijerVNKCalculator; using System.Data; using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Standard.Calculation; @@ -74,7 +75,7 @@ DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin }; - var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(damKernelInput.DesignScenario.GetUpliftCriterionPiping(null)); + var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(location.ModelFactors.UpliftCriterionPiping.Value); upliftSituation.IsUplift = (upliftLocationAndResult != null); var xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; var xExit = 0.0; @@ -213,7 +214,8 @@ /// The design results /// /// - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, + string resultMessage, out List designResults) { DamPipingSellmeijerVnkOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijerVnkOutput; if (damPipingOutput == null) @@ -227,7 +229,7 @@ designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, DamProjectCalculationSpecification.SelectedAnalysisType) { CalculationResult = damPipingOutput.CalculationResult Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1134 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1134) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1137) @@ -28,6 +28,7 @@ using Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityCommon; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; @@ -252,35 +253,35 @@ var calculator = StabilityCalculator(kernelDataInput); try { - calculator.Calculate(); + calculator.Calculate(); - // get (first) results - var results = calculator.GetResults(); - if (results.Count > 0) + // get (first) results + var results = calculator.GetResults(); + if (results.Count > 0) + { + var stabilityOutputItem = new DamMacroStabilityOutputItem(); + var zone1 = new DamMacroStabilityOutputItem.ResultsSingleZone { - var stabilityOutputItem = new DamMacroStabilityOutputItem(); - var zone1 = new DamMacroStabilityOutputItem.ResultsSingleZone + SafetyFactor = results[0].Zone1.SafetyFactor, + CircleSurfacePointLeftXCoordinate = results[0].Zone1.CircleSurfacePointLeftXCoordinate, + CircleSurfacePointRightXCoordinate = results[0].Zone1.CircleSurfacePointRightXCoordinate, + }; + stabilityOutputItem.Zone1Results = zone1; + if (results[0].Zone2 != null) + { + var zone2Result = results[0].Zone2.Value; + var zone2 = new DamMacroStabilityOutputItem.ResultsSingleZone { - SafetyFactor = results[0].Zone1.SafetyFactor, - CircleSurfacePointLeftXCoordinate = results[0].Zone1.CircleSurfacePointLeftXCoordinate, - CircleSurfacePointRightXCoordinate = results[0].Zone1.CircleSurfacePointRightXCoordinate, + SafetyFactor = zone2Result.SafetyFactor, + CircleSurfacePointLeftXCoordinate = zone2Result.CircleSurfacePointLeftXCoordinate, + CircleSurfacePointRightXCoordinate = zone2Result.CircleSurfacePointRightXCoordinate, }; - stabilityOutputItem.Zone1Results = zone1; - if (results[0].Zone2 != null) - { - var zone2Result = results[0].Zone2.Value; - var zone2 = new DamMacroStabilityOutputItem.ResultsSingleZone - { - SafetyFactor = zone2Result.SafetyFactor, - CircleSurfacePointLeftXCoordinate = zone2Result.CircleSurfacePointLeftXCoordinate, - CircleSurfacePointRightXCoordinate = zone2Result.CircleSurfacePointRightXCoordinate, - }; - stabilityOutputItem.Zone2Results = zone2; - } - return stabilityOutputItem; + stabilityOutputItem.Zone2Results = zone2; } - return null; + return stabilityOutputItem; } + return null; + } catch (Exception e) { var message = new LogMessage { MessageType = LogMessageType.Info, Message = e.Message }; @@ -294,16 +295,20 @@ internal XDocument CreateMstabDamXmlDocument(DamKernelInput damKernelInput, DamMacroStabilityInput kernelDataInput) { var stabilityProjectFilename = kernelDataInput.DGeoStabilityInputFileName; - var scenario = damKernelInput.DesignScenario; var subSoilScenario = damKernelInput.SubSoilScenario; - var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityInnerSlope?? scenario.Location.ModelFactors.RequiredSafetyFactorStabilityInnerSlope; + var requiredSafetyFactor = damKernelInput.Location.ModelFactors.RequiredSafetyFactorStabilityInnerSlope; if (requiredSafetyFactor == null) { throw new MacroStabilityException("Required safety factor must be specified"); } List errorMessages; - - XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, + + XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc( + stabilityProjectFilename, + damKernelInput.Location, + damKernelInput.RiverLevelHigh, + damKernelInput.RiverLevelLow, + subSoilScenario, null, requiredSafetyFactor.Value, kernelDataInput.FailureMechanismParametersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); @@ -345,7 +350,7 @@ /// The result message. /// The design results. /// - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, string resultMessage, out List designResults) { if (damKernelInput == null) @@ -359,12 +364,12 @@ } designResults = new List(); - if (damMacroStabilityOutput.StabilityOutputItems.Count > 0) + if (damMacroStabilityOutput.StabilityOutputItems.Count > 0) { var damMacroStabilityOutputItem = damMacroStabilityOutput.StabilityOutputItems[0]; if (damMacroStabilityOutputItem != null) { - var designResult = NewDesignResult(damKernelInput); + var designResult = NewDesignResult(damKernelInput, designScenario); FillDesignResult(damMacroStabilityOutputItem, designResult); designResult.StabilityDesignResults.UpliftSituation = damMacroStabilityOutput.UpliftSituation; designResults.Add(designResult); @@ -379,7 +384,7 @@ var damMacroStabilityOutputItem = damMacroStabilityOutput.StabilityOutputItems[1]; if (damMacroStabilityOutputItem != null) { - var designResult = NewDesignResult(damKernelInput); + var designResult = NewDesignResult(damKernelInput, designScenario); FillDesignResult(damMacroStabilityOutputItem, designResult); designResult.StabilityDesignResults.UpliftSituation = damMacroStabilityOutput.UpliftSituation; designResults.Add(designResult); @@ -388,15 +393,15 @@ else { // add empty result for UpliftVan - var designResult = NewDesignResult(damKernelInput); + var designResult = NewDesignResult(damKernelInput, designScenario); designResult.DamFailureMechanismeCalculation.FailureMechanismParametersMStab.MStabParameters.Model = MStabModelType.UpliftVan; designResult.CalculationResult = CalculationResult.NoRun; designResult.StabilityDesignResults.UpliftSituation = damMacroStabilityOutput.UpliftSituation; designResults.Add(designResult); } // add worst result from Bishop/UpliftVan, but only if both succeeded. - if (designResults[0].CalculationResult == CalculationResult.Succeeded && + if (designResults[0].CalculationResult == CalculationResult.Succeeded && designResults[1].CalculationResult == CalculationResult.Succeeded) { if (designResults[0].StabilityDesignResults.SafetyFactor <= designResults[1].StabilityDesignResults.SafetyFactor) @@ -453,11 +458,11 @@ throw new NotImplementedException(); } - private DesignResult NewDesignResult(DamKernelInput damKernelInput) + private DesignResult NewDesignResult(DamKernelInput damKernelInput, DesignScenario designScenario) { string soilProfile2DName = damKernelInput.SubSoilScenario.ToString(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, DamProjectCalculationSpecification.SelectedAnalysisType) { // initialize as failed @@ -476,20 +481,20 @@ designResult.CalculationResult = damMacroStabilityOutputItem.CalculationResult; if (designResult.CalculationResult != CalculationResult.UnexpectedError) { - designResult.StabilityDesignResults.Zone1SafetyFactor = - damMacroStabilityOutputItem.Zone1Results.SafetyFactor; - designResult.StabilityDesignResults.LocalZone1EntryPointX = - damMacroStabilityOutputItem.Zone1Results.CircleSurfacePointLeftXCoordinate; - designResult.StabilityDesignResults.LocalZone1ExitPointX = - damMacroStabilityOutputItem.Zone1Results.CircleSurfacePointRightXCoordinate; + designResult.StabilityDesignResults.Zone1SafetyFactor = + damMacroStabilityOutputItem.Zone1Results.SafetyFactor; + designResult.StabilityDesignResults.LocalZone1EntryPointX = + damMacroStabilityOutputItem.Zone1Results.CircleSurfacePointLeftXCoordinate; + designResult.StabilityDesignResults.LocalZone1ExitPointX = + damMacroStabilityOutputItem.Zone1Results.CircleSurfacePointRightXCoordinate; - designResult.StabilityDesignResults.SafetyFactor = designResult.StabilityDesignResults.Zone1SafetyFactor; - if (damMacroStabilityOutputItem.Zone2Results != null) - { + designResult.StabilityDesignResults.SafetyFactor = designResult.StabilityDesignResults.Zone1SafetyFactor; + if (damMacroStabilityOutputItem.Zone2Results != null) + { var zone2 = (DamMacroStabilityOutputItem.ResultsSingleZone)damMacroStabilityOutputItem.Zone2Results; - designResult.StabilityDesignResults.Zone2SafetyFactor = zone2.SafetyFactor; - designResult.StabilityDesignResults.LocalZone2EntryPointX = zone2.CircleSurfacePointLeftXCoordinate; - designResult.StabilityDesignResults.LocalZone2ExitPointX = zone2.CircleSurfacePointRightXCoordinate; + designResult.StabilityDesignResults.Zone2SafetyFactor = zone2.SafetyFactor; + designResult.StabilityDesignResults.LocalZone2EntryPointX = zone2.CircleSurfacePointLeftXCoordinate; + designResult.StabilityDesignResults.LocalZone2ExitPointX = zone2.CircleSurfacePointRightXCoordinate; } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r1133 -r1137 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1133) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1137) @@ -33,6 +33,7 @@ using Deltares.DamEngine.Data.Standard.Logging; using Deltares.DamMacroStability.Calculator; using System.IO; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.Geometry; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityOutwards @@ -187,16 +188,21 @@ internal XDocument CreateMstabDamXmlDocument(DamKernelInput damKernelInput, DamMacroStabilityInput kernelDataInput) { var stabilityProjectFilename = kernelDataInput.DGeoStabilityInputFileName; - var scenario = damKernelInput.DesignScenario; + var modelFactors = damKernelInput.Location.ModelFactors; var subSoilScenario = damKernelInput.SubSoilScenario; - var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityOuterSlope?? scenario.Location.ModelFactors.RequiredSafetyFactorStabilityOuterSlope; + var requiredSafetyFactor = modelFactors.RequiredSafetyFactorStabilityOuterSlope; if (requiredSafetyFactor == null) { throw new MacroStabilityException(Resources.DamMacroStabilityOutwardsKernelWrapper_Prepare_NoRequiredSafetyFactor); } List errorMessages; - XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, + XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc( + stabilityProjectFilename, + damKernelInput.Location, + damKernelInput.RiverLevelHigh, + damKernelInput.RiverLevelLow, + subSoilScenario, null, requiredSafetyFactor.Value, kernelDataInput.FailureMechanismParametersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); @@ -238,7 +244,8 @@ /// The result message. /// The design results. /// - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, + string resultMessage, out List designResults) { DamMacroStabilityOutput damMacroStabilityOutput = kernelDataOutput as DamMacroStabilityOutput; if (damKernelInput == null) @@ -254,7 +261,7 @@ designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, DamProjectCalculationSpecification.SelectedAnalysisType) { // initialize as failed