Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/WesterdijkPiping.xml
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/WesterdijkPiping.xml (revision 0)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/WesterdijkPiping.xml (revision 3332)
@@ -0,0 +1,670 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/HHNK_Westerdijk0.soilmaterials.mdb
===================================================================
diff -u
Binary files differ
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs
===================================================================
diff -u -r3249 -r3332
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 3249)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 3332)
@@ -137,18 +137,45 @@
foreach (var inputSensorLocation in inputSensorData.SensorLocations)
{
var sensorLocation = new Data.General.Sensors.SensorLocation();
- sensorLocation.Location = locations.First(l => l.Name.Equals(inputSensorLocation.LocationId));
- sensorLocation.Location.SensorLocation = sensorLocation;
- sensorLocation.SensorGroup = sensorData.SensorGroups.First(sg => sg.ID.Equals(inputSensorLocation.GroupId));
- sensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder);
- sensorLocation.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder);
- sensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtRiver = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtRiver);
- sensorLocation.SourceTypePl1PlLineOffsetBelowShoulderBaseInside = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1PlLineOffsetBelowShoulderBaseInside);
- sensorLocation.SourceTypePl1WaterLevelAtPolder = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1WaterLevelAtPolder);
- sensorLocation.SourceTypePl1WaterLevelAtRiver = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl1WaterLevelAtRiver);
- sensorLocation.SourceTypePl3 = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl3);
- sensorLocation.SourceTypePl4 = ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl4);
- sensorData.SensorLocations.Add(sensorLocation);
+ try
+ {
+ sensorLocation.Location = locations.First(l => l.Name.Equals(inputSensorLocation.LocationId));
+ }
+ catch (Exception e)
+ {
+ // location may not have been selected for calculation in which case this location can not be found for this sensor. Just do not add the sensorlocation
+ sensorLocation = null;
+ }
+
+ if (sensorLocation != null)
+ {
+ sensorLocation.Location.SensorLocation = sensorLocation;
+ sensorLocation.SensorGroup =
+ sensorData.SensorGroups.First(sg => sg.ID.Equals(inputSensorLocation.GroupId));
+ sensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtPolder =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1PlLineOffsetBelowDikeTopAtPolder);
+ sensorLocation.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1PlLineOffsetBelowDikeToeAtPolder);
+ sensorLocation.SourceTypePl1PlLineOffsetBelowDikeTopAtRiver =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1PlLineOffsetBelowDikeTopAtRiver);
+ sensorLocation.SourceTypePl1PlLineOffsetBelowShoulderBaseInside =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1PlLineOffsetBelowShoulderBaseInside);
+ sensorLocation.SourceTypePl1WaterLevelAtPolder =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1WaterLevelAtPolder);
+ sensorLocation.SourceTypePl1WaterLevelAtRiver =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation
+ .SourceTypePl1WaterLevelAtRiver);
+ sensorLocation.SourceTypePl3 =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl3);
+ sensorLocation.SourceTypePl4 =
+ ConversionHelper.ConvertToDataSourceTypeSensors(inputSensorLocation.SourceTypePl4);
+ sensorData.SensorLocations.Add(sensorLocation);
+ }
}
}
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj
===================================================================
diff -u -r3249 -r3332
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 3249)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 3332)
@@ -53,6 +53,7 @@
+
@@ -147,6 +148,18 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
@@ -231,6 +244,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -338,6 +354,36 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.InputTimeSeries.xml
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.InputTimeSeries.xml (revision 0)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.InputTimeSeries.xml (revision 3332)
@@ -0,0 +1,200 @@
+
+
+ 0.0
+
+
+ instantaneous
+ IJsselmeer
+ H.meting
+
+
+
+ -999.0
+ IJsselmeer
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB01
+ H.meting
+
+
+
+ -999.0
+ HB01
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB02
+ H.meting
+
+
+
+ -999.0
+ HB02
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB03
+ H.meting
+
+
+
+ -999.0
+ HB03
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB04
+ H.meting
+
+
+
+ -999.0
+ HB04
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB05
+ H.meting
+
+
+
+ -999.0
+ HB05
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB06
+ H.meting
+
+
+
+ -999.0
+ HB06
+ mNAP
+
+
+
+
+
+ instantaneous
+ HB07
+ H.meting
+
+
+
+ -999.0
+ HB07
+ mNAP
+
+
+
+
+
+ instantaneous
+ MB01-1
+ H.meting
+
+
+
+ -999.0
+ MB01-1
+ mNAP
+
+
+
+
+
+ instantaneous
+ MB01-2
+ H.meting
+
+
+
+ -999.0
+ MB01-2
+ mNAP
+
+
+
+
+
+ instantaneous
+ MB02-1
+ H.meting
+
+
+
+ -999.0
+ MB02-1
+ mNAP
+
+
+
+
+
+ instantaneous
+ MB02-2
+ H.meting
+
+
+
+ -999.0
+ MB02-2
+ mNAP
+
+
+
+
+
+ instantaneous
+ PL3_1
+ H.meting
+
+
+
+ -999.0
+ PL3_1
+ mNAP
+
+
+
+
+
+ instantaneous
+ PL3_2
+ H.meting
+
+
+
+ -999.0
+ PL3_2
+ mNAP
+
+
+
+
\ No newline at end of file
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalWesterDijkPipingTests.cs
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalWesterDijkPipingTests.cs (revision 0)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalWesterDijkPipingTests.cs (revision 3332)
@@ -0,0 +1,86 @@
+// Copyright (C) Stichting Deltares 2020. 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.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Deltares.DamEngine.Data.Design;
+using Deltares.DamEngine.Data.Geotechnics;
+using Deltares.DamEngine.Interface;
+using Deltares.DamEngine.Io;
+using Deltares.DamEngine.TestHelpers;
+using NUnit.Framework;
+
+namespace Deltares.DamEngine.IntegrationTests.IntegrationTests
+{
+ [TestFixture]
+ [Category("Work_In_Progress")]
+ class OperationalWesterDijkPipingTests
+ {
+ private const double tolerance = 0.0005;
+
+ [Test]
+ public void Run_UsingTestFiles_HasExpectedResultsInOutputFile()
+ {
+ const string calcDir = "TestOperationalWesterdijk";
+ const string workingDir = @"TestFiles\";
+ const string baseTestDirectory = @".\";
+ if (Directory.Exists(calcDir))
+ {
+ Directory.Delete(calcDir, true); // delete previous results
+ }
+
+ Directory.CreateDirectory(calcDir);
+ // Switch to TestFiles directory to check if DamLive can also run from another directory
+ Directory.SetCurrentDirectory(workingDir);
+
+ const string inputFileName = baseTestDirectory + @"WesterdijkPiping.xml";
+ const string outputFileName = baseTestDirectory + @"WesterdijkPiping.output.xml";
+ string inputString = File.ReadAllText(inputFileName);
+ inputString = XmlAdapter.ChangeValueInXml(inputString, "ProjectPath", ""); // Current directory will be used
+ inputString = XmlAdapter.ChangeValueInXml(inputString, "CalculationMap", calcDir); // Current directory will be used
+ inputString = XmlAdapter.ChangeValueInXml(inputString, "MapForSoilgeometries2D", baseTestDirectory + @"Operational\WesterDijkPiping\input.Geometries\");
+ inputString = XmlAdapter.ChangeValueInXml(inputString, "SoilDatabaseName", baseTestDirectory + @"Operational\WesterDijkPiping\HHNK_Westerdijk0.soilmaterials.mdb");
+ EngineInterface engineInterface = new EngineInterface(inputString);
+ Assert.IsNotNull(engineInterface.DamProjectData);
+
+ string result = engineInterface.Validate();
+ Assert.IsTrue(result == null, "Validation must succeed but does not, see validation output xml in debugger");
+ string outputString = engineInterface.Run();
+ File.WriteAllText(outputFileName, outputString, Encoding.Unicode);
+ Assert.IsNotNull(outputString);
+ var output = DamXmlSerialization.LoadOutputFromXmlString(outputString);
+
+ // This now fails as the test is based on 2D sti files instead of the required 1D-profiles. Note that I already adapted the file for FailureMechanisms per Segment
+ // as that was still set to Stability (1) where it should be Piping(2).
+ Assert.AreEqual(2.321, output.Results.OperationalOutputTimeSeries[0].Entries.TimeSerieEntry[0].Value, tolerance);
+ Assert.AreEqual(2.321, output.Results.OperationalOutputTimeSeries[0].Entries.TimeSerieEntry[1].Value, tolerance);
+ // Following values were 0.590 in the previous DamLive version, but that has to do with how the
+ // reference level Su is handled in D-GeoStability 18.1 and D-GeoStability 15.1
+ Assert.AreEqual(2.326, output.Results.OperationalOutputTimeSeries[1].Entries.TimeSerieEntry[0].Value, tolerance);
+ Assert.AreEqual(2.326, output.Results.OperationalOutputTimeSeries[1].Entries.TimeSerieEntry[1].Value, tolerance);
+
+ }
+ }
+}
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.ParametersFile.xml
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.ParametersFile.xml (revision 0)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/live.ParametersFile.xml (revision 3332)
@@ -0,0 +1,15 @@
+
+
+
+ 0
+ 0
+ 1
+ 0
+ 0
+
+
+ Bishop
+ Grid
+ 2
+
+
\ No newline at end of file
Index: DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/WesterdijkPiping.xml
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/WesterdijkPiping.xml (revision 0)
+++ DamEngine/branches/DamEngine 19.2/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/WesterDijkPiping/WesterdijkPiping.xml (revision 3332)
@@ -0,0 +1,268 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file