Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Readers/StabilityPointStructuresCalculationConfigurationReader.cs =================================================================== diff -u -rff3bf86946b3c76d494d5ca885464e4afb617788 -r00a098e99eda461e762ad7296742f28750ca1b88 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Readers/StabilityPointStructuresCalculationConfigurationReader.cs (.../StabilityPointStructuresCalculationConfigurationReader.cs) (revision ff3bf86946b3c76d494d5ca885464e4afb617788) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Readers/StabilityPointStructuresCalculationConfigurationReader.cs (.../StabilityPointStructuresCalculationConfigurationReader.cs) (revision 00a098e99eda461e762ad7296742f28750ca1b88) @@ -23,6 +23,8 @@ using System.Collections.Generic; using System.Xml.Linq; using Core.Common.Base.IO; +using Ringtoets.Common.IO.Configurations; +using Ringtoets.Common.IO.Configurations.Helpers; using Ringtoets.Common.IO.Readers; using Ringtoets.Common.IO.Schema; using Ringtoets.StabilityPointStructures.IO.Properties; @@ -41,6 +43,9 @@ private const string golfReductieSchemaName = "GolfReductieSchema.xsd"; private const string voorlandProfielSchemaName = "VoorlandProfielSchema.xsd"; private const string stochastSchemaName = "StochastSchema.xsd"; + private const string stochastStandaardafwijkingSchemaName = "StochastStandaardafwijkingSchema.xsd"; + private const string stochastVariatiecoefficientSchemaName = "StochastVariatiecoefficientSchema.xsd"; + private const string structureBaseSchemaName = "KunstwerkenBasisSchema.xsd"; /// /// Creates a new instance of . @@ -74,13 +79,109 @@ }, { stochastSchemaName, RingtoetsCommonIOResources.StochastSchema + }, + { + stochastStandaardafwijkingSchemaName, RingtoetsCommonIOResources.StochastStandaardafwijkingSchema + }, + { + stochastVariatiecoefficientSchemaName, RingtoetsCommonIOResources.StochastVariatiecoefficientSchema + }, + { + structureBaseSchemaName, RingtoetsCommonIOResources.KunstwerkenBasisSchema } } ) { } protected override StabilityPointStructuresCalculationConfiguration ParseCalculationElement(XElement calculationElement) { - return new StabilityPointStructuresCalculationConfiguration(calculationElement.Attribute(ConfigurationSchemaIdentifiers.NameAttribute).Value); + return new StabilityPointStructuresCalculationConfiguration(calculationElement.Attribute(ConfigurationSchemaIdentifiers.NameAttribute).Value) + { + AllowedLevelIncreaseStorage = GetStandardDeviationStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.AllowedLevelIncreaseStorageStochastName), + AreaFlowApertures = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.AreaFlowAperturesStochastName), + BankWidth = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.BankWidthStochastName), + CriticalOvertoppingDischarge = GetVariationCoefficientStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.CriticalOvertoppingDischargeStochastName), + ConstructiveStrengthLinearLoadModel = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.ConstructiveStrengthLinearLoadModelStochastName), + ConstructiveStrengthQuadraticLoadModel = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.ConstructiveStrengthQuadraticLoadModelStochastName), + DrainCoefficient = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.DrainCoefficientStochastName), + EvaluationLevel = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.EvaluationLevelElement), + FactorStormDurationOpenStructure = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.FactorStormDurationOpenStructureElement), + FailureCollisionEnergy = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.FailureCollisionEnergyStochastName), + FailureProbabilityRepairClosure = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.FailureProbabilityRepairClosureElement), + FailureProbabilityStructureWithErosion = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.FailureProbabilityStructureWithErosionElement), + FlowVelocityStructureClosable = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.FlowVelocityStructureClosableStochastName), + FlowWidthAtBottomProtection = GetStandardDeviationStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.FlowWidthAtBottomProtectionStochastName), + ForeshoreProfileName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.ForeshoreProfileNameElement), + HydraulicBoundaryLocationName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.HydraulicBoundaryLocationElement), + InflowModelType = (ConfigurationStabilityPointStructuresInflowModelType?) + calculationElement.GetConvertedValueFromDescendantStringElement( + StabilityPointStructuresConfigurationSchemaIdentifiers.InflowModelTypeElement), + InsideWaterLevel = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.InsideWaterLevelStochastName), + InsideWaterLevelFailureConstruction = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.InsideWaterLevelFailureConstructionStochastName), + LevelCrestStructure = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.LevelCrestStructureStochastName), + LevellingCount = calculationElement.GetIntegerValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.LevellingCountElement), + LoadSchematizationType = (ConfigurationStabilityPointStructuresLoadSchematizationType?) + calculationElement.GetConvertedValueFromDescendantStringElement( + StabilityPointStructuresConfigurationSchemaIdentifiers.LoadSchematizationTypeElement), + ProbabilityCollisionSecondaryStructure = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.ProbabilityCollisionSecondaryStructureElement), + ModelFactorSuperCriticalFlow = GetStandardDeviationStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.ModelFactorSuperCriticalFlowStochastName), + ShipMass = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.ShipMassStochastName), + ShipVelocity = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.ShipVelocityStochastName), + StabilityLinearLoadModel = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.StabilityLinearLoadModelStochastName), + StabilityQuadraticLoadModel = GetVariationCoefficientStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.StabilityQuadraticLoadModelStochastName), + StructureName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), + StorageStructureArea = GetVariationCoefficientStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.StorageStructureAreaStochastName), + StormDuration = GetVariationCoefficientStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.StormDurationStochastName), + StructureNormalOrientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation), + ThresholdHeightOpenWeir = GetStandardDeviationStochastParameters(calculationElement, StabilityPointStructuresConfigurationSchemaIdentifiers.ThresholdHeightOpenWeirStochastName), + VerticalDistance = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.VerticalDistanceElement), + VolumicWeightWater = calculationElement.GetDoubleValueFromDescendantElement(StabilityPointStructuresConfigurationSchemaIdentifiers.VolumicWeightWaterElement), + WaveReduction = GetWaveReductionParameters(calculationElement), + WidthFlowApertures = GetStandardDeviationStochastParameters(calculationElement, ConfigurationSchemaIdentifiers.WidthFlowAperturesStochastName) + }; } + + private static WaveReductionConfiguration GetWaveReductionParameters(XElement calculationElement) + { + XElement waveReduction = calculationElement.GetDescendantElement(ConfigurationSchemaIdentifiers.WaveReduction); + if (waveReduction != null) + { + return new WaveReductionConfiguration + { + BreakWaterType = (ConfigurationBreakWaterType?) calculationElement.GetConvertedValueFromDescendantStringElement(ConfigurationSchemaIdentifiers.BreakWaterType), + BreakWaterHeight = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterHeight), + UseBreakWater = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseBreakWater), + UseForeshoreProfile = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseForeshore) + }; + } + return null; + } + + private static MeanVariationCoefficientStochastConfiguration GetVariationCoefficientStochastParameters(XElement calculationElement, string stochastName) + { + XElement element = calculationElement.GetStochastElement(stochastName); + if (element != null) + { + return new MeanVariationCoefficientStochastConfiguration + { + Mean = element.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.MeanElement), + VariationCoefficient = element.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.VariationCoefficientElement) + }; + } + return null; + } + + private static MeanStandardDeviationStochastConfiguration GetStandardDeviationStochastParameters(XElement calculationElement, string stochastName) + { + XElement element = calculationElement.GetStochastElement(stochastName); + if (element != null) + { + return new MeanStandardDeviationStochastConfiguration + { + Mean = element.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.MeanElement), + StandardDeviation = element.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.StandardDeviationElement) + }; + } + return null; + } } } \ No newline at end of file