Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs =================================================================== diff -u -rddcfe77680566b25a6eac697323787a03ae25e46 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision ddcfe77680566b25a6eac697323787a03ae25e46) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -22,15 +22,16 @@ using System; using System.Collections.Generic; using System.Linq; -using Deltares.MacroStability.Geometry; +using Deltares.MacroStability.CSharpWrapper.Input; +using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; -using SoilLayer = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilLayer; +using SoilProfile = Deltares.MacroStability.CSharpWrapper.Input.SoilProfile; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan { @@ -84,7 +85,7 @@ return new UpliftVanCalculatorResult( UpliftVanSlidingCurveResultCreator.Create(upliftVanKernel.SlidingCurveResult), - UpliftVanCalculationGridResultCreator.Create(upliftVanKernel.SlipPlaneResult), + UpliftVanCalculationGridResultCreator.Create(upliftVanKernel.UpliftVanCalculationGridResult), MacroStabilityInwardsKernelMessagesCreator.CreateFromLogMessages(upliftVanKernel.CalculationMessages), new UpliftVanCalculatorResult.ConstructionProperties { @@ -114,39 +115,24 @@ { LayerWithSoil[] layersWithSoil = LayerWithSoilCreator.Create(input.SoilProfile, out IDictionary layerLookup); - SurfaceLine2 surfaceLine = SurfaceLineCreator.Create(input.SurfaceLine); - SoilProfile2D soilProfile2D = SoilProfileCreator.Create(layersWithSoil); + SurfaceLine surfaceLine = SurfaceLineCreator.Create(input.SurfaceLine); + SoilProfile soilProfile = SoilProfileCreator.Create(layersWithSoil); - IWaternetKernel waternetDailyKernelWrapper = factory.CreateWaternetDailyKernel(UpliftVanLocationCreator.CreateDaily(input)); - CalculateWaternet(waternetDailyKernelWrapper, soilProfile2D, surfaceLine); + MacroStabilityInput waternetDailyKernelInput = MacroStabilityInputCreator.CreateDailyWaternetForUpliftVan(input, layersWithSoil, surfaceLine, soilProfile); + MacroStabilityInput waternetExtremeKernelInput = MacroStabilityInputCreator.CreateExtremeWaternetForUpliftVan(input, layersWithSoil, surfaceLine, soilProfile); - IWaternetKernel waternetExtremeKernelWrapper = factory.CreateWaternetExtremeKernel(UpliftVanLocationCreator.CreateExtreme(input)); - CalculateWaternet(waternetExtremeKernelWrapper, soilProfile2D, surfaceLine); + IWaternetKernel waternetDailyKernelWrapper = factory.CreateWaternetDailyKernel(waternetDailyKernelInput); + waternetDailyKernelWrapper.Calculate(); - IUpliftVanKernel upliftVanKernel = factory.CreateUpliftVanKernel(); - upliftVanKernel.SetSlipPlaneUpliftVan(SlipPlaneUpliftVanCreator.Create(input.SlipPlane)); - upliftVanKernel.SetSlipPlaneConstraints(SlipPlaneConstraintsCreator.Create(input.SlipPlaneConstraints)); - upliftVanKernel.SetSoilModel(layersWithSoil.Select(lws => lws.Soil).ToArray()); - upliftVanKernel.SetSoilProfile(soilProfile2D); - upliftVanKernel.SetWaternetDaily(waternetDailyKernelWrapper.Waternet); - upliftVanKernel.SetWaternetExtreme(waternetExtremeKernelWrapper.Waternet); - upliftVanKernel.SetMoveGrid(input.MoveGrid); - upliftVanKernel.SetMaximumSliceWidth(input.MaximumSliceWidth); - upliftVanKernel.SetSurfaceLine(surfaceLine); - upliftVanKernel.SetGridAutomaticDetermined(input.SlipPlane.GridAutomaticDetermined); - upliftVanKernel.SetTangentLinesAutomaticDetermined(input.SlipPlane.TangentLinesAutomaticAtBoundaries); - upliftVanKernel.SetFixedSoilStresses(FixedSoilStressCreator.Create(layerLookup)); - upliftVanKernel.SetPreConsolidationStresses(PreConsolidationStressCreator.Create(input.SoilProfile.PreconsolidationStresses)); - upliftVanKernel.SetAutomaticForbiddenZones(input.SlipPlaneConstraints.AutomaticForbiddenZones); + IWaternetKernel waternetExtremeKernelWrapper = factory.CreateWaternetExtremeKernel(waternetExtremeKernelInput); + waternetExtremeKernelWrapper.Calculate(); - return upliftVanKernel; + MacroStabilityInput kernelInput = MacroStabilityInputCreator.CreateUpliftVan(input, layersWithSoil, layerLookup, + surfaceLine, soilProfile, + waternetDailyKernelWrapper.Waternet, + waternetExtremeKernelWrapper.Waternet); + + return factory.CreateUpliftVanKernel(kernelInput); } - - private static void CalculateWaternet(IWaternetKernel waternetKernelWrapper, SoilProfile2D soilProfile2D, SurfaceLine2 surfaceLine) - { - waternetKernelWrapper.SetSoilProfile(soilProfile2D); - waternetKernelWrapper.SetSurfaceLine(surfaceLine); - waternetKernelWrapper.Calculate(); - } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs =================================================================== diff -u -rddcfe77680566b25a6eac697323787a03ae25e46 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs (.../WaternetCalculator.cs) (revision ddcfe77680566b25a6eac697323787a03ae25e46) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs (.../WaternetCalculator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -22,8 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Deltares.MacroStability.WaternetCreator; -using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input; @@ -93,7 +92,7 @@ /// /// The location to create the Waternet for. /// The created . - protected abstract IWaternetKernel CreateWaternetKernel(Location location); + protected abstract IWaternetKernel CreateWaternetKernel(MacroStabilityInput kernelInput); private WaternetCalculatorInput Input { get; } @@ -121,13 +120,8 @@ private IWaternetKernel GetWaternetKernel() { - IWaternetKernel waternetKernel = CreateWaternetKernel(WaternetLocationCreator.Create(Input)); - - LayerWithSoil[] layersWithSoil = LayerWithSoilCreator.Create(Input.SoilProfile, out IDictionary _); - waternetKernel.SetSoilProfile(SoilProfileCreator.Create(layersWithSoil)); - waternetKernel.SetSurfaceLine(SurfaceLineCreator.Create(Input.SurfaceLine)); - - return waternetKernel; + MacroStabilityInput kernelInput = MacroStabilityInputCreator.CreateWaternet(Input); + return CreateWaternetKernel(kernelInput); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs =================================================================== diff -u -r870b9a145e270c1ae1879cfadec7ccbf9fade51d -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs (.../WaternetDailyCalculator.cs) (revision 870b9a145e270c1ae1879cfadec7ccbf9fade51d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs (.../WaternetDailyCalculator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using Deltares.MacroStability.WaternetCreator; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; @@ -43,9 +43,9 @@ public WaternetDailyCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) : base(input, factory) {} - protected override IWaternetKernel CreateWaternetKernel(Location location) + protected override IWaternetKernel CreateWaternetKernel(MacroStabilityInput kernelInput) { - return Factory.CreateWaternetDailyKernel(location); + return Factory.CreateWaternetDailyKernel(kernelInput); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs =================================================================== diff -u -r870b9a145e270c1ae1879cfadec7ccbf9fade51d -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs (.../WaternetExtremeCalculator.cs) (revision 870b9a145e270c1ae1879cfadec7ccbf9fade51d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs (.../WaternetExtremeCalculator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using Deltares.MacroStability.WaternetCreator; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; @@ -43,9 +43,9 @@ public WaternetExtremeCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) : base(input, factory) {} - protected override IWaternetKernel CreateWaternetKernel(Location location) + protected override IWaternetKernel CreateWaternetKernel(MacroStabilityInput kernelInput) { - return Factory.CreateWaternetExtremeKernel(location); + return Factory.CreateWaternetExtremeKernel(kernelInput); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/FixedSoilStressCreator.cs =================================================================== diff -u -r0539eaef8189648d9a41a1840b65e64796bc0e86 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/FixedSoilStressCreator.cs (.../FixedSoilStressCreator.cs) (revision 0539eaef8189648d9a41a1840b65e64796bc0e86) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/FixedSoilStressCreator.cs (.../FixedSoilStressCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -22,22 +22,22 @@ using System; using System.Collections.Generic; using System.Linq; -using Deltares.MacroStability.Geometry; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using SoilLayer = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilLayer; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input { /// - /// Creates instances which are required by . + /// Creates instances which are required by . /// internal static class FixedSoilStressCreator { /// - /// Creates objects based on the given layers. + /// Creates objects based on the given layers. /// - /// The layers to create for. - /// An of . + /// The layers to create for. + /// An of . /// Thrown when /// is null. public static IEnumerable Create(IDictionary layerLookup) Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoil.cs =================================================================== diff -u -rdc5cde6f5d4c2f659854e1b2c0c010a19cabb186 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoil.cs (.../LayerWithSoil.cs) (revision dc5cde6f5d4c2f659854e1b2c0c010a19cabb186) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoil.cs (.../LayerWithSoil.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -20,7 +20,7 @@ // All rights reserved. using System.Collections.Generic; -using Deltares.MacroStability.Geometry; +using Deltares.MacroStability.CSharpWrapper.Input; using Point2D = Core.Common.Base.Geometry.Point2D; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LocationCreatorHelper.cs =================================================================== diff -u -rd88689fd053416ad5077227ec0700dd59566e185 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LocationCreatorHelper.cs (.../LocationCreatorHelper.cs) (revision d88689fd053416ad5077227ec0700dd59566e185) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/LocationCreatorHelper.cs (.../LocationCreatorHelper.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -21,18 +21,14 @@ using System; using System.ComponentModel; -using Deltares.MacroStability.WaternetCreator; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.Primitives; -using PlLineCreationMethod = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.PlLineCreationMethod; -using WaternetCreationMode = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.WaternetCreationMode; -using WtiStabilityPlLineCreationMethod = Deltares.MacroStability.WaternetCreator.PlLineCreationMethod; -using WtiStabilityWaternetCreationMode = Deltares.MacroStability.WaternetCreator.WaternetCreationMode; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input { /// - /// Helper class to convert properties needed in the - /// and . + /// Helper class to convert properties needed in the + /// and . /// internal static class LocationCreatorHelper { @@ -68,63 +64,5 @@ throw new NotSupportedException(); } } - - /// - /// Converts a into a . - /// - /// The to convert. - /// A based on . - /// Thrown when - /// is an invalid value. - /// Thrown when - /// is a valid value, but unsupported. - public static WtiStabilityWaternetCreationMode ConvertWaternetCreationMode(WaternetCreationMode waternetCreationMode) - { - if (!Enum.IsDefined(typeof(WaternetCreationMode), waternetCreationMode)) - { - throw new InvalidEnumArgumentException(nameof(waternetCreationMode), - (int) waternetCreationMode, - typeof(WaternetCreationMode)); - } - - switch (waternetCreationMode) - { - case WaternetCreationMode.CreateWaternet: - return WtiStabilityWaternetCreationMode.CreateWaternet; - case WaternetCreationMode.FillInWaternetValues: - return WtiStabilityWaternetCreationMode.FillInWaternetValues; - default: - throw new NotSupportedException(); - } - } - - /// - /// Converts a into a . - /// - /// The to convert. - /// A based on . - /// Thrown when - /// is an invalid value. - /// Thrown when - /// is a valid value, but unsupported. - public static WtiStabilityPlLineCreationMethod ConvertPlLineCreationMethod(PlLineCreationMethod plLineCreationMethod) - { - if (!Enum.IsDefined(typeof(PlLineCreationMethod), plLineCreationMethod)) - { - throw new InvalidEnumArgumentException(nameof(plLineCreationMethod), - (int) plLineCreationMethod, - typeof(PlLineCreationMethod)); - } - - switch (plLineCreationMethod) - { - case PlLineCreationMethod.RingtoetsWti2017: - return WtiStabilityPlLineCreationMethod.RingtoetsWti2017; - case PlLineCreationMethod.None: - return WtiStabilityPlLineCreationMethod.None; - default: - throw new NotSupportedException(); - } - } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/PreConsolidationStressCreator.cs =================================================================== diff -u -r77da97f3ca4bc3de4c03c0ec921ff8b75bd5d466 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/PreConsolidationStressCreator.cs (.../PreConsolidationStressCreator.cs) (revision 77da97f3ca4bc3de4c03c0ec921ff8b75bd5d466) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/PreConsolidationStressCreator.cs (.../PreConsolidationStressCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -25,6 +25,7 @@ using Deltares.MacroStability.Geometry; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; +using KernelPreconsolidationStress = Deltares.MacroStability.CSharpWrapper.Input.PreconsolidationStress; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input { @@ -40,14 +41,14 @@ /// An of . /// Thrown when /// is null. - public static IEnumerable Create(IEnumerable preconsolidationStresses) + public static IEnumerable Create(IEnumerable preconsolidationStresses) { if (preconsolidationStresses == null) { throw new ArgumentNullException(nameof(preconsolidationStresses)); } - return preconsolidationStresses.Select(preconsolidationStress => new PreConsolidationStress + return preconsolidationStresses.Select(preconsolidationStress => new KernelPreconsolidationStress { StressValue = preconsolidationStress.Stress, X = preconsolidationStress.Coordinate.X, Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneConstraintsCreator.cs =================================================================== diff -u -r68a64d20c6cc528ca79e5173cfcc1600c9d2147f -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneConstraintsCreator.cs (.../SlipPlaneConstraintsCreator.cs) (revision 68a64d20c6cc528ca79e5173cfcc1600c9d2147f) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneConstraintsCreator.cs (.../SlipPlaneConstraintsCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -20,23 +20,23 @@ // All rights reserved. using System; -using Deltares.MacroStability.Data; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input { /// - /// Creates instances which are required by . + /// Creates instances which are required by . /// public static class SlipPlaneConstraintsCreator { /// - /// Creates a based on the given + /// Creates a based on the given /// which can be used by . /// /// The to get the information from. - /// A new with the given information from . + /// A new with the given information from . /// Thrown when is null. public static SlipPlaneConstraints Create(UpliftVanSlipPlaneConstraints input) { Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs =================================================================== diff -u -r476c10932cea472a1475d63d32c2ad019bc5c57a -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision 476c10932cea472a1475d63d32c2ad019bc5c57a) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Deltares.MacroStability.CSharpWrapper; using Deltares.MacroStability.Data; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; @@ -39,17 +40,17 @@ /// The to get the information from. /// A new with the given information from . /// Thrown when is null. - public static SlipPlaneUpliftVan Create(UpliftVanSlipPlane slipPlane) + public static UpliftVanCalculationGrid Create(UpliftVanSlipPlane slipPlane) { if (slipPlane == null) { throw new ArgumentNullException(nameof(slipPlane)); } - var kernelSlipPlane = new SlipPlaneUpliftVan + var kernelSlipPlane = new UpliftVanCalculationGrid { - SlipPlaneLeftGrid = CreateGrid(slipPlane, slipPlane.LeftGrid), - SlipPlaneRightGrid = CreateGrid(slipPlane, slipPlane.RightGrid), + LeftGrid = CreateGrid(slipPlane, slipPlane.LeftGrid), + RightGrid = CreateGrid(slipPlane, slipPlane.RightGrid), SlipPlaneTangentLine = CreateTangentLine(slipPlane) }; Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs =================================================================== diff -u -r77da97f3ca4bc3de4c03c0ec921ff8b75bd5d466 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 77da97f3ca4bc3de4c03c0ec921ff8b75bd5d466) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.Geometry; using Deltares.MacroStability.Standard; using Point2D = Core.Common.Base.Geometry.Point2D; @@ -40,14 +41,14 @@ /// The layer data to use in the . /// A new . /// Thrown when any parameter is null. - public static SoilProfile2D Create(IEnumerable layersWithSoil) + public static SoilProfile Create(IEnumerable layersWithSoil) { if (layersWithSoil == null) { throw new ArgumentNullException(nameof(layersWithSoil)); } - var profile = new SoilProfile2D(); + var profile = new SoilProfile(); var alreadyCreatedPoints = new List(); var alreadyCreatedCurves = new List(); Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs =================================================================== diff -u -r52a3af45b53c91f86d92e011e3988b95138884ea -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 52a3af45b53c91f86d92e011e3988b95138884ea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.Linq; using Core.Common.Base.Geometry; +using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.Geometry; using Riskeer.MacroStabilityInwards.Primitives; @@ -41,14 +42,14 @@ /// which to take the information. /// A new with information taken from the . /// Thrown when is null. - public static SurfaceLine2 Create(MacroStabilityInwardsSurfaceLine surfaceLine) + public static SurfaceLine Create(MacroStabilityInwardsSurfaceLine surfaceLine) { if (surfaceLine == null) { throw new ArgumentNullException(nameof(surfaceLine)); } - var wtiSurfaceLine = new SurfaceLine2 + var wtiSurfaceLine = new SurfaceLine { Name = surfaceLine.Name }; Fisheye: Tag fe0f11c19023237d7f3629c2206b4fe5eb5e121f refers to a dead (removed) revision in file `Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanLocationCreator.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs =================================================================== diff -u --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (revision 0) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -0,0 +1,123 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using Deltares.MacroStability.CSharpWrapper; +using Deltares.MacroStability.CSharpWrapper.Input; +using Deltares.MacroStability.WaternetCreator; +using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; +using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; + +namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input +{ + /// + /// Creates instances which are required by . + /// + internal static class UpliftVanWaternetCreatorInputCreator + { + /// + /// Creates a based on the given under extreme circumstances, + /// which can be used by . + /// + /// The to get the information from. + /// A new with the given information from . + /// Thrown when is null. + /// Thrown when , + /// or + /// is an invalid value. + /// Thrown when , + /// or + /// is a valid value, but unsupported. + public static WaternetCreatorInput CreateExtreme(UpliftVanCalculatorInput input) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + WaternetCreatorInput creatorInput = CreateBaseLocation(input); + creatorInput.WaterLevelRiver = input.AssessmentLevel; + creatorInput.WaterLevelPolder = input.WaterLevelPolderExtreme; + creatorInput.UseDefaultOffsets = input.PhreaticLineOffsetsExtreme.UseDefaults; + creatorInput.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtRiver; + creatorInput.PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtPolder; + creatorInput.PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsExtreme.BelowShoulderBaseInside; + creatorInput.PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsExtreme.BelowDikeToeAtPolder; + creatorInput.PenetrationLength = input.PenetrationLengthExtreme; + return creatorInput; + } + + /// + /// Creates a based on the given under daily circumstances, + /// which can be used by . + /// + /// The to get the information from. + /// A new with the given information from . + /// Thrown when is null. + /// Thrown when , + /// or + /// is an invalid value. + /// Thrown when , + /// or + /// is a valid value, but unsupported. + public static WaternetCreatorInput CreateDaily(UpliftVanCalculatorInput input) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + WaternetCreatorInput creatorInput = CreateBaseLocation(input); + creatorInput.WaterLevelRiver = input.WaterLevelRiverAverage; + creatorInput.WaterLevelPolder = input.WaterLevelPolderDaily; + creatorInput.UseDefaultOffsets = input.PhreaticLineOffsetsDaily.UseDefaults; + creatorInput.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsDaily.BelowDikeTopAtRiver; + creatorInput.PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeTopAtPolder; + creatorInput.PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsetsDaily.BelowShoulderBaseInside; + creatorInput.PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsetsDaily.BelowDikeToeAtPolder; + creatorInput.PenetrationLength = input.PenetrationLengthDaily; + return creatorInput; + } + + private static WaternetCreatorInput CreateBaseLocation(UpliftVanCalculatorInput input) + { + return new WaternetCreatorInput + { + DikeSoilScenario = LocationCreatorHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), + WaterLevelRiverAverage = input.WaterLevelRiverAverage, + DrainageConstructionPresent = input.DrainageConstruction.IsPresent, + DrainageConstruction = input.DrainageConstruction.IsPresent + ? new Point2D(input.DrainageConstruction.XCoordinate, input.DrainageConstruction.ZCoordinate) + : null, + MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver, + MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder, + AdjustPl3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift, + LeakageLengthOutwardsPl3 = input.LeakageLengthOutwardsPhreaticLine3, + LeakageLengthInwardsPl3 = input.LeakageLengthInwardsPhreaticLine3, + LeakageLengthOutwardsPl4 = input.LeakageLengthOutwardsPhreaticLine4, + LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4, + HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, + HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards + }; + } + } +} \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs =================================================================== diff -u --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (revision 0) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using Deltares.MacroStability.CSharpWrapper; +using Deltares.MacroStability.CSharpWrapper.Input; +using Deltares.MacroStability.WaternetCreator; +using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; +using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; + +namespace Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input +{ + /// + /// Creates instances which are required by . + /// + internal static class WaternetCreatorInputCreator + { + /// + /// Creates a based on the given + /// which can be used by . + /// + /// The to get the information from. + /// A new with the given information from . + /// Thrown when is null. + /// Thrown when , + /// or + /// is an invalid value. + /// Thrown when , + /// or + /// is a valid value, but unsupported. + public static WaternetCreatorInput Create(WaternetCalculatorInput input) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + return new WaternetCreatorInput + { + DikeSoilScenario = LocationCreatorHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), + WaterLevelRiver = input.AssessmentLevel, + WaterLevelRiverAverage = input.WaterLevelRiverAverage, + WaterLevelPolder = input.WaterLevelPolder, + DrainageConstructionPresent = input.DrainageConstruction.IsPresent, + DrainageConstruction = input.DrainageConstruction.IsPresent + ? new Point2D(input.DrainageConstruction.XCoordinate, input.DrainageConstruction.ZCoordinate) + : null, + MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver, + MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder, + UseDefaultOffsets = input.PhreaticLineOffsets.UseDefaults, + PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsets.BelowDikeTopAtRiver, + PlLineOffsetBelowDikeTopAtPolder = input.PhreaticLineOffsets.BelowDikeTopAtPolder, + PlLineOffsetBelowShoulderBaseInside = input.PhreaticLineOffsets.BelowShoulderBaseInside, + PlLineOffsetBelowDikeToeAtPolder = input.PhreaticLineOffsets.BelowDikeToeAtPolder, + AdjustPl3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift, + LeakageLengthOutwardsPl3 = input.LeakageLengthOutwardsPhreaticLine3, + LeakageLengthInwardsPl3 = input.LeakageLengthInwardsPhreaticLine3, + LeakageLengthOutwardsPl4 = input.LeakageLengthOutwardsPhreaticLine4, + LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4, + HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, + HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, + PenetrationLength = input.PenetrationLength + }; + } + } +} \ No newline at end of file Fisheye: Tag fe0f11c19023237d7f3629c2206b4fe5eb5e121f refers to a dead (removed) revision in file `Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetLocationCreator.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/IMacroStabilityInwardsKernelFactory.cs =================================================================== diff -u -r3057e5426828844ea8201ee85c61ebbc0f1d6e47 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/IMacroStabilityInwardsKernelFactory.cs (.../IMacroStabilityInwardsKernelFactory.cs) (revision 3057e5426828844ea8201ee85c61ebbc0f1d6e47) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/IMacroStabilityInwardsKernelFactory.cs (.../IMacroStabilityInwardsKernelFactory.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.WaternetCreator; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; @@ -33,21 +34,22 @@ /// /// Creates an Uplift Van kernel. /// + /// The input of the kernel. /// A new . - IUpliftVanKernel CreateUpliftVanKernel(); + IUpliftVanKernel CreateUpliftVanKernel(MacroStabilityInput kernelInput); /// /// Creates a Waternet kernel for extreme circumstances. /// - /// The to use. + /// The input of the kernel. /// A new . - IWaternetKernel CreateWaternetExtremeKernel(Location location); + IWaternetKernel CreateWaternetExtremeKernel(MacroStabilityInput kernelInput); /// /// Creates Waternet kernel for daily circumstances. /// - /// The to use. + /// The input of the kernel. /// A new . - IWaternetKernel CreateWaternetDailyKernel(Location location); + IWaternetKernel CreateWaternetDailyKernel(MacroStabilityInput kernelInput); } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/MacroStabilityInwardsKernelWrapperFactory.cs =================================================================== diff -u -r870b9a145e270c1ae1879cfadec7ccbf9fade51d -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/MacroStabilityInwardsKernelWrapperFactory.cs (.../MacroStabilityInwardsKernelWrapperFactory.cs) (revision 870b9a145e270c1ae1879cfadec7ccbf9fade51d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/MacroStabilityInwardsKernelWrapperFactory.cs (.../MacroStabilityInwardsKernelWrapperFactory.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Deltares.MacroStability.CSharpWrapper; +using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.WaternetCreator; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; @@ -39,29 +41,23 @@ /// public static IMacroStabilityInwardsKernelFactory Instance { - get - { - return instance ?? (instance = new MacroStabilityInwardsKernelWrapperFactory()); - } - set - { - instance = value; - } + get => instance ?? (instance = new MacroStabilityInwardsKernelWrapperFactory()); + set => instance = value; } - public IUpliftVanKernel CreateUpliftVanKernel() + public IUpliftVanKernel CreateUpliftVanKernel(MacroStabilityInput kernelInput) { - return new UpliftVanKernelWrapper(); + return new UpliftVanKernelWrapper(new Calculator(kernelInput), new Validator(kernelInput)); } - public IWaternetKernel CreateWaternetExtremeKernel(Location location) + public IWaternetKernel CreateWaternetExtremeKernel(MacroStabilityInput kernelInput) { - return new WaternetKernelWrapper(location, "WaternetExtreme"); + return new WaternetKernelWrapper(new Calculator(kernelInput), new Validator(kernelInput), "WaternetExtreme"); } - public IWaternetKernel CreateWaternetDailyKernel(Location location) + public IWaternetKernel CreateWaternetDailyKernel(MacroStabilityInput kernelInput) { - return new WaternetKernelWrapper(location, "WaternetDaily"); + return new WaternetKernelWrapper(new Calculator(kernelInput), new Validator(kernelInput), "WaternetDaily"); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs =================================================================== diff -u -r122ad979f6f5819771fd11b8797a8cd6e2963d05 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision 122ad979f6f5819771fd11b8797a8cd6e2963d05) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -21,10 +21,8 @@ using System.Collections.Generic; using Deltares.MacroStability.CSharpWrapper; -using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.CSharpWrapper.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan; -using WtiStabilityWaternet = Deltares.MacroStability.CSharpWrapper.Waternet; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan { @@ -61,9 +59,9 @@ DualSlidingCircleMinimumSafetyCurve SlidingCurveResult { get; } /// - /// Gets the slip plane result. + /// Gets the calculation grid result. /// - UpliftVanCalculationGrid SlipPlaneResult { get; } + UpliftVanCalculationGrid UpliftVanCalculationGridResult { get; } /// /// Gets the messages returned by the kernel during @@ -72,91 +70,6 @@ IEnumerable CalculationMessages { get; } /// - /// Sets the slip plane Uplift Van. - /// - /// The slip plane Uplift Van to set. - void SetSlipPlaneUpliftVan(UpliftVanCalculationGrid slipPlaneUpliftVan); - - /// - /// Sets the slip plane constraints. - /// - /// The slip plane constraints to set. - void SetSlipPlaneConstraints(SlipPlaneConstraints slipPlaneConstraints); - - /// - /// Sets the soil model. - /// - /// The soil model to set. - void SetSoilModel(IEnumerable soilModel); - - /// - /// Sets the soil profile. - /// - /// The soil profile to set. - void SetSoilProfile(SoilProfile soilProfile); - - /// - /// Sets the Waternet under daily circumstances. - /// - /// The daily Waternet to set. - void SetWaternetDaily(WtiStabilityWaternet waternetDaily); - - /// - /// Sets the Waternet under extreme circumstances. - /// - /// The extreme Waternet to set. - void SetWaternetExtreme(WtiStabilityWaternet waternetExtreme); - - /// - /// Sets the move grid property. - /// - /// The move grid value to set. - void SetMoveGrid(bool moveGrid); - - /// - /// Sets the maximum slice width. - /// [m] - /// - /// The maximum slice width to set. - void SetMaximumSliceWidth(double maximumSliceWidth); - - /// - /// Sets the surface line. - /// - /// The surface line to set. - void SetSurfaceLine(SurfaceLine surfaceLine); - - /// - /// Sets whether the grid is automatically determined or not. - /// - /// The grid automatic determined value to set. - void SetGridAutomaticDetermined(bool gridAutomaticDetermined); - - /// - /// Sets whether the tangent lines are automatically determined or not. - /// - /// The tangent automatic lines determined value to set. - void SetTangentLinesAutomaticDetermined(bool tangentLinesAutomaticDetermined); - - /// - /// Sets the fixed soil stresses. - /// - /// The soil stresses to set. - void SetFixedSoilStresses(IEnumerable soilStresses); - - /// - /// Sets the preconsolidation stresses. - /// - /// The preconsolidation stresses to set. - void SetPreConsolidationStresses(IEnumerable preconsolidationStresses); - - /// - /// Sets whether the forbidden zones are automatically determined or not. - /// - /// The automatic forbidden zones to set. - void SetAutomaticForbiddenZones(bool automaticForbiddenZones); - - /// /// Performs the Uplift Van calculation. /// /// Thrown when @@ -166,7 +79,7 @@ /// /// Validates the input for the Uplift Van calculation. /// - /// An of objects. + /// An of objects. /// Thrown when /// an error occurs when performing the validation. IEnumerable Validate(); Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs =================================================================== diff -u -r122ad979f6f5819771fd11b8797a8cd6e2963d05 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision 122ad979f6f5819771fd11b8797a8cd6e2963d05) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -23,61 +23,25 @@ using System.Collections.Generic; using System.Linq; using Deltares.MacroStability.CSharpWrapper; -using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.CSharpWrapper.Output; -using ConstructionStage = Deltares.MacroStability.CSharpWrapper.Input.ConstructionStage; -using MacroStabilityInput = Deltares.MacroStability.CSharpWrapper.Input.MacroStabilityInput; -using Orientation = Deltares.MacroStability.CSharpWrapper.Input.Orientation; -using SearchAlgorithm = Deltares.MacroStability.CSharpWrapper.Input.SearchAlgorithm; -using WtiStabilityWaternet = Deltares.MacroStability.CSharpWrapper.Waternet; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan { /// - /// Class that wraps for performing an Uplift Van calculation. + /// Class that wraps the for performing an Uplift Van calculation. /// internal class UpliftVanKernelWrapper : IUpliftVanKernel { - private readonly MacroStabilityInput macroStabilityInput; + private readonly ICalculator calculator; + private readonly IValidator validator; /// /// Creates a new instance of . /// - public UpliftVanKernelWrapper() + public UpliftVanKernelWrapper(ICalculator calculator, IValidator validator) { - macroStabilityInput = new MacroStabilityInput - { - StabilityModel = - { - Orientation = Orientation.Inwards, - SearchAlgorithm = SearchAlgorithm.Grid, - ModelOption = StabilityModelOptionType.UpliftVan, - ConstructionStages = - { - AddConstructionStage(), - AddConstructionStage() - } - }, - PreprocessingInput = - { - SearchAreaConditions = - { - MaxSpacingBetweenBoundaries = 0.8, - OnlyAbovePleistoceen = true - }, - PreConstructionStages = - { - new PreConstructionStage - { - WaternetCreationMode = WaternetCreationMode.FillInWaternetValues - }, - new PreConstructionStage - { - WaternetCreationMode = WaternetCreationMode.FillInWaternetValues - } - } - } - }; + this.calculator = calculator; + this.validator = validator; FactorOfStability = double.NaN; ForbiddenZonesXEntryMin = double.NaN; @@ -92,101 +56,14 @@ public DualSlidingCircleMinimumSafetyCurve SlidingCurveResult { get; private set; } - public UpliftVanCalculationGrid SlipPlaneResult { get; private set; } + public UpliftVanCalculationGrid UpliftVanCalculationGridResult { get; private set; } public IEnumerable CalculationMessages { get; private set; } - public void SetSoilModel(IEnumerable soilModel) - { - foreach (Soil soil in soilModel) - { - macroStabilityInput.StabilityModel.Soils.Add(soil); - } - } - - public void SetSoilProfile(SoilProfile soilProfile) - { - GetDailyConstructionStage().SoilProfile = soilProfile; - GetExtremeConstructionStage().SoilProfile = soilProfile; - } - - public void SetWaternetDaily(WtiStabilityWaternet waternetDaily) - { - GetDailyConstructionStage().Waternet = waternetDaily; - } - - public void SetWaternetExtreme(WtiStabilityWaternet waternetExtreme) - { - GetExtremeConstructionStage().Waternet = waternetExtreme; - } - - public void SetMoveGrid(bool moveGrid) - { - macroStabilityInput.StabilityModel.MoveGrid = moveGrid; - } - - public void SetMaximumSliceWidth(double maximumSliceWidth) - { - macroStabilityInput.StabilityModel.MaximumSliceWidth = maximumSliceWidth; - } - - public void SetSlipPlaneUpliftVan(UpliftVanCalculationGrid slipPlaneUpliftVan) - { - macroStabilityInput.StabilityModel.UpliftVanCalculationGrid = slipPlaneUpliftVan; - } - - public void SetSurfaceLine(SurfaceLine surfaceLine) - { - foreach (PreConstructionStage preConstructionStage in macroStabilityInput.PreprocessingInput.PreConstructionStages) - { - preConstructionStage.SurfaceLine = surfaceLine; - } - } - - public void SetSlipPlaneConstraints(SlipPlaneConstraints slipPlaneConstraints) - { - macroStabilityInput.StabilityModel.SlipPlaneConstraints = slipPlaneConstraints; - } - - public void SetGridAutomaticDetermined(bool gridAutomaticDetermined) - { - macroStabilityInput.PreprocessingInput.SearchAreaConditions.AutoSearchArea = gridAutomaticDetermined; - } - - public void SetTangentLinesAutomaticDetermined(bool tangentLinesAutomaticDetermined) - { - macroStabilityInput.PreprocessingInput.SearchAreaConditions.AutoTangentLines = tangentLinesAutomaticDetermined; - } - - public void SetFixedSoilStresses(IEnumerable soilStresses) - { - ConstructionStage stage = GetDailyConstructionStage(); - foreach (FixedSoilStress soilStress in soilStresses) - { - stage.FixedSoilStresses.Add(soilStress); - } - } - - public void SetPreConsolidationStresses(IEnumerable preconsolidationStresses) - { - ConstructionStage stage = GetDailyConstructionStage(); - - foreach (PreconsolidationStress preconsolidationStress in preconsolidationStresses) - { - stage.PreconsolidationStresses.Add(preconsolidationStress); - } - } - - public void SetAutomaticForbiddenZones(bool automaticForbiddenZones) - { - macroStabilityInput.PreprocessingInput.SearchAreaConditions.AutomaticForbiddenZones = automaticForbiddenZones; - } - public void Calculate() { try { - var calculator = new Calculator(macroStabilityInput); MacroStabilityOutput output = calculator.Calculate(); CalculationMessages = output.StabilityOutput.Messages ?? Enumerable.Empty(); @@ -202,7 +79,6 @@ { try { - var validator = new Validator(macroStabilityInput); ValidationOutput output = validator.Validate(); return output.Messages; } @@ -212,39 +88,14 @@ } } - private ConstructionStage GetDailyConstructionStage() - { - return macroStabilityInput.StabilityModel.ConstructionStages.First(); - } - - private ConstructionStage GetExtremeConstructionStage() - { - return macroStabilityInput.StabilityModel.ConstructionStages.Last(); - } - - private static ConstructionStage AddConstructionStage() - { - return new ConstructionStage - { - MultiplicationFactorsCPhiForUplift = - { - new MultiplicationFactorsCPhiForUplift - { - MultiplicationFactor = 0.0, - UpliftFactor = 1.2 - } - } - }; - } - private void SetResults(MacroStabilityOutput output) { FactorOfStability = output.StabilityOutput.SafetyFactor; ForbiddenZonesXEntryMin = output.PreprocessingOutputBase.ForbiddenZone.XEntryMin; ForbiddenZonesXEntryMax = output.PreprocessingOutputBase.ForbiddenZone.XEntryMax; SlidingCurveResult = (DualSlidingCircleMinimumSafetyCurve) output.StabilityOutput.MinimumSafetyCurve; - SlipPlaneResult = ((UpliftVanPreprocessingOutput) output.PreprocessingOutputBase).UpliftVanCalculationGrid; + UpliftVanCalculationGridResult = ((UpliftVanPreprocessingOutput) output.PreprocessingOutputBase).UpliftVanCalculationGrid; } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/IWaternetKernel.cs =================================================================== diff -u -re35222f637844b64df2d6fef45bc365a7d805439 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/IWaternetKernel.cs (.../IWaternetKernel.cs) (revision e35222f637844b64df2d6fef45bc365a7d805439) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/IWaternetKernel.cs (.../IWaternetKernel.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -46,16 +46,6 @@ WtiStabilityWaternet Waternet { get; } /// - /// Sets the soil profile. - /// - void SetSoilProfile(SoilProfile soilProfile); - - /// - /// Sets the surface line. - /// - void SetSurfaceLine(SurfaceLine surfaceLine); - - /// /// Performs the Waternet calculation. /// /// Thrown when @@ -69,7 +59,5 @@ /// Thrown when /// an error occurs when performing the validation. IEnumerable Validate(); - - void SetSoils(ICollection soils); } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/WaternetKernelWrapper.cs =================================================================== diff -u -re35222f637844b64df2d6fef45bc365a7d805439 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/WaternetKernelWrapper.cs (.../WaternetKernelWrapper.cs) (revision e35222f637844b64df2d6fef45bc365a7d805439) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/Waternet/WaternetKernelWrapper.cs (.../WaternetKernelWrapper.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -23,7 +23,6 @@ using System.Collections.Generic; using System.Linq; using Deltares.MacroStability.CSharpWrapper; -using Deltares.MacroStability.CSharpWrapper.Input; using Deltares.MacroStability.CSharpWrapper.Output; using Deltares.MacroStability.CSharpWrapper.Output.WaternetCreator; using Deltares.MacroStability.Standard; @@ -37,66 +36,29 @@ /// internal class WaternetKernelWrapper : IWaternetKernel { + private readonly ICalculator calculator; + private readonly IValidator validator; private readonly string waternetName; - private readonly MacroStabilityInput input; /// /// Creates a new instance of . /// /// The to use. /// The name of the . /// - public WaternetKernelWrapper(WaternetCreatorInput waternetCreatorInput, string waternetName) + public WaternetKernelWrapper(ICalculator calculator, IValidator validator, string waternetName) { + this.calculator = calculator; + this.validator = validator; this.waternetName = waternetName; - - input = new MacroStabilityInput - { - StabilityModel = - { - ConstructionStages = - { - new ConstructionStage() - } - }, - PreprocessingInput = - { - PreConstructionStages = - { - new PreConstructionStage - { - WaternetCreationMode = WaternetCreationMode.CreateWaternet, - WaternetCreatorInput = waternetCreatorInput - } - } - } - }; - } public WtiStabilityWaternet Waternet { get; private set; } - public void SetSoils(ICollection soils) - { - input.StabilityModel.Soils = soils; - } - - public void SetSoilProfile(SoilProfile soilProfile) - { - input.StabilityModel.ConstructionStages.First().SoilProfile = soilProfile; - } - - public void SetSurfaceLine(SurfaceLine surfaceLine) - { - input.PreprocessingInput.PreConstructionStages.First().SurfaceLine = surfaceLine; - } - public void Calculate() { try { - var calculator = new Calculator(input); - CheckIfWaternetCanBeGenerated(); WaternetCreatorOutput output = calculator.CalculateWaternet(0); @@ -116,7 +78,6 @@ { try { - var validator = new Validator(input); ValidationOutput output = validator.ValidateWaternetCreator(); return output.Messages; } @@ -132,7 +93,6 @@ /// Thrown when the Waternet can not be generated. private void CheckIfWaternetCanBeGenerated() { - var validator = new Validator(input); ValidationOutput output = validator.ValidateWaternetCreator(); if(!output.IsValid) Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs =================================================================== diff -u -r3623b78a8f27884b79c09b4a0fdfd6419b0ec3e7 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 3623b78a8f27884b79c09b4a0fdfd6419b0ec3e7) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -131,8 +131,8 @@ { var factory = (TestMacroStabilityInwardsKernelFactory) MacroStabilityInwardsKernelWrapperFactory.Instance; UpliftVanKernelStub upliftVanKernel = factory.LastCreatedUpliftVanKernel; - upliftVanKernel.SetWaternetDaily(factory.CreateWaternetDailyKernel(UpliftVanLocationCreator.CreateDaily(input)).Waternet); - upliftVanKernel.SetWaternetExtreme(factory.CreateWaternetExtremeKernel(UpliftVanLocationCreator.CreateExtreme(input)).Waternet); + upliftVanKernel.SetWaternetDaily(factory.CreateWaternetDailyKernel(UpliftVanWaternetCreatorInputCreator.CreateDaily(input)).Waternet); + upliftVanKernel.SetWaternetExtreme(factory.CreateWaternetExtremeKernel(UpliftVanWaternetCreatorInputCreator.CreateExtreme(input)).Waternet); SetValidKernelOutput(upliftVanKernel); // Call Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetDailyCalculatorTest.cs =================================================================== diff -u -rdccd06261ac7704bcdf747ef9fb0765b5662375e -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetDailyCalculatorTest.cs (.../WaternetDailyCalculatorTest.cs) (revision dccd06261ac7704bcdf747ef9fb0765b5662375e) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetDailyCalculatorTest.cs (.../WaternetDailyCalculatorTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -76,7 +76,7 @@ LayerWithSoil[] layersWithSoil = LayerWithSoilCreator.Create(input.SoilProfile, out IDictionary _); KernelInputAssert.AssertSoilProfiles(SoilProfileCreator.Create(layersWithSoil), waternetKernel.SoilProfile); - KernelInputAssert.AssertLocations(WaternetLocationCreator.Create(input), waternetKernel.Location); + KernelInputAssert.AssertLocations(WaternetCreatorInputCreator.Create(input), waternetKernel.Location); KernelInputAssert.AssertSurfaceLines(SurfaceLineCreator.Create(input.SurfaceLine), waternetKernel.SurfaceLine); } } Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetExtremeCalculatorTest.cs =================================================================== diff -u -r0fd821099e40783d33174622452d5814301170f3 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetExtremeCalculatorTest.cs (.../WaternetExtremeCalculatorTest.cs) (revision 0fd821099e40783d33174622452d5814301170f3) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetExtremeCalculatorTest.cs (.../WaternetExtremeCalculatorTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -76,7 +76,7 @@ LayerWithSoil[] layersWithSoil = LayerWithSoilCreator.Create(input.SoilProfile, out IDictionary layerLookup); KernelInputAssert.AssertSoilProfiles(SoilProfileCreator.Create(layersWithSoil), waternetKernel.SoilProfile); - KernelInputAssert.AssertLocations(WaternetLocationCreator.Create(input), waternetKernel.Location); + KernelInputAssert.AssertLocations(WaternetCreatorInputCreator.Create(input), waternetKernel.Location); KernelInputAssert.AssertSurfaceLines(SurfaceLineCreator.Create(input.SurfaceLine), waternetKernel.SurfaceLine); } } Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanLocationCreatorTest.cs =================================================================== diff -u -rcb8cfeedd559f70eb8931ed09d869ecc9459d8b7 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanLocationCreatorTest.cs (.../UpliftVanLocationCreatorTest.cs) (revision cb8cfeedd559f70eb8931ed09d869ecc9459d8b7) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanLocationCreatorTest.cs (.../UpliftVanLocationCreatorTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -43,7 +43,7 @@ public void CreateExtreme_InputNull_ThrowsArgumentNullException() { // Call - void Call() => UpliftVanLocationCreator.CreateExtreme(null); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(null); // Assert var exception = Assert.Throws(Call); @@ -67,7 +67,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateExtreme(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert string message = $"The value of argument 'dikeSoilScenario' ({99}) is invalid for Enum type '{nameof(MacroStabilityInwardsDikeSoilScenario)}'."; @@ -96,7 +96,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateExtreme(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert Assert.AreEqual(expectedDikeSoilScenario, location.DikeSoilScenario); @@ -119,7 +119,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateExtreme(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{nameof(WaternetCreationMode)}'."; @@ -146,7 +146,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateExtreme(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert Assert.AreEqual(expectedWaternetCreationMode, location.WaternetCreationMode); @@ -169,7 +169,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateExtreme(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{nameof(PlLineCreationMethod)}'."; @@ -196,7 +196,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateExtreme(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert Assert.AreEqual(expectedPlLineCreationMethod, location.PlLineCreationMethod); @@ -243,7 +243,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateExtreme(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); // Assert Assert.AreEqual(input.AssessmentLevel, location.HeadInPlLine3); @@ -265,7 +265,7 @@ public void CreateDaily_InputNull_ThrowsArgumentNullException() { // Call - void Call() => UpliftVanLocationCreator.CreateDaily(null); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(null); // Assert var exception = Assert.Throws(Call); @@ -289,7 +289,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateDaily(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert string message = $"The value of argument 'dikeSoilScenario' ({99}) is invalid for Enum type '{nameof(MacroStabilityInwardsDikeSoilScenario)}'."; @@ -318,7 +318,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateDaily(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert Assert.AreEqual(expectedDikeSoilScenario, location.DikeSoilScenario); @@ -341,7 +341,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateDaily(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{nameof(WaternetCreationMode)}'."; @@ -368,7 +368,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateDaily(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert Assert.AreEqual(expectedWaternetCreationMode, location.WaternetCreationMode); @@ -391,7 +391,7 @@ }); // Call - void Call() => UpliftVanLocationCreator.CreateDaily(input); + void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{nameof(PlLineCreationMethod)}'."; @@ -418,7 +418,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateDaily(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert Assert.AreEqual(expectedPlLineCreationMethod, location.PlLineCreationMethod); @@ -465,7 +465,7 @@ }); // Call - Location location = UpliftVanLocationCreator.CreateDaily(input); + Location location = UpliftVanWaternetCreatorInputCreator.CreateDaily(input); // Assert Assert.AreEqual(input.WaterLevelRiverAverage, location.HeadInPlLine3); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetLocationCreatorTest.cs =================================================================== diff -u -rcb8cfeedd559f70eb8931ed09d869ecc9459d8b7 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetLocationCreatorTest.cs (.../WaternetLocationCreatorTest.cs) (revision cb8cfeedd559f70eb8931ed09d869ecc9459d8b7) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetLocationCreatorTest.cs (.../WaternetLocationCreatorTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -43,7 +43,7 @@ public void Create_InputNull_ThrowsArgumentNullException() { // Call - void Call() => WaternetLocationCreator.Create(null); + void Call() => WaternetCreatorInputCreator.Create(null); // Assert var exception = Assert.Throws(Call); @@ -65,7 +65,7 @@ }); // Call - void Call() => WaternetLocationCreator.Create(input); + void Call() => WaternetCreatorInputCreator.Create(input); // Assert string message = $"The value of argument 'dikeSoilScenario' ({99}) is invalid for Enum type '{nameof(MacroStabilityInwardsDikeSoilScenario)}'."; @@ -92,7 +92,7 @@ }); // Call - Location location = WaternetLocationCreator.Create(input); + Location location = WaternetCreatorInputCreator.Create(input); // Assert Assert.AreEqual(expectedDikeSoilScenario, location.DikeSoilScenario); @@ -113,7 +113,7 @@ }); // Call - void Call() => WaternetLocationCreator.Create(input); + void Call() => WaternetCreatorInputCreator.Create(input); // Assert string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{nameof(WaternetCreationMode)}'."; @@ -138,7 +138,7 @@ }); // Call - Location location = WaternetLocationCreator.Create(input); + Location location = WaternetCreatorInputCreator.Create(input); // Assert Assert.AreEqual(expectedWaternetCreationMode, location.WaternetCreationMode); @@ -159,7 +159,7 @@ }); // Call - void Call() => WaternetLocationCreator.Create(input); + void Call() => WaternetCreatorInputCreator.Create(input); // Assert string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{nameof(PlLineCreationMethod)}'."; @@ -184,7 +184,7 @@ }); // Call - Location location = WaternetLocationCreator.Create(input); + Location location = WaternetCreatorInputCreator.Create(input); // Assert Assert.AreEqual(expectedPlLineCreationMethod, location.PlLineCreationMethod); @@ -243,7 +243,7 @@ }); // Call - Location location = WaternetLocationCreator.Create(input); + Location location = WaternetCreatorInputCreator.Create(input); // Assert Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs =================================================================== diff -u -r6bc65102a16d453d3e9f031aac2827130eef2b38 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision 6bc65102a16d453d3e9f031aac2827130eef2b38) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -23,16 +23,12 @@ using System.Collections.Generic; using System.Linq; using Core.Common.TestUtil; -using Core.Common.Util.Extensions; using Core.Common.Util.Reflection; -using Deltares.MacroStability.Data; -using Deltares.MacroStability.Geometry; -using Deltares.MacroStability.Kernel; -using Deltares.MacroStability.Preprocessing; -using Deltares.MacroStability.Standard; +using Deltares.MacroStability.CSharpWrapper.Input; +using Deltares.MacroStability.CSharpWrapper.Output; using NUnit.Framework; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; -using WtiStabilityWaternet = Deltares.MacroStability.Geometry.Waternet; +using WtiStabilityWaternet = Deltares.MacroStability.CSharpWrapper.Waternet; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Test.Kernels.UpliftVan { @@ -51,13 +47,12 @@ Assert.IsNaN(kernel.ForbiddenZonesXEntryMin); Assert.IsNaN(kernel.ForbiddenZonesXEntryMax); Assert.IsNull(kernel.SlidingCurveResult); - Assert.IsNull(kernel.SlipPlaneResult); + Assert.IsNull(kernel.UpliftVanCalculationGridResult); Assert.IsNull(kernel.CalculationMessages); - var kernelModel = TypeUtils.GetField(kernel, "kernelModel"); - StabilityModel stabilityModel = kernelModel.StabilityModel; + var input = TypeUtils.GetField(kernel, "input"); - AssertConstructorValues(stabilityModel, kernelModel); + AssertConstructorValues(input); } [Test] @@ -88,10 +83,10 @@ // Call var kernel = new UpliftVanKernelWrapper(); - kernel.SetSoilModel(soilModel); + kernel.SetSoils(soilModel); kernel.SetSoilProfile(soilProfile2D); kernel.SetMaximumSliceWidth(maximumSliceWidth); - kernel.SetSlipPlaneUpliftVan(slipPlaneUpliftVan); + kernel.SetUpliftVanCalculationGrid(slipPlaneUpliftVan); kernel.SetSurfaceLine(surfaceLine); kernel.SetMoveGrid(moveGrid); kernel.SetGridAutomaticDetermined(gridAutomaticDetermined); @@ -100,7 +95,7 @@ kernel.SetWaternetDaily(waternetDaily); kernel.SetWaternetExtreme(waternetExtreme); kernel.SetFixedSoilStresses(fixedSoilStresses); - kernel.SetPreConsolidationStresses(preConsolidationStresses); + kernel.SetPreconsolidationStresses(preConsolidationStresses); kernel.SetAutomaticForbiddenZones(automaticForbiddenZones); // Assert @@ -162,7 +157,7 @@ Assert.IsNaN(kernel.ForbiddenZonesXEntryMax); Assert.IsNaN(kernel.ForbiddenZonesXEntryMin); Assert.IsNull(kernel.SlidingCurveResult); - Assert.IsNull(kernel.SlipPlaneResult); + Assert.IsNull(kernel.UpliftVanCalculationGridResult); } [Test] @@ -191,7 +186,7 @@ Assert.IsFalse(double.IsNaN(kernel.ForbiddenZonesXEntryMin)); Assert.IsFalse(double.IsNaN(kernel.ForbiddenZonesXEntryMax)); Assert.IsNotNull(kernel.SlidingCurveResult); - Assert.IsNotNull(kernel.SlipPlaneResult); + Assert.IsNotNull(kernel.UpliftVanCalculationGridResult); } [Test] @@ -243,40 +238,39 @@ Assert.AreEqual(11, validationMessages.Count()); } - private static void AssertConstructorValues(StabilityModel stabilityModel, KernelModel kernelModel) + private static void AssertConstructorValues(MacroStabilityInput input) { - Assert.AreEqual(GridOrientation.Inwards, stabilityModel.GridOrientation); - Assert.IsNotNull(stabilityModel.SlipCircle); - Assert.AreEqual(SearchAlgorithm.Grid, stabilityModel.SearchAlgorithm); - Assert.AreEqual(ModelOptions.UpliftVan, stabilityModel.ModelOption); + Assert.AreEqual(Orientation.Inwards, input.StabilityModel.Orientation); + Assert.IsNotNull(input.StabilityModel.BishopCalculationCircle); + Assert.AreEqual(SearchAlgorithm.Grid, input.StabilityModel.SearchAlgorithm); + Assert.AreEqual(StabilityModelOptionType.UpliftVan, input.StabilityModel.ModelOption); - Assert.AreEqual(0.8, kernelModel.PreprocessingModel.SearchAreaConditions.MaxSpacingBetweenBoundaries); - Assert.IsTrue(kernelModel.PreprocessingModel.SearchAreaConditions.OnlyAbovePleistoceen); + Assert.AreEqual(0.8, input.PreprocessingInput.SearchAreaConditions.MaxSpacingBetweenBoundaries); + Assert.IsTrue(input.PreprocessingInput.SearchAreaConditions.OnlyAbovePleistoceen); - Assert.AreEqual(2, kernelModel.PreprocessingModel.PreProcessingConstructionStages.Count); - kernelModel.PreprocessingModel.PreProcessingConstructionStages.ForEachElementDo( - ppcs => Assert.AreSame(stabilityModel, ppcs.StabilityModel)); + Assert.AreEqual(2, input.PreprocessingInput.PreConstructionStages.Count); + Assert.IsTrue(input.PreprocessingInput.PreConstructionStages.All(stage => stage.WaternetCreationMode == WaternetCreationMode.FillInWaternetValues)); } - private static void AssertConstructionStages(IEnumerable constructionStages, SoilProfile2D soilProfile2D, IEnumerable waternets, - IEnumerable fixedSoilStresses, IEnumerable preConsolidationStresses) + private static void AssertConstructionStages(IEnumerable constructionStages, SoilProfile soilProfile2D, IEnumerable waternets, + IEnumerable fixedSoilStresses, IEnumerable preConsolidationStresses) { Assert.AreEqual(2, constructionStages.Count()); for (var i = 0; i < constructionStages.Count(); i++) { ConstructionStage constructionStage = constructionStages.ElementAt(i); - Assert.AreSame(waternets.ElementAt(i), constructionStage.GeotechnicsData.CurrentWaternet); + Assert.AreSame(waternets.ElementAt(i), constructionStage.Waternet); Assert.AreSame(soilProfile2D, constructionStage.SoilProfile); - Assert.AreEqual(1, constructionStage.MultiplicationFactorsCPhiForUpliftList.Count); - Assert.AreEqual(1.2, constructionStage.MultiplicationFactorsCPhiForUpliftList[0].UpliftFactor); - Assert.AreEqual(0.0, constructionStage.MultiplicationFactorsCPhiForUpliftList[0].MultiplicationFactor); + Assert.AreEqual(1, constructionStage.MultiplicationFactorsCPhiForUplift.Count); + Assert.AreEqual(1.2, constructionStage.MultiplicationFactorsCPhiForUplift.ElementAt(0).UpliftFactor); + Assert.AreEqual(0.0, constructionStage.MultiplicationFactorsCPhiForUplift.ElementAt(0).MultiplicationFactor); } - CollectionAssert.AreEqual(fixedSoilStresses, constructionStages.First().SoilStresses); + CollectionAssert.AreEqual(fixedSoilStresses, constructionStages.First().FixedSoilStresses); CollectionAssert.AreEqual(preConsolidationStresses, constructionStages.First().PreconsolidationStresses); - CollectionAssert.IsEmpty(constructionStages.Last().SoilStresses); + CollectionAssert.IsEmpty(constructionStages.Last().FixedSoilStresses); CollectionAssert.IsEmpty(constructionStages.Last().PreconsolidationStresses); } @@ -317,7 +311,7 @@ OuterLoop = loop }; var kernelWrapper = new UpliftVanKernelWrapper(); - kernelWrapper.SetSoilModel(new List + kernelWrapper.SetSoils(new List { soil }); @@ -368,7 +362,7 @@ } } }); - kernelWrapper.SetSlipPlaneUpliftVan(new SlipPlaneUpliftVan + kernelWrapper.SetUpliftVanCalculationGrid(new SlipPlaneUpliftVan { SlipPlaneLeftGrid = new SlipCircleGrid { @@ -451,7 +445,7 @@ OuterLoop = loop }; var kernelWrapper = new UpliftVanKernelWrapper(); - kernelWrapper.SetSoilModel(new List + kernelWrapper.SetSoils(new List { soil }); @@ -491,15 +485,15 @@ } } }); - kernelWrapper.SetSlipPlaneUpliftVan(new SlipPlaneUpliftVan()); + kernelWrapper.SetUpliftVanCalculationGrid(new SlipPlaneUpliftVan()); kernelWrapper.SetMoveGrid(true); kernelWrapper.SetMaximumSliceWidth(0); kernelWrapper.SetSlipPlaneConstraints(new SlipPlaneConstraints()); return kernelWrapper; } - private static void AssertIrrelevantValues(StabilityModel stabilityModel) + private static void AssertIrrelevantValues(StabilityInput stabilityModel) { Assert.IsNotNull(stabilityModel.BeeswarmOptions); Assert.IsNotNull(stabilityModel.SpencerSlipPlanes); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/TestMacroStabilityInwardsKernelFactory.cs =================================================================== diff -u -r1cedc019c6fb70cddf5dffeade8edde820ecda18 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/TestMacroStabilityInwardsKernelFactory.cs (.../TestMacroStabilityInwardsKernelFactory.cs) (revision 1cedc019c6fb70cddf5dffeade8edde820ecda18) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/TestMacroStabilityInwardsKernelFactory.cs (.../TestMacroStabilityInwardsKernelFactory.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Deltares.MacroStability.WaternetCreator; +using Deltares.MacroStability.CSharpWrapper.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; @@ -52,24 +52,25 @@ /// public WaternetKernelStub LastCreatedWaternetKernel { get; } - public IUpliftVanKernel CreateUpliftVanKernel() + public IUpliftVanKernel CreateUpliftVanKernel(MacroStabilityInput kernelInput) { + LastCreatedUpliftVanKernel.SetInput(kernelInput); return LastCreatedUpliftVanKernel; } - public IWaternetKernel CreateWaternetExtremeKernel(Location location) + public IWaternetKernel CreateWaternetExtremeKernel(MacroStabilityInput kernelInput) { - return CreateWaternetKernel(location); + return CreateWaternetKernel(kernelInput); } - public IWaternetKernel CreateWaternetDailyKernel(Location location) + public IWaternetKernel CreateWaternetDailyKernel(MacroStabilityInput kernelInput) { - return CreateWaternetKernel(location); + return CreateWaternetKernel(kernelInput); } - private IWaternetKernel CreateWaternetKernel(Location location) + private IWaternetKernel CreateWaternetKernel(MacroStabilityInput kernelInput) { - LastCreatedWaternetKernel.SetLocation(location); + LastCreatedWaternetKernel.SetInput(kernelInput); return LastCreatedWaternetKernel; } } Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs =================================================================== diff -u -rba564a2ca0ec7d9ad0c8e5bc2cf05abf4fd7f15b -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs (.../UpliftVanKernelStub.cs) (revision ba564a2ca0ec7d9ad0c8e5bc2cf05abf4fd7f15b) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs (.../UpliftVanKernelStub.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -21,11 +21,10 @@ using System; using System.Collections.Generic; -using Deltares.MacroStability.Data; -using Deltares.MacroStability.Geometry; -using Deltares.MacroStability.Standard; +using Deltares.MacroStability.CSharpWrapper; +using Deltares.MacroStability.CSharpWrapper.Input; +using Deltares.MacroStability.CSharpWrapper.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; -using WtiStabilityWaternet = Deltares.MacroStability.Geometry.Waternet; namespace Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil.Kernels.UpliftVan { @@ -65,174 +64,45 @@ public bool ReturnLogMessages { get; set; } /// - /// Gets the soil model. + /// Gets the . /// - public IList SoilModel { get; private set; } + public MacroStabilityInput KernelInput { get; private set; } - /// - /// Gets the soil profile. - /// - public SoilProfile2D SoilProfile { get; private set; } - - /// - /// Gets an indicator whether a grid should be moved. - /// - public bool MoveGrid { get; private set; } - - /// - /// Gets the maximum slice width. - /// - public double MaximumSliceWidth { get; private set; } - - /// - /// Gets the surface line. - /// - public SurfaceLine2 SurfaceLine { get; private set; } - - /// - /// Gets the slip plane uplift van object. - /// - public SlipPlaneUpliftVan SlipPlaneUpliftVan { get; private set; } - - /// - /// Gets the slip plane constraints object. - /// - public SlipPlaneConstraints SlipPlaneConstraints { get; private set; } - - /// - /// Gets an indicator whether a grid should be automatically determined by the kernel. - /// - public bool GridAutomaticDetermined { get; private set; } - - /// - /// Gets an indicator whether tangent lines should be automatically determined by the kernel. - /// - public bool TangentLinesAutomaticDetermined { get; private set; } - - /// - /// Gets the Waternet daily. - /// - public WtiStabilityWaternet WaternetDaily { get; private set; } - - /// - /// Gets the Waternet extreme. - /// - public WtiStabilityWaternet WaternetExtreme { get; private set; } - - /// - /// Gets the fixed soil stresses. - /// - public IEnumerable SoilStresses { get; private set; } - - /// - /// Gets the preconsolidation stresses. - /// - public IEnumerable PreConsolidationStresses { get; private set; } - - /// - /// Gets an indicator whether forbidden zones should be automatically determined by the kernel. - /// - public bool AutomaticForbiddenZones { get; private set; } - public double FactorOfStability { get; set; } public double ForbiddenZonesXEntryMin { get; set; } public double ForbiddenZonesXEntryMax { get; set; } - public SlidingDualCircle SlidingCurveResult { get; set; } + public DualSlidingCircleMinimumSafetyCurve SlidingCurveResult { get; set; } - public SlipPlaneUpliftVan SlipPlaneResult { get; set; } + public UpliftVanCalculationGrid UpliftVanCalculationGridResult { get; set; } - public IEnumerable CalculationMessages { get; private set; } + public IEnumerable CalculationMessages { get; private set; } - public void SetSlipPlaneUpliftVan(SlipPlaneUpliftVan slipPlaneUpliftVan) + /// + /// Sets the . + /// + /// The input to set. + public void SetInput(MacroStabilityInput input) { - SlipPlaneUpliftVan = slipPlaneUpliftVan; + KernelInput = input; } - public void SetSlipPlaneConstraints(SlipPlaneConstraints slipPlaneConstraints) - { - SlipPlaneConstraints = slipPlaneConstraints; - } - - public void SetSoilModel(IList soilModel) - { - SoilModel = soilModel; - } - - public void SetSoilProfile(SoilProfile2D soilProfile) - { - SoilProfile = soilProfile; - } - - public void SetWaternetDaily(WtiStabilityWaternet waternetDaily) - { - WaternetDaily = waternetDaily; - } - - public void SetWaternetExtreme(WtiStabilityWaternet waternetExtreme) - { - WaternetExtreme = waternetExtreme; - } - - public void SetMoveGrid(bool moveGrid) - { - MoveGrid = moveGrid; - } - - public void SetMaximumSliceWidth(double maximumSliceWidth) - { - MaximumSliceWidth = maximumSliceWidth; - } - - public void SetSurfaceLine(SurfaceLine2 surfaceLine) - { - SurfaceLine = surfaceLine; - } - - public void SetGridAutomaticDetermined(bool gridAutomaticDetermined) - { - GridAutomaticDetermined = gridAutomaticDetermined; - } - - public void SetTangentLinesAutomaticDetermined(bool tangentLinesAutomaticDetermined) - { - TangentLinesAutomaticDetermined = tangentLinesAutomaticDetermined; - } - - public void SetFixedSoilStresses(IEnumerable soilStresses) - { - SoilStresses = soilStresses; - } - - public void SetPreConsolidationStresses(IEnumerable preConsolidationStresses) - { - PreConsolidationStresses = preConsolidationStresses; - } - - public void SetAutomaticForbiddenZones(bool automaticForbiddenZones) - { - AutomaticForbiddenZones = automaticForbiddenZones; - } - public void Calculate() { if (ReturnLogMessages) { CalculationMessages = new[] { - new LogMessage(LogMessageType.Trace, "subject", "Calculation Trace"), - new LogMessage(LogMessageType.Debug, "subject", "Calculation Debug"), - new LogMessage(LogMessageType.Info, "subject", "Calculation Info"), - new LogMessage(LogMessageType.Warning, "subject", "Calculation Warning"), - new LogMessage(LogMessageType.Error, "subject", "Calculation Error"), - new LogMessage(LogMessageType.FatalError, "subject", "Calculation Fatal Error") + CreateMessage(MessageType.Warning, "Calculation Warning"), + CreateMessage(MessageType.Error, "Calculation Error"), + CreateMessage(MessageType.Info, "Calculation Info") }; } else { - CalculationMessages = new LogMessage[0]; + CalculationMessages = new Message[0]; } if (ThrowExceptionOnCalculate) @@ -243,7 +113,7 @@ Calculated = true; } - public IEnumerable Validate() + public IEnumerable Validate() { if (ThrowExceptionOnValidate) { @@ -252,13 +122,21 @@ if (ReturnValidationResults) { - yield return new ValidationResult(ValidationResultType.Warning, "Validation Warning"); - yield return new ValidationResult(ValidationResultType.Error, "Validation Error"); - yield return new ValidationResult(ValidationResultType.Info, "Validation Info"); - yield return new ValidationResult(ValidationResultType.Debug, "Validation Debug"); + yield return CreateMessage(MessageType.Warning, "Validation Warning"); + yield return CreateMessage(MessageType.Error, "Validation Error"); + yield return CreateMessage(MessageType.Info, "Validation Info"); } Validated = true; } + + private static Message CreateMessage(MessageType messageType, string message) + { + return new Message + { + MessageType = messageType, + Content = message + }; + } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/Waternet/WaternetKernelStub.cs =================================================================== diff -u -rddcfe77680566b25a6eac697323787a03ae25e46 -rfe0f11c19023237d7f3629c2206b4fe5eb5e121f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/Waternet/WaternetKernelStub.cs (.../WaternetKernelStub.cs) (revision ddcfe77680566b25a6eac697323787a03ae25e46) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/Waternet/WaternetKernelStub.cs (.../WaternetKernelStub.cs) (revision fe0f11c19023237d7f3629c2206b4fe5eb5e121f) @@ -21,11 +21,10 @@ using System; using System.Collections.Generic; -using Deltares.MacroStability.Geometry; -using Deltares.MacroStability.Standard; -using Deltares.MacroStability.WaternetCreator; +using Deltares.MacroStability.CSharpWrapper.Input; +using Deltares.MacroStability.CSharpWrapper.Output; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; -using WtiStabilityWaternet = Deltares.MacroStability.Geometry.Waternet; +using WtiStabilityWaternet = Deltares.MacroStability.CSharpWrapper.Waternet; namespace Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil.Kernels.Waternet { @@ -60,41 +59,21 @@ public bool ReturnValidationResults { get; set; } /// - /// Gets the location. + /// Gets the . /// - public Location Location { get; private set; } + public MacroStabilityInput KernelInput { get; private set; } - /// - /// Gets the soil profile. - /// - public SoilProfile2D SoilProfile { get; private set; } - - /// - /// Gets the surface line. - /// - public SurfaceLine2 SurfaceLine { get; private set; } - public WtiStabilityWaternet Waternet { get; set; } /// - /// Sets the location. + /// Sets the . /// - /// The to set. - public void SetLocation(Location location) + /// The input to set. + public void SetInput(MacroStabilityInput input) { - Location = location; + KernelInput = input; } - public void SetSoilProfile(SoilProfile2D soilProfile) - { - SoilProfile = soilProfile; - } - - public void SetSurfaceLine(SurfaceLine2 surfaceLine) - { - SurfaceLine = surfaceLine; - } - public void Calculate() { if (ThrowExceptionOnCalculate) @@ -105,7 +84,7 @@ Calculated = true; } - public IEnumerable Validate() + public IEnumerable Validate() { if (ThrowExceptionOnValidate) { @@ -114,13 +93,21 @@ if (ReturnValidationResults) { - yield return new ValidationResult(ValidationResultType.Warning, "Validation Warning"); - yield return new ValidationResult(ValidationResultType.Error, "Validation Error"); - yield return new ValidationResult(ValidationResultType.Info, "Validation Info"); - yield return new ValidationResult(ValidationResultType.Debug, "Validation Debug"); + yield return CreateMessage(MessageType.Warning, "Validation Warning"); + yield return CreateMessage(MessageType.Error, "Validation Error"); + yield return CreateMessage(MessageType.Info, "Validation Info"); } Validated = true; } + + private static Message CreateMessage(MessageType messageType, string message) + { + return new Message + { + MessageType = messageType, + Content = message + }; + } } } \ No newline at end of file