Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs =================================================================== diff -u -r670 -r683 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs (.../StabilityCalculator.cs) (revision 670) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs (.../StabilityCalculator.cs) (revision 683) @@ -833,7 +833,6 @@ } } - /// /// Depending on outward/inward stability (position of grid) the exitpoint of the slipcricle is determined /// @@ -865,214 +864,7 @@ } } - private void 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); - failureMechanismeParamatersMStab.MStabParameters.ForbiddenZone = new MStabForbiddenZone - { - IsXEntryMinUsed = false, - XEntryMin = 0.0, - IsXEntryMaxUsed = true, - XEntryMax = maxZoneX - }; - } - /// - /// Create XML definition for Stability calculation - /// - /// - /// - /// - /// - /// - /// - /// - /// -// public XDocument CreateMStabXmlDoc(string mstabProjectFilename, Scenario scenario, SoilProfile1D soilProfile, -// string soilGeometry2DName, double riverLevel, -// MStabDesignEmbankment mstabDesignEmbankment, SurfaceLine2 surfaceLine) -// { -// SoilProfile1D profile1D = soilProfile as SoilProfile1D; -// SoilProfile2D profile2D = soilProfile as SoilProfile2D; -// ConsistencyCheck(scenario, profile1D, soilGeometry2DName); -// failureMechanismeParamatersMStab.Location = scenario.Location; -// if (profile1D != null) -// { -// failureMechanismeParamatersMStab.SoilProfile1D = profile1D; -// // 1d-geometry -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.SoilProfileType = -// SoilProfileType.ProfileType1D; -// } -// else -// { -// // 2d-geometry -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.SoilProfileType = -// SoilProfileType.ProfileType2D; -// } -// // Geometry Creation Options -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.SoilGeometry2DFilename = -// soilGeometry2DName; -// -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.MaterialForDike = -// scenario.Location.DikeEmbankmentMaterial; -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.MaterialForShoulder = -// scenario.Location.ShoulderEmbankmentMaterial; -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.IsUseOriginalPLLineAssignments = -// scenario.Location.IsUseOriginalPLLineAssignments; -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.IsDesign = -// (mstabDesignEmbankment != null); -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.XOffsetSoilGeometry2DOrigin = -// -scenario.Location.XSoilGeometry2DOrigin; -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PLLineAssignment = -// CalculationHelper.PLLineCreationMethod2PLLineAssignment(scenario.Location.PLLineCreationMethod); -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.IntrusionVerticalWaterPressureType = -// scenario.Location.IntrusionVerticalWaterPressure.Value; -// failureMechanismeParamatersMStab.MStabParameters.GeometryCreationOptions.PenetrationLength = -// scenario.Location.PenetrationLength; -// // End of Geometry Creation Options -// // Design options -// failureMechanismeParamatersMStab.Design = mstabDesignEmbankment; -// -// failureMechanismeParamatersMStab.SurfaceLine = surfaceLine; -// failureMechanismeParamatersMStab.RiverLevel = riverLevel; // scenario.RiverLevel; -// failureMechanismeParamatersMStab.DikeTableHeight = -// scenario.DikeTableHeight ?? surfaceLine.GetDefaultDikeTableHeight() ?? 0; -// failureMechanismeParamatersMStab.TrafficLoad = this.trafficLoad; -// -// // Horizontal balance; TODO: Combine with code in StabilityCalculation -// if (failureMechanismeParamatersMStab.MStabParameters.Model == MStabModelType.HorizontalBalance) -// { -// if (profile1D == null) -// { -// throw new DamFailureMechanismeCalculatorException( -// "Model horizontal balance does not support 2d-geometries"); -// } -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea = new HorizontalBalanceArea(); -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.XLeft = -// surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.XRight = -// surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.YTop = riverLevel; -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.YBottom = -// profile1D.InBetweenAquiferLayer != null -// ? profile1D.InBetweenAquiferLayer.TopLevel -// : profile1D.BottomAquiferLayer.TopLevel; -// int planeCount = -// (int)(Math.Round((failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.YTop - -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.YBottom) / 0.25)); -// failureMechanismeParamatersMStab.MStabParameters.HorizontalBalanceArea.PlaneCount = Math.Min(planeCount, 50); -// -// } -// -// // Zonestype is ZoneAreas; TODO: Combine with code in StabilityCalculation -// var dikeTopAtPolder = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder); -// if ( -// failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.ZonesType.Equals( -// MStabZonesType.ZoneAreas)) -// { -// double? dikeTableHeight = scenario.DikeTableHeight ?? surfaceLine.GetDefaultDikeTableHeight() ?? null; -// if (!dikeTableHeight.HasValue) -// throw new DamFailureMechanismeCalculatorException("Surface line has no dike table height."); -// failureMechanismeParamatersMStab.MStabParameters.ZoneAreas = new MStabZoneAreas -// { -// DikeTableHeight = dikeTableHeight.Value, -// DikeTableWidth = scenario.Location.ZoneAreaRestSlopeCrestWidth, -// SafetyFactorZone1A = scenario.ModelFactors.RequiredSafetyFactorStabilityInnerSlope ?? this.requiredSafetyFactor, -// SafetyFactorZone1B = scenario.ModelFactors.RequiredSafetyFactorStabilityInnerSlope ?? this.requiredSafetyFactor, -// XCoordinateDikeTopAtPolder = dikeTopAtPolder.X, -// XCoordinateDikeTopAtRiver = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X, -// XCoordinateStartRestProfile = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X -// }; -// } -// -// if (failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.ZonesType.Equals( -// MStabZonesType.ForbiddenZone)) -// { -// CreateForbiddenZone(scenario, surfaceLine); -// } -// -// // Make sure riverlevel is correct with respect to surfaceline -// double riverLevelLow = double.NaN; -// if (failureMechanismeParamatersMStab.MStabParameters.GridPosition == MStabGridPosition.Left && scenario.RiverLevelLow.HasValue) -// { -// riverLevelLow = scenario.RiverLevelLow.Value; -// } -// double? riverLevelHigh = riverLevel; -// var surfaceLevelOutside = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside); -// if (riverLevelHigh < surfaceLevelOutside.Z) -// { -// var riverLevelHighIsBelowSurfaceLevelOutside = Path.GetFileName(mstabProjectFilename) + ": " + -// LocalizationManager.GetTranslatedText(this.GetType(), -// "riverLevelHighIsBelowSurfaceLevelOutside"); -// LogMessage logMessage = new LogMessage(LogMessageType.Warning, null, -// String.Format(riverLevelHighIsBelowSurfaceLevelOutside, riverLevelHigh, -// surfaceLevelOutside.Z)); -// errorMessages.Add(logMessage); -// } -// -// var currentSurfaceLine = scenario.GetMostRecentSurfaceLine(soilProfile, Path.GetFileName(soilGeometry2DName)); -// if (currentSurfaceLine == null) -// { -// currentSurfaceLine = surfaceLine; -// } -// if (SelectedStabilityKernelType == StabilityKernelType.AdvancedWti || -// SelectedStabilityKernelType == StabilityKernelType.AdvancedDotNet) -// { -// var lphreaticAdaptionType = NWOPhreaticAdaption != null -// ? (PhreaticAdaptionType)NWOPhreaticAdaption -// : PhreaticAdaptionType.None; -// var stabilityProjectObjectCreator = new StabilityProjectObjectCreator(); -// failureMechanismeParamatersMStab.PLLines = stabilityProjectObjectCreator.CreateAllPlLinesUsingWaternetCreator(scenario.Location, -// currentSurfaceLine, soilProfile, lphreaticAdaptionType, modelParametersForPLLines.PenetrationLength, riverLevelHigh.Value, modelParametersForPLLines.PLLineCreationMethod, riverLevelLow); -// } -// else -// { -// failureMechanismeParamatersMStab.PLLines = CreateAllPLLines(scenario.Location, currentSurfaceLine, -// soilProfile, soilGeometry2DName, riverLevelHigh.Value, riverLevelLow); -// } -// // Slip circle definition for Uplift Van; TODO: Combine with code in StabilityCalculation -// if (this.failureMechanismeParamatersMStab.MStabParameters.Model == MStabModelType.UpliftVan) -// { -// // 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 -// var upliftLocationAndResult = this.GetLocationWithLowestUpliftFactor(currentSurfaceLine, soilProfile, -// soilGeometry2DName, -// failureMechanismeParamatersMStab.PLLines, -// scenario.Location); -// double upliftCriterion = -// scenario.GetUpliftCriterionStability(scenario.Location.ModelFactors.UpliftCriterionStability); -// bool isUplift = !(upliftLocationAndResult == null) && -// (upliftLocationAndResult.UpliftFactor < upliftCriterion); -// double xCoordinateLastUpliftPoint = isUplift -// ? upliftLocationAndResult.X -// : currentSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; -// var nonWaterRetaining2 = currentSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint2); -// if (nonWaterRetaining2 != -// null) -// { -// xCoordinateLastUpliftPoint = -// nonWaterRetaining2.X; -// } -// failureMechanismeParamatersMStab.MStabParameters.SlipCircleDefinition.XCoordinateLastUpliftPoint = -// xCoordinateLastUpliftPoint; -// } -// -// failureMechanismeParamatersMStab.MStabParameters.ProjectFileName = mstabProjectFilename; -// failureMechanismeParamatersMStab.MStabParameters.SoilDatabaseName = scenario.Location.SoildatabaseName; -// -// if (!failureMechanismeParamatersMStab.IsComplete) -// { -// throw new Exception("Not all required data is available"); -// } -// DamMStabAssembler assembler = new DamMStabAssembler(); -// XDocument mstabXML = assembler.CreateDataTransferObject(failureMechanismeParamatersMStab); -// return mstabXML; -// } - - /// /// Determines which MStabResults of 2, contains the smallest safety factor /// ///