Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs =================================================================== diff -u -r1105 -r1133 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1105) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1133) @@ -167,7 +167,7 @@ damKernelInput.DesignScenario.Location.ShoulderEmbankmentMaterial = "Del_Ppp"; damKernelInput.DesignScenario.Location.StabilityOptions.MinimalCircleDepth = 1.0; damKernelInput.DesignScenario.Location.StabilityOptions.StabilityZoneType = MStabZonesType.ZoneAreas; - var FailureMechanismParametersMStab = new FailureMechanismParametersMStab + var failureMechanismParametersMStab = new FailureMechanismParametersMStab { MStabParameters = { @@ -186,7 +186,7 @@ var kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper { - FailureMechanismParametersMStab = FailureMechanismParametersMStab + FailureMechanismParametersMStab = failureMechanismParametersMStab }; // Prepare the wrapper. Result is input for the calculation dll @@ -224,9 +224,9 @@ scenario.Location.StabilityOptions = new StabilityOptions { TrafficLoad = 10.0, - SoilGeometries2DPath = absoluteFolder + SoilGeometries2DPath = absoluteFolder, + SoilDatabaseName = soilDbName }; - scenario.Location.StabilityOptions.SoilDatabaseName = soilDbName; scenario.ModelFactors.RequiredSafetyFactorStabilityOuterSlope = 1.1; scenario.ModelFactors.UpliftCriterionStability = 1.2; @@ -258,25 +258,28 @@ var soilDbName = Path.Combine(testFolder, "DAM Tutorial Design0.soilmaterials.mdb"); // modify name of output sti file XDocument xDocument = XDocument.Load(xmlFileName); - XElement inputElement = (from element in xDocument.Root.Descendants() - where element.Name.LocalName == DamMStabAssembler.XmlElementNameInput - select element).Single(); - XAttribute mstabFileName = inputElement.Attribute(DamMStabAssembler.XmlAttributeMStabFileName); - Debug.Assert(mstabFileName != null, "mstabFileName != null"); - mstabFileName.Value = stiFileName; + if (xDocument.Root != null) + { + XElement inputElement = (from element in xDocument.Root.Descendants() + where element.Name.LocalName == DamMStabAssembler.XmlElementNameInput + select element).Single(); + XAttribute mstabFileName = inputElement.Attribute(DamMStabAssembler.XmlAttributeMStabFileName); + Debug.Assert(mstabFileName != null, "mstabFileName != null"); + mstabFileName.Value = stiFileName; - // modify name of Soil DB Name - XAttribute dbName = inputElement.Attribute(DamMStabAssembler.XmlAttributeSoilDBName); - Debug.Assert(dbName != null, "dbName != null"); - dbName.Value = soilDbName; + // modify name of Soil DB Name + XAttribute dbName = inputElement.Attribute(DamMStabAssembler.XmlAttributeSoilDBName); + Debug.Assert(dbName != null, "dbName != null"); + dbName.Value = soilDbName; - // modify name of geometry input file - XElement geometryOptionsElement = (from element in inputElement.Descendants() - where element.Name.LocalName == DamMStabAssembler.XmlElementGeometryCreationOptions - select element).Single(); - XAttribute geomFileName = geometryOptionsElement.Attribute(DamMStabAssembler.XmlAttributeSoilGeometry2DFilename); - Debug.Assert(geomFileName != null, "geomFileName != null"); - geomFileName.Value = geometryFileName; + // modify name of geometry input file + XElement geometryOptionsElement = (from element in inputElement.Descendants() + where element.Name.LocalName == DamMStabAssembler.XmlElementGeometryCreationOptions + select element).Single(); + XAttribute geomFileName = geometryOptionsElement.Attribute(DamMStabAssembler.XmlAttributeSoilGeometry2DFilename); + Debug.Assert(geomFileName != null, "geomFileName != null"); + geomFileName.Value = geometryFileName; + } return xDocument; } @@ -439,9 +442,9 @@ scenario.Location.StabilityOptions = new StabilityOptions { TrafficLoad = 10.0, - SoilGeometries2DPath = "" + SoilGeometries2DPath = "", + SoilDatabaseName = soilDbName }; - scenario.Location.StabilityOptions.SoilDatabaseName = soilDbName; scenario.ModelFactors.RequiredSafetyFactorStabilityInnerSlope = 1.1; scenario.ModelFactors.UpliftCriterionStability = 1.2; @@ -452,7 +455,7 @@ SegmentFailureMechanismType = FailureMechanismSystemType.StabilityOutside }; - var FailureMechanismParametersMStab = new FailureMechanismParametersMStab + var failureMechanismParametersMStab = new FailureMechanismParametersMStab { MStabParameters = { @@ -477,7 +480,7 @@ var kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper { - FailureMechanismParametersMStab = FailureMechanismParametersMStab + FailureMechanismParametersMStab = failureMechanismParametersMStab }; // Prepare the wrapper. Result is input for the calculation dll Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r1129 -r1133 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1129) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1133) @@ -34,7 +34,6 @@ using Deltares.DamMacroStability.Calculator; using System.IO; using Deltares.DamEngine.Data.Geometry; -using Deltares.DamEngine.Data.Geotechnics; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityOutwards { @@ -273,14 +272,14 @@ ResultMessage = resultMessage, UpliftSituation = damMacroStabilityOutput.UpliftSituation }; + // Overall safety factor is always the one as determined for Zone 1. The zone 2 factor is only informative. stabilityDesignResults.SafetyFactor = stabilityDesignResults.Zone1SafetyFactor; if (damMacroStabilityOutputItem.Zone2Results != null) { var zone2 = (DamMacroStabilityOutputItem.ResultsSingleZone)damMacroStabilityOutputItem.Zone2Results; stabilityDesignResults.Zone2SafetyFactor = zone2.SafetyFactor; stabilityDesignResults.LocalZone2EntryPointX = zone2.CircleSurfacePointRightXCoordinate; stabilityDesignResults.LocalZone2ExitPointX = zone2.CircleSurfacePointLeftXCoordinate; - stabilityDesignResults.SafetyFactor = Math.Min(damMacroStabilityOutputItem.Zone1Results.SafetyFactor, zone2.SafetyFactor); } stabilityDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; // In the actual sti file, the start of the surface line is always reset to 0. In order to keep all