Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutput.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutput.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutput.cs (revision 1901) @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.Standard.Calculation; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards +{ + public class DamWbiMacroStabilityOutput : IKernelDataOutput + { + /// + /// Gets or sets the calculation result. + /// + /// + /// The calculation result. + /// + public CalculationResult CalculationResult { get; set; } + + /// + /// Gets or sets the stability output items. + /// + /// + /// The stability output items. + /// + public List StabilityOutputItems { get; set; } + + //ToDo Add UpliftSituation? + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapperTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapperTests.cs (revision 1901) @@ -0,0 +1,201 @@ +using System.Collections.Generic; +using System.Data; +using Deltares.DamEngine.Calculators.KernelWrappers.Common; +using Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards; +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.Tests.KernelWrappers.DamMacroStabilityCommon; +using Deltares.DamEngine.Data.Design; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Standard.Calculation; +using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.DamEngine.TestHelpers.Factories; +using NUnit.Framework; + +namespace Deltares.DamEngine.Calculators.Tests.KernelWrappers.DamWbiMacroStabilityInwards +{ + [TestFixture] + public class DamWbiMacroStabilityInwardsKernelWrapperTests + { + + [Test] + public void TestPrepare() + { + const double diff = 0.0001; + + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + IKernelDataInput kernelDataInput; + IKernelDataOutput kernelDataOutput; + var kernelInput = new DamKernelInput(); + + // ToDo: Not clear yet what must be done in Prepare. Temporary test code added. + // start of temporary test code + kernelInput.RiverLevelHigh = 0.5; + kernelWrapper.Prepare(kernelInput, 0, out kernelDataInput, out kernelDataOutput); + DamWbiMacroStabilityInput damMacroStabilityInput1 = (DamWbiMacroStabilityInput)kernelDataInput; + Assert.AreEqual(0.234, damMacroStabilityInput1.TmpWbiMacroIn, diff); + + kernelInput.RiverLevelHigh = 1.5; + kernelWrapper.Prepare(kernelInput, 0, out kernelDataInput, out kernelDataOutput); + DamWbiMacroStabilityInput damMacroStabilityInput2 = (DamWbiMacroStabilityInput)kernelDataInput; + Assert.AreEqual(1.234, damMacroStabilityInput2.TmpWbiMacroIn, diff); + // end of temporary test code + } + + [Test] + public void TestValidate() + { + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + + // Validate without setting values. Expected error messages. + var macroStabilityInput = new DamWbiMacroStabilityInput(); + var macroStabilityOutput = new DamWbiMacroStabilityOutput(); + List messages; + kernelWrapper.Validate(macroStabilityInput, macroStabilityOutput, out messages); + Assert.IsTrue(messages.Count > 0); + + // Validate the input when valid input is provided. Expected no messages. + macroStabilityInput = new DamWbiMacroStabilityInput(); + messages.Clear(); + // ToDo: Not clear yet what input must be provided to make Validate succeed. Temporary test code added. + // start of temporary test code + macroStabilityInput.TmpWbiMacroIn = 1.1; + // end of temporary test code + kernelWrapper.Validate(macroStabilityInput, macroStabilityOutput, out messages); + Assert.AreEqual(0, messages.Count); + } + + [Test] + public void TestPostProcess() + { + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + var kernelInput = CreateDamKernelInputForTest(); + DamWbiMacroStabilityOutput macroStabilityOutput = new DamWbiMacroStabilityOutput(); + + // Fill macroStabilityOutput with calculation output + macroStabilityOutput.CalculationResult = CalculationResult.NoLicense; + var macroStabilityOutputItem = new DamWbiMacroStabilityOutputItem(); + macroStabilityOutputItem.CalculationResult = CalculationResult.Succeeded; + var zoneResults = macroStabilityOutputItem.Zone1Results; + zoneResults.SafetyFactor = 2.34; + macroStabilityOutputItem.Zone1Results = zoneResults; + // ToDo: Add all output items when it is clear what will be in macroStabilityOutputItem + macroStabilityOutput.StabilityOutputItems = new List(); + macroStabilityOutput.StabilityOutputItems.Add(macroStabilityOutputItem); + + DesignScenario designScenario = new DesignScenario + { + Location = kernelInput.Location + }; + List results; + + kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out results); + Assert.IsTrue(results.Count > 0); + foreach (var result in results) + { + // ToDo: CalculationResult of macroStabilityOutputItem is used. CalculationResult of macroStabilityOutput is ignored. Correct? + Assert.AreEqual(macroStabilityOutputItem.CalculationResult, result.CalculationResult); + Assert.AreEqual(zoneResults.SafetyFactor, result.StabilityDesignResults.SafetyFactor); + // ToDo: Add all output items when it is clear what parts of StabilityDesignResults will be filled + } + } + + [Test] + public void TestFullCalculation() + { + const double diff = 0.0001; + + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + + // Prepare the wrapper. Result is input for the calculation dll + IKernelDataInput kernelDataInput; + IKernelDataOutput kernelDataOutput; + var kernelInput = CreateDamKernelInputForTest(); + kernelWrapper.Prepare(kernelInput, 0, out kernelDataInput, out kernelDataOutput); + + // Validate the input + List messages; + kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out messages); + // ToDo: Not clear yet what input must be provided to make Validate succeed. Skip for now. + //Assert.AreEqual(0, messages.Count); + + // Run the dll + kernelWrapper.Execute(kernelDataInput, kernelDataOutput, out messages); + DamWbiMacroStabilityOutput macroStabilityOutput = (DamWbiMacroStabilityOutput)kernelDataOutput; + Assert.AreEqual(0, messages.Count); + Assert.AreEqual(CalculationResult.Succeeded, macroStabilityOutput.CalculationResult); + // ToDo: Not clear how kernel must be connected. Temporary test code added. + // start of temporary test code + Assert.AreEqual(1, macroStabilityOutput.StabilityOutputItems.Count); + Assert.AreEqual(1.357, macroStabilityOutput.StabilityOutputItems[0].Zone1Results.SafetyFactor, diff); + // end of temporary test code + + // Fill the design results + DesignScenario designScenario = new DesignScenario + { + Location = kernelInput.Location + }; + List results; + kernelWrapper.PostProcess(kernelInput, macroStabilityOutput, designScenario, "", out results); + Assert.IsTrue(results.Count > 0); + foreach (var result in results) + { + Assert.AreEqual(CalculationResult.Succeeded, result.CalculationResult); + Assert.AreEqual(1.357, result.StabilityDesignResults.SafetyFactor); + // ToDo: Add all output items when it is clear what parts of StabilityDesignResults will be filled + } + } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen invoer object gedefinieerd voor WBI Macrostabiliteit")] + [SetUICulture("nl-NL")] + public void TestLanguageNLThrowsExceptionWhenInputIsNull() + { + List messages; + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + kernelWrapper.Execute(null, null, out messages); ; + } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "No input object defined for WBI Macro Stability")] + [SetUICulture("en-US")] + public void TestLanguageENThrowsExceptionWhenWbiStabilityInputIsNull() + { + List messages; + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + kernelWrapper.Execute(null, null, out messages); ; + } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen uitvoer object gedefinieerd voor WBI Macrostabiliteit")] + [SetUICulture("nl-NL")] + public void TestThrowsExceptionWhenWbiStabilityOutputIsNull() + { + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + List results; + kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results); + } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen Dam invoer object gedefinieerd voor WBI Macrostabiliteit")] + [SetUICulture("nl-NL")] + public void TestThrowsExceptionWhenDamKernelInputIsNull() + { + var kernelWrapper = new DamWbiMacroStabilityInwardsKernelWrapper(); + List results; + kernelWrapper.PostProcess(null, null, null, "", out results); + } + + private static DamKernelInput CreateDamKernelInputForTest() + { + // ToDo: Not clear yet what parts apply to Wbi Stability. For now, minimal implementation. Add DamWbiMacroStabilityTestHelper? + var location = DamMacroStabilityTestHelper.CreateLocation(FactoryForSurfaceLines.CreateSurfaceLineTutorial1()); + var subSoilScenario = new SoilGeometryProbability(); + var damKernelInput = new DamKernelInput(); + damKernelInput.Location = location; + damKernelInput.SubSoilScenario = subSoilScenario; + return damKernelInput; + } + + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx =================================================================== diff -u -r1644 -r1901 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1644) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1901) @@ -168,6 +168,15 @@ Geen uitvoer object gedefinieerd voor Sellmeijer VNK + + Geen Dam invoer object gedefinieerd voor WBI Macrostabiliteit + + + Geen invoer object gedefinieerd voor WBI Macrostabiliteit + + + Geen uitvoer object gedefinieerd voor WBI Macrostabiliteit + Locatie '{0}', ondergrond scenario '{1}', ontwerp scenario '{2}': De berekening is mislukt met de volgende foutmelding '{3}'. Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs (revision 1901) @@ -0,0 +1,300 @@ +using System; +using System.Collections.Generic; +using System.Data; +using Deltares.DamEngine.Calculators.DikesDesign; +using Deltares.DamEngine.Calculators.KernelWrappers.Common; +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Data.Design; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Geometry; +using Deltares.DamEngine.Data.Standard.Calculation; +using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.WTIStability.Calculation.Wrapper; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards +{ + public class DamWbiMacroStabilityInwardsKernelWrapper : IKernelWrapper + { + /// + /// Prepares the specified dam kernel input. + /// + /// The dam kernel input. + /// The number of the current iteration. + /// The kernel data input. + /// The kernel data output + /// + /// Result of the prepare + /// + public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) + { + var macroStabilityInput = new DamWbiMacroStabilityInput(); + kernelDataInput = macroStabilityInput; + + // ToDo: Not clear yet what must be done in Prepare. Temporary test code added. + // start of temporary test code + if (damKernelInput.RiverLevelHigh > 1) + { + macroStabilityInput.TmpWbiMacroIn = 1.234; + } + else + { + macroStabilityInput.TmpWbiMacroIn = 0.234; + } + // end of temporary test code + + var macroStabilityOutput = new DamWbiMacroStabilityOutput + { + CalculationResult = CalculationResult.NoRun + }; + kernelDataOutput = macroStabilityOutput; + + return PrepareResult.NotRelevant; + } + + /// + /// Validates the specified kernel data input. + /// + /// The kernel data input. + /// The kernel data output. + /// The return messages. + /// + /// Zero when there are no errors, one when there are errors that prevent a calculation + /// + public int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) + { + messages = new List(); + // ToDo: Not clear yet what input must be provided to make Validate succeed. Temporary test code added. + // start of temporary test code + DamWbiMacroStabilityInput macroStabilityInput = (DamWbiMacroStabilityInput)kernelDataInput; + if (macroStabilityInput.TmpWbiMacroIn > 1.0) + { + // no message, presumed input valid for test + } + else + // end of temporary test code. next code must be enough, presumed that the kernel does all the validation + { + DamWbiMacroStabilityOutput macroStabilityOutput = (DamWbiMacroStabilityOutput)kernelDataOutput; + var calculator = CreateWbiStabilityCalculator(kernelDataInput); + string kernelMessage = calculator.Validate(); + messages.Add(new LogMessage() + { + Message = kernelMessage, + MessageType = LogMessageType.Error + }); + if (messages.Count > 0) + { + macroStabilityOutput.CalculationResult = CalculationResult.InvalidInputData; + } + } + return messages.Count; + } + + /// + /// Executes the kernel. + /// + /// The kernel data input. + /// The kernel data output. + /// The return messages. + public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) + { + DamWbiMacroStabilityInput macroStabilityInput = (DamWbiMacroStabilityInput)kernelDataInput; + DamWbiMacroStabilityOutput macroStabilityOutput = (DamWbiMacroStabilityOutput)kernelDataOutput; + ThrowWhenWbiMacroStabilityKernelInputNull(macroStabilityInput); + ThrowWhenWbiMacroStabilityKernelOutputNull(macroStabilityOutput); + messages = new List(); + PerformWbiStabilityCalculation(out messages, macroStabilityOutput, macroStabilityInput); + } + + + private static void PerformWbiStabilityCalculation(out List messages, DamWbiMacroStabilityOutput macroStabilityOutput, + DamWbiMacroStabilityInput macroStabilityInput) + { + macroStabilityOutput.CalculationResult = CalculationResult.NoRun; + messages = new List(); + try + { + macroStabilityOutput.StabilityOutputItems = new List(); + var calculator = CreateWbiStabilityCalculator(macroStabilityInput); + + // ToDo: Not clear how kernel must be connected. Skip actual calculation. Temporary result for test added. + //string result = calculator.Run(); + // start of temporary test code + macroStabilityOutput.CalculationResult = CalculationResult.Succeeded; + var macroStabilityOutputItem = new DamWbiMacroStabilityOutputItem(); + var zoneResults = macroStabilityOutputItem.Zone1Results; + zoneResults.SafetyFactor = 1.357; + macroStabilityOutputItem.Zone1Results = zoneResults; + macroStabilityOutput.StabilityOutputItems.Add(macroStabilityOutputItem); + // end of temporary test code + } + catch (Exception e) + { + macroStabilityOutput.CalculationResult = CalculationResult.UnexpectedError; + messages.Add(new LogMessage(LogMessageType.Error, null, e.Message)); + } + } + + + /// + /// Creates the calculator for Wbi stability based on kernel input. + /// + /// The kernel data input. + /// + /// No input object defined + private static WTIStabilityCalculation CreateWbiStabilityCalculator(IKernelDataInput kernelDataInput) + { + DamWbiMacroStabilityInput macroStabilityInput = (DamWbiMacroStabilityInput)kernelDataInput; + ThrowWhenWbiMacroStabilityKernelInputNull(macroStabilityInput); + var calculator = new WTIStabilityCalculation + { + // ToDo not clear yet what input is expected + }; + return calculator; + } + + /// + /// Fills the design results with the kernel output. + /// + /// The dam kernel input. + /// The kernel data output. + /// The design scenario. + /// The result message. + /// The design results. + /// + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, + string resultMessage, out List designResults) + { + ThrowWhenWbiMacroStabilityDamKernelInputNull(damKernelInput); + DamWbiMacroStabilityOutput macroStabilityOutput = kernelDataOutput as DamWbiMacroStabilityOutput; + ThrowWhenWbiMacroStabilityKernelOutputNull(macroStabilityOutput); + designResults = new List(); + if (macroStabilityOutput.StabilityOutputItems.Count > 0) + { + var macroStabilityOutputItem = macroStabilityOutput.StabilityOutputItems[0]; + if (macroStabilityOutputItem != null) + { + var designResult = NewDesignResult(damKernelInput, designScenario, macroStabilityOutputItem); + FillDesignResult(macroStabilityOutputItem, designResult); + // ToDo: Add NumberOfIterations and UpliftSituation? + //designResult.StabilityDesignResults.NumberOfIterations = lastIterationIndex; + //designResult.StabilityDesignResults.UpliftSituation = macroStabilityOutput.UpliftSituation; + designResults.Add(designResult); + } + } + // ToDo: multiple runs (multiple modeltypes) as for DGeoStability? Fill overall result. + } + + private DesignResult NewDesignResult(DamKernelInput damKernelInput, DesignScenario designScenario, + DamWbiMacroStabilityOutputItem macroStabilityOutputItem) + { + string soilProfile2DName = damKernelInput.SubSoilScenario.ToString(); + var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName) + { + // initialize as failed + CalculationResult = CalculationResult.RunFailed + }; + designResult.StabilityDesignResults = new StabilityDesignResults(); + // ToDo: Add all stuff as for DGeoStability? + var stabilityDesignResults = new StabilityDesignResults(); +// stabilityDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; +// designResult.BaseFileName = Path.GetFileNameWithoutExtension(macroStabilityOutputItem.ProjectFileName); +// designResult.ProfileName = soilProfile2DName; + designResult.StabilityDesignResults = stabilityDesignResults; +// designResult.CalculationSubDir = DamMacroStabilityUtils.GetCalculationSubDir(macroStabilityOutputItem.StabilityModelType); + return designResult; + } + + private static void FillDesignResult(DamWbiMacroStabilityOutputItem macroStabilityOutputItem, DesignResult designResult) + { + //ToDo Same code as for DGeoStability? + designResult.CalculationResult = macroStabilityOutputItem.CalculationResult; + designResult.StabilityDesignResults.StabilityModelType = macroStabilityOutputItem.StabilityModelType; + if (designResult.CalculationResult == CalculationResult.Succeeded) + { + designResult.StabilityDesignResults.Zone1SafetyFactor = + macroStabilityOutputItem.Zone1Results.SafetyFactor; + designResult.StabilityDesignResults.LocalZone1EntryPointX = + macroStabilityOutputItem.Zone1Results.CircleSurfacePointLeftXCoordinate; + designResult.StabilityDesignResults.LocalZone1ExitPointX = + macroStabilityOutputItem.Zone1Results.CircleSurfacePointRightXCoordinate; + + designResult.StabilityDesignResults.SafetyFactor = designResult.StabilityDesignResults.Zone1SafetyFactor; + if (macroStabilityOutputItem.Zone2Results != null) + { + var zone2 = (DamWbiMacroStabilityOutputItem.ResultsSingleZone)macroStabilityOutputItem.Zone2Results; + designResult.StabilityDesignResults.Zone2SafetyFactor = zone2.SafetyFactor; + designResult.StabilityDesignResults.LocalZone2EntryPointX = zone2.CircleSurfacePointLeftXCoordinate; + designResult.StabilityDesignResults.LocalZone2ExitPointX = zone2.CircleSurfacePointRightXCoordinate; + } + } + } + + /// + /// Throws the when wbi macro stability kernel input is not assigned. + /// + /// The dam wbi macro stability input. + /// + public static void ThrowWhenWbiMacroStabilityKernelInputNull(DamWbiMacroStabilityInput damWbiMacroStabilityInput) + { + if (damWbiMacroStabilityInput == null) + { + throw new NoNullAllowedException(Resources.DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityInputObjectDefined); + } + } + /// + /// Throws the when wbi macro stability kernel output is not assigned. + /// + /// The dam wbi macro stability output. + /// + public static void ThrowWhenWbiMacroStabilityKernelOutputNull(DamWbiMacroStabilityOutput damWbiMacroStabilityOutput) + { + if (damWbiMacroStabilityOutput == null) + { + throw new NoNullAllowedException(Resources.DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityOutputObjectDefined); + } + } + + /// + /// Throws the when wbi macro stability dam kernel input is not assigned. + /// + /// The dam kernel input. + /// + public static void ThrowWhenWbiMacroStabilityDamKernelInputNull(DamKernelInput damKernelInput) + { + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamWbiMacroStabilityKernelWrapper_NoDamInputObjectDefinedForWbiMacroStability); + } + } + + public ShoulderDesign CalculateDesignAtPoint(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, + IKernelDataOutput kernelDataOutput, GeometryPoint point, out List messages) + { + // ToDo: Not clear yet if this must be done or how + throw new NotImplementedException(); + } + + public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, + out DesignAdvise designAdvise, out string evaluationMessage) + { + // ToDo: Not clear yet if this must be done or how + throw new NotImplementedException(); + } + + public void PrepareDesign(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, + int iterationIndex, out EmbankmentDesignParameters embankmentDesignParameters) + { + // ToDo: Not clear yet if this must be done or how + throw new NotImplementedException(); + } + + public DesignStrategy GetDesignStrategy(DamKernelInput damKernelInput) + { + // ToDo: Not clear yet if this must be done or how + throw new NotImplementedException(); + } + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInput.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInput.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInput.cs (revision 1901) @@ -0,0 +1,10 @@ +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards +{ + public class DamWbiMacroStabilityInput : IKernelDataInput + { + //ToDo Not clear yet what input must be provided. TmpWbiMacroIn is used for test, replace later by actual input. + public double TmpWbiMacroIn { get; set; } + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutputItem.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutputItem.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityOutputItem.cs (revision 1901) @@ -0,0 +1,57 @@ +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.Standard.Calculation; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards +{ + public class DamWbiMacroStabilityOutputItem + { + /// + /// Gets or sets the calculation result. + /// + /// + /// The calculation result. + /// + public CalculationResult CalculationResult { get; set; } + + /// + /// Structure holding the resuls per zone + /// + public struct ResultsSingleZone + { + public double SafetyFactor; + public double CircleSurfacePointLeftXCoordinate; + public double CircleSurfacePointRightXCoordinate; + public void Init() + { + SafetyFactor = 0.0; + CircleSurfacePointLeftXCoordinate = 0.0; + CircleSurfacePointRightXCoordinate = 0.0; + } + } + + /// + /// Gets or sets the zone1 results. + /// + /// + /// The zone1. + /// + public DamWbiMacroStabilityOutputItem.ResultsSingleZone Zone1Results { get; set; } + + /// + /// Gets or sets the zone2 results. + /// + /// + /// The zone2. + /// + public DamWbiMacroStabilityOutputItem.ResultsSingleZone? Zone2Results { get; set; } + + /// + /// Gets or sets the type of the stability model. + /// + /// + /// The type of the stability model. + /// + public MStabModelType StabilityModelType { get; set; } + + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r1644 -r1901 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1644) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1901) @@ -218,6 +218,33 @@ } /// + /// Looks up a localized string similar to No Dam input object defined for WBI Macro Stability. + /// + internal static string DamWbiMacroStabilityKernelWrapper_NoDamInputObjectDefinedForWbiMacroStability { + get { + return ResourceManager.GetString("DamWbiMacroStabilityKernelWrapper_NoDamInputObjectDefinedForWbiMacroStability", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No input object defined for WBI Macro Stability. + /// + internal static string DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityInputObjectDefined { + get { + return ResourceManager.GetString("DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityInputObjectDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No output object defined for WBI Macro Stability. + /// + internal static string DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityOutputObjectDefined { + get { + return ResourceManager.GetString("DamWbiMacroStabilityKernelWrapper_NoWbiMacroStabilityOutputObjectDefined", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Location '{0}', subsoil scenario '{1}', design scenario '{2}': The calculation failed with error message '{3}'. /// internal static string DesignCalculatorGeneralException { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj =================================================================== diff -u -r1741 -r1901 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1741) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1901) @@ -49,6 +49,7 @@ + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj =================================================================== diff -u -r1732 -r1901 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1732) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1901) @@ -47,6 +47,9 @@ ..\..\lib\FailureMechanisms\WbiPipingMerged\Deltares.WTIPiping.Merged.dll + + ..\..\lib\FailureMechanisms\WbiMacroStability\Deltares.WTIStability.Calculation.Wrapper.dll + False ..\..\lib\log4net.2.0.3\log4net.dll @@ -72,6 +75,10 @@ + + + + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r1644 -r1901 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1644) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1901) @@ -282,4 +282,13 @@ Location '{0}', subsoil scenario '{1}', timestep '{2}', timestamp '{3}': The validation for this calculation failed. + + No input object defined for WBI Macro Stability + + + No output object defined for WBI Macro Stability + + + No Dam input object defined for WBI Macro Stability + \ No newline at end of file