private static WaternetCreatorInput CreateBaseWaternetCreatorInput(UpliftVanCalculatorInput input) { return(new WaternetCreatorInput { DikeSoilScenario = WaternetCreatorInputHelper.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, UnitWeightWater = input.WaterVolumetricWeight }); }
/// <summary> /// Creates a <see cref="WaternetCreatorInput"/> based on the given <paramref name="input"/> /// which can be used by <see cref="IWaternetKernel"/>. /// </summary> /// <param name="input">The <see cref="WaternetCalculatorInput"/> to get the information from.</param> /// <returns>A new <see cref="WaternetCreatorInput"/> with the given information from <paramref name="input"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="input"/> is <c>null</c>.</exception> /// <exception cref="InvalidEnumArgumentException">Thrown when <see cref="WaternetCalculatorInput.DikeSoilScenario"/> /// is an invalid value.</exception> /// <exception cref="NotSupportedException">Thrown when <see cref="WaternetCalculatorInput.DikeSoilScenario"/> /// is a valid value, but unsupported.</exception> public static WaternetCreatorInput Create(WaternetCalculatorInput input) { if (input == null) { throw new ArgumentNullException(nameof(input)); } return(new WaternetCreatorInput { DikeSoilScenario = WaternetCreatorInputHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), WaterLevelRiver = input.AssessmentLevel, HeadInPlLine3 = input.AssessmentLevel, HeadInPlLine4 = 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, UnitWeightWater = input.WaterVolumetricWeight }); }