Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs =================================================================== diff -u -rf2eea656d0dcf8ed238cad8822bd7310840b45c4 -r9b68b88ccc29f7a24829149d8f4e098d950f942c --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs (.../WaternetCalculator.cs) (revision f2eea656d0dcf8ed238cad8822bd7310840b45c4) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetCalculator.cs (.../WaternetCalculator.cs) (revision 9b68b88ccc29f7a24829149d8f4e098d950f942c) @@ -20,11 +20,16 @@ // All rights reserved. using System; +using System.Collections.Generic; +using System.Linq; +using Deltares.WTIStability.Data.Geo; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Output; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Output; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; +using SoilLayer = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilLayer; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet { @@ -81,6 +86,7 @@ private IWaternetKernel CalculateWaternet() { IWaternetKernel waternetKernel = CreateWaternetKernel(); + SetinputOnKernel(waternetKernel); try { @@ -93,5 +99,23 @@ return waternetKernel; } + + private void SetinputOnKernel(IWaternetKernel waternetKernel) + { + Soil[] soils = SoilCreator.Create(Input.SoilProfile); + Dictionary layersWithSoils = + Input.SoilProfile.Layers + .Zip(soils, (layer, soil) => new + { + layer, + soil + }) + .ToDictionary(x => x.layer, x => x.soil); + + waternetKernel.SoilModel = SoilModelCreator.Create(soils); + waternetKernel.SoilProfile = SoilProfileCreator.Create(Input.SoilProfile, layersWithSoils); + waternetKernel.Location = WaternetStabilityLocationCreator.Create(Input); + waternetKernel.SurfaceLine = SurfaceLineCreator.Create(Input.SurfaceLine, Input.LandwardDirection); + } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs =================================================================== diff -u -r4061c28197adfa0f3dc171c74fbe300ecb3a89c4 -r9b68b88ccc29f7a24829149d8f4e098d950f942c --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs (.../WaternetDailyCalculator.cs) (revision 4061c28197adfa0f3dc171c74fbe300ecb3a89c4) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetDailyCalculator.cs (.../WaternetDailyCalculator.cs) (revision 9b68b88ccc29f7a24829149d8f4e098d950f942c) @@ -20,14 +20,9 @@ // All rights reserved. using System; -using System.Collections.Generic; -using System.Linq; -using Deltares.WTIStability.Data.Geo; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; -using SoilLayer = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilLayer; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet { @@ -44,29 +39,12 @@ /// The factory responsible for creating the Waternet kernel. /// Thrown when or /// is null. - public WaternetDailyCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) + public WaternetDailyCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) : base(input, factory) {} protected override IWaternetKernel CreateWaternetKernel() { - IWaternetKernel waternetKernel = Factory.CreateWaternetDailyKernel(); - - Soil[] soils = SoilCreator.Create(Input.SoilProfile); - Dictionary layersWithSoils = - Input.SoilProfile.Layers - .Zip(soils, (layer, soil) => new - { - layer, - soil - }) - .ToDictionary(x => x.layer, x => x.soil); - - waternetKernel.SoilModel = SoilModelCreator.Create(soils); - waternetKernel.SoilProfile = SoilProfileCreator.Create(Input.SoilProfile, layersWithSoils); - waternetKernel.Location = WaternetStabilityLocationCreator.Create(Input); - waternetKernel.SurfaceLine = SurfaceLineCreator.Create(Input.SurfaceLine, Input.LandwardDirection); - - return waternetKernel; + return Factory.CreateWaternetDailyKernel(); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs =================================================================== diff -u -r4061c28197adfa0f3dc171c74fbe300ecb3a89c4 -r9b68b88ccc29f7a24829149d8f4e098d950f942c --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs (.../WaternetExtremeCalculator.cs) (revision 4061c28197adfa0f3dc171c74fbe300ecb3a89c4) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/WaternetExtremeCalculator.cs (.../WaternetExtremeCalculator.cs) (revision 9b68b88ccc29f7a24829149d8f4e098d950f942c) @@ -20,14 +20,9 @@ // All rights reserved. using System; -using System.Collections.Generic; -using System.Linq; -using Deltares.WTIStability.Data.Geo; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet.Input; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.Waternet; -using SoilLayer = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.SoilLayer; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet { @@ -44,29 +39,12 @@ /// The factory responsible for creating the Waternet kernel. /// Thrown when or /// is null. - public WaternetExtremeCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) + public WaternetExtremeCalculator(WaternetCalculatorInput input, IMacroStabilityInwardsKernelFactory factory) : base(input, factory) {} protected override IWaternetKernel CreateWaternetKernel() { - IWaternetKernel waternetKernel = Factory.CreateWaternetExtremeKernel(); - - Soil[] soils = SoilCreator.Create(Input.SoilProfile); - Dictionary layersWithSoils = - Input.SoilProfile.Layers - .Zip(soils, (layer, soil) => new - { - layer, - soil - }) - .ToDictionary(x => x.layer, x => x.soil); - - waternetKernel.SoilModel = SoilModelCreator.Create(soils); - waternetKernel.SoilProfile = SoilProfileCreator.Create(Input.SoilProfile, layersWithSoils); - waternetKernel.Location = WaternetStabilityLocationCreator.Create(Input); - waternetKernel.SurfaceLine = SurfaceLineCreator.Create(Input.SurfaceLine, Input.LandwardDirection); - - return waternetKernel; + return Factory.CreateWaternetExtremeKernel(); } } } \ No newline at end of file