Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs (.../DamPipingHelper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs (.../DamPipingHelper.cs) (revision 3291) @@ -76,7 +76,7 @@ ThrowHelper.ThrowIfArgumentNull(soilProfile.BottomAquiferLayer, string.Format(Resources.NoBottomAquiferLayer, soilProfile.Name)); UpliftSituation upliftSituation; - plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.Location, damKernelInput.SubSoilScenario.SoilProfile1D, + plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, damKernelInput.Location, damKernelInput.SubSoilScenario.SoilProfile1D, damKernelInput.RiverLevelHigh, out upliftSituation); UpliftLocationDeterminator upliftLocationDeterminator = new UpliftLocationDeterminator Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculatorTask.cs =================================================================== diff -u -r3250 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculatorTask.cs (.../OperationalCalculatorTask.cs) (revision 3250) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculatorTask.cs (.../OperationalCalculatorTask.cs) (revision 3291) @@ -104,5 +104,13 @@ /// The calculation messages. /// public List CalculationMessages { get; set; } + + /// + /// Gets or sets the calculation result. + /// + /// + /// The calculation result. + /// + public CalculationResult CalculationResult { get; set; } } } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputForDebugging.xml =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputForDebugging.xml (.../InputForDebugging.xml) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputForDebugging.xml (.../InputForDebugging.xml) (revision 3291) @@ -1,535 +1,227 @@ - + - - - + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs (.../WtiPipingSellmeijerRevisedKernelWrapper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs (.../WtiPipingSellmeijerRevisedKernelWrapper.cs) (revision 3291) @@ -77,9 +77,13 @@ var soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; var location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; + if (double.IsNaN(waterLevel)) + { + waterLevel = location.Scenarios[0].RiverLevel; + } UpliftSituation upliftSituation; var plLines = - PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); + PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel, out upliftSituation); EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); return PrepareResult.Successful; } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 3291) @@ -68,7 +68,7 @@ var location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); + var plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel, out upliftSituation); EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); return PrepareResult.Successful; } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Data/General/Dike.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Data/General/Dike.cs (.../Dike.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Data/General/Dike.cs (.../Dike.cs) (revision 3291) @@ -193,7 +193,7 @@ } } - public void Validate() + public void Validate(bool IsOperational) { if (Locations == null || Locations.Count < 1) { @@ -211,11 +211,17 @@ throw new SurfaceLineException(validationResults[0].Text); } } - + if (location.Scenarios.Count < 1) { throw new DikeException("Location " + location.Name + " has no scenarios, at least one scenario is required."); } + + if (IsOperational && location.Scenarios.Count > 1) + { + throw new DikeException(string.Format( + "For Operational (DamLive), location {0} has {1} scenarios but only one is allowed!", location.Name, location.Scenarios.Count)); + } } } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DebuggingTest.cs (.../DebuggingTest.cs) (revision 3291) @@ -21,6 +21,7 @@ using System.IO; using System.Threading; +using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Interface; using Deltares.DamEngine.Io; using NUnit.Framework; @@ -46,9 +47,18 @@ string inputString = File.ReadAllText(fullInputFilename); EngineInterface engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); + var result = engineInterface.Validate(); + Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); string outputString = engineInterface.Run(); var output = DamXmlSerialization.LoadOutputFromXmlString(outputString); - Assert.AreNotEqual(null, output.Results.CalculationResults); + if (engineInterface.DamProjectData.DamProjectType == DamProjectType.Design) + { + Assert.AreNotEqual(null, output.Results.CalculationResults); + } + else + { + Assert.AreNotEqual(null, output.Results.OperationalOutputTimeSeries); + } } } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/EngineInterface.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/EngineInterface.cs (.../EngineInterface.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/EngineInterface.cs (.../EngineInterface.cs) (revision 3291) @@ -150,7 +150,19 @@ { SendMessage(new LogMessage() { MessageType = LogMessageType.Info, Message = Resources.StartValidation }); List validationMessages = null; - //validationMessages = DamProjectData.Validate(); or something like this.... + + try + { + DamProjectData.Dike.Validate(DamProjectData.DamProjectType == DamProjectType.Operational); + } + catch (Exception e) + { + var validationMessage = new LogMessage(LogMessageType.Error,null, e.Message); + validationMessages = new List {validationMessage}; + DamProjectData.CalculationMessages = new List(); + } + + // Local validation can give messages and these have to be added to the results but note that there // already can be messages added by instantiation of the interface too. So add the local to the global if (validationMessages != null && validationMessages.Count > 0) Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs (.../PlLinesHelper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs (.../PlLinesHelper.cs) (revision 3291) @@ -60,7 +60,7 @@ waterLevel, waterLevelRiverLow, out upliftSituation); break; case PlLineCreationMethod.Sensors: - plLines = CreatePlLinesForStabilitySensors(location, subSoilScenario, sensorPlLineCreatorSettings); + plLines = CreatePlLinesForStabilitySensors(location, sensorPlLineCreatorSettings); break; default: throw new NotImplementedException(string.Format(@"Pl-line creation method '{0}' is not implemented", @@ -76,8 +76,7 @@ /// The sub soil scenario. /// The sensor pl-line creator settings. /// - public static PlLines CreatePlLinesForStabilitySensors(Location location, SoilGeometryProbability subSoilScenario, - SensorPlLineCreatorSettings sensorPlLineCreatorSettings) + public static PlLines CreatePlLinesForStabilitySensors(Location location, SensorPlLineCreatorSettings sensorPlLineCreatorSettings) { PlLines plLines = null; @@ -157,7 +156,7 @@ /// The water level. /// The uplift situation. /// - public static PlLines CreatePlLinesForPiping(Location location, SoilProfile1D soilProfile, double waterLevel, + public static PlLines CreatePlLinesForPiping(DateTime timeStepDateTime, Location location, SoilProfile1D soilProfile, double waterLevel, out UpliftSituation upliftSituation) { var plLinesCreator = new PlLinesCreator.PlLinesCreator @@ -178,7 +177,18 @@ DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin }; - var plLines = plLinesCreator.CreateAllPlLines(location); + PlLines plLines; + if (location.ModelParametersForPlLines.PlLineCreationMethod == PlLineCreationMethod.Sensors) + { + var sensorPlLineCreatorSettings = new SensorPlLineCreatorSettings(); + sensorPlLineCreatorSettings.SensorLocation = location.SensorLocation; + sensorPlLineCreatorSettings.DateTime = timeStepDateTime; + plLines = CreatePlLinesForStabilitySensors(location, sensorPlLineCreatorSettings); //ToDo Bka: consult with Tom whether we can just use this and just rename or does it really has to be different for Piping? + } + else + { + plLines = plLinesCreator.CreateAllPlLines(location); + } upliftSituation.Pl3HeadAdjusted = plLinesCreator.Pl3HeadAdjusted; upliftSituation.Pl3LocationXMinUplift = plLinesCreator.Pl3LocationXMinUplift; upliftSituation.Pl3MinUplift = plLinesCreator.Pl3MinUplift; Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 3291) @@ -75,7 +75,7 @@ var location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); + PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel, out upliftSituation); EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, damPipingBlighInput, waterLevel, damPipingBlighOutput); return PrepareResult.Successful; } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 3291) @@ -70,7 +70,7 @@ var location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); + var plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel, out upliftSituation); EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); return PrepareResult.Successful; } Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs =================================================================== diff -u -r3263 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 3263) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators/DikesOperational/OperationalCalculator.cs (.../OperationalCalculator.cs) (revision 3291) @@ -128,7 +128,8 @@ DesignScenario designScenario = null; if (location.Scenarios.Count > 0) { - designScenario = location.Scenarios[entryIndex]; + // For Operational only ONE scenario is allowed (decided by Irene/Bernard on 30-07-2020). So that's the one that must be used. + designScenario = location.Scenarios[0]; designScenario.Location = location; } var sensorValues = values[entry.DateTime][location]; @@ -200,7 +201,7 @@ CalculateOneTimeEntry(task.Location, task.SoiProfileProbability, task.DesignScenario, task.ProjectPath, task.CalculationMap, task.FailureMechanismeCalculationSpecification, task.TimeSerieEntry, task.TimeStepIndex, - task.CalculationMessages); + task.CalculationMessages, task.CalculationResult); Debug.WriteLine("End calculation Location '{0}', soilprofile '{1}'", task.Location, task.SoiProfileProbability); } @@ -209,7 +210,7 @@ string projectPath, string calculationMap, DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification, TimeSerieEntry timeSerieEntry, int timeStepIndex, - List calculationMessages) + List calculationMessages, CalculationResult calculationResult) { try { @@ -247,7 +248,7 @@ { PerformOperationalCalculation( kernelWrapper, kernelDataInput, kernelDataOutput, - damKernelInput, timeStepIndex, timeSerieEntry, out var calculationResult, + damKernelInput, timeStepIndex, timeSerieEntry, out calculationResult, calculationMessages); } else @@ -375,6 +376,8 @@ switch (currentSpecification.PipingModelType) { case PipingModelType.Bligh: +// parameter = TimeSerieParameters.StabilityInsideFactor.ToString(); ##Bka 2020-07-13 +// break; case PipingModelType.SellmeijerVnk: case PipingModelType.Sellmeijer4Forces: throw new NotImplementedException(); Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs =================================================================== diff -u -r3249 -r3291 --- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 3249) +++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 3291) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; @@ -43,7 +44,8 @@ var soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); var riverLevel = 1.0; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); + var timeStepDateTime = new DateTime(); + var plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel, out upliftSituation); Assert.AreEqual(4, plLines.PlLineCount); Assert.AreEqual(8, plLines.Lines[PlLineType.Pl1].Points.Count); Assert.IsTrue(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0])); @@ -74,7 +76,8 @@ var soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); var riverLevel = 1.0; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); + var timeStepDateTime = new DateTime(); + var plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel, out upliftSituation); Assert.AreEqual(4, plLines.PlLineCount); Assert.AreEqual(8, plLines.Lines[PlLineType.Pl1].Points.Count); Assert.IsTrue(new PlLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0])); @@ -112,7 +115,8 @@ var riverLevel = 0.5; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); + var timeStepDateTime = new DateTime(); + var plLines = PlLinesHelper.CreatePlLinesForPiping(timeStepDateTime, location, soilProfile1D, riverLevel, out upliftSituation); Assert.AreEqual(4, plLines.PlLineCount); Assert.AreEqual(8, plLines.Lines[PlLineType.Pl1].Points.Count); Assert.IsTrue(new PlLinePoint(0.000, 0.500).LocationEquals(plLines.Lines[PlLineType.Pl1].Points[0]));