Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/AquitardEvaluatorTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/AquitardEvaluatorTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/AquitardEvaluatorTests.cs (revision 1050) @@ -0,0 +1,133 @@ +// Copyright (C) Stichting Deltares 2018. 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 Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator; +using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.TestHelpers.Factories; +using NUnit.Framework; + +namespace Deltares.DamEngine.Calculators.Tests.RegionalAssessment.Evaluator +{ + [TestFixture] + public class AquitardEvaluatorTests + { + const double cTolerance = 0.000001; + + [Test] + [ExpectedException(typeof(AquitardEvaluatorException))] + public void DetermineAquitardThicknessRaisesExceptionWhenSurfaceLevelAboveProfile() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateSimpleProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(12.0, null); + } + + [Test] + [ExpectedException(typeof(AquitardEvaluatorException), ExpectedMessage = "Specified z-level 12 in AquitardEvaluator is outside soilprofile 'DefaultNameSoilProfile1D' (should be between -20 and 10).")] + [SetUICulture("en-US")] + public void DetermineAquitardClayThicknessRaisesExceptionWhenSurfaceLevelAboveProfile() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateSimpleProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(12.0, null); + } + + [Test] + [ExpectedException(typeof(AquitardEvaluatorException), ExpectedMessage = "Het opgegeven niveau -22 in AquitardEvaluator valt buiten het grondprofiel 'DefaultNameSoilProfile1D' en moet tussen -20 en 10 liggen.")] + [SetUICulture("nl-NL")] + public void DetermineAquitardThicknessRaisesExceptionWhenSurfaceLevelBelowProfile() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateSimpleProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(-22.0, null); + } + + [Test] + [ExpectedException(typeof(AquitardEvaluatorException))] + public void DetermineAquitardClayThicknessRaisesExceptionWhenSurfaceLevelBelowProfile() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateSimpleProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(-22.0, null); + } + + [Test] + public void CanEvaluateSimpleProfileWithAquitardWithUnitWeighMoreThan12() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateClaySandProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + double actualValue = aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(2.0, null); + // surfacelevel = 2.0 m. + // aquifer toplevel = -5.0 + // thickness aquitard = 2.0 - (-5.0) = 7.0 + const double expectedValue = 7.0; + Assert.AreEqual(expectedValue, actualValue, cTolerance); + } + + [Test] + public void CanEvaluateProfileWithTwoAquifersAndAquitardWithUnitWeighEqual12() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateClaySandClaySandProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + double actualValue = aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(2.0, null); + // surfacelevel = 2.0 m. + // aquifer toplevel = 1.0 + // thickness aquitard = 2.0 - 1.0 = 1.0 + const double expectedValue = 1.0; + Assert.AreEqual(expectedValue, actualValue, cTolerance); + } + + [Test] + public void CanEvaluateProfileWithTwoAquifersAndAquitardWithUnitWeighLessThan12() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateClaySandClaySandProfile(); + soiProfile.Layers[0].Soil.BelowPhreaticLevel = 10.0; + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + double actualValue = aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(2.0, null); + // aquitard unit weight < 12.0 so no thickness aquitard expected + const double expectedValue = 0.0; + Assert.AreEqual(expectedValue, actualValue, cTolerance); + } + + [Test, Ignore("Test data does not succeed with this check in place")] + [ExpectedException(typeof(AquitardEvaluatorException))] + public void DetermineAquitardClayThicknessRaisesExceptionWhenMoreThan3Aquifers() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.CreateClaySandClaySandClaySandProfile(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + double actualValue = aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(2.0, null); + } + + [Test] + public void CanEvaluateMultiAquitardLayerProfile() + { + SoilProfile1D soiProfile = FactoryForSoilProfiles.Create5LayerProfileWith1Aquifer(); + var aquitardEvaluator = new AquitardEvaluator(soiProfile); + double actualValue = aquitardEvaluator.DetermineAquitardThicknessWithMinimalWeight(2.0, null); + // surfacelevel = 2.0 m. + // aquifer toplevel = -5 + // aquitard with less then 12.0 unit weight is 2.5 thick + // thickness aquitard = 2.0 - (-5.0) - 2.5 = 4.5 + const double expectedValue = 4.5; + Assert.AreEqual(expectedValue, actualValue, cTolerance); + } + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/UpliftEvaluatorTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/UpliftEvaluatorTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/UpliftEvaluatorTests.cs (revision 1050) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. 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 Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.TestHelpers.Factories; +using NUnit.Framework; + +namespace Deltares.DamEngine.Calculators.Tests.RegionalAssessment.Evaluator +{ + [TestFixture] + public class UpliftEvaluatorTests + { + [Test] + public void CanDetectUplift() + { + var upliftEvaluator = new UpliftEvaluator(); + var surfaceLineTutorial1 = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); + var location = CreateLocation(surfaceLineTutorial1); + + // Next adjustment to meet condition that all PL3 points removal is enabled (see PLLinesCreator.DetermineHowToActDueToDitch()) + location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DitchPolderSide).X += 2.5; + var soilProfile = FactoryForSoilProfiles.CreateClaySandProfile(); + foreach (SoilLayer1D layer in soilProfile.Layers) + { + layer.Soil.DryUnitWeight = layer.Soil.AbovePhreaticLevel - 10; + } + Enum[] previousChoices = CreateChoices(); + + previousChoices[2] = DikeDrySensitivity.None; + var uplifType = (UpliftType)upliftEvaluator.Evaluate(location, new SoilGeometry(soilProfile, null), previousChoices); + Assert.AreEqual(UpliftType.NoUplift, uplifType); + + previousChoices[2] = DikeDrySensitivity.Dry; + foreach (var layer in soilProfile.Layers) + { + layer.Soil.BelowPhreaticLevel = layer.Soil.BelowPhreaticLevel - 10; + } + uplifType = (UpliftType)upliftEvaluator.Evaluate(location, new SoilGeometry(soilProfile, null), previousChoices); + Assert.AreEqual(UpliftType.Uplift, uplifType); + } + + private Location CreateLocation(SurfaceLine2 surfaceline) + { + var location = new Location + { + Name = "Test location", + DredgingDepth = -4.0, + BoezemLevelTp = 2.0, + BoezemLevelHbp = 1.8, + PolderLevel = -1.0, + PolderLevelLow = -1.0 + }; + location.HeadPl3 = location.BoezemLevelHbp - 0.1; + location.HeadPl4 = location.BoezemLevelHbp - 0.1; + location.SurfaceLine = surfaceline; + location.LocalXZSheetPilePoint = location.SurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); + location.ModelFactors.UpliftCriterionStability = 1.0; + location.SheetPileLength = 0.0; + + return location; + } + + private Enum[] CreateChoices() + { + Enum[] choices = new Enum[3]; + choices[0] = HydraulicShortcutType.NoHydraulicShortcut; + choices[1] = LoadSituation.Dry; + choices[2] = DikeDrySensitivity.None; + return choices; + } + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj =================================================================== diff -u -r1046 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1046) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1050) @@ -49,6 +49,9 @@ + + + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RWScenarioSelector.cs =================================================================== diff -u -r946 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RWScenarioSelector.cs (.../RWScenarioSelector.cs) (revision 946) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RWScenarioSelector.cs (.../RWScenarioSelector.cs) (revision 1050) @@ -22,6 +22,8 @@ using System; using System.Collections.Generic; using System.Linq; +using Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator; +using Deltares.DamEngine.Calculators.RegionalAssessment.HydraulicShortcut; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.RWScenarios; @@ -53,11 +55,11 @@ { List scenarios = new List(); - RWEvaluator[] evaluators = new RWEvaluator[] + Evaluator[] evaluators = new Evaluator[] { - new DikeMaterialRWEvaluator(), - new HydraulicShortcutRWEvaluator(), - new UpliftRWEvaluator() + new DikeMaterialEvaluator(), + new HydraulicShortcutEvaluator(), + new UpliftEvaluator() }; Enum[] choices = new Enum[evaluators.Length + 1]; @@ -214,17 +216,19 @@ private RWScenarioProfileResult GetScenario(ScenarioType scenarioType, Enum[] choices, Location location, SoilGeometryProbability soilGeometryProbability, FailureMechanismSystemType failureMechanismType, PipingModelType pipingModelType) { - RWScenarioProfileResult scenario = new RWScenarioProfileResult(location, soilGeometryProbability); - scenario.FailureMechanismType = failureMechanismType; - scenario.MstabModelOption = MStabModelType.Bishop; - scenario.PipingModelOption = pipingModelType; + RWScenarioProfileResult scenario = new RWScenarioProfileResult(location, soilGeometryProbability) + { + FailureMechanismType = failureMechanismType, + MstabModelOption = MStabModelType.Bishop, + PipingModelOption = pipingModelType, + LoadSituation = (LoadSituation) choices[0], + DikeDrySensitivity = (DikeDrySensitivity) choices[1], + HydraulicShortcutType = (HydraulicShortcutType) choices[2], + UpliftType = (UpliftType) choices[3], + ScenarioType = scenarioType + }; - scenario.LoadSituation = (LoadSituation)choices[0]; - scenario.DikeDrySensitivity = (DikeDrySensitivity)choices[1]; - scenario.HydraulicShortcutType = (HydraulicShortcutType)choices[2]; - scenario.UpliftType = (UpliftType)choices[3]; - scenario.ScenarioType = scenarioType; //if (scenario.IsDry) //{ Fisheye: Tag 1050 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/UpliftRWEvaluator.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx =================================================================== diff -u -r1040 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1050) @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Het opgegeven niveau {0} in AquitardEvaluator valt buiten het grondprofiel '{1}' en moet tussen {2} en {3} liggen. + Model Horizontaal Evenwicht ondersteunt geen 2D profielen. Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/HydraulicShortcut/HydraulicShortcutEvaluator.cs =================================================================== diff -u -r1046 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/HydraulicShortcut/HydraulicShortcutEvaluator.cs (.../HydraulicShortcutEvaluator.cs) (revision 1046) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/HydraulicShortcut/HydraulicShortcutEvaluator.cs (.../HydraulicShortcutEvaluator.cs) (revision 1050) @@ -22,10 +22,10 @@ using System; using System.Collections.Generic; using Deltares.DamEngine.Calculators.PlLinesCreator; +using Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator; using Deltares.DamEngine.Calculators.Uplift; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.PlLines; -using Deltares.DamEngine.Data.RWScenarios; namespace Deltares.DamEngine.Calculators.RegionalAssessment.HydraulicShortcut { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/DikeMaterialEvaluatorTests.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/DikeMaterialEvaluatorTests.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/Evaluator/DikeMaterialEvaluatorTests.cs (revision 1050) @@ -0,0 +1,57 @@ +// Copyright (C) Stichting Deltares 2018. 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 Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.Geotechnics; +using NUnit.Framework; + +namespace Deltares.DamEngine.Calculators.Tests.RegionalAssessment.Evaluator +{ + [TestFixture] + public class DikeMaterialEvaluatorTests + { + [Test] + public void CanDetectDrySensitiveDike() + { + var dikeMaterialEvaluator = new DikeMaterialEvaluator(); + var location = new Location + { + DikeMaterialType = SoilType.Peat + }; + var dikeDrySensitivity = (DikeDrySensitivity)dikeMaterialEvaluator.Evaluate(location, null, null); + Assert.AreEqual(DikeDrySensitivity.Dry, dikeDrySensitivity); + } + + [Test] + public void CanDetectNotDrySensitiveDike() + { + var dikeMaterialEvaluator = new DikeMaterialEvaluator(); + var location = new Location + { + DikeMaterialType = SoilType.Sand + }; + var dikeDrySensitivity = (DikeDrySensitivity)dikeMaterialEvaluator.Evaluate(location, null, null); + Assert.AreEqual(DikeDrySensitivity.None, dikeDrySensitivity); + } + + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r1040 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1050) @@ -61,6 +61,15 @@ } /// + /// Looks up a localized string similar to Specified z-level {0} in AquitardEvaluator is outside soilprofile '{1}' (should be between {2} and {3}).. + /// + internal static string AquitardEvaluatorSurfaceLevelOutsideProfile { + get { + return ResourceManager.GetString("AquitardEvaluatorSurfaceLevelOutsideProfile", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Model horizontal balance does not support 2d-geometries.. /// internal static string DamMacroStabilityKernelWrapper_HorBal2DProfNotAllowed { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r1040 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1050) @@ -180,4 +180,7 @@ The lowest layer is not an aquifer in soilprofile '{0}'. + + Specified z-level {0} in AquitardEvaluator is outside soilprofile '{1}' (should be between {2} and {3}). + \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/DikeMaterialRWEvaluator.cs =================================================================== diff -u -r877 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/DikeMaterialRWEvaluator.cs (.../Deltares.DamEngine.Data/RWScenarios/DikeMaterialRWEvaluator.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/DikeMaterialRWEvaluator.cs (.../Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/DikeMaterialEvaluator.cs) (revision 1050) @@ -23,19 +23,26 @@ using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geotechnics; -namespace Deltares.DamEngine.Data.RWScenarios +namespace Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator { - public class DikeMaterialRWEvaluator : RWEvaluator + /// + /// Evaluates whether the dike dry sensitivity is dry or none depending on the dikematerial type. + /// + /// + public class DikeMaterialEvaluator : Evaluator { - public DikeMaterialRWEvaluator() + /// + /// Evaluates the specified a location. + /// + /// a location. + /// a soil geometry. + /// The previous choices. + /// Dry when dike material type is peat, else none + public override Enum Evaluate(Location aLocation, SoilGeometry aSoilGeometry, params Enum[] previousChoices) { - } + base.Evaluate(aLocation, aSoilGeometry, previousChoices); - public override Enum Evaluate(Location location, SoilGeometry soilGeometry, params Enum[] previousChoices) - { - base.Evaluate(location, soilGeometry, previousChoices); - - if (location.DikeMaterialType == SoilType.Peat) + if (aLocation.DikeMaterialType == SoilType.Peat) { return DikeDrySensitivity.Dry; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/AquitardEvaluator.cs =================================================================== diff -u -r877 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/AquitardEvaluator.cs (.../Deltares.DamEngine.Data/RWScenarios/AquitardEvaluator.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/AquitardEvaluator.cs (.../Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/AquitardEvaluator.cs) (revision 1050) @@ -21,10 +21,15 @@ using System; using System.Collections.Generic; +using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.Geotechnics; -namespace Deltares.DamEngine.Data.RWScenarios +namespace Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator { + /// + /// Exception class for AquitardEvaluator + /// + /// public class AquitardEvaluatorException : Exception { public AquitardEvaluatorException(string message) @@ -33,10 +38,18 @@ } } + /// + /// Class which determines Aquitard values which are used in the determination of hydraulic shortcut. + /// public class AquitardEvaluator { - private SoilProfile1D soilProfile; - const double CMinimimalUnitWeightAquitard = 12.0; // kN/m2 + private readonly SoilProfile1D soilProfile; + const double cMinimimalUnitWeightAquitard = 12.0; // kN/m2 + + /// + /// Initializes a new instance of the class. + /// + /// The soil profile. public AquitardEvaluator(SoilProfile1D soilProfile) { this.soilProfile = soilProfile; @@ -46,6 +59,7 @@ /// Sum all aquitards between boezembottom and aquifer with a minimum weight of CMinimimalUnitWeightAquitard /// /// + /// /// public double DetermineAquitardThicknessWithMinimalWeight(double surfaceLevel, Soil embankmentMaterial) { @@ -56,26 +70,53 @@ /// Sum all aquitards between boezembottom and aquifer without check on minimum weight /// /// + /// /// public double DetermineAquitardThicknessWithoutMinimalWeight(double surfaceLevel, Soil embankmentMaterial) { return DetermineAquitardThickness(surfaceLevel, false, embankmentMaterial); } /// + /// Determines the aquitard clay thickness. + /// + /// The surface level. + /// + public double DetermineAquitardClayThickness(double surfaceLevel) + { + ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, null); + double aquitardBottomLevel = soilProfile.GetTopLevelOfHighestAquifer(); + double thickness = 0.0; + foreach (SoilLayer1D layer in soilProfile.Layers) + { + if (layer.Soil.SoilType == SoilType.Clay) + { + double levelTop = Math.Min(surfaceLevel, layer.TopLevel); + double levelBottom = Math.Max(aquitardBottomLevel, layer.TopLevel - soilProfile.GetLayerHeight(layer)); + if (levelTop > levelBottom) + { + thickness += (levelTop - levelBottom); + } + } + } + return thickness; + } + + /// /// Sum all aquitards between boezembottom and aquifer /// /// /// + /// /// private double DetermineAquitardThickness(double surfaceLevel, bool checkOnMinimalWeight, Soil embankmentMaterial) { ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, embankmentMaterial); - double aquitardBottomLevel = this.soilProfile.GetTopLevelOfHighestAquifer(); + double aquitardBottomLevel = soilProfile.GetTopLevelOfHighestAquifer(); double thickness = 0.0; - List layers = new List(this.soilProfile.Layers); + List layers = new List(soilProfile.Layers); if (surfaceLevel > soilProfile.TopLevel) { SoilLayer1D embankmentLayer = new SoilLayer1D(embankmentMaterial, surfaceLevel); @@ -89,7 +130,7 @@ // Only include layer if soil has minimal weight if (checkOnMinimalWeight) { - includeLayer = layer.Soil.BelowPhreaticLevel >= CMinimimalUnitWeightAquitard; + includeLayer = layer.Soil.BelowPhreaticLevel >= cMinimimalUnitWeightAquitard; } // Only include layer if soil is waterremmend (clay or peat) @@ -113,43 +154,14 @@ return thickness; } - public double DetermineAquitardClayThickness(double surfaceLevel) - { - ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, null); - //ThrowExceptionWhenMoreThan2Aquifers(); - double aquitardBottomLevel = this.soilProfile.GetTopLevelOfHighestAquifer(); - double thickness = 0.0; - foreach (SoilLayer1D layer in soilProfile.Layers) - { - if (layer.Soil.SoilType == SoilType.Clay) - { - double levelTop = Math.Min(surfaceLevel, layer.TopLevel); - double levelBottom = Math.Max(aquitardBottomLevel, layer.TopLevel - soilProfile.GetLayerHeight(layer)); - if (levelTop > levelBottom) - { - thickness += (levelTop - levelBottom); - } - } - } - return thickness; - } - private void ThrowExceptionWhenSurfaceLevelOutsideProfile(double surfaceLevel, Soil embankmentMaterial) { if (surfaceLevel < soilProfile.BottomLevel || (surfaceLevel > soilProfile.TopLevel && embankmentMaterial == null)) { - throw new AquitardEvaluatorException(String.Format( - "Specified z-level {0} in AquitardEvaluator outside soilprofile '{1}' (should be between {2} and {3}", + throw new AquitardEvaluatorException(string.Format( + Resources.AquitardEvaluatorSurfaceLevelOutsideProfile, surfaceLevel, soilProfile.Name, soilProfile.BottomLevel, soilProfile.TopLevel)); } - } - - private void ThrowExceptionWhenMoreThan2Aquifers() - { - if (soilProfile.GetAquiferLayers().Count > 2) - { - throw new AquitardEvaluatorException("Soilprofile has more than 2 aquifers"); - } - } + } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/UpliftRWEvaluator.cs =================================================================== diff -u -r946 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/UpliftRWEvaluator.cs (.../DikesAssessmentRegional/UpliftRWEvaluator.cs) (revision 946) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/RegionalAssessment/Evaluator/UpliftRWEvaluator.cs (.../RegionalAssessment/Evaluator/UpliftEvaluator.cs) (revision 1050) @@ -25,24 +25,30 @@ using Deltares.DamEngine.Calculators.Uplift; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.PlLines; -using Deltares.DamEngine.Data.RWScenarios; -namespace Deltares.DamEngine.Calculators.Dikes_Assessment_Regional +namespace Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator { - public class UpliftRWEvaluator : RWEvaluator + /// + /// + /// + /// + public class UpliftEvaluator : Evaluator { private DikeDrySensitivity dikeDrySensitivity = DikeDrySensitivity.None; private LoadSituation loadSituation = LoadSituation.Wet; private HydraulicShortcutType hydraulicShortcutType = HydraulicShortcutType.NoHydraulicShortcut; - public UpliftRWEvaluator() + /// + /// Evaluates the specified a location. + /// + /// a location. + /// a soil geometry. + /// The previous choices. + /// + public override Enum Evaluate(Location aLocation, SoilGeometry aSoilGeometry, params Enum[] previousChoices) { - } + base.Evaluate(aLocation, aSoilGeometry, previousChoices); - public override Enum Evaluate(Location location, SoilGeometry soilGeometry, params Enum[] previousChoices) - { - base.Evaluate(location, soilGeometry, previousChoices); - Dictionary choices = new Dictionary(); foreach (Enum enumValue in previousChoices) { @@ -60,7 +66,7 @@ UpliftType upliftType = UpliftType.NoUplift; if (upliftFactor != null) { - if (upliftFactor.Value < location.ModelFactors.UpliftCriterionStability) + if (upliftFactor.Value < aLocation.ModelFactors.UpliftCriterionStability) { return UpliftType.Uplift; } @@ -72,9 +78,9 @@ /// Create PL-lines /// /// - private PLLines CreatePLLines() + private PLLines CreatePlLines() { - PLLinesCreator plLinesCreator = new PLLinesCreator(); + var plLinesCreator = new PLLinesCreator(); double waterLevel = GetBoezemLevel(); plLinesCreator.WaterLevelRiverHigh = waterLevel; @@ -98,10 +104,8 @@ plLinesCreator.IsUseOvenDryUnitWeight = (dikeDrySensitivity == DikeDrySensitivity.Dry); plLinesCreator.IsHydraulicShortcut = (hydraulicShortcutType == HydraulicShortcutType.HydraulicShortcut); plLinesCreator.XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin; - -// PLLines plLines = plLinesCreator.CreateAllPLLines(location); -// return plLines; ##Bka - return null; + var plLines = plLinesCreator.CreateAllPLLines(location); + return plLines; } /// @@ -136,15 +140,16 @@ SoilProfile = soilGeometry.SoilProfile, SoilGeometry2DName = null, DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), - PLLines = CreatePLLines(), + PLLines = CreatePlLines(), IsUseOvenDryUnitWeight = (dikeDrySensitivity == DikeDrySensitivity.Dry), XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin }; UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAtWithLowestUpliftFactor(); if (upliftLocationAndResult != null) + { return upliftLocationAndResult.UpliftFactor; - else - return null; + } + return null; } } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj =================================================================== diff -u -r1046 -r1050 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1046) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1050) @@ -58,10 +58,12 @@ - + + +