Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernel.cs =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernel.cs (.../DamPipingBlighKernel.cs) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernel.cs (.../DamPipingBlighKernelWrapper.cs) (revision 500) @@ -1,38 +1,95 @@ using System; using System.Collections.Generic; +using System.Data; using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.DamPiping.BlighCalculator; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamPipingBligh { - public class DamPipingBlighKernel : IKernel + public class DamPipingBlighKernelWrapper : IKernelWrapper { - public IKernelDataInput Prepare(Location location) + + public IKernelDataInput Prepare(DamKernelInput damKernelInput) { - throw new NotImplementedException(); + // TODO: this is just fake data + return new DamPipingBlighInput() + { + HRiver = 2.0, + HExit = 0.0, + Rc = 0.3, + DTotal = 5.0, + SeepageLength = 40.5, + D70 = 180.0 + }; } - public IKernelDataInput Prepare(DamKernelInput damKernelInput) + public int Validate(IKernelDataInput kernelDataInput, out List messages) { - throw new NotImplementedException(); + var calculatorBligh = PipingCalculatorBligh(kernelDataInput); + List kernelMessages = calculatorBligh.Validate(); + messages = new List(); + foreach (string stringMessage in kernelMessages) + { + messages.Add(new LogMessage() {Message = stringMessage , MessageType = LogMessageType.Error}); + } + return messages.Count; } - public int Validate(IKernelDataInput kernelDataInput, IList messages) + public IKernelDataOutput Execute(IKernelDataInput kernelDataInput, out List messages) { - throw new NotImplementedException(); + var calculatorBligh = PipingCalculatorBligh(kernelDataInput); + calculatorBligh.Calculate(); + var damPipingBlighOutput = new DamPipingBlighOutput(); + damPipingBlighOutput.FoSp = calculatorBligh.FoSp; + damPipingBlighOutput.Hc = calculatorBligh.Hc; + messages = new List(); + return damPipingBlighOutput; } - public IKernelDataOutput Execute(IKernelDataInput kernelDataInput, IList messages) + private static PipingCalculatorBligh PipingCalculatorBligh(IKernelDataInput kernelDataInput) { - throw new NotImplementedException(); + DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; + if (damPipingBlighInput == null) + { + throw new NoNullAllowedException("No input object defined for Bligh"); + } + var calculator = new PipingCalculatorBligh + { + HRiver = damPipingBlighInput.HRiver, + HExit = damPipingBlighInput.HExit, + Rc = damPipingBlighInput.Rc, + DTotal = damPipingBlighInput.DTotal, + SeepageLength = damPipingBlighInput.SeepageLength, + D70 = damPipingBlighInput.D70 + }; + return calculator; } - public void PostProcess(IKernelDataOutput kernelDataOutput, DesignResult designResult) + public void PostProcess(IKernelDataOutput kernelDataOutput, out DesignResult designResult) { - throw new NotImplementedException(); + DamPipingBlighOutput damPipingBlighOutput = kernelDataOutput as DamPipingBlighOutput; + if (damPipingBlighOutput == null) + { + throw new NoNullAllowedException("No output object defined for Bligh"); + } + string id = "id"; + string soilProfile2DName = "soilProfile2DName"; + var d = new DamFailureMechanismeCalculationSpecification(); + var s = new DesignScenario(); + var p = new SoilProfile1D(); + + designResult = new DesignResult(id, d, s, p, soilProfile2DName, AnalysisType.NoAdaption,0); + var pipingDesignResults = new PipingDesignResults(PipingModelType.Bligh); + pipingDesignResults.BlighFactor = damPipingBlighOutput.FoSp; + pipingDesignResults.BlighHcritical = damPipingBlighOutput.Hc; + designResult.PipingDesignResults = pipingDesignResults; } + } } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs =================================================================== diff -u --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (revision 0) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (revision 500) @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Deltares.DamEngine.Calculators.KernelWrappers.Common; +using Deltares.DamEngine.Calculators.KernelWrappers.DamPipingBligh; +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Standard.Logging; + +namespace Deltares.DamEngine.Calculators.Dikes_Design +{ + public class DesignCalculator + { + public List Execute(DamProjectData damProjectData) + { + for (int locationIndex = 0; locationIndex < damProjectData.Dike.Locations.Count; locationIndex++) + { + // TODO: Scenario loop to be implemetented + //for (int designScenarioIndex = 0; designScenarioIndex < damProjectData.Dike.Scenarios.Count; designScenarioIndex++) + //{ + //} + var calculationMessages = new List(); + IKernelWrapper kernelWrapper = new DamPipingBlighKernelWrapper(); + var damKernelInput = new DamKernelInput(); + damKernelInput.Location = damProjectData.Dike.Locations[locationIndex]; + damKernelInput.DesignScenario = null; + IKernelDataInput kernelDataInput = kernelWrapper.Prepare(damKernelInput); + IKernelDataOutput kernelDataOutput = new DamPipingBlighOutput(); + kernelWrapper.Execute(kernelDataInput, out calculationMessages); + DesignResult designResult; + kernelWrapper.PostProcess(kernelDataOutput, out designResult); + + } + return null; + } + } +} Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 500) @@ -12,7 +12,7 @@ { public Location Location { get; set; } public DesignScenario DesignScenario { get; set; } - // public SubSoilScenario SubSoilScenario { get; set; } // To be implemented; should be replacement of SoilGeometryProbability + public SoilGeometryProbability SubSoilScenario { get; set; } // To be implemented; should be replacement of SoilGeometryProbability } } Fisheye: Tag 500 refers to a dead (removed) revision in file `dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernel.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 500) @@ -32,6 +32,9 @@ MinimumRecommendedRules.ruleset + + ..\..\lib\FailureMechanisms\DamPiping\Deltares.DamPiping.BlighCalculator.dll + False ..\..\lib\log4net.2.0.3\log4net.dll @@ -50,6 +53,7 @@ + @@ -77,9 +81,9 @@ - + - + Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs (.../DamPipingBlighOutput.cs) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs (.../DamPipingBlighOutput.cs) (revision 500) @@ -4,5 +4,7 @@ { public class DamPipingBlighOutput : IKernelDataOutput { + public double FoSp { get; set; } + public double Hc { get; set; } } } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighInput.cs =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighInput.cs (.../DamPipingBlighInput.cs) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighInput.cs (.../DamPipingBlighInput.cs) (revision 500) @@ -4,5 +4,11 @@ { public class DamPipingBlighInput : IKernelDataInput { + public double HRiver { get; set; } + public double HExit { get; set; } + public double Rc { get; set; } + public double DTotal { get; set; } + public double SeepageLength { get; set; } + public double D70 { get; set; } } } Fisheye: Tag 500 refers to a dead (removed) revision in file `dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernel.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: dam classic/trunk/src/Dam/Data/Deltares.Dam.Data.csproj =================================================================== diff -u -r453 -r500 --- dam classic/trunk/src/Dam/Data/Deltares.Dam.Data.csproj (.../Deltares.Dam.Data.csproj) (revision 453) +++ dam classic/trunk/src/Dam/Data/Deltares.Dam.Data.csproj (.../Deltares.Dam.Data.csproj) (revision 500) @@ -441,6 +441,7 @@ SoilProfileDataSet.xsd + Component SoilProfileDataSet.cs Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernel.cs =================================================================== diff -u -r495 -r500 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernel.cs (.../IKernel.cs) (revision 495) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernel.cs (.../IKernelWrapper.cs) (revision 500) @@ -6,11 +6,11 @@ namespace Deltares.DamEngine.Calculators.KernelWrappers.Interfaces { - interface IKernel + interface IKernelWrapper { IKernelDataInput Prepare(DamKernelInput damKernelInput); - int Validate(IKernelDataInput kernelDataInput, IList messages); - IKernelDataOutput Execute(IKernelDataInput kernelDataInput, IList messages); - void PostProcess(IKernelDataOutput kernelDataOutput, DesignResult designResult); + int Validate(IKernelDataInput kernelDataInput, out List messages); + IKernelDataOutput Execute(IKernelDataInput kernelDataInput, out List messages); + void PostProcess(IKernelDataOutput kernelDataOutput, out DesignResult designResult); } }