Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs =================================================================== diff -u -r669 -r683 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 669) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 683) @@ -4,8 +4,11 @@ using System.Xml.Linq; using Deltares.DamEngine.Calculators.General; using Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStability.Assemblers; +using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Calculators.Stability; using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.PlLines; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Logging; @@ -38,6 +41,7 @@ ConsistencyCheck(scenario, profile1D, soilGeometry2DName); FailureMechanismeParamatersMStab failureMechanismeParamatersMStab = new FailureMechanismeParamatersMStab(); + failureMechanismeParamatersMStab.Location = scenario.Location; if (profile1D != null) { @@ -66,14 +70,12 @@ (mstabDesignEmbankment != null); failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.XOffsetSoilGeometry2DOrigin = -scenario.Location.XSoilGeometry2DOrigin; - //ToDo zant PLLineCreationMethod is no longer property of Location -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PLLineAssignment = -// CalculationHelper.PLLineCreationMethod2PLLineAssignment(scenario.Location.PLLineCreationMethod); + failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PLLineAssignment = + CalculationHelper.PLLineCreationMethod2PLLineAssignment(scenario.Location.ModelParametersForPLLines.PLLineCreationMethod); failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.IntrusionVerticalWaterPressureType = scenario.Location.IntrusionVerticalWaterPressure.Value; - //ToDo zant PenetrationLength is no longer property of Location -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PenetrationLength = -// scenario.Location.PenetrationLength; + failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PenetrationLength = + scenario.Location.ModelParametersForPLLines.PenetrationLength; // End of Geometry Creation Options @@ -132,11 +134,10 @@ }; } - //ToDo zant Tmp disabled -// if (failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.ZonesType.Equals(MStabZonesType.ForbiddenZone)) -// { -// CreateForbiddenZone(scenario, surfaceLine); -// } + if (failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.ZonesType.Equals(MStabZonesType.ForbiddenZone)) + { + failureMechanismeParamatersMStab.MStabParameters.ForbiddenZone = CreateForbiddenZone(scenario, surfaceLine); + } // Make sure riverlevel is correct with respect to surfaceline double riverLevelLow = double.NaN; @@ -149,14 +150,9 @@ if (riverLevelHigh < surfaceLevelOutside.Z) { var riverLevelHighIsBelowSurfaceLevelOutside = Path.GetFileName(mstabProjectFilename) + ": " + - //ToDo zant -// LocalizationManager.GetTranslatedText(this.GetType(), -// "riverLevelHighIsBelowSurfaceLevelOutside"); - "riverLevelHighIsBelowSurfaceLevelOutside"; - + Resources.MStabXmlDoc_CreateMStabXmlDoc_RiverLevelHighIsBelowSurfaceLevelOutside; LogMessage logMessage = new LogMessage(LogMessageType.Warning, null, - String.Format(riverLevelHighIsBelowSurfaceLevelOutside, riverLevelHigh, - surfaceLevelOutside.Z)); + string.Format(riverLevelHighIsBelowSurfaceLevelOutside, riverLevelHigh, surfaceLevelOutside.Z)); errorMessages.Add(logMessage); } @@ -166,9 +162,18 @@ currentSurfaceLine = surfaceLine; } - //ToDo zant CreateAllPLLines was changed -// failureMechanismeParamatersMStab.PLLines = CalculationHelper.CreateAllPLLines(scenario.Location, currentSurfaceLine, -// soilProfile, soilGeometry2DName, riverLevelHigh.Value, riverLevelLow); + //ToDo zant_xml CreateAllPLLines was changed + // ToDo zant_mxl I think a Location needs Segments for location.GetMostProbableProfile while creating Pl lines + // failureMechanismeParamatersMStab.PLLines = CreateAllPLLines(scenario.Location, currentSurfaceLine, + // soilProfile, soilGeometry2DName, riverLevelHigh.Value, riverLevelLow); +// SoilProfileType soilProfileType; +// // string tmpSoilGeometry2DName; +// // CalculationHelper.DetermineSoilGeometryType(scenario.Location, out soilProfileType, out tmpSoilGeometry2DName); +// soilProfileType = SoilProfileType.ProfileType1D; +// var waterLevel = 0; // What is the waterlevel? +// failureMechanismeParamatersMStab.PLLines = CalculationHelper.CreateAllPLLines(waterLevel, +// scenario.Location, soilGeometry2DName, soilProfileType); + // End of ToDo zant_xml CreateAllPLLines was changed // Slip circle definition for Uplift Van; TODO: Combine with code in StabilityCalculation if (failureMechanismeParamatersMStab.MStabParameters.Model == MStabModelType.UpliftVan) @@ -193,15 +198,34 @@ failureMechanismeParamatersMStab.MStabParameters.ProjectFileName = mstabProjectFilename; failureMechanismeParamatersMStab.MStabParameters.SoilDatabaseName = scenario.Location.SoildatabaseName; - if (!failureMechanismeParamatersMStab.IsComplete) - { - throw new Exception("Not all required data is available"); - } + //ToDo zant_xml Fails because PLLines are not created yet +// if (!failureMechanismeParamatersMStab.IsComplete) +// { +// throw new Exception("Not all required data is available"); +// } + DamMStabAssembler assembler = new DamMStabAssembler(); XDocument mstabXML = assembler.CreateDataTransferObject(failureMechanismeParamatersMStab); return mstabXML; } + public static MStabForbiddenZone CreateForbiddenZone(DesignScenario scenario, SurfaceLine2 surfaceLine) + { + var dikeTopAtPolder = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder); + // Zonestype is ForbiddenZone; TODO: Combine with code in StabilityCalculator? + double maxZoneX = dikeTopAtPolder.X + + scenario.Location.ForbiddenZoneFactor * (surfaceLine.GetDikeToeInward().X - dikeTopAtPolder.X); + return new MStabForbiddenZone + { + IsXEntryMinUsed = false, + XEntryMin = 0.0, + IsXEntryMaxUsed = true, + XEntryMax = maxZoneX + }; + } + + + /// /// ///