Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r630 -r638 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 630) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 638) @@ -7,6 +7,7 @@ using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.Data.Standard.Calculation; using Deltares.DamEngine.Data.Standard.Logging; using Deltares.DamPiping.BlighCalculator; @@ -56,7 +57,7 @@ xExit = upliftLocationAndResult.X; surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); SoilLayer1D heaveLayer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId); - d70 = factorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; + d70 = factorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; var topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); } @@ -94,9 +95,10 @@ foreach (string stringMessage in kernelMessages) { messages.Add(new LogMessage() - { - Message = stringMessage, MessageType = LogMessageType.Error - }); + { + Message = stringMessage, + MessageType = LogMessageType.Error + }); } return messages.Count; } @@ -109,23 +111,34 @@ /// public IKernelDataOutput Execute(IKernelDataInput kernelDataInput, out List messages) { - DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; - if (damPipingBlighInput == null) - { - throw new NoNullAllowedException("No input object defined for Bligh"); - } - messages = new List(); var damPipingBlighOutput = new DamPipingBlighOutput() { + CalculationResult = CalculationResult.NoRun, FoSp = defaultMaxReturnValue }; - if (damPipingBlighInput.IsUplift) + messages = new List(); + try { - var calculatorBligh = CreatePipingCalculatorBligh(kernelDataInput); - calculatorBligh.Calculate(); - damPipingBlighOutput.FoSp = calculatorBligh.FoSp; - damPipingBlighOutput.Hc = calculatorBligh.Hc; + + DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; + if (damPipingBlighInput == null) + { + throw new NoNullAllowedException("No input object defined for Bligh"); + } + if (damPipingBlighInput.IsUplift) + { + var calculatorBligh = CreatePipingCalculatorBligh(kernelDataInput); + calculatorBligh.Calculate(); + damPipingBlighOutput.FoSp = calculatorBligh.FoSp; + damPipingBlighOutput.Hc = calculatorBligh.Hc; + damPipingBlighOutput.CalculationResult = CalculationResult.Succeeded; + } } + catch (Exception e) + { + damPipingBlighOutput.CalculationResult = CalculationResult.UnexpectedError; + messages.Add(new LogMessage(LogMessageType.Error, null, e.Message)); + } return damPipingBlighOutput; } @@ -170,19 +183,23 @@ } string id = "id"; string soilProfile2DName = "soilProfile2DName"; - var d = new DamFailureMechanismeCalculationSpecification(); + var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification() + { + FailureMechanismSystemType = FailureMechanismSystemType.Piping, + PipingModelType = PipingModelType.Bligh + }; var designScenario = damKernelInput.DesignScenario; var soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; - designResult = new DesignResult(d, designScenario, soilProfile1D, soilProfile2DName, AnalysisType.NoAdaption,0); + designResult = new DesignResult(damFailureMechanismeCalculationSpecification, + designScenario, soilProfile1D, soilProfile2DName, + DamProjectCalculationSpecification.SelectedAnalysisType, 0); + designResult.CalculationResult = damPipingBlighOutput.CalculationResult; var pipingDesignResults = new PipingDesignResults(PipingModelType.Bligh); pipingDesignResults.BlighFactor = damPipingBlighOutput.FoSp; pipingDesignResults.BlighHcritical = damPipingBlighOutput.Hc; designResult.PipingDesignResults = pipingDesignResults; - // Location name - // LocationscenarioId - // Profilename - // Calculationresult + designResult.CalculationResult = damPipingBlighOutput.CalculationResult; } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs =================================================================== diff -u -r623 -r638 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (.../DesignCalculator.cs) (revision 623) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (.../DesignCalculator.cs) (revision 638) @@ -22,28 +22,7 @@ /// public List Execute(DamProjectData damProjectData) { - IKernelWrapper kernelWrapper = null; - switch (damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType) - { - case FailureMechanismSystemType.HorizontalBalance: - case FailureMechanismSystemType.StabilityInside: - case FailureMechanismSystemType.StabilityOutside: - throw new NotImplementedException("Requested kernel not implemented yet"); - case FailureMechanismSystemType.Piping: - switch (damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType) - { - case PipingModelType.SellmeijerVnk: - case PipingModelType.Wti2017: - throw new NotImplementedException("Requested kernel not implemented yet"); - case PipingModelType.Bligh: - kernelWrapper = new DamPipingBlighKernelWrapper(); - break; - case PipingModelType.Sellmeijer4Forces: - kernelWrapper = new DamPipingSellmeijer4ForcesKernelWrapper(); - break; - } - break; - } + IKernelWrapper kernelWrapper = CreateKernelWrapper(damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType, damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType); if (kernelWrapper == null) { throw new NotImplementedException("Requested kernel not implemented yet"); @@ -81,5 +60,33 @@ } return calculationMessages; } + + private IKernelWrapper CreateKernelWrapper(FailureMechanismSystemType failureMechanismSystemType, PipingModelType pipingModelType) + { + IKernelWrapper kernelWrapper = null; + switch (failureMechanismSystemType) + { + case FailureMechanismSystemType.HorizontalBalance: + case FailureMechanismSystemType.StabilityInside: + case FailureMechanismSystemType.StabilityOutside: + throw new NotImplementedException("Requested kernel not implemented yet"); + case FailureMechanismSystemType.Piping: + switch (pipingModelType) + { + case PipingModelType.SellmeijerVnk: + case PipingModelType.Wti2017: + throw new NotImplementedException("Requested kernel not implemented yet"); + case PipingModelType.Bligh: + kernelWrapper = new DamPipingBlighKernelWrapper(); + break; + case PipingModelType.Sellmeijer4Forces: + kernelWrapper = new DamPipingSellmeijer4ForcesKernelWrapper(); + break; + } + break; + } + return kernelWrapper; + } + } } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs =================================================================== diff -u -r500 -r638 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs (.../DamPipingBlighOutput.cs) (revision 500) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs (.../DamPipingBlighOutput.cs) (revision 638) @@ -1,9 +1,11 @@ using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.Standard.Calculation; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamPipingBligh { public class DamPipingBlighOutput : IKernelDataOutput { + public CalculationResult CalculationResult { get; set; } public double FoSp { get; set; } public double Hc { get; set; } }