Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs =================================================================== diff -u -r67d3117861b4e393093753aaa3e9a28125a4a74f -re53ef4c278a378cb5b3973dc939a19896f94b1cc --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision 67d3117861b4e393093753aaa3e9a28125a4a74f) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/MacroStabilityInwardsCalculator.cs (.../MacroStabilityInwardsCalculator.cs) (revision e53ef4c278a378cb5b3973dc939a19896f94b1cc) @@ -21,7 +21,11 @@ using System; using System.Collections.Generic; +using System.Linq; +using Deltares.WTIStability.Data.Geo; +using Deltares.WTIStability.Data.Standard; using Ringtoets.MacroStabilityInwards.KernelWrapper.SubCalculator; +using Ringtoets.MacroStabilityInwards.Primitives; namespace Ringtoets.MacroStabilityInwards.KernelWrapper { @@ -86,10 +90,36 @@ private IUpliftVanCalculator CreateUpliftVanCalculator() { IUpliftVanCalculator calculator = factory.CreateUpliftVanCalculator(); - calculator.SoilProfile = input.SoilProfile; + Soil[] soils = MacroStabilityInwardsSoilCreator.Create(input.SoilProfile); + calculator.SoilModel = CreateSoilModel(soils); + calculator.SoilProfile = CreateSoilProfile(input.SoilProfile.LayersUnderSurfaceLine.ToArray(), soils); return calculator; } + private SoilProfile2D CreateSoilProfile(IList layers, IList soils) + { + var profile = new SoilProfile2D(); + + for (int i = 0; i < layers.Count; i++) + { + profile.Surfaces.Add(new SoilLayer2D + { + IsAquifer = layers[i].Properties.IsAquifer, + Soil = soils[i] + }); + } + + return profile; + } + + private SoilModel CreateSoilModel(IEnumerable soils) + { + var soilModel = new SoilModel(); + soilModel.Soils.AddRange(soils); + + return soilModel; + } + /// /// Returns a list of validation messages. The validation messages are based on the values of the /// which was provided to this and are determined by the kernel.