Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs (revision 0)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -0,0 +1,55 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets 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 System;
+using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics;
+
+namespace Ringtoets.HydraRing.Calculation.Calculator
+{
+ ///
+ /// Calculator which calculates the dunes boundary conditions associated to the result of iterating towards a
+ /// probability of failure given a norm.
+ ///
+ internal class DunesBoundaryConditionsCalculator : HydraRingCalculatorBase, IDunesBoundaryConditionsCalculator
+ {
+ ///
+ /// Create a new instance of .
+ ///
+ /// The directory in which the Hydraulic Boundary Database can be found.
+ /// The id of the assessment section which is used in the calculation.
+ /// Thrown when is null.
+ internal DunesBoundaryConditionsCalculator(string hlcdDirectory, string ringId)
+ : base(hlcdDirectory, ringId)
+ {
+ WaterLevel = double.NaN;
+ WaveHeight = double.NaN;
+ WavePeriod = double.NaN;
+ }
+
+ public double WaterLevel { get; private set; }
+ public double WaveHeight { get; private set; }
+ public double WavePeriod { get; private set; }
+
+ public void Calculate(DunesBoundaryConditionsCalculationInput input) {}
+
+ protected override void SetOutputs() {}
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs
===================================================================
diff -u -r3e85c5e5e79e465ba07589e589ec7bdef22c0e60 -r8258f2589f1a34f8c77b61877d594ea3e813b3af
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs (.../HydraRingCalculatorFactory.cs) (revision 3e85c5e5e79e465ba07589e589ec7bdef22c0e60)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs (.../HydraRingCalculatorFactory.cs) (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -83,5 +83,10 @@
{
return new StructuresStabilityPointCalculator(hlcdDirectory, ringId);
}
+
+ public IDunesBoundaryConditionsCalculator CreateDunesBoundaryConditionsCalculator(string hlcdDirectory, string ringId)
+ {
+ return new DunesBoundaryConditionsCalculator(hlcdDirectory, ringId);
+ }
}
}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs
===================================================================
diff -u -r3e85c5e5e79e465ba07589e589ec7bdef22c0e60 -r8258f2589f1a34f8c77b61877d594ea3e813b3af
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs (.../IHydraRingCalculatorFactory.cs) (revision 3e85c5e5e79e465ba07589e589ec7bdef22c0e60)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs (.../IHydraRingCalculatorFactory.cs) (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -100,5 +100,14 @@
/// A new .
/// Thrown when is null.
IStructuresStabilityPointCalculator CreateStructuresStabilityPointCalculator(string hlcdDirectory, string ringId);
+
+ ///
+ /// Creates a calculator for performing a calculation for dunes boundary conditions.
+ ///
+ /// The directory where the hydraulic database can be found.
+ /// The id of the assessment section which is used in the calculation.
+ /// A new .
+ /// Thrown when is null.
+ IDunesBoundaryConditionsCalculator CreateDunesBoundaryConditionsCalculator(string hlcdDirectory, string ringId);
}
}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/IDunesBoundaryConditionsCalculator.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/IDunesBoundaryConditionsCalculator.cs (revision 0)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/IDunesBoundaryConditionsCalculator.cs (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -0,0 +1,69 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets 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 Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics;
+
+namespace Ringtoets.HydraRing.Calculation.Calculator
+{
+ ///
+ /// Interface for a calculator which calculates the dunes boundary conditions associated to the result of iterating towards a
+ /// probability of failure given a norm.
+ ///
+ public interface IDunesBoundaryConditionsCalculator
+ {
+ ///
+ /// Gets the water level at a location.
+ ///
+ double WaterLevel { get; }
+
+ ///
+ /// Gets the wave height at a location.
+ ///
+ double WaveHeight { get; }
+
+ ///
+ /// Gets the wave period at a location.
+ ///
+ double WavePeriod { get; }
+
+ ///
+ /// Gets the temporary output directory that is generated during the Hydra-Ring calculation.
+ ///
+ string OutputDirectory { get; }
+
+ ///
+ /// Gets the content of the last error file generated during the Hydra-Ring calculation.
+ ///
+ string LastErrorFileContent { get; }
+
+ ///
+ /// Performs the actual calculation by running the Hydra-Ring executable.
+ ///
+ /// The which contains all the necessary input
+ /// for the calculation.
+ void Calculate(DunesBoundaryConditionsCalculationInput input);
+
+ ///
+ /// Cancels any currently running Hydra-Ring calculation.
+ ///
+ void Cancel();
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj
===================================================================
diff -u -r586d097de0087256cb5cf3dda3a3c612721fee9c -r8258f2589f1a34f8c77b61877d594ea3e813b3af
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 586d097de0087256cb5cf3dda3a3c612721fee9c)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -45,8 +45,10 @@
Properties\GlobalAssembly.cs
+
+
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DunesBoundaryConditionsCalculatorTest.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DunesBoundaryConditionsCalculatorTest.cs (revision 0)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DunesBoundaryConditionsCalculatorTest.cs (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -0,0 +1,45 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets 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 NUnit.Framework;
+using Ringtoets.HydraRing.Calculation.Calculator;
+
+namespace Ringtoets.HydraRing.Calculation.Test.Calculator
+{
+ [TestFixture]
+ public class DunesBoundaryConditionsCalculatorTest
+ {
+ [Test]
+ public void DefaultConstructor_InitializesOutputWithoutValues()
+ {
+ // Call
+ var calculator = new DunesBoundaryConditionsCalculator(string.Empty, string.Empty);
+
+ // Assert
+ Assert.IsInstanceOf(calculator);
+ Assert.IsInstanceOf(calculator);
+ Assert.IsNaN(calculator.WaterLevel);
+ Assert.IsNaN(calculator.WaveHeight);
+ Assert.IsNaN(calculator.WavePeriod);
+ Assert.IsNull(calculator.OutputDirectory);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj
===================================================================
diff -u -r586d097de0087256cb5cf3dda3a3c612721fee9c -r8258f2589f1a34f8c77b61877d594ea3e813b3af
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 586d097de0087256cb5cf3dda3a3c612721fee9c)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -57,6 +57,7 @@
+
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/TestHydraRingCalculatorFactory.cs
===================================================================
diff -u -rd56bec747401ad6676fac64af5eef6d5fd89c47c -r8258f2589f1a34f8c77b61877d594ea3e813b3af
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/TestHydraRingCalculatorFactory.cs (.../TestHydraRingCalculatorFactory.cs) (revision d56bec747401ad6676fac64af5eef6d5fd89c47c)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.TestUtil/Calculator/TestHydraRingCalculatorFactory.cs (.../TestHydraRingCalculatorFactory.cs) (revision 8258f2589f1a34f8c77b61877d594ea3e813b3af)
@@ -41,6 +41,7 @@
public readonly TestStructuresOvertoppingCalculator StructuresOvertoppingCalculator = new TestStructuresOvertoppingCalculator();
public readonly TestStructuresClosureCalculator StructuresClosureCalculator = new TestStructuresClosureCalculator();
public readonly TestStructuresStabilityPointCalculator StructuresStabilityPointCalculator = new TestStructuresStabilityPointCalculator();
+ public readonly TestDunesBoundaryConditionsCalculator DunesBoundaryConditionsCalculator = new TestDunesBoundaryConditionsCalculator();
public IDesignWaterLevelCalculator CreateDesignWaterLevelCalculator(string hlcdDirectory, string ringId)
{
@@ -97,6 +98,13 @@
StructuresStabilityPointCalculator.RingId = ringId;
return StructuresStabilityPointCalculator;
}
+
+ public IDunesBoundaryConditionsCalculator CreateDunesBoundaryConditionsCalculator(string hlcdDirectory, string ringId)
+ {
+ DunesBoundaryConditionsCalculator.HydraulicBoundaryDatabaseDirectory = hlcdDirectory;
+ DunesBoundaryConditionsCalculator.RingId = ringId;
+ return DunesBoundaryConditionsCalculator;
+ }
}
public class TestWaveHeightCalculator : TestHydraRingCalculator, IWaveHeightCalculator
@@ -164,6 +172,15 @@
public string LastErrorFileContent { get; set; }
}
+ public class TestDunesBoundaryConditionsCalculator : TestHydraRingCalculator, IDunesBoundaryConditionsCalculator
+ {
+ public double WaterLevel { get; set; }
+ public double WaveHeight { get; set; }
+ public double WavePeriod { get; set; }
+ public string OutputDirectory { get; set; }
+ public string LastErrorFileContent { get; set; }
+ }
+
public class TestHydraRingCalculator
{
public readonly List ReceivedInputs = new List();