Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DAMFailureMechanismeCalculator.cs =================================================================== diff -u -r599 -r669 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DAMFailureMechanismeCalculator.cs (.../DAMFailureMechanismeCalculator.cs) (revision 599) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DAMFailureMechanismeCalculator.cs (.../DAMFailureMechanismeCalculator.cs) (revision 669) @@ -25,14 +25,10 @@ using System.IO; using System.Linq; using System.Reflection; -using System.Text.RegularExpressions; -using System.Xml.Linq; -using System.Xml.Serialization; using Deltares.DamEngine.Calculators.Dikes_Design; using Deltares.DamEngine.Calculators.General; using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; -using Deltares.DamEngine.Data.General.NWO; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; @@ -86,8 +82,6 @@ public string MapForSoilGeometries2D { get; set; } - public NonWaterRetainingObject NonWaterRetainingObject { get; set; } - public List ErrorMessages { get @@ -118,10 +112,7 @@ case AnalysisType.AdaptGeometry: RedesignSurfaceLinesForAllScenarios(scenario); - break; - case AnalysisType.AdaptNWO: - ImplementNWOInSurfaceLinesForAllScenarios(scenario); - break; + break; } } @@ -473,35 +464,10 @@ // { // stabilityCalculator.Calculate(scenario, soilProfileProbability.SoilProfile1D, GetFullSoilGeometry2DName(soilProfileProbability.StiFileName), iter); // MStabResults? mStabResults = scenario.GetMStabResults(soilProfileProbability.SoilProfile1D, soilProfileProbability.StiFileName); -// if ((mStabResults != null) && (AnalysisType.AdaptNWO == analysisType)) -// { -// // Store the NWO results -// stabilityCalculator.NWOPhreaticAdaption = NonWaterRetainingObject.PhreaticAdaption; -// var results = new NonWaterRetainingObjectResults(); -// results.NwoId = NonWaterRetainingObject.NwoId; -// var coordinateSystemConverter = new CoordinateSystemConverter(); -// coordinateSystemConverter.DefineGlobalXYZBasedOnLine(scenario.Location.SurfaceLine2.Geometry); -// results.AdaptedSurfaceLine = scenario.Location.LocalXZSurfaceLine2.FullDeepClone(); -// coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(results.AdaptedSurfaceLine.Geometry); -// results.LocationXrdStart = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint1).X; -// results.LocationYrdStart = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint1).Y; -// results.LocationZrdStart = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint1).Z; -// results.LocationXrdEnd = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint4).X; -// results.LocationYrdEnd = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint4).Y; -// results.LocationZrdEnd = results.AdaptedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.NonWaterRetainingObjectPoint4).Z; -// -// results.MStabResults = mStabResults.Value; -// results.SoilProfileProbability = soilProfileProbability; -// scenario.NwoResults.Add(results); -// } // } -// // assign original surfaceline to redesigned surfaceline (not for NWODesign as that would provide wrong surface line) -// if (analysisType != AnalysisType.AdaptNWO) -// { -// scenario.SetRedesignedSurfaceLine(soilProfileProbability.SoilProfile1D, +// scenario.SetRedesignedSurfaceLine(soilProfileProbability.SoilProfile1D, // soilProfileProbability.StiFileName, // scenario.Location.SurfaceLine2); -// } // } // catch (DamFailureMechanismeCalculatorException calculatorException) // { @@ -567,28 +533,6 @@ return !isSkipCalculation; } - /// - /// - /// - /// - private void ImplementNWOInSurfaceLinesForAllScenarios(DesignScenario scenario) - { -// try -// { -// ImplementNWOInSurfaceLine(scenario); -// } -// catch (Exception exception) -// { -// scenario.Errors.Add(exception.Message); -// Exception innerException = exception.InnerException; -// while (innerException != null) -// { -// scenario.Errors.Add(innerException.Message); -// innerException = innerException.InnerException; -// } -// } - } - // private void CalculateScenario(Scenario scenario, int iter) // { // switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) @@ -609,95 +553,6 @@ /// /// /// - /// -// private double? ImplementNWOInSurfaceLine(Scenario scenario) -// { -// double? safetyFactor = null; -// -// if (scenario.Location != null) -// { -// SurfaceLine2 originalLocalXzSurfaceLine = scenario.Location.LocalXZSurfaceLine2.FullDeepClone(); -// try -// { -// // fit the non water retaining object in the current surfaceline. If it does (no longer) fit, surfaceline is returned as null and -// // the calculation is finished. The phreaticline may have to be adapted to the new surfaceline. -// -// var nwoInSurfacleLine = new NonWaterRetainingObjectInSurfaceLine(); -// nwoInSurfacleLine.NonWaterRetainingObject = NonWaterRetainingObject; -// nwoInSurfacleLine.SurfaceLine = scenario.Location.LocalXZSurfaceLine2; -// nwoInSurfacleLine.GridPosition = damFailureMechanismeCalculationSpecification.FailureMechanismeParamatersMStab.MStabParameters.GridPosition; -// nwoInSurfacleLine.StepSizeX = NonWaterRetainingObject.StepSizeX; -// double fitPositionX = nwoInSurfacleLine.DetermineStartLocationForNonWaterRetainingObject(true); -// if (nwoInSurfacleLine.DoesPositionXFitInSurfaceLine(fitPositionX)) -// { -// var iter = 0; -// bool doneFittingNWO = false; -// while (!doneFittingNWO) -// { -// // try to fit NWO in surfaceline. If successfull, calculate it, else this is finished. -// SurfaceLine2 localXzSurfaceLine = nwoInSurfacleLine.FitNonWaterRetainingObjectInSurfaceLine(fitPositionX); -// if (localXzSurfaceLine != null) -// { -// var validationError = localXzSurfaceLine.Validate().FirstOrDefault(vr => vr.MessageType == ValidationResultType.Error); -// if (validationError != null) -// { -// localXzSurfaceLine.Dispose(); -// throw new SurfaceLineException(validationError.Text); -// } -// -// scenario.Location.LocalXZSurfaceLine2.Dispose(); -// scenario.Location.LocalXZSurfaceLine2 = localXzSurfaceLine; -// // calculate with this surfaceline and store the results. -// CalculateScenario(scenario, iter); -// // Get new fitPositionX (based on stepsize X and gridposition) -// fitPositionX = nwoInSurfacleLine.DetermineNewFitPostionX(fitPositionX, true); -// iter++; -// } -// else -// { -// doneFittingNWO = true; -// } -// } -// -// if (iter > 0) -// { -// // restore the original surface line -// // Note: 'originalLocalXzSurfaceLine' is only used if now exception have occurred and -// scenario.Location.LocalXZSurfaceLine2 = originalLocalXzSurfaceLine; -// } -// else -// { -// throw new DamFailureMechanismeCalculatorException( -// "NonWaterRetainingObject does not fit within Surfaceline."); -// } -// } -// else -// { -// throw new DamFailureMechanismeCalculatorException( -// "NonWaterRetainingObject does not fit within Surfaceline."); -// } -// } -// catch (Exception e) -// { -// originalLocalXzSurfaceLine.Dispose(); // Clone has become an orphan, so dispose and discard -// -// // Add scenario if having a failure mechanism calculation exception: -// var calculatorException = e as DamFailureMechanismeCalculatorException; -// if (calculatorException != null) -// { -// calculatorException.Scenario = scenario; -// } -// throw; -// } -// } -// -// return safetyFactor; -// } - - /// - /// - /// - /// private void RedesignSurfaceLinesForAllScenarios(DesignScenario scenario) { // try