Index: Riskeer/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs (.../AssessmentSectionCalculationActivityFactory.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs (.../AssessmentSectionCalculationActivityFactory.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -71,7 +71,7 @@ if (assessmentSection.MacroStabilityInwards.IsRelevant) { - activities.AddRange(MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.MacroStabilityInwards, assessmentSection)); + activities.AddRange(MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.MacroStabilityInwards, assessmentSection.MacroStabilityInwards.GeneralInput, assessmentSection)); } if (assessmentSection.StabilityStoneCover.IsRelevant) Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs =================================================================== diff -u -r25a925a4c8abc38a558698fd67efecaede992b2d -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision 25a925a4c8abc38a558698fd67efecaede992b2d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -51,6 +51,7 @@ /// Thrown when an error occurs /// during the validation. public static IEnumerable ValidateExtreme(IMacroStabilityInwardsWaternetInput input, + IGeneralMacroStabilityInwardsWaternetInput generalInput, RoundedDouble assessmentLevel) { if (input == null) @@ -60,7 +61,7 @@ IWaternetCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance .CreateWaternetExtremeCalculator( - CreateExtremeCalculatorInput(input, assessmentLevel), + CreateExtremeCalculatorInput(input, generalInput, assessmentLevel), MacroStabilityInwardsKernelWrapperFactory.Instance); try @@ -83,7 +84,7 @@ /// is null. /// Thrown when an error occurs /// during the validation. - public static IEnumerable ValidateDaily(IMacroStabilityInwardsWaternetInput input) + public static IEnumerable ValidateDaily(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput) { if (input == null) { @@ -92,7 +93,7 @@ IWaternetCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance .CreateWaternetDailyCalculator( - CreateDailyCalculatorInput(input), + CreateDailyCalculatorInput(input, generalInput), MacroStabilityInwardsKernelWrapperFactory.Instance); try @@ -117,6 +118,7 @@ /// Thrown when /// is null. public static MacroStabilityInwardsWaternet CalculateExtreme(IMacroStabilityInwardsWaternetInput input, + IGeneralMacroStabilityInwardsWaternetInput generalInput, RoundedDouble assessmentLevel) { if (input == null) @@ -126,7 +128,7 @@ IWaternetCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance .CreateWaternetExtremeCalculator( - CreateExtremeCalculatorInput(input, assessmentLevel), + CreateExtremeCalculatorInput(input,generalInput, assessmentLevel), MacroStabilityInwardsKernelWrapperFactory.Instance); try @@ -151,7 +153,7 @@ /// could not be calculated. /// Thrown when /// is null. - public static MacroStabilityInwardsWaternet CalculateDaily(IMacroStabilityInwardsWaternetInput input) + public static MacroStabilityInwardsWaternet CalculateDaily(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput) { if (input == null) { @@ -160,7 +162,7 @@ IWaternetCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance .CreateWaternetDailyCalculator( - CreateDailyCalculatorInput(input), + CreateDailyCalculatorInput(input, generalInput), MacroStabilityInwardsKernelWrapperFactory.Instance); try @@ -175,9 +177,9 @@ } } - private static WaternetCalculatorInput CreateDailyCalculatorInput(IMacroStabilityInwardsWaternetInput input) + private static WaternetCalculatorInput CreateDailyCalculatorInput(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput) { - WaternetCalculatorInput.ConstructionProperties properties = CreateCalculatorInputConstructionProperties(input); + WaternetCalculatorInput.ConstructionProperties properties = CreateCalculatorInputConstructionProperties(input, generalInput); properties.PhreaticLineOffsets = PhreaticLineOffsetsConverter.Convert(input.LocationInputDaily); properties.AssessmentLevel = input.WaterLevelRiverAverage; properties.WaterLevelPolder = input.LocationInputDaily.WaterLevelPolder; @@ -186,9 +188,9 @@ return new WaternetCalculatorInput(properties); } - private static WaternetCalculatorInput CreateExtremeCalculatorInput(IMacroStabilityInwardsWaternetInput input, RoundedDouble assessmentLevel) + private static WaternetCalculatorInput CreateExtremeCalculatorInput(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput, RoundedDouble assessmentLevel) { - WaternetCalculatorInput.ConstructionProperties properties = CreateCalculatorInputConstructionProperties(input); + WaternetCalculatorInput.ConstructionProperties properties = CreateCalculatorInputConstructionProperties(input, generalInput); properties.PhreaticLineOffsets = PhreaticLineOffsetsConverter.Convert(input.LocationInputExtreme); properties.AssessmentLevel = assessmentLevel; properties.WaterLevelPolder = input.LocationInputExtreme.WaterLevelPolder; @@ -197,7 +199,7 @@ return new WaternetCalculatorInput(properties); } - private static WaternetCalculatorInput.ConstructionProperties CreateCalculatorInputConstructionProperties(IMacroStabilityInwardsWaternetInput input) + private static WaternetCalculatorInput.ConstructionProperties CreateCalculatorInputConstructionProperties(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput) { return new WaternetCalculatorInput.ConstructionProperties { @@ -214,7 +216,8 @@ LeakageLengthInwardsPhreaticLine4 = input.LeakageLengthInwardsPhreaticLine4, PiezometricHeadPhreaticLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, PiezometricHeadPhreaticLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, - AdjustPhreaticLine3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift + AdjustPhreaticLine3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift, + WaterVolumetricWeight = generalInput.WaterVolumetricWeight }; } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/DerivedMacroStabilityInwardsInput.cs =================================================================== diff -u -r838734d6ff0b1fcc80b430fc3e51dd4dea3b7b9c -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/DerivedMacroStabilityInwardsInput.cs (.../DerivedMacroStabilityInwardsInput.cs) (revision 838734d6ff0b1fcc80b430fc3e51dd4dea3b7b9c) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/DerivedMacroStabilityInwardsInput.cs (.../DerivedMacroStabilityInwardsInput.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -38,15 +38,15 @@ /// The assessment level at stake. /// Thrown when is null. /// Returns the corresponding derived Waternet value. - public static MacroStabilityInwardsWaternet GetWaternetExtreme(MacroStabilityInwardsInput input, RoundedDouble assessmentLevel) + public static MacroStabilityInwardsWaternet GetWaternetExtreme(MacroStabilityInwardsInput input, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble assessmentLevel) { if (input == null) { throw new ArgumentNullException(nameof(input)); } return input.SoilProfileUnderSurfaceLine != null - ? WaternetCalculationService.CalculateExtreme(input, assessmentLevel) + ? WaternetCalculationService.CalculateExtreme(input, generalInput, assessmentLevel) : new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]); } @@ -57,15 +57,15 @@ /// The input to calculate the Waternet for. /// Thrown when is null. /// Returns the corresponding derived Waternet value. - public static MacroStabilityInwardsWaternet GetWaternetDaily(MacroStabilityInwardsInput input) + public static MacroStabilityInwardsWaternet GetWaternetDaily(MacroStabilityInwardsInput input, GeneralMacroStabilityInwardsInput generalInput) { if (input == null) { throw new ArgumentNullException(nameof(input)); } return input.SoilProfileUnderSurfaceLine != null - ? WaternetCalculationService.CalculateDaily(input) + ? WaternetCalculationService.CalculateDaily(input, generalInput) : new MacroStabilityInwardsWaternet(new MacroStabilityInwardsPhreaticLine[0], new MacroStabilityInwardsWaternetLine[0]); } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/GeneralMacroStabilityInwardsInput.cs =================================================================== diff -u -rcb960ce7f5fd9a9402c7335c4393b03805b97072 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/GeneralMacroStabilityInwardsInput.cs (.../GeneralMacroStabilityInwardsInput.cs) (revision cb960ce7f5fd9a9402c7335c4393b03805b97072) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Data/GeneralMacroStabilityInwardsInput.cs (.../GeneralMacroStabilityInwardsInput.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -19,13 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Riskeer.MacroStabilityInwards.Primitives; + namespace Riskeer.MacroStabilityInwards.Data { /// /// Class that holds all the overarching macro stability inwards calculation /// input parameters, e.g. the values that apply for all calculations. /// - public class GeneralMacroStabilityInwardsInput + public class GeneralMacroStabilityInwardsInput : IGeneralMacroStabilityInwardsWaternetInput { /// /// Creates a new instance of . Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -256,7 +256,7 @@ { get { - return new MacroStabilityInwardsWaterStressesProperties(data.WrappedData, GetEffectiveAssessmentLevel(), propertyChangeHandler); + return new MacroStabilityInwardsWaterStressesProperties(data.WrappedData, data.FailureMechanism.GeneralInput, GetEffectiveAssessmentLevel(), propertyChangeHandler); } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressLinesProperties.cs =================================================================== diff -u -rbbf5d8fd06b31fae8e3310d8eda12b7cf0b9fa37 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressLinesProperties.cs (.../MacroStabilityInwardsWaterStressLinesProperties.cs) (revision bbf5d8fd06b31fae8e3310d8eda12b7cf0b9fa37) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressLinesProperties.cs (.../MacroStabilityInwardsWaterStressLinesProperties.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -40,21 +40,23 @@ private const int waternetDailyPropertyIndex = 2; private readonly RoundedDouble assessmentLevel; + private GeneralMacroStabilityInwardsInput generalInput; /// /// Creates a new instance of . /// /// The data of the properties. /// The assessment level at stake. /// Thrown when is null. - public MacroStabilityInwardsWaterStressLinesProperties(MacroStabilityInwardsInput data, RoundedDouble assessmentLevel) + public MacroStabilityInwardsWaterStressLinesProperties(MacroStabilityInwardsInput data, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble assessmentLevel) { if (data == null) { throw new ArgumentNullException(nameof(data)); } this.data = data; + this.generalInput = generalInput; this.assessmentLevel = assessmentLevel; } @@ -67,7 +69,7 @@ { get { - return new MacroStabilityInwardsWaternetProperties(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(data, assessmentLevel)); + return new MacroStabilityInwardsWaternetProperties(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(data, generalInput, assessmentLevel)); } } @@ -80,7 +82,7 @@ { get { - return new MacroStabilityInwardsWaternetProperties(DerivedMacroStabilityInwardsInput.GetWaternetDaily(data)); + return new MacroStabilityInwardsWaternetProperties(DerivedMacroStabilityInwardsInput.GetWaternetDaily(data, generalInput)); } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs =================================================================== diff -u -rbbf5d8fd06b31fae8e3310d8eda12b7cf0b9fa37 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs (.../MacroStabilityInwardsWaterStressesProperties.cs) (revision bbf5d8fd06b31fae8e3310d8eda12b7cf0b9fa37) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsWaterStressesProperties.cs (.../MacroStabilityInwardsWaterStressesProperties.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -54,6 +54,7 @@ private const int locationDailyPropertyIndex = 13; private const int waterStressLinesPropertyIndex = 14; + private readonly GeneralMacroStabilityInwardsInput generalInput; private readonly RoundedDouble assessmentLevel; private readonly IObservablePropertyChangeHandler propertyChangeHandler; @@ -66,6 +67,7 @@ /// Thrown when or /// is null. public MacroStabilityInwardsWaterStressesProperties(MacroStabilityInwardsInput data, + GeneralMacroStabilityInwardsInput generalInput, RoundedDouble assessmentLevel, IObservablePropertyChangeHandler propertyChangeHandler) { @@ -80,6 +82,7 @@ } this.data = data; + this.generalInput = generalInput; this.assessmentLevel = assessmentLevel; this.propertyChangeHandler = propertyChangeHandler; } @@ -299,7 +302,7 @@ { get { - return new MacroStabilityInwardsWaterStressLinesProperties(data, assessmentLevel); + return new MacroStabilityInwardsWaterStressLinesProperties(data, generalInput, assessmentLevel); } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs =================================================================== diff -u -r356423bfc298b67f53cf5b7c78765e9f96fa9295 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 356423bfc298b67f53cf5b7c78765e9f96fa9295) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -75,6 +75,7 @@ private readonly List soilLayerChartDataLookup; private MacroStabilityInwardsCalculationScenario data; + private readonly GeneralMacroStabilityInwardsInput generalInput; private IMacroStabilityInwardsSoilProfile currentSoilProfile; private MacroStabilityInwardsSurfaceLine currentSurfaceLine; @@ -91,6 +92,7 @@ /// obtaining the hydraulic boundary location calculation. /// Thrown when any input parameter is null. public MacroStabilityInwardsInputView(MacroStabilityInwardsCalculationScenario data, + GeneralMacroStabilityInwardsInput generalInput, IAssessmentSection assessmentSection, Func getHydraulicBoundaryLocationCalculationFunc) { @@ -110,6 +112,7 @@ } this.data = data; + this.generalInput = generalInput; this.getHydraulicBoundaryLocationCalculationFunc = getHydraulicBoundaryLocationCalculationFunc; InitializeComponent(); @@ -254,8 +257,8 @@ SetSurfaceLineChartData(surfaceLine); SetSoilProfileChartData(surfaceLine, soilProfile); - SetWaternetExtremeChartData(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(macroStabilityInwardsInput, GetEffectiveAssessmentLevel()), surfaceLine); - SetWaternetDailyChartData(DerivedMacroStabilityInwardsInput.GetWaternetDaily(macroStabilityInwardsInput), surfaceLine); + SetWaternetExtremeChartData(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(macroStabilityInwardsInput, generalInput, GetEffectiveAssessmentLevel()), surfaceLine); + SetWaternetDailyChartData(DerivedMacroStabilityInwardsInput.GetWaternetDaily(macroStabilityInwardsInput, generalInput), surfaceLine); MacroStabilityInwardsGridDeterminationType gridDeterminationType = macroStabilityInwardsInput.GridDeterminationType; MacroStabilityInwardsGrid leftGrid = macroStabilityInwardsInput.LeftGrid; Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs =================================================================== diff -u -r502628993928a1e34023af884433fd19ebac2adb -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 502628993928a1e34023af884433fd19ebac2adb) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -92,6 +92,7 @@ private readonly IDictionary waternetLineDailyLookup; private MacroStabilityInwardsCalculationScenario data; + private GeneralMacroStabilityInwardsInput generalInput; private MacroStabilityInwardsSurfaceLine currentSurfaceLine; private IMacroStabilityInwardsSoilProfile currentSoilProfile; @@ -105,6 +106,7 @@ /// for obtaining the normative assessment level. /// Thrown when any input parameter is null. public MacroStabilityInwardsOutputChartControl(MacroStabilityInwardsCalculationScenario data, + GeneralMacroStabilityInwardsInput generalInput, Func getNormativeAssessmentLevelFunc) { if (data == null) @@ -118,6 +120,7 @@ } this.data = data; + this.generalInput = generalInput; this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc; InitializeComponent(); @@ -297,8 +300,8 @@ SetSoilProfileChartData(); } - SetWaternetExtremeChartData(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(input, GetEffectiveAssessmentLevel())); - SetWaternetDailyChartData(DerivedMacroStabilityInwardsInput.GetWaternetDaily(input)); + SetWaternetExtremeChartData(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(input, generalInput, GetEffectiveAssessmentLevel())); + SetWaternetDailyChartData(DerivedMacroStabilityInwardsInput.GetWaternetDaily(input, generalInput)); if (data.Output != null) { Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.Designer.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.Designer.cs (.../MacroStabilityInwardsOutputView.Designer.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.Designer.cs (.../MacroStabilityInwardsOutputView.Designer.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -39,7 +39,7 @@ private void InitializeComponent() { this.splitContainer = new System.Windows.Forms.SplitContainer(); - this.macroStabilityInwardsOutputChartControl = new Riskeer.MacroStabilityInwards.Forms.Views.MacroStabilityInwardsOutputChartControl(data, getNormativeAssessmentLevelFunc); + this.macroStabilityInwardsOutputChartControl = new Riskeer.MacroStabilityInwards.Forms.Views.MacroStabilityInwardsOutputChartControl(data, generalInput, getNormativeAssessmentLevelFunc); this.slicesTable = new Riskeer.MacroStabilityInwards.Forms.Views.MacroStabilityInwardsSlicesTable(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); this.splitContainer.Panel1.SuspendLayout(); Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.cs (.../MacroStabilityInwardsOutputView.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputView.cs (.../MacroStabilityInwardsOutputView.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -39,6 +39,7 @@ private readonly Func getNormativeAssessmentLevelFunc; private MacroStabilityInwardsCalculationScenario data; + private readonly GeneralMacroStabilityInwardsInput generalInput; /// /// Creates a new instance of . @@ -47,6 +48,7 @@ /// for obtaining the normative assessment level. /// Thrown when any input parameter is null. public MacroStabilityInwardsOutputView(MacroStabilityInwardsCalculationScenario data, + GeneralMacroStabilityInwardsInput generalInput, Func getNormativeAssessmentLevelFunc) { if (data == null) @@ -60,6 +62,7 @@ } this.data = data; + this.generalInput = generalInput; this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc; InitializeComponent(); Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationExporter.cs =================================================================== diff -u -rcd04c831419b71c6a002df97a597f381a6a02855 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationExporter.cs (.../MacroStabilityInwardsCalculationExporter.cs) (revision cd04c831419b71c6a002df97a597f381a6a02855) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationExporter.cs (.../MacroStabilityInwardsCalculationExporter.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -48,6 +48,7 @@ private static readonly ILog log = LogManager.GetLogger(typeof(MacroStabilityInwardsCalculationExporter)); private readonly MacroStabilityInwardsCalculation calculation; + private readonly GeneralMacroStabilityInwardsInput generalInput; private readonly IPersistenceFactory persistenceFactory; private readonly string filePath; private readonly Func getNormativeAssessmentLevelFunc; @@ -71,6 +72,7 @@ /// does not end with a directory or path separator (empty file name). /// public MacroStabilityInwardsCalculationExporter(MacroStabilityInwardsCalculation calculation, + GeneralMacroStabilityInwardsInput generalInput, IPersistenceFactory persistenceFactory, string filePath, Func getNormativeAssessmentLevelFunc) { @@ -92,6 +94,7 @@ IOUtils.ValidateFilePath(filePath); this.calculation = calculation; + this.generalInput = generalInput; this.persistenceFactory = persistenceFactory; this.filePath = filePath; this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc; @@ -106,7 +109,7 @@ { ValidateData(); - PersistableDataModel persistableDataModel = PersistableDataModelFactory.Create(calculation, getNormativeAssessmentLevelFunc, filePath); + PersistableDataModel persistableDataModel = PersistableDataModelFactory.Create(calculation, generalInput, getNormativeAssessmentLevelFunc, filePath); string tempFilePath = $"{filePath}.temp"; Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs =================================================================== diff -u -r62d53cd1f3e85be9b340e24d3a84d71493a8fe71 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 62d53cd1f3e85be9b340e24d3a84d71493a8fe71) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Exporters/MacroStabilityInwardsCalculationGroupExporter.cs (.../MacroStabilityInwardsCalculationGroupExporter.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -45,6 +45,7 @@ private static readonly ILog log = LogManager.GetLogger(typeof(MacroStabilityInwardsCalculationGroupExporter)); private readonly CalculationGroup calculationGroup; + private readonly GeneralMacroStabilityInwardsInput generalInput; private readonly IPersistenceFactory persistenceFactory; private readonly string folderPath; private readonly string fileExtension; @@ -68,7 +69,7 @@ /// does not contain an invalid character, /// is not too long. /// - public MacroStabilityInwardsCalculationGroupExporter(CalculationGroup calculationGroup, IPersistenceFactory persistenceFactory, string folderPath, + public MacroStabilityInwardsCalculationGroupExporter(CalculationGroup calculationGroup, GeneralMacroStabilityInwardsInput generalInput, IPersistenceFactory persistenceFactory, string folderPath, string fileExtension, Func getNormativeAssessmentLevelFunc) { if (calculationGroup == null) @@ -89,6 +90,7 @@ IOUtils.ValidateFolderPath(folderPath); this.calculationGroup = calculationGroup; + this.generalInput = generalInput; this.persistenceFactory = persistenceFactory; this.folderPath = folderPath; this.fileExtension = fileExtension; @@ -119,7 +121,7 @@ log.WarnFormat(Resources.MacroStabilityInwardsCalculationGroupExporter_Export_Calculation_0_has_no_output_and_is_skipped, calculation.Name); break; case MacroStabilityInwardsCalculation calculation: - continueExport = ExportCalculation(calculation, currentFolderPath, exportedCalculations); + continueExport = ExportCalculation(calculation, generalInput, currentFolderPath, exportedCalculations); break; } @@ -161,14 +163,14 @@ return true; } - private bool ExportCalculation(MacroStabilityInwardsCalculation calculation, string currentFolderPath, IDictionary exportedCalculations) + private bool ExportCalculation(MacroStabilityInwardsCalculation calculation, GeneralMacroStabilityInwardsInput generalInput, string currentFolderPath, IDictionary exportedCalculations) { log.InfoFormat(CoreCommonGuiResources.GuiExportHandler_ExportItemUsingDialog_Start_exporting_DataType_0_, calculation.Name); string uniqueName = NamingHelper.GetUniqueName(exportedCalculations, ((ICalculationBase)calculation).Name, c => c.Value); string filePath = GetCalculationFilePath(currentFolderPath, uniqueName); - var exporter = new MacroStabilityInwardsCalculationExporter(calculation, persistenceFactory, filePath, () => getNormativeAssessmentLevelFunc(calculation)); + var exporter = new MacroStabilityInwardsCalculationExporter(calculation, generalInput, persistenceFactory, filePath, () => getNormativeAssessmentLevelFunc(calculation)); bool exportSucceeded = exporter.Export(); if (!exportSucceeded) Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableDataModelFactory.cs =================================================================== diff -u -rb9ceec3c71d972d3d467c1520033ac48cf77b2e9 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableDataModelFactory.cs (.../PersistableDataModelFactory.cs) (revision b9ceec3c71d972d3d467c1520033ac48cf77b2e9) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableDataModelFactory.cs (.../PersistableDataModelFactory.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -45,6 +45,7 @@ /// Thrown when /// has no output. public static PersistableDataModel Create(MacroStabilityInwardsCalculation calculation, + GeneralMacroStabilityInwardsInput generalInput, Func getNormativeAssessmentLevelFunc, string filePath) { @@ -77,8 +78,8 @@ Geometry = PersistableGeometryFactory.Create(soilProfile, idFactory, registry), SoilLayers = PersistableSoilLayerCollectionFactory.Create(soilProfile, idFactory, registry), Waternets = PersistableWaternetFactory.Create( - DerivedMacroStabilityInwardsInput.GetWaternetDaily(input), - DerivedMacroStabilityInwardsInput.GetWaternetExtreme(input, GetEffectiveAssessmentLevel(input, getNormativeAssessmentLevelFunc)), + DerivedMacroStabilityInwardsInput.GetWaternetDaily(input, generalInput), + DerivedMacroStabilityInwardsInput.GetWaternetExtreme(input, generalInput, GetEffectiveAssessmentLevel(input, getNormativeAssessmentLevelFunc)), idFactory, registry), WaternetCreatorSettings = PersistableWaternetCreatorSettingsFactory.Create(input, GetEffectiveAssessmentLevel(input, getNormativeAssessmentLevelFunc), idFactory, registry), States = PersistableStateFactory.Create(soilProfile, idFactory, registry), Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs =================================================================== diff -u -r25a925a4c8abc38a558698fd67efecaede992b2d -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs (.../UpliftVanCalculatorInput.cs) (revision 25a925a4c8abc38a558698fd67efecaede992b2d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs (.../UpliftVanCalculatorInput.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -108,6 +108,7 @@ DikeSoilScenario = properties.DikeSoilScenario; MoveGrid = properties.MoveGrid; MaximumSliceWidth = properties.MaximumSliceWidth; + WaterVolumetricWeight = properties.WaterVolumetricWeight; } /// @@ -136,6 +137,7 @@ PenetrationLengthDaily = double.NaN; DikeSoilScenario = MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay; MaximumSliceWidth = double.NaN; + WaterVolumetricWeight = double.NaN; } #region Properties @@ -280,6 +282,12 @@ /// public double MaximumSliceWidth { internal get; set; } + /// + /// Gets or sets the volumetric weight of water. + /// [m] + /// + public double WaterVolumetricWeight { internal get; set; } + #endregion } @@ -424,6 +432,12 @@ /// [m] /// public double MaximumSliceWidth { get; } + + /// + /// Gets the maximum slice width. + /// [m] + /// + public double WaterVolumetricWeight { get; } #endregion } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Input/WaternetCalculatorInput.cs =================================================================== diff -u -r25a925a4c8abc38a558698fd67efecaede992b2d -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Input/WaternetCalculatorInput.cs (.../WaternetCalculatorInput.cs) (revision 25a925a4c8abc38a558698fd67efecaede992b2d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/Waternet/Input/WaternetCalculatorInput.cs (.../WaternetCalculatorInput.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -89,6 +89,7 @@ PenetrationLength = properties.PenetrationLength; AdjustPhreaticLine3And4ForUplift = properties.AdjustPhreaticLine3And4ForUplift; DikeSoilScenario = properties.DikeSoilScenario; + WaterVolumetricWeight = properties.WaterVolumetricWeight; } /// @@ -114,6 +115,7 @@ PiezometricHeadPhreaticLine2Inwards = double.NaN; PenetrationLength = double.NaN; DikeSoilScenario = MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay; + WaterVolumetricWeight = double.NaN; } #region Properties @@ -220,6 +222,12 @@ /// public double PenetrationLength { internal get; set; } + /// + /// Gets or sets the penetration length. + /// [m] + /// + public double WaterVolumetricWeight { internal get; set; } + #endregion } @@ -327,6 +335,12 @@ /// public double PenetrationLength { get; } + /// + /// Gets the volumetric weight of water + /// [kN/m3] + /// + public double WaterVolumetricWeight { get; } + #endregion } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs =================================================================== diff -u -rca2e4b3a0824dd8b142fae068b29ee2fbbd1069e -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (.../UpliftVanWaternetCreatorInputCreator.cs) (revision ca2e4b3a0824dd8b142fae068b29ee2fbbd1069e) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (.../UpliftVanWaternetCreatorInputCreator.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -116,7 +116,7 @@ LeakageLengthInwardsPl4 = input.LeakageLengthInwardsPhreaticLine4, HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, - UnitWeightWater = 9.81 + UnitWeightWater = input.WaterVolumetricWeight }; } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs =================================================================== diff -u -rfb28e8a8ebbe1645f52806c788195fd49444626a -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (.../WaternetCreatorInputCreator.cs) (revision fb28e8a8ebbe1645f52806c788195fd49444626a) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (.../WaternetCreatorInputCreator.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -78,7 +78,7 @@ HeadInPlLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards, HeadInPlLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards, PenetrationLength = input.PenetrationLength, - UnitWeightWater = 9.81 + UnitWeightWater = input.WaterVolumetricWeight }; } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs =================================================================== diff -u -r8dd568726bfcaf1f2c517f6e7c76ebe2b0f7e8b1 -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 8dd568726bfcaf1f2c517f6e7c76ebe2b0f7e8b1) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -173,7 +173,7 @@ Name = Resources.MacroStabilityInwardsCalculationExporter_DisplayName, Extension = Resources.Stix_file_filter_extension, CreateFileExporter = (context, filePath) => new MacroStabilityInwardsCalculationExporter( - context.WrappedData, new PersistenceFactory(), filePath, + context.WrappedData, context.FailureMechanism.GeneralInput, new PersistenceFactory(), filePath, () => GetNormativeAssessmentLevel(context.AssessmentSection, context.WrappedData)), IsEnabled = context => context.WrappedData.HasOutput, GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), new FileFilterGenerator(Resources.Stix_file_filter_extension, @@ -184,7 +184,7 @@ { Name = Resources.MacroStabilityInwardsCalculationExporter_DisplayName, Extension = Resources.Stix_file_filter_extension, - CreateFileExporter = (context, folderPath) => new MacroStabilityInwardsCalculationGroupExporter(context.WrappedData, new PersistenceFactory(), folderPath, Resources.Stix_file_filter_extension, + CreateFileExporter = (context, folderPath) => new MacroStabilityInwardsCalculationGroupExporter(context.WrappedData, context.FailureMechanism.GeneralInput, new PersistenceFactory(), folderPath, Resources.Stix_file_filter_extension, calculation => GetNormativeAssessmentLevel(context.AssessmentSection, calculation)), IsEnabled = context => context.WrappedData.HasOutput(), GetExportPath = () => ExportHelper.GetFolderPath(GetInquiryHelper()) @@ -276,6 +276,7 @@ Image = RiskeerCommonFormsResources.GenericInputOutputIcon, CloseForData = CloseInputViewForData, CreateInstance = context => new MacroStabilityInwardsInputView(context.MacroStabilityInwardsCalculation, + context.FailureMechanism.GeneralInput, context.AssessmentSection, () => context.AssessmentSection.GetNormativeHydraulicBoundaryLocationCalculation(context.WrappedData.HydraulicBoundaryLocation)) }; @@ -295,7 +296,7 @@ GetViewName = (view, context) => RiskeerCommonFormsResources.CalculationOutput_DisplayName, Image = RiskeerCommonFormsResources.GeneralOutputIcon, CloseForData = RiskeerPluginHelper.ShouldCloseViewWithCalculationData, - CreateInstance = context => new MacroStabilityInwardsOutputView(context.WrappedData, + CreateInstance = context => new MacroStabilityInwardsOutputView(context.WrappedData, context.FailureMechanism.GeneralInput, () => GetNormativeAssessmentLevel(context.AssessmentSection, context.WrappedData)) }; @@ -430,11 +431,11 @@ return assessmentSection.GetNormativeAssessmentLevel(calculation.InputParameters.HydraulicBoundaryLocation); } - private static void ValidateAll(IEnumerable calculations, IAssessmentSection assessmentSection) + private static void ValidateAll(IEnumerable calculations, GeneralMacroStabilityInwardsInput generalInput, IAssessmentSection assessmentSection) { foreach (MacroStabilityInwardsCalculation calculation in calculations) { - MacroStabilityInwardsCalculationService.Validate(calculation, GetNormativeAssessmentLevel(assessmentSection, calculation)); + MacroStabilityInwardsCalculationService.Validate(calculation, generalInput, GetNormativeAssessmentLevel(assessmentSection, calculation)); } } @@ -683,14 +684,14 @@ private static void ValidateAllInFailureMechanism(MacroStabilityInwardsFailureMechanismContext context) { - ValidateAll(context.WrappedData.Calculations.OfType(), context.Parent); + ValidateAll(context.WrappedData.Calculations.OfType(), context.WrappedData.GeneralInput, context.Parent); } private void CalculateAllInFailureMechanism(MacroStabilityInwardsFailureMechanismContext context) { ActivityProgressDialogRunner.Run( Gui.MainWindow, - MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(context.WrappedData, context.Parent)); + MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(context.WrappedData, context.WrappedData.GeneralInput, context.Parent)); } #endregion @@ -862,14 +863,14 @@ private static void ValidateAllInCalculationGroup(MacroStabilityInwardsCalculationGroupContext context) { - ValidateAll(context.WrappedData.GetCalculations().OfType(), context.AssessmentSection); + ValidateAll(context.WrappedData.GetCalculations().OfType(), context.FailureMechanism.GeneralInput, context.AssessmentSection); } private void CalculateAllInCalculationGroup(CalculationGroup group, MacroStabilityInwardsCalculationGroupContext context) { ActivityProgressDialogRunner.Run( Gui.MainWindow, - MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(group, context.AssessmentSection)); + MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(group, context.FailureMechanism.GeneralInput, context.AssessmentSection)); } #endregion @@ -939,14 +940,14 @@ private static void Validate(MacroStabilityInwardsCalculationScenarioContext context) { - MacroStabilityInwardsCalculationService.Validate(context.WrappedData, GetNormativeAssessmentLevel(context.AssessmentSection, context.WrappedData)); + MacroStabilityInwardsCalculationService.Validate(context.WrappedData, context.FailureMechanism.GeneralInput, GetNormativeAssessmentLevel(context.AssessmentSection, context.WrappedData)); } private void Calculate(MacroStabilityInwardsCalculation calculation, MacroStabilityInwardsCalculationScenarioContext context) { ActivityProgressDialogRunner.Run( Gui.MainWindow, - MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivity(calculation, context.AssessmentSection)); + MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivity(calculation, context.FailureMechanism.GeneralInput, context.AssessmentSection)); } #endregion Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/IGeneralMacroStabilityInwardsWaternetInput.cs =================================================================== diff -u --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/IGeneralMacroStabilityInwardsWaternetInput.cs (revision 0) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Primitives/IGeneralMacroStabilityInwardsWaternetInput.cs (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -0,0 +1,38 @@ +// 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 Core.Common.Base.Data; + +namespace Riskeer.MacroStabilityInwards.Primitives +{ + /// + /// Interface that holds macro stability inwards general input parameters for + /// a Waternet calculation. + /// + public interface IGeneralMacroStabilityInwardsWaternetInput + { + /// + /// Gets the volumetric weight of water. + /// [kN/m3] + /// + double WaterVolumetricWeight { get; } + } +} \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivity.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivity.cs (.../MacroStabilityInwardsCalculationActivity.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivity.cs (.../MacroStabilityInwardsCalculationActivity.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -34,6 +34,7 @@ { private readonly RoundedDouble normativeAssessmentLevel; private readonly MacroStabilityInwardsCalculation calculation; + private readonly GeneralMacroStabilityInwardsInput generalInput; /// /// Creates a new instance of . @@ -42,23 +43,25 @@ /// The normative assessment level to use in case the manual assessment level is not applicable. /// Thrown when is null. public MacroStabilityInwardsCalculationActivity(MacroStabilityInwardsCalculation calculation, + GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel) : base(calculation) { this.calculation = calculation; this.normativeAssessmentLevel = normativeAssessmentLevel; + this.generalInput = generalInput; Description = string.Format(RiskeerCommonServiceResources.Perform_calculation_with_name_0_, calculation.Name); } protected override void PerformCalculation() { - MacroStabilityInwardsCalculationService.Calculate(calculation, normativeAssessmentLevel); + MacroStabilityInwardsCalculationService.Calculate(calculation, generalInput, normativeAssessmentLevel); } protected override bool Validate() { - return MacroStabilityInwardsCalculationService.Validate(calculation, normativeAssessmentLevel); + return MacroStabilityInwardsCalculationService.Validate(calculation, generalInput, normativeAssessmentLevel); } protected override void OnCancel() Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivityFactory.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivityFactory.cs (.../MacroStabilityInwardsCalculationActivityFactory.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationActivityFactory.cs (.../MacroStabilityInwardsCalculationActivityFactory.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -45,6 +45,7 @@ /// A collection of . /// Thrown when any parameter is null. public static IEnumerable CreateCalculationActivities(MacroStabilityInwardsFailureMechanism failureMechanism, + GeneralMacroStabilityInwardsInput generalInput, IAssessmentSection assessmentSection) { if (failureMechanism == null) @@ -57,7 +58,7 @@ throw new ArgumentNullException(nameof(assessmentSection)); } - return CreateCalculationActivities(failureMechanism.CalculationsGroup, assessmentSection); + return CreateCalculationActivities(failureMechanism.CalculationsGroup, generalInput, assessmentSection); } /// @@ -70,6 +71,7 @@ /// A collection of . /// Thrown when any parameter is null. public static IEnumerable CreateCalculationActivities(CalculationGroup calculationGroup, + GeneralMacroStabilityInwardsInput generalInput, IAssessmentSection assessmentSection) { if (calculationGroup == null) @@ -84,7 +86,7 @@ return calculationGroup.GetCalculations() .Cast() - .Select(calc => CreateCalculationActivity(calc, assessmentSection)) + .Select(calc => CreateCalculationActivity(calc,generalInput, assessmentSection)) .ToArray(); } @@ -97,6 +99,7 @@ /// A . /// Thrown when any parameter is null. public static CalculatableActivity CreateCalculationActivity(MacroStabilityInwardsCalculation calculation, + GeneralMacroStabilityInwardsInput generalInput, IAssessmentSection assessmentSection) { if (calculation == null) @@ -110,6 +113,7 @@ } return new MacroStabilityInwardsCalculationActivity(calculation, + generalInput, assessmentSection.GetNormativeAssessmentLevel(calculation.InputParameters.HydraulicBoundaryLocation)); } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs =================================================================== diff -u -rd3d4f64d32720e6ac2c582b38e4b4e07398be1ae -r448f6dbf9768780659b7e9380edee12483dcdaaa --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision d3d4f64d32720e6ac2c582b38e4b4e07398be1ae) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision 448f6dbf9768780659b7e9380edee12483dcdaaa) @@ -57,7 +57,7 @@ /// The normative assessment level to use in case the manual assessment level is not applicable. /// false if contains validation errors; true otherwise. /// Thrown when is null. - public static bool Validate(MacroStabilityInwardsCalculation calculation, RoundedDouble normativeAssessmentLevel) + public static bool Validate(MacroStabilityInwardsCalculation calculation, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel) { if (calculation == null) { @@ -82,9 +82,9 @@ try { waternetExtremeKernelMessages = ValidateWaternet(() => WaternetCalculationService.ValidateExtreme( - calculation.InputParameters, GetEffectiveAssessmentLevel(calculation.InputParameters, normativeAssessmentLevel)), + calculation.InputParameters, generalInput, GetEffectiveAssessmentLevel(calculation.InputParameters, normativeAssessmentLevel)), Resources.MacroStabilityInwardsCalculationService_Validate_Waternet_extreme_validation_started); - waternetDailyKernelMessages = ValidateWaternet(() => WaternetCalculationService.ValidateDaily(calculation.InputParameters), + waternetDailyKernelMessages = ValidateWaternet(() => WaternetCalculationService.ValidateDaily(calculation.InputParameters, generalInput), Resources.MacroStabilityInwardsCalculationService_Validate_Waternet_daily_validation_started); } catch (WaternetCalculationException e) @@ -98,7 +98,7 @@ if (!waternetExtremeKernelMessages.Any() && !waternetDailyKernelMessages.Any()) { - IUpliftVanCalculator calculator = GetCalculator(calculation, normativeAssessmentLevel); + IUpliftVanCalculator calculator = GetCalculator(calculation, generalInput, normativeAssessmentLevel); try { @@ -131,7 +131,7 @@ /// Thrown when is null. /// Thrown when an error (both expected or unexpected) occurred during the calculation. /// Consider calling first to see if calculation is possible. - public static void Calculate(MacroStabilityInwardsCalculation calculation, RoundedDouble normativeAssessmentLevel) + public static void Calculate(MacroStabilityInwardsCalculation calculation, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel) { if (calculation == null) { @@ -144,7 +144,7 @@ try { - IUpliftVanCalculator calculator = GetCalculator(calculation, normativeAssessmentLevel); + IUpliftVanCalculator calculator = GetCalculator(calculation, generalInput, normativeAssessmentLevel); macroStabilityInwardsResult = calculator.Calculate(); } @@ -197,9 +197,9 @@ CalculationServiceHelper.LogCalculationEnd(); } - private static IUpliftVanCalculator GetCalculator(MacroStabilityInwardsCalculation calculation, RoundedDouble normativeAssessmentLevel) + private static IUpliftVanCalculator GetCalculator(MacroStabilityInwardsCalculation calculation, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel) { - UpliftVanCalculatorInput upliftVanCalculatorInput = CreateInputFromData(calculation.InputParameters, normativeAssessmentLevel); + UpliftVanCalculatorInput upliftVanCalculatorInput = CreateInputFromData(calculation.InputParameters, generalInput, normativeAssessmentLevel); IUpliftVanCalculator calculator = MacroStabilityInwardsCalculatorFactory.Instance.CreateUpliftVanCalculator(upliftVanCalculatorInput, MacroStabilityInwardsKernelWrapperFactory.Instance); return calculator; } @@ -226,7 +226,7 @@ CalculationServiceHelper.LogValidationEnd(); } - private static UpliftVanCalculatorInput CreateInputFromData(MacroStabilityInwardsInput inputParameters, RoundedDouble normativeAssessmentLevel) + private static UpliftVanCalculatorInput CreateInputFromData(MacroStabilityInwardsInput inputParameters, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel) { RoundedDouble effectiveAssessmentLevel = GetEffectiveAssessmentLevel(inputParameters, normativeAssessmentLevel); @@ -261,7 +261,8 @@ PenetrationLengthDaily = inputParameters.LocationInputDaily.PenetrationLength, AdjustPhreaticLine3And4ForUplift = inputParameters.AdjustPhreaticLine3And4ForUplift, MoveGrid = inputParameters.MoveGrid, - MaximumSliceWidth = inputParameters.MaximumSliceWidth + MaximumSliceWidth = inputParameters.MaximumSliceWidth, + WaterVolumetricWeight = generalInput.WaterVolumetricWeight }); }