Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs (.../DamProjectCalculationSpecification.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamProjectCalculationSpecification.cs (.../DamProjectCalculationSpecification.cs) (revision 1977) @@ -35,14 +35,22 @@ private static AnalysisType selectedAnalysisType = AnalysisType.AdaptGeometry; private DamFailureMechanismeCalculationSpecification currentSpecification; - private StabilityKernelType selectedStabilityKernelType; - + + /// + /// Initializes a new instance of the class. + /// public DamProjectCalculationSpecification() { damCalculationSpecifications = new List(); //waterLevelTimeSeriesFileName = @"d:\src\delftgeosystems\trunk\data\Dam\RRD\Groot Salland\DAM UI Testdata\inputshortstart_dam.xml"; } + /// + /// Gets the dam calculation specifications. + /// + /// + /// The dam calculation specifications. + /// [Validate] public List DamCalculationSpecifications { @@ -88,6 +96,12 @@ } } + /// + /// Gets or sets the current specification. + /// + /// + /// The current specification. + /// public DamFailureMechanismeCalculationSpecification CurrentSpecification { get @@ -105,19 +119,11 @@ } } - public StabilityKernelType SelectedStabilityKernelType - { - get { return selectedStabilityKernelType; } - set - { - selectedStabilityKernelType = value; - if (currentSpecification != null) - { - currentSpecification.StabilityKernelType = selectedStabilityKernelType; - } - } - } + /// + /// Validates this instance. + /// + /// [Validate] public ValidationResult[] Validate() { Index: DamEngine/trunk/xsd/DamInput.xsd =================================================================== diff -u -r1960 -r1977 --- DamEngine/trunk/xsd/DamInput.xsd (.../DamInput.xsd) (revision 1960) +++ DamEngine/trunk/xsd/DamInput.xsd (.../DamInput.xsd) (revision 1977) @@ -120,6 +120,7 @@ + Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 1977) @@ -204,6 +204,7 @@ [TestCase(FailureMechanismSystemType.StabilityOutside, 1)] [TestCase(FailureMechanismSystemType.Piping, 2)] [TestCase(FailureMechanismSystemType.HorizontalBalance, 3)] + [TestCase(FailureMechanismSystemType.WtiStabilityInside, 4)] public void CanConvertToInputFailureMechanismSystemType(FailureMechanismSystemType failureMechanismSystemType, int inputFailureMechanismSystemType) { Assert.AreEqual(inputFailureMechanismSystemType, ConversionHelper.ConvertToInputFailureMechanismSystemType(failureMechanismSystemType)); @@ -214,6 +215,7 @@ [TestCase(1, FailureMechanismSystemType.StabilityOutside)] [TestCase(2, FailureMechanismSystemType.Piping)] [TestCase(3, FailureMechanismSystemType.HorizontalBalance)] + [TestCase(4, FailureMechanismSystemType.WtiStabilityInside)] public void CanConvertToFailureMechanismSystemType(int inputFailureMechanismSystemType, FailureMechanismSystemType failureMechanismSystemType) { Assert.AreEqual(failureMechanismSystemType, ConversionHelper.ConvertToFailureMechanismSystemType(inputFailureMechanismSystemType)); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r1970 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs (.../WtiMacroStabilityInwardsKernelWrapperTests.cs) (revision 1970) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs (.../WtiMacroStabilityInwardsKernelWrapperTests.cs) (revision 1977) @@ -355,7 +355,7 @@ subSoilScenario.StiFileName = ""; subSoilScenario.FullStiFileName = ""; subSoilScenario.SoilProfile2D = DamMacroStabilityTestHelper.CreateSoilProfile2D(); - subSoilScenario.SegmentFailureMechanismType = FailureMechanismSystemType.StabilityInside; + subSoilScenario.SegmentFailureMechanismType = FailureMechanismSystemType.WtiStabilityInside; var damKernelInput = new DamKernelInput(); damKernelInput.Location = location; Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1977) @@ -131,6 +131,7 @@ { sb.Append(String.Format("(2D) {0} ({1}%) ", spp.StiFileName, spp.Probability)); } + //#Bka: should be adapted for WtiStability where 2D profiles are used. } } return sb.ToString(); Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 1977) @@ -61,6 +61,7 @@ { switch (DamFailureMechanismeCalculation.FailureMechanismSystemType) { + case FailureMechanismSystemType.WtiStabilityInside: case FailureMechanismSystemType.StabilityInside: case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.HorizontalBalance: @@ -150,6 +151,7 @@ { switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { + case FailureMechanismSystemType.WtiStabilityInside: // #Bka: For now use soilGeometry2DName, probably this must become soilProfile2D.Name and soilProfile2D should be passed. Or soilProfile2D will be used for filling soilGeometry2DName before calling this case FailureMechanismSystemType.StabilityInside: case FailureMechanismSystemType.HorizontalBalance: case FailureMechanismSystemType.StabilityOutside: Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1967 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1967) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1977) @@ -74,29 +74,30 @@ { CalculationResult = CalculationResult.NoRun }; - try + kernelDataOutput = macroStabilityOutput; + if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType == FailureMechanismSystemType.WtiStabilityInside) { - // Determine whether there is uplift - var upliftSituation = UpliftHelper.DetermineStabilityUplift(damKernelInput, false); - macroStabilityOutput.UpliftSituation = upliftSituation; - kernelDataOutput = macroStabilityOutput; - if (upliftSituation.IsUplift) + try { - // ToDo MWDAM-1356: Not clear yet what parts are required for input. - var xmlInput = CreateXmlInput(macroStabilityInput, FailureMechanismParametersMStab.EmbankmentDesignParameters); - return PrepareKernel(xmlInput); + // Determine whether there is uplift + var upliftSituation = UpliftHelper.DetermineStabilityUplift(damKernelInput, false); + macroStabilityOutput.UpliftSituation = upliftSituation; + if (upliftSituation.IsUplift) + { + // ToDo MWDAM-1356: Not clear yet what parts are required for input. + var xmlInput = CreateXmlInput(macroStabilityInput, FailureMechanismParametersMStab.EmbankmentDesignParameters); + return PrepareKernel(xmlInput); + } + return PrepareResult.NotRelevant; } - else + catch { - return PrepareResult.NotRelevant; + kernelDataOutput = macroStabilityOutput; + return PrepareResult.Failed; } - } - catch - { - kernelDataOutput = macroStabilityOutput; - return PrepareResult.Failed; - } + kernelDataInput = null; + return PrepareResult.NotRelevant; } private PrepareResult PrepareKernel(string xmlInput) Index: DamEngine/trunk/src/Deltares.DamEngine.Io/DamInput.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Io/DamInput.cs (.../DamInput.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Io/DamInput.cs (.../DamInput.cs) (revision 1977) @@ -1,25 +1,4 @@ -// Copyright (C) Stichting Deltares 2019. All rights reserved. -// -// This file is part of the Dam Engine. -// -// The Dam Engine is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero 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. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 Index: DamEngine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 1977) @@ -337,6 +337,7 @@ public const int InputFailureMechanismStabilityOutside = 1; public const int InputFailureMechanismPiping = 2; public const int InputFailureMechanismHorizontalBalance = 3; + public const int InputFailureMechanismWtiStabilityInside = 4; /// /// Converts the Dam failure mechanism type to the input failure mechanism type . @@ -350,7 +351,8 @@ {FailureMechanismSystemType.StabilityInside, InputFailureMechanismStabilityInside}, {FailureMechanismSystemType.StabilityOutside, InputFailureMechanismStabilityOutside}, {FailureMechanismSystemType.Piping, InputFailureMechanismPiping}, - {FailureMechanismSystemType.HorizontalBalance, InputFailureMechanismHorizontalBalance} + {FailureMechanismSystemType.HorizontalBalance, InputFailureMechanismHorizontalBalance}, + {FailureMechanismSystemType.WtiStabilityInside, InputFailureMechanismWtiStabilityInside} }; return translationTable[segmentFailureMechanismType]; } @@ -367,7 +369,8 @@ {InputFailureMechanismStabilityInside, FailureMechanismSystemType.StabilityInside}, {InputFailureMechanismStabilityOutside, FailureMechanismSystemType.StabilityOutside}, {InputFailureMechanismPiping, FailureMechanismSystemType.Piping}, - {InputFailureMechanismHorizontalBalance, FailureMechanismSystemType.HorizontalBalance} + {InputFailureMechanismHorizontalBalance, FailureMechanismSystemType.HorizontalBalance}, + {InputFailureMechanismWtiStabilityInside, FailureMechanismSystemType.WtiStabilityInside} }; return translationTable[failureMechanismSystemType]; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs =================================================================== diff -u -r1965 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs (.../KernelWrapperHelper.cs) (revision 1965) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs (.../KernelWrapperHelper.cs) (revision 1977) @@ -27,6 +27,7 @@ using Deltares.DamEngine.Calculators.KernelWrappers.DamPipingSellmeijer4Forces; using Deltares.DamEngine.Calculators.KernelWrappers.DamPipingSellmeijerVnk; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.KernelWrappers.WtiMacroStabilityInwards; using Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingSellmeijerRevised; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Standard; @@ -63,6 +64,12 @@ var damMacroStabilityKernelWrapper = (DamMacroStabilityInwardsKernelWrapper)kernelWrapper; damMacroStabilityKernelWrapper.FailureMechanismParametersMStab = currentSpecification.FailureMechanismParametersMStab.Copy(); break; + case FailureMechanismSystemType.WtiStabilityInside: + kernelWrapper = new WtiMacroStabilityInwardsKernelWrapper(); + var wtiMacroStabilityInwardsKernelWrapper = (WtiMacroStabilityInwardsKernelWrapper)kernelWrapper; + wtiMacroStabilityInwardsKernelWrapper.FailureMechanismParametersMStab = + currentSpecification.FailureMechanismParametersMStab.Copy(); + break; case FailureMechanismSystemType.Piping: switch (currentSpecification.PipingModelType) { Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamFailureMechanismeCalculationSpecification.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamFailureMechanismeCalculationSpecification.cs (.../DamFailureMechanismeCalculationSpecification.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/DamFailureMechanismeCalculationSpecification.cs (.../DamFailureMechanismeCalculationSpecification.cs) (revision 1977) @@ -35,7 +35,6 @@ private Enum calculationModel; private FailureMechanismParametersMStab failureMechanismParametersMStab; private static DamProjectType damProjectType; - private StabilityKernelType stabilityKernelType = StabilityKernelType.DamClassic; private RegionalAssessmentScenarioJobSettings regionalAssessmentScenarioJobSettings; /// @@ -80,13 +79,9 @@ // To solve MWDAM-592, remember the current pipingmodeltype as this gets reset by setting the // calculationmodel. Only switch it back when needed. var oldPipingModelType = pipingModelType; -// foreach (Enum possibleModel in this.GetDomain("CalculationModel")) -// { -// this.CalculationModel = possibleModel; -// break; -// } #Bka: I think this is only needed for the UI. switch (failureMechanismSystemType) { + case FailureMechanismSystemType.WtiStabilityInside: case FailureMechanismSystemType.StabilityInside: failureMechanismParametersMStab.MStabParameters.GridPosition = MStabGridPosition.Right; break; @@ -175,18 +170,6 @@ } /// - /// Gets or sets the type of the stability kernel. - /// - /// - /// The type of the stability kernel. - /// - public StabilityKernelType StabilityKernelType - { - get { return stabilityKernelType; } - set { stabilityKernelType = value; } - } - - /// /// Gets or sets the assessment scenario job settings. /// /// @@ -237,9 +220,9 @@ public override string ToString() { string description = ""; - description += String.Format("{0}", StabilityKernelType); description += String.Format("{0}", this.FailureMechanismSystemType); if ((this.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside) || + (this.FailureMechanismSystemType == FailureMechanismSystemType.WtiStabilityInside) || (this.FailureMechanismSystemType == FailureMechanismSystemType.StabilityOutside)) { //interface? Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs =================================================================== diff -u -r1965 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 1965) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 1977) @@ -328,6 +328,8 @@ string parameter = ""; switch (currentSpecification.FailureMechanismSystemType) { + case FailureMechanismSystemType.WtiStabilityInside: + throw new NotImplementedException(); case FailureMechanismSystemType.HorizontalBalance: throw new NotImplementedException(); case FailureMechanismSystemType.StabilityOutside: Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs (.../MacroStabilityOutwardsTests.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/MacroStabilityOutwardsTests.cs (.../MacroStabilityOutwardsTests.cs) (revision 1977) @@ -62,7 +62,6 @@ inputString = XmlAdapter.ChangeValueInXml(inputString, "SoilDatabaseName", @"TestFiles\DAM Tutorial Design0.soilmaterials.mdb"); EngineInterface engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); - engineInterface.DamProjectData.DamProjectCalculationSpecification.CurrentSpecification.StabilityKernelType = StabilityKernelType.DamClassic; engineInterface.DamProjectData.DamProjectCalculationSpecification.CurrentSpecification.StabilityModelType = MStabModelType.Bishop; engineInterface.DamProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismParametersMStab.MStabParameters.GridPosition = MStabGridPosition.Left; engineInterface.DamProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType = FailureMechanismSystemType.StabilityOutside; Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/DAMEnumerations.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 1977) @@ -21,7 +21,6 @@ namespace Deltares.DamEngine.Data.General { - public enum DamType { Primary, @@ -35,28 +34,6 @@ Design } - // TODO: FM this is failure mechanism specific code and should be moved to ..\KernelWrappers - public enum StabilityKernelType - { - // The Classic models all use DGMStabDam.dll to generate a sti file from the input (so also pl-lines only) - // DAM classic uses the Delphi version of DGS (as exe) to solve the calculation - DamClassic, - - // DAM classic .Net uses the .Net version of DGS which is based on the old Delphi code to solve the calculation - DamClassicDotNet, - - // DAM classic WTI uses the .Net version of DGS which is based on the new C# code to solve the calculation - DamClassicWti, - - // The advanced models use the geotechnics and DGS classes to generate the required data from input, - // using the waternet only. This requires the -rto option for starting - // Advanced .Net uses the .Net version of DGS which is based on the old Delphi code to solve the calculation - AdvancedDotNet, - - // Advanced WTI uses the .Net version of DGS which is based on the new C# code to solve the calculation - AdvancedWti - }; - public enum AnalysisType { NoAdaption, @@ -68,7 +45,8 @@ StabilityInside, StabilityOutside, Piping, - HorizontalBalance + HorizontalBalance, + WtiStabilityInside } // TODO: FM this is failure mechanism specific code and should be moved to ..\KernelWrappers Index: DamEngine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs =================================================================== diff -u -r1974 -r1977 --- DamEngine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs (.../DamOutput.cs) (revision 1974) +++ DamEngine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs (.../DamOutput.cs) (revision 1977) @@ -1,25 +1,4 @@ -// Copyright (C) Stichting Deltares 2019. All rights reserved. -// -// This file is part of the Dam Engine. -// -// The Dam Engine is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero 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. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000