Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs (.../FillDamFromXmlInputTests.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillDamFromXmlInputTests.cs (.../FillDamFromXmlInputTests.cs) (revision 445) @@ -1,4 +1,5 @@ -using Deltares.DamEngine.Data.General; +using System.Net.Sockets; +using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlInput; using Deltares.DamEngine.Interface; @@ -24,8 +25,35 @@ private DamProjectData CreateExampleDamProjectData() { + const int locationCount = 3; var damProjectData = new DamProjectData(); damProjectData.DamProjectType = DamProjectType.Design; + damProjectData.Dike = new Dike(); + for (int i = 0; i < locationCount; i++) + { + var location = new Data.General.Location(); + location.ModelParametersForPLLines.PLLineCreationMethod = (PLLineCreationMethod) i; + location.IntrusionVerticalWaterPressure = (IntrusionVerticalWaterPressureType) i; + location.PolderLevel = 1.0 * i + 0.11; + location.ModelParametersForPLLines.DampingFactorPL4 = 1.0 * i + 0.12; + location.ModelParametersForPLLines.DampingFactorPL3 = 1.0 * i + 0.13; + location.ModelParametersForPLLines.PenetrationLength = 1.0 * i + 0.14; + location.PlLineOffsetBelowDikeCrestMiddle = 1.0 * i + 0.15; + location.UsePlLineOffsetFactorBelowShoulderCrest = true; + location.PlLineOffsetFactorBelowShoulderCrest = 1.0 * i + 0.16; + location.PlLineOffsetDryBelowDikeCrestMiddle = 1.0 * i + 0.17; + location.UsePlLineOffsetDryFactorBelowShoulderCrest = true; + location.PlLineOffsetDryFactorBelowShoulderCrest = 1.0 * i + 0.18; + location.SlopeDampingPiezometricHeightPolderSide = 1.0 * i + 0.19; + location.PlLineOffsetBelowDikeTopAtRiver = 1.0 * i + 0.20; + location.PlLineOffsetBelowDikeTopAtPolder = 1.0 * i + 0.21; + location.PlLineOffsetBelowShoulderBaseInside = 1.0 * i + 0.22; + location.PlLineOffsetBelowDikeToeAtPolder = 1.0 * i + 0.23; + location.HeadPl2 = 1.0 * i + 0.24; + location.HeadPl3 = 1.0 * i + 0.25; + location.HeadPl4 = 1.0 * i + 0.21; + damProjectData.Dike.Locations.Add(location); + } return damProjectData; } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/CalculationHelper.cs =================================================================== diff -u -r354 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/CalculationHelper.cs (.../CalculationHelper.cs) (revision 354) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/CalculationHelper.cs (.../CalculationHelper.cs) (revision 445) @@ -366,7 +366,7 @@ WaterLevelRiverHigh = waterLevel, SurfaceLine = location.LocalXZSurfaceLine2, WaterLevelPolder = location.PolderLevel, - HeadInPLLine2 = location.HeadPL2, + HeadInPLLine2 = location.HeadPl2, HeadInPLLine3 = null, HeadInPLLine4 = null, ModelParametersForPLLines = location.ModelParametersForPLLines, Index: dam engine/trunk/Xsds Liquid/DamLocation.xsd =================================================================== diff -u -r353 -r445 --- dam engine/trunk/Xsds Liquid/DamLocation.xsd (.../DamLocation.xsd) (revision 353) +++ dam engine/trunk/Xsds Liquid/DamLocation.xsd (.../DamLocation.xsd) (revision 445) @@ -27,10 +27,7 @@ - - - - + @@ -41,6 +38,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 445) @@ -29,5 +29,48 @@ Assert.AreEqual(inputDamProjectType, ConversionHelper.ConvertToInputDamProjectType(damProjectType)); } + [Test] + [TestCase(PLLineCreationMethod.ExpertKnowledgeLinearInDike, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike)] + [TestCase(PLLineCreationMethod.ExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD)] + [TestCase(PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD)] + [TestCase(PLLineCreationMethod.None, LocationWaternetOptionsPhreaticLineCreationMethod.None)] + [TestCase(PLLineCreationMethod.Sensors, LocationWaternetOptionsPhreaticLineCreationMethod.Sensors)] + public void CanConvertInputPlLineCreationMethod(PLLineCreationMethod plLineCreationMethod, LocationWaternetOptionsPhreaticLineCreationMethod inputPhreaticLineCreationMethod) + { + Assert.AreEqual(inputPhreaticLineCreationMethod, ConversionHelper.ConvertToInputPhreaticLineCreationMethod(plLineCreationMethod)); + } + + [Test] + [TestCase(LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike, PLLineCreationMethod.ExpertKnowledgeLinearInDike)] + [TestCase(LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD, PLLineCreationMethod.ExpertKnowledgeRRD)] + [TestCase(LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD)] + [TestCase(LocationWaternetOptionsPhreaticLineCreationMethod.None, PLLineCreationMethod.None)] + [TestCase(LocationWaternetOptionsPhreaticLineCreationMethod.Sensors, PLLineCreationMethod.Sensors)] + public void CanConvertPlLineCreationMethod(LocationWaternetOptionsPhreaticLineCreationMethod inputPhreaticLineCreationMethod, PLLineCreationMethod plLineCreationMethod) + { + Assert.AreEqual(plLineCreationMethod, ConversionHelper.ConvertToPhreaticLineCreationMethod(inputPhreaticLineCreationMethod)); + } + + [Test] + [TestCase(LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic, IntrusionVerticalWaterPressureType.FullHydroStatic)] + [TestCase(LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic, IntrusionVerticalWaterPressureType.HydroStatic)] + [TestCase(LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear, IntrusionVerticalWaterPressureType.Linear)] + [TestCase(LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent, IntrusionVerticalWaterPressureType.SemiTimeDependent)] + [TestCase(LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard, IntrusionVerticalWaterPressureType.Standard)] + public void CanConvertInputIntrusionVerticalWaterPressureType(LocationWaternetOptionsIntrusionVerticalWaterPressure inputIntrusionVerticalWaterPressureType, IntrusionVerticalWaterPressureType intrusionVerticalWaterPressureType) + { + Assert.AreEqual(intrusionVerticalWaterPressureType, ConversionHelper.ConvertToIntrusionVerticalWaterPressure(inputIntrusionVerticalWaterPressureType)); + } + + [Test] + [TestCase(IntrusionVerticalWaterPressureType.FullHydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic)] + [TestCase(IntrusionVerticalWaterPressureType.HydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic)] + [TestCase(IntrusionVerticalWaterPressureType.Linear, LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear)] + [TestCase(IntrusionVerticalWaterPressureType.SemiTimeDependent, LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent)] + [TestCase(IntrusionVerticalWaterPressureType.Standard, LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard)] + public void CanConvertIntrusionVerticalWaterPressureType(IntrusionVerticalWaterPressureType intrusionVerticalWaterPressureType, LocationWaternetOptionsIntrusionVerticalWaterPressure inputIntrusionVerticalWaterPressureType) + { + Assert.AreEqual(inputIntrusionVerticalWaterPressureType, ConversionHelper.ConvertToInputIntrusionVerticalWaterPressure(intrusionVerticalWaterPressureType)); + } } } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Assessment Regional/UpliftRWEvaluator.cs =================================================================== diff -u -r354 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Assessment Regional/UpliftRWEvaluator.cs (.../UpliftRWEvaluator.cs) (revision 354) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Assessment Regional/UpliftRWEvaluator.cs (.../UpliftRWEvaluator.cs) (revision 445) @@ -78,7 +78,7 @@ double waterLevel = GetBoezemLevel(); plLinesCreator.WaterLevelRiverHigh = waterLevel; - plLinesCreator.HeadInPLLine2 = location.HeadPL2; + plLinesCreator.HeadInPLLine2 = location.HeadPl2; plLinesCreator.HeadInPLLine3 = location.HeadPl3; plLinesCreator.HeadInPLLine4 = location.HeadPl4; Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs =================================================================== diff -u -r354 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs (.../StabilityCalculator.cs) (revision 354) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Stability/StabilityCalculator.cs (.../StabilityCalculator.cs) (revision 445) @@ -148,7 +148,7 @@ plLineCreator.WaterLevelRiverLow = waterlevelLow; plLineCreator.IsUseLowWaterLevel = (failureMechanismeParamatersMStab.MStabParameters.GridPosition == MStabGridPosition.Left); plLineCreator.WaterLevelPolder = location.PolderLevel; - plLineCreator.HeadInPLLine2 = location.HeadPL2; + plLineCreator.HeadInPLLine2 = location.HeadPl2; plLineCreator.HeadInPLLine3 = location.HeadPl3; plLineCreator.HeadInPLLine4 = location.HeadPl4; plLineCreator.ModelParametersForPLLines = this.modelParametersForPLLines; Index: dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/ConversionHelper.cs (.../ConversionHelper.cs) (revision 445) @@ -40,5 +40,85 @@ }; return translationTable[damProjectType]; } + + /// + /// Converts the type PLLineCreationMethod from Dam Engine type to input object type. + /// + /// Type of the dam project. + /// + /// Type of the input object. + /// + public static LocationWaternetOptionsPhreaticLineCreationMethod ConvertToInputPhreaticLineCreationMethod(PLLineCreationMethod plLineCreationMethod) + { + var translationTable = new Dictionary() + { + {PLLineCreationMethod.ExpertKnowledgeLinearInDike, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike}, + {PLLineCreationMethod.ExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD}, + {PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD}, + {PLLineCreationMethod.Sensors, LocationWaternetOptionsPhreaticLineCreationMethod.Sensors}, + {PLLineCreationMethod.None, LocationWaternetOptionsPhreaticLineCreationMethod.None} + }; + return translationTable[plLineCreationMethod]; + } + + /// + /// Converts the type PLLineCreationMethod from input object type to Dam Engine type. + /// + /// Type of the input object. + /// + /// Type of the dam object. + /// + public static PLLineCreationMethod ConvertToPhreaticLineCreationMethod(LocationWaternetOptionsPhreaticLineCreationMethod inputPhreaticLineCreationMethod) + { + var translationTable = new Dictionary() + { + {LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike,PLLineCreationMethod.ExpertKnowledgeLinearInDike}, + {LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD, PLLineCreationMethod.ExpertKnowledgeRRD}, + {LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD}, + {LocationWaternetOptionsPhreaticLineCreationMethod.Sensors, PLLineCreationMethod.Sensors}, + {LocationWaternetOptionsPhreaticLineCreationMethod.None, PLLineCreationMethod.None} + }; + return translationTable[inputPhreaticLineCreationMethod]; + } + + /// + /// Converts the type IntrusionVerticalWaterPressureType from Dam Engine type to input object type. + /// + /// Type of the dam project. + /// + /// Type of the input object. + /// + public static LocationWaternetOptionsIntrusionVerticalWaterPressure ConvertToInputIntrusionVerticalWaterPressure(IntrusionVerticalWaterPressureType intrusionVerticalWaterPressureType) + { + var translationTable = new Dictionary() + { + {IntrusionVerticalWaterPressureType.FullHydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic}, + {IntrusionVerticalWaterPressureType.HydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic}, + {IntrusionVerticalWaterPressureType.Linear, LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear}, + {IntrusionVerticalWaterPressureType.SemiTimeDependent, LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent}, + {IntrusionVerticalWaterPressureType.Standard, LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard} + }; + return translationTable[intrusionVerticalWaterPressureType]; + } + + /// + /// Converts the type IntrusionVerticalWaterPressureType from input object type to Dam Engine type. + /// + /// Type of the input object. + /// + /// Type of the dam object. + /// + public static IntrusionVerticalWaterPressureType ConvertToIntrusionVerticalWaterPressure(LocationWaternetOptionsIntrusionVerticalWaterPressure inputIntrusionVerticalWaterPressure) + { + var translationTable = new Dictionary() + { + {LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic, IntrusionVerticalWaterPressureType.FullHydroStatic}, + {LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic, IntrusionVerticalWaterPressureType.HydroStatic}, + {LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear, IntrusionVerticalWaterPressureType.Linear}, + {LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent, IntrusionVerticalWaterPressureType.SemiTimeDependent}, + {LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard, IntrusionVerticalWaterPressureType.Standard} + }; + return translationTable[inputIntrusionVerticalWaterPressure]; + } } } \ No newline at end of file Index: dam engine/trunk/src/Deltares.DamEngine.Io/DamInput.cs =================================================================== diff -u -r416 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Io/DamInput.cs (.../DamInput.cs) (revision 416) +++ dam engine/trunk/src/Deltares.DamEngine.Io/DamInput.cs (.../DamInput.cs) (revision 445) @@ -277,70 +277,168 @@ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class LocationWaternetOptions { - private double dampingFactorPL3Field; + private LocationWaternetOptionsPhreaticLineCreationMethod phreaticLineCreationMethodField; - private bool dampingFactorPL3FieldSpecified; + private double polderLevelField; - private double dampingFactorPL4Field; + private double headPl2Field; - private bool dampingFactorPL4FieldSpecified; + private bool headPl2FieldSpecified; + private double headPl3Field; + + private bool headPl3FieldSpecified; + + private double headPl4Field; + + private bool headPl4FieldSpecified; + + private double dampingFactorPL3Field; + + private double dampingFactorPL4Field; + private double penetrationLengthField; - private bool penetrationLengthFieldSpecified; + private double slopeDampingFactorField; - private LocationWaternetOptionsPLLineCreationMethod pLLineCreationMethodField; + private double pl1BelowCrestRiversideField; - public LocationWaternetOptions() { - this.pLLineCreationMethodField = LocationWaternetOptionsPLLineCreationMethod.ExpertKnowledgeRRD; + private double pl1BelowCrestPoldersideField; + + private double pl1BelowShoulderCrestPoldersideField; + + private double pl1BelowToeDikePoldersideField; + + private double pl1BelowCrestMiddleField; + + private bool pl1BelowCrestMiddleFieldSpecified; + + private double pl1FactorBelowShoulderCrestField; + + private bool pl1FactorBelowShoulderCrestFieldSpecified; + + private double dryPl1BelowCrestMiddleField; + + private bool dryPl1BelowCrestMiddleFieldSpecified; + + private double dryPl1FactorBelowShoulderCrestField; + + private bool dryPl1FactorBelowShoulderCrestFieldSpecified; + + private LocationWaternetOptionsIntrusionVerticalWaterPressure intrusionVerticalWaterPressureField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public LocationWaternetOptionsPhreaticLineCreationMethod PhreaticLineCreationMethod { + get { + return this.phreaticLineCreationMethodField; + } + set { + this.phreaticLineCreationMethodField = value; + } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - public double DampingFactorPL3 { + public double PolderLevel { get { - return this.dampingFactorPL3Field; + return this.polderLevelField; } set { - this.dampingFactorPL3Field = value; + this.polderLevelField = value; } } /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double HeadPl2 { + get { + return this.headPl2Field; + } + set { + this.headPl2Field = value; + } + } + + /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool DampingFactorPL3Specified { + public bool HeadPl2Specified { get { - return this.dampingFactorPL3FieldSpecified; + return this.headPl2FieldSpecified; } set { - this.dampingFactorPL3FieldSpecified = value; + this.headPl2FieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - public double DampingFactorPL4 { + public double HeadPl3 { get { - return this.dampingFactorPL4Field; + return this.headPl3Field; } set { - this.dampingFactorPL4Field = value; + this.headPl3Field = value; } } /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool DampingFactorPL4Specified { + public bool HeadPl3Specified { get { - return this.dampingFactorPL4FieldSpecified; + return this.headPl3FieldSpecified; } set { - this.dampingFactorPL4FieldSpecified = value; + this.headPl3FieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] + public double HeadPl4 { + get { + return this.headPl4Field; + } + set { + this.headPl4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool HeadPl4Specified { + get { + return this.headPl4FieldSpecified; + } + set { + this.headPl4FieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DampingFactorPL3 { + get { + return this.dampingFactorPL3Field; + } + set { + this.dampingFactorPL3Field = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DampingFactorPL4 { + get { + return this.dampingFactorPL4Field; + } + set { + this.dampingFactorPL4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] public double PenetrationLength { get { return this.penetrationLengthField; @@ -351,34 +449,165 @@ } /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double SlopeDampingFactor { + get { + return this.slopeDampingFactorField; + } + set { + this.slopeDampingFactorField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestRiverside { + get { + return this.pl1BelowCrestRiversideField; + } + set { + this.pl1BelowCrestRiversideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestPolderside { + get { + return this.pl1BelowCrestPoldersideField; + } + set { + this.pl1BelowCrestPoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowShoulderCrestPolderside { + get { + return this.pl1BelowShoulderCrestPoldersideField; + } + set { + this.pl1BelowShoulderCrestPoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowToeDikePolderside { + get { + return this.pl1BelowToeDikePoldersideField; + } + set { + this.pl1BelowToeDikePoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestMiddle { + get { + return this.pl1BelowCrestMiddleField; + } + set { + this.pl1BelowCrestMiddleField = value; + } + } + + /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool PenetrationLengthSpecified { + public bool Pl1BelowCrestMiddleSpecified { get { - return this.penetrationLengthFieldSpecified; + return this.pl1BelowCrestMiddleFieldSpecified; } set { - this.penetrationLengthFieldSpecified = value; + this.pl1BelowCrestMiddleFieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(LocationWaternetOptionsPLLineCreationMethod.ExpertKnowledgeRRD)] - public LocationWaternetOptionsPLLineCreationMethod PLLineCreationMethod { + public double Pl1FactorBelowShoulderCrest { get { - return this.pLLineCreationMethodField; + return this.pl1FactorBelowShoulderCrestField; } set { - this.pLLineCreationMethodField = value; + this.pl1FactorBelowShoulderCrestField = value; } } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool Pl1FactorBelowShoulderCrestSpecified { + get { + return this.pl1FactorBelowShoulderCrestFieldSpecified; + } + set { + this.pl1FactorBelowShoulderCrestFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DryPl1BelowCrestMiddle { + get { + return this.dryPl1BelowCrestMiddleField; + } + set { + this.dryPl1BelowCrestMiddleField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DryPl1BelowCrestMiddleSpecified { + get { + return this.dryPl1BelowCrestMiddleFieldSpecified; + } + set { + this.dryPl1BelowCrestMiddleFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DryPl1FactorBelowShoulderCrest { + get { + return this.dryPl1FactorBelowShoulderCrestField; + } + set { + this.dryPl1FactorBelowShoulderCrestField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DryPl1FactorBelowShoulderCrestSpecified { + get { + return this.dryPl1FactorBelowShoulderCrestFieldSpecified; + } + set { + this.dryPl1FactorBelowShoulderCrestFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public LocationWaternetOptionsIntrusionVerticalWaterPressure IntrusionVerticalWaterPressure { + get { + return this.intrusionVerticalWaterPressureField; + } + set { + this.intrusionVerticalWaterPressureField = value; + } + } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] - public enum LocationWaternetOptionsPLLineCreationMethod { + public enum LocationWaternetOptionsPhreaticLineCreationMethod { /// ExpertKnowledgeRRD, @@ -399,6 +628,28 @@ /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + public enum LocationWaternetOptionsIntrusionVerticalWaterPressure { + + /// + Standard, + + /// + Linear, + + /// + FullHydroStatic, + + /// + HydroStatic, + + /// + SemiTimeDependent, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] Index: dam engine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs =================================================================== diff -u -r418 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs (.../DamOutput.cs) (revision 418) +++ dam engine/trunk/src/Deltares.DamEngine.Io/DamOutput.cs (.../DamOutput.cs) (revision 445) @@ -322,70 +322,168 @@ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class LocationWaternetOptions { - private double dampingFactorPL3Field; + private LocationWaternetOptionsPhreaticLineCreationMethod phreaticLineCreationMethodField; - private bool dampingFactorPL3FieldSpecified; + private double polderLevelField; - private double dampingFactorPL4Field; + private double headPl2Field; - private bool dampingFactorPL4FieldSpecified; + private bool headPl2FieldSpecified; + private double headPl3Field; + + private bool headPl3FieldSpecified; + + private double headPl4Field; + + private bool headPl4FieldSpecified; + + private double dampingFactorPL3Field; + + private double dampingFactorPL4Field; + private double penetrationLengthField; - private bool penetrationLengthFieldSpecified; + private double slopeDampingFactorField; - private LocationWaternetOptionsPLLineCreationMethod pLLineCreationMethodField; + private double pl1BelowCrestRiversideField; - public LocationWaternetOptions() { - this.pLLineCreationMethodField = LocationWaternetOptionsPLLineCreationMethod.ExpertKnowledgeRRD; + private double pl1BelowCrestPoldersideField; + + private double pl1BelowShoulderCrestPoldersideField; + + private double pl1BelowToeDikePoldersideField; + + private double pl1BelowCrestMiddleField; + + private bool pl1BelowCrestMiddleFieldSpecified; + + private double pl1FactorBelowShoulderCrestField; + + private bool pl1FactorBelowShoulderCrestFieldSpecified; + + private double dryPl1BelowCrestMiddleField; + + private bool dryPl1BelowCrestMiddleFieldSpecified; + + private double dryPl1FactorBelowShoulderCrestField; + + private bool dryPl1FactorBelowShoulderCrestFieldSpecified; + + private LocationWaternetOptionsIntrusionVerticalWaterPressure intrusionVerticalWaterPressureField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public LocationWaternetOptionsPhreaticLineCreationMethod PhreaticLineCreationMethod { + get { + return this.phreaticLineCreationMethodField; + } + set { + this.phreaticLineCreationMethodField = value; + } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - public double DampingFactorPL3 { + public double PolderLevel { get { - return this.dampingFactorPL3Field; + return this.polderLevelField; } set { - this.dampingFactorPL3Field = value; + this.polderLevelField = value; } } /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double HeadPl2 { + get { + return this.headPl2Field; + } + set { + this.headPl2Field = value; + } + } + + /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool DampingFactorPL3Specified { + public bool HeadPl2Specified { get { - return this.dampingFactorPL3FieldSpecified; + return this.headPl2FieldSpecified; } set { - this.dampingFactorPL3FieldSpecified = value; + this.headPl2FieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - public double DampingFactorPL4 { + public double HeadPl3 { get { - return this.dampingFactorPL4Field; + return this.headPl3Field; } set { - this.dampingFactorPL4Field = value; + this.headPl3Field = value; } } /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool DampingFactorPL4Specified { + public bool HeadPl3Specified { get { - return this.dampingFactorPL4FieldSpecified; + return this.headPl3FieldSpecified; } set { - this.dampingFactorPL4FieldSpecified = value; + this.headPl3FieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] + public double HeadPl4 { + get { + return this.headPl4Field; + } + set { + this.headPl4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool HeadPl4Specified { + get { + return this.headPl4FieldSpecified; + } + set { + this.headPl4FieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DampingFactorPL3 { + get { + return this.dampingFactorPL3Field; + } + set { + this.dampingFactorPL3Field = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DampingFactorPL4 { + get { + return this.dampingFactorPL4Field; + } + set { + this.dampingFactorPL4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] public double PenetrationLength { get { return this.penetrationLengthField; @@ -396,34 +494,165 @@ } /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double SlopeDampingFactor { + get { + return this.slopeDampingFactorField; + } + set { + this.slopeDampingFactorField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestRiverside { + get { + return this.pl1BelowCrestRiversideField; + } + set { + this.pl1BelowCrestRiversideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestPolderside { + get { + return this.pl1BelowCrestPoldersideField; + } + set { + this.pl1BelowCrestPoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowShoulderCrestPolderside { + get { + return this.pl1BelowShoulderCrestPoldersideField; + } + set { + this.pl1BelowShoulderCrestPoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowToeDikePolderside { + get { + return this.pl1BelowToeDikePoldersideField; + } + set { + this.pl1BelowToeDikePoldersideField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double Pl1BelowCrestMiddle { + get { + return this.pl1BelowCrestMiddleField; + } + set { + this.pl1BelowCrestMiddleField = value; + } + } + + /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool PenetrationLengthSpecified { + public bool Pl1BelowCrestMiddleSpecified { get { - return this.penetrationLengthFieldSpecified; + return this.pl1BelowCrestMiddleFieldSpecified; } set { - this.penetrationLengthFieldSpecified = value; + this.pl1BelowCrestMiddleFieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(LocationWaternetOptionsPLLineCreationMethod.ExpertKnowledgeRRD)] - public LocationWaternetOptionsPLLineCreationMethod PLLineCreationMethod { + public double Pl1FactorBelowShoulderCrest { get { - return this.pLLineCreationMethodField; + return this.pl1FactorBelowShoulderCrestField; } set { - this.pLLineCreationMethodField = value; + this.pl1FactorBelowShoulderCrestField = value; } } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool Pl1FactorBelowShoulderCrestSpecified { + get { + return this.pl1FactorBelowShoulderCrestFieldSpecified; + } + set { + this.pl1FactorBelowShoulderCrestFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DryPl1BelowCrestMiddle { + get { + return this.dryPl1BelowCrestMiddleField; + } + set { + this.dryPl1BelowCrestMiddleField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DryPl1BelowCrestMiddleSpecified { + get { + return this.dryPl1BelowCrestMiddleFieldSpecified; + } + set { + this.dryPl1BelowCrestMiddleFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public double DryPl1FactorBelowShoulderCrest { + get { + return this.dryPl1FactorBelowShoulderCrestField; + } + set { + this.dryPl1FactorBelowShoulderCrestField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DryPl1FactorBelowShoulderCrestSpecified { + get { + return this.dryPl1FactorBelowShoulderCrestFieldSpecified; + } + set { + this.dryPl1FactorBelowShoulderCrestFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public LocationWaternetOptionsIntrusionVerticalWaterPressure IntrusionVerticalWaterPressure { + get { + return this.intrusionVerticalWaterPressureField; + } + set { + this.intrusionVerticalWaterPressureField = value; + } + } } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] - public enum LocationWaternetOptionsPLLineCreationMethod { + public enum LocationWaternetOptionsPhreaticLineCreationMethod { /// ExpertKnowledgeRRD, @@ -444,6 +673,28 @@ /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] + public enum LocationWaternetOptionsIntrusionVerticalWaterPressure { + + /// + Standard, + + /// + Linear, + + /// + FullHydroStatic, + + /// + HydroStatic, + + /// + SemiTimeDependent, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 445) @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Io.XmlInput; +using Location = Deltares.DamEngine.Data.General.Location; namespace Deltares.DamEngine.Interface { @@ -17,6 +18,35 @@ { var damProjectData = new DamProjectData(); damProjectData.DamProjectType = ConversionHelper.ConvertToDamProjectType(input.DamProjectType); + + damProjectData.Dike = new Dike(); + for (int i = 0; i < input.Locations.Length; i++) + { + var location = new Location(); + var inputLocation = input.Locations[i]; + var waternetOptions = inputLocation.WaternetOptions; + location.ModelParametersForPLLines.PLLineCreationMethod = ConversionHelper.ConvertToPhreaticLineCreationMethod(waternetOptions.PhreaticLineCreationMethod); + location.IntrusionVerticalWaterPressure = ConversionHelper.ConvertToIntrusionVerticalWaterPressure(waternetOptions.IntrusionVerticalWaterPressure); + location.PolderLevel = waternetOptions.PolderLevel; + location.ModelParametersForPLLines.DampingFactorPL4 = waternetOptions.DampingFactorPL3; + location.ModelParametersForPLLines.DampingFactorPL3 = waternetOptions.DampingFactorPL4; + location.ModelParametersForPLLines.PenetrationLength = waternetOptions.PenetrationLength; + location.PlLineOffsetBelowDikeCrestMiddle = (waternetOptions.Pl1BelowCrestMiddleSpecified ? (double?) waternetOptions.Pl1BelowCrestMiddle : null); + location.UsePlLineOffsetFactorBelowShoulderCrest = waternetOptions.Pl1FactorBelowShoulderCrestSpecified; + location.PlLineOffsetFactorBelowShoulderCrest = waternetOptions.Pl1FactorBelowShoulderCrest; + location.PlLineOffsetDryBelowDikeCrestMiddle = (waternetOptions.DryPl1BelowCrestMiddleSpecified ? (double?) waternetOptions.DryPl1BelowCrestMiddle : null); + location.UsePlLineOffsetDryFactorBelowShoulderCrest = waternetOptions.DryPl1FactorBelowShoulderCrestSpecified; + location.PlLineOffsetDryFactorBelowShoulderCrest = waternetOptions.DryPl1FactorBelowShoulderCrest; + location.HeadPl2 = (waternetOptions.HeadPl2Specified ? (double?)waternetOptions.HeadPl2 : null); + location.HeadPl3 = (waternetOptions.HeadPl3Specified ? (double?)waternetOptions.HeadPl3 : null); + location.HeadPl4 = (waternetOptions.HeadPl4Specified ? (double?)waternetOptions.HeadPl4 : null); + location.SlopeDampingPiezometricHeightPolderSide = waternetOptions.SlopeDampingFactor; + location.PlLineOffsetBelowDikeTopAtRiver = waternetOptions.Pl1BelowCrestRiverside; + location.PlLineOffsetBelowDikeTopAtPolder = waternetOptions.Pl1BelowCrestPolderside; + location.PlLineOffsetBelowShoulderBaseInside = waternetOptions.Pl1BelowShoulderCrestPolderside; + location.PlLineOffsetBelowDikeToeAtPolder = waternetOptions.Pl1BelowToeDikePolderside; + damProjectData.Dike.Locations.Add(location); + } return damProjectData; } Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Location.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Location.cs (.../Location.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Location.cs (.../Location.cs) (revision 445) @@ -1458,7 +1458,7 @@ /// /// The head pl 2. /// - public virtual double? HeadPL2 + public virtual double? HeadPl2 { get { Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 445) @@ -89,9 +89,6 @@ - - - Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs =================================================================== diff -u -r444 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 444) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 445) @@ -857,7 +857,7 @@ plLinesCreator.SurfaceLine = surfaceLine; plLinesCreator.WaterLevelPolder = location.PolderLevel; - plLinesCreator.HeadInPLLine2 = location.HeadPL2; + plLinesCreator.HeadInPLLine2 = location.HeadPl2; plLinesCreator.HeadInPLLine3 = location.HeadPl3; plLinesCreator.HeadInPLLine4 = location.HeadPl4; plLinesCreator.ModelParametersForPLLines = location.ModelParametersForPLLines; Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs =================================================================== diff -u -r441 -r445 --- dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 445) @@ -3,8 +3,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Deltares.DamEngine.Io.XmlInput; using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Io.XmlInput; +//using Deltares.DamEngine.Io.XmlInput; +//using Deltares.DamEngine.Io.XmlOutput; +using Input = Deltares.DamEngine.Io.XmlInput.Input; namespace Deltares.DamEngine.Interface { @@ -14,6 +17,41 @@ { Input input = new Input(); input.DamProjectType = ConversionHelper.ConvertToInputDamProjectType(damProjectData.DamProjectType); + int locationCount = damProjectData.Dike.Locations.Count; + input.Locations = new Io.XmlInput.Location[locationCount]; + for (int i = 0; i < locationCount; i++) + { + var location = damProjectData.Dike.Locations[i]; + input.Locations[i] = new Io.XmlInput.Location(); + var waternetOptions = new Io.XmlInput.LocationWaternetOptions(); + + waternetOptions.PhreaticLineCreationMethod = ConversionHelper.ConvertToInputPhreaticLineCreationMethod(location.ModelParametersForPLLines.PLLineCreationMethod); + waternetOptions.IntrusionVerticalWaterPressure = ConversionHelper.ConvertToInputIntrusionVerticalWaterPressure(location.IntrusionVerticalWaterPressure?? IntrusionVerticalWaterPressureType.Standard); + waternetOptions.PolderLevel = location.PolderLevel; + waternetOptions.DampingFactorPL3 = location.ModelParametersForPLLines.DampingFactorPL4; + waternetOptions.DampingFactorPL4 = location.ModelParametersForPLLines.DampingFactorPL3; + waternetOptions.PenetrationLength = location.ModelParametersForPLLines.PenetrationLength; + waternetOptions.Pl1BelowCrestMiddleSpecified = location.PlLineOffsetBelowDikeCrestMiddle.HasValue; + waternetOptions.Pl1BelowCrestMiddle = location.PlLineOffsetBelowDikeCrestMiddle ?? 0.0; + waternetOptions.Pl1FactorBelowShoulderCrestSpecified = location.UsePlLineOffsetFactorBelowShoulderCrest ?? false; + waternetOptions.Pl1FactorBelowShoulderCrest = location.PlLineOffsetFactorBelowShoulderCrest ?? 0.0; + waternetOptions.DryPl1BelowCrestMiddleSpecified = location.PlLineOffsetDryBelowDikeCrestMiddle.HasValue; + waternetOptions.DryPl1BelowCrestMiddle = location.PlLineOffsetDryBelowDikeCrestMiddle ?? 0.0; + waternetOptions.DryPl1FactorBelowShoulderCrestSpecified = location.UsePlLineOffsetDryFactorBelowShoulderCrest ?? false; + waternetOptions.DryPl1FactorBelowShoulderCrest = location.PlLineOffsetDryFactorBelowShoulderCrest??0.0; + waternetOptions.HeadPl2Specified = location.HeadPl2.HasValue; + waternetOptions.HeadPl2 = location.HeadPl2 ?? 0.0; + waternetOptions.HeadPl3Specified = location.HeadPl3.HasValue; + waternetOptions.HeadPl3 = location.HeadPl3 ?? 0.0; + waternetOptions.HeadPl4Specified = location.HeadPl4.HasValue; + waternetOptions.HeadPl4 = location.HeadPl4 ?? 0.0; + waternetOptions.SlopeDampingFactor = location.SlopeDampingPiezometricHeightPolderSide; + waternetOptions.Pl1BelowCrestRiverside = location.PlLineOffsetBelowDikeTopAtRiver; + waternetOptions.Pl1BelowCrestPolderside = location.PlLineOffsetBelowDikeTopAtPolder; + waternetOptions.Pl1BelowShoulderCrestPolderside = location.PlLineOffsetBelowShoulderBaseInside; + waternetOptions.Pl1BelowToeDikePolderside = location.PlLineOffsetBelowDikeToeAtPolder; + input.Locations[i].WaternetOptions = waternetOptions; + } return input; } }