Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r1080 -r1129 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1080) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1129) @@ -96,7 +96,7 @@ switch (analysisType) { case AnalysisType.AdaptGeometry: - PerformDesignCalculation(kernelWrapper, kernelDataInput, kernelDataOutput, + PerformDesignCalculationShoulderIterativePerPoint(kernelWrapper, kernelDataInput, kernelDataOutput, damKernelInput, calculationMessages, damProjectData.DesignCalculations); break; case AnalysisType.NoAdaption: @@ -280,7 +280,18 @@ double maxHeight = Math.Abs((top - bottom) * maxFractionOfDikeHeightForShoulderHeight); return bottom + maxHeight; } - private static void PerformDesignCalculation(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, + /// + /// Performs the design calculation shoulder iterative per point. + /// This is a design strategy used for Piping + /// + /// The kernel wrapper. + /// The kernel data input. + /// The kernel data output. + /// The dam kernel input. + /// The calculation messages. + /// The design calculations. + /// + private static void PerformDesignCalculationShoulderIterativePerPoint(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, List calculationMessages, List designCalculations) { var designResults = new List(); @@ -310,15 +321,15 @@ pointCount++; // Calculate the piping design at the given point. This returns the required adaption (berm length and height) if any. - var pipingDesign = kernelWrapper.CalculateDesignAtPoint(damKernelInput, kernelDataInput, kernelDataOutput, point, out locationCalculationMessages); - if (pipingDesign != null) + ShoulderDesign shoulderDesign = kernelWrapper.CalculateDesignAtPoint(damKernelInput, kernelDataInput, kernelDataOutput, point, out locationCalculationMessages); + if (shoulderDesign != null) { // Piping is an issue so adapt the surfaceline for it - desiredShoulderLength = pipingDesign.ShoulderLengthFromToe; + desiredShoulderLength = shoulderDesign.ShoulderLengthFromToe; desiredShoulderLength = Math.Max(desiredShoulderLength, oldDesiredShoulderLength); oldDesiredShoulderLength = desiredShoulderLength; // shoulder height is height above surfacelevel!! - desiredShoulderHeight = pipingDesign.ShoulderHeightFromToe; + desiredShoulderHeight = shoulderDesign.ShoulderHeightFromToe; desiredShoulderHeight = Math.Max(desiredShoulderHeight, oldDesiredShoulderHeight); oldDesiredShoulderHeight = desiredShoulderHeight; } @@ -374,12 +385,14 @@ designCalculations.Add(designResult); } } - // safetyFactor = pipingCalculator.CalculatePipingFactor(location, newSurfaceLine, soilProfileProbability.SoilProfile, scenario.RiverLevel); - // if (safetyFactor < scenario.RequiredSafetyFactorPiping) - // { - // throw new DamFailureMechanismeCalculatorException("Deterministic Design: Piping is not safe yet."); - // } - // return newSurfaceLine; + + string evaluationMessage; + bool designSuccessful = kernelWrapper.EvaluateDesign(damKernelInput, kernelDataInput, kernelDataOutput, out evaluationMessage); + if (!designSuccessful) + { + throw new DesignCalculatorException(String.Format(Resources.DesignUnsuccessful, + damKernelInput.Location.Name, damKernelInput.SubSoilScenario) + ", " + evaluationMessage); + } } } }