Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r684 -r686 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 684) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 686) @@ -21,15 +21,25 @@ public class DamPipingBlighKernelWrapper : IKernelWrapper { private const double defaultFluidisationGradient = 0.3; - public const double DefaultMaxReturnValue = 90.0; + private const double defaultMaxReturnValue = 90.0; /// /// Create the kernel input. /// /// The dam kernel input. - /// - public PrepareResult Prepare(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput) + /// The kernel data input. + /// The kernel data output. + /// + /// Result of the prepare + /// + public PrepareResult Prepare(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) { + var damPipingBlighOutput = new DamPipingBlighOutput() + { + CalculationResult = CalculationResult.NoRun, + FoSp = defaultMaxReturnValue + }; + kernelDataOutput = damPipingBlighOutput; if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType == FailureMechanismSystemType.Piping) { var damPipingBlighInput = new DamPipingBlighInput(); @@ -38,7 +48,8 @@ var surfaceLine = damKernelInput.Location.SurfaceLine; var location = damKernelInput.Location; double riverLevel = damKernelInput.DesignScenario.RiverLevel; - var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel); + UpliftSituation upliftSituation; + var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel, out upliftSituation); UpliftLocationDeterminator upliftLocationDeterminator = new UpliftLocationDeterminator { PLLines = plLines, @@ -48,12 +59,13 @@ XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin }; var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(damKernelInput.DesignScenario.GetUpliftCriterionPiping(null)); - bool isUplift = (upliftLocationAndResult != null); + upliftSituation.IsUplift = (upliftLocationAndResult != null); double xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; double xExit = 0.0; double surfaceLevel = 0.0; double d70 = 0.0; double dCoverLayer = 0.0; + double? upliftFactor = null; if (upliftLocationAndResult != null) { xExit = upliftLocationAndResult.X; @@ -62,6 +74,7 @@ d70 = Physics.FactorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; var topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + upliftFactor = upliftLocationAndResult.UpliftFactor; } double seepageLength = xExit - xEntry; damPipingBlighInput.HRiver = riverLevel; @@ -79,8 +92,11 @@ DTotal = dCoverLayer, SeepageLength = seepageLength, D70 = d70, - IsUplift = isUplift + }; + damPipingBlighOutput.ExitPointX = xExit; + damPipingBlighOutput.UpliftFactor = upliftFactor; + damPipingBlighOutput.UpliftSituation = upliftSituation; return PrepareResult.Successful; } kernelDataInput = null; @@ -113,15 +129,14 @@ /// Executes the kernel. /// /// The kernel data input. + /// The kernel data output. /// The messages. - /// - public IKernelDataOutput Execute(IKernelDataInput kernelDataInput, out List messages) + /// No input object defined for Bligh + public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { - var damPipingBlighOutput = new DamPipingBlighOutput() - { - CalculationResult = CalculationResult.NoRun, - FoSp = DefaultMaxReturnValue - }; + DamPipingBlighOutput damPipingBlighOutput = (DamPipingBlighOutput) kernelDataOutput; + damPipingBlighOutput.CalculationResult = CalculationResult.NoRun; + damPipingBlighOutput.FoSp = defaultMaxReturnValue; messages = new List(); try { @@ -131,7 +146,7 @@ { throw new NoNullAllowedException("No input object defined for Bligh"); } - if (damPipingBlighInput.IsUplift) + if (damPipingBlighOutput.UpliftSituation.IsUplift) { var calculatorBligh = CreatePipingCalculatorBligh(kernelDataInput); calculatorBligh.Calculate(); @@ -145,7 +160,6 @@ damPipingBlighOutput.CalculationResult = CalculationResult.UnexpectedError; messages.Add(new LogMessage(LogMessageType.Error, null, e.Message)); } - return damPipingBlighOutput; } /// @@ -188,7 +202,7 @@ throw new NoNullAllowedException("No output object defined for Bligh"); } - // TODO: for now this only works for 1D profiles and NoAdaption of geometry + // TODO: for now this only works for 1D profiles string soilProfile2DName = "soilProfile2DName"; var damFailureMechanismeCalculationSpecification = new DamFailureMechanismeCalculationSpecification() { @@ -209,7 +223,11 @@ pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; designResult.PipingDesignResults = pipingDesignResults; designResult.CalculationResult = damPipingBlighOutput.CalculationResult; + pipingDesignResults.UpliftSituation = damPipingBlighOutput.UpliftSituation; + pipingDesignResults.LocalExitPointX = damPipingBlighOutput.ExitPointX; + pipingDesignResults.UpliftFactor = damPipingBlighOutput.UpliftFactor; + } }