Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs =================================================================== diff -u -r404 -r444 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 404) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 444) @@ -692,10 +692,10 @@ DesignResult liftVanCalculationResult = (from calculationResult in upliftVanCalculationResults where calculationResult.LocationName.Equals(bishopCalculationRecord.LocationName) && calculationResult.ScenarioName.Equals(bishopCalculationRecord.ScenarioName) && - calculationResult.StabilityProfileName.Equals(bishopCalculationRecord.StabilityProfileName) + calculationResult.ProfileName.Equals(bishopCalculationRecord.ProfileName) select calculationResult).ToList().FirstOrDefault(); DesignResult normativeCalculationResult = SelectStabilityNormativeResult(bishopCalculationRecord, liftVanCalculationResult, - bishopCalculationRecord.AnalysisType, bishopCalculationRecord.ProbabilisticType); + DamProjectCalculationSpecification.SelectedAnalysisType); // Clone this result, to make sure the original won't be changed normativeCalculationResult = (DesignResult) normativeCalculationResult.Clone(); normativeCalculationResult.DamFailureMechanismeCalculation = bishopLiftvancalculation; @@ -713,32 +713,18 @@ /// /// /// - private DesignResult SelectStabilityNormativeResult(DesignResult bishopCalculationRecord, DesignResult liftVanCalculationResult, AnalysisType analysisType, ProbabilisticType probabilisticType) + private DesignResult SelectStabilityNormativeResult(DesignResult bishopCalculationRecord, DesignResult liftVanCalculationResult, AnalysisType analysisType) { switch (analysisType) { case AnalysisType.NoAdaption: - switch (probabilisticType) { - case ProbabilisticType.Deterministic: - return SelectStabilityNormativeResultDeterministicNormal(liftVanCalculationResult, bishopCalculationRecord); - case ProbabilisticType.Probabilistic: - case ProbabilisticType.ProbabilisticFragility: - return SelectStabilityNormativeResultProbabilisticNormal(liftVanCalculationResult, bishopCalculationRecord); - default: - throw new ArgumentOutOfRangeException("probabilisticType"); + return SelectStabilityNormativeResultDeterministicNormal(liftVanCalculationResult, bishopCalculationRecord); } case AnalysisType.AdaptNWO: case AnalysisType.AdaptGeometry: - switch (probabilisticType) { - case ProbabilisticType.Deterministic: - return SelectStabilityNormativeResultDeterministicDesign(liftVanCalculationResult, bishopCalculationRecord); - case ProbabilisticType.Probabilistic: - case ProbabilisticType.ProbabilisticFragility: - return SelectStabilityNormativeResultProbabilisticDesign(liftVanCalculationResult, bishopCalculationRecord); - default: - throw new ArgumentOutOfRangeException("probabilisticType"); + return SelectStabilityNormativeResultDeterministicDesign(liftVanCalculationResult, bishopCalculationRecord); } default: throw new ArgumentOutOfRangeException("analysisType"); @@ -753,11 +739,11 @@ /// private DesignResult SelectStabilityNormativeResultDeterministicNormal(DesignResult liftVanCalculationResult, DesignResult bishopCalculationRecord) { - if ((liftVanCalculationResult != null) && (liftVanCalculationResult.StabilitySafetyFactor.HasValue)) + if ((liftVanCalculationResult != null) && (liftVanCalculationResult.SafetyFactor.HasValue)) { - if ((bishopCalculationRecord != null) && (bishopCalculationRecord.StabilitySafetyFactor.HasValue)) + if ((bishopCalculationRecord != null) && (bishopCalculationRecord.SafetyFactor.HasValue)) { - return (liftVanCalculationResult.StabilitySafetyFactor.Value < bishopCalculationRecord.StabilitySafetyFactor.Value + return (liftVanCalculationResult.SafetyFactor.Value < bishopCalculationRecord.SafetyFactor.Value ? liftVanCalculationResult : bishopCalculationRecord); } @@ -773,34 +759,23 @@ } /// - /// Select which result is the norm for stability Bishop/UpliftVan design probabilistic calculation - /// - /// - /// - /// - private DesignResult SelectStabilityNormativeResultProbabilisticDesign(DesignResult liftVanCalculationResult, DesignResult bishopCalculationRecord) - { - throw new ApplicationException("Not implemented yet"); - } - - /// /// Select which result is the norm for stability Bishop/UpliftVan design deterministic calculation /// /// /// /// private DesignResult SelectStabilityNormativeResultDeterministicDesign(DesignResult liftVanCalculationResult, DesignResult bishopCalculationRecord) { - if ((liftVanCalculationResult != null) && (liftVanCalculationResult.StabilitySafetyFactor.HasValue)) + if ((liftVanCalculationResult != null) && (liftVanCalculationResult.SafetyFactor.HasValue)) { - if ((bishopCalculationRecord != null) && (bishopCalculationRecord.StabilitySafetyFactor.HasValue)) + if ((bishopCalculationRecord != null) && (bishopCalculationRecord.SafetyFactor.HasValue)) { bool dla = liftVanCalculationResult.DikeLength.HasValue; dla = dla && bishopCalculationRecord.DikeLength.HasValue; if (dla && (Math.Abs(liftVanCalculationResult.DikeLength.Value - bishopCalculationRecord.DikeLength.Value) < GeometryPoint.Precision)) { - return (liftVanCalculationResult.StabilitySafetyFactor < - bishopCalculationRecord.StabilitySafetyFactor + return (liftVanCalculationResult.SafetyFactor < + bishopCalculationRecord.SafetyFactor ? liftVanCalculationResult : bishopCalculationRecord); } @@ -823,17 +798,6 @@ } /// - /// Select which result is the norm for stability Bishop/UpliftVan normal probabilistic calculation - /// - /// - /// - /// - private DesignResult SelectStabilityNormativeResultProbabilisticNormal(DesignResult liftVanCalculationResult, DesignResult bishopCalculationRecord) - { - throw new ApplicationException("Not implemented yet"); - } - - /// /// Create PLLines with selected model /// /// Index: dam engine/trunk/Xsds Liquid/DamCalculationResults.xsd =================================================================== diff -u -r404 -r444 --- dam engine/trunk/Xsds Liquid/DamCalculationResults.xsd (.../DamCalculationResults.xsd) (revision 404) +++ dam engine/trunk/Xsds Liquid/DamCalculationResults.xsd (.../DamCalculationResults.xsd) (revision 444) @@ -41,7 +41,6 @@ - Fisheye: Tag 444 refers to a dead (removed) revision in file `dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/NwoResults.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs =================================================================== diff -u -r441 -r444 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs (.../LocationJob.cs) (revision 441) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs (.../LocationJob.cs) (revision 444) @@ -256,12 +256,12 @@ { foreach (var calculationResult in scenario.CalculationResults) { - if (calculationResult.PipingFailureProbability != null) + if (calculationResult.FailureProbability != null) { - if (calculationResult.PipingFailureProbability.Value > res && - calculationResult.PipingFailureProbability.Value < DamGlobalConstants.NoRunValue) + if (calculationResult.FailureProbability.Value > res && + calculationResult.FailureProbability.Value < DamGlobalConstants.NoRunValue) { - res = calculationResult.PipingFailureProbability.Value; + res = calculationResult.FailureProbability.Value; // if (calculationResult.RequiredFailureProbability != null) #Bka required value must come from input, not results // { // designRequiredFactor = calculationResult.RequiredFailureProbability.Value; Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/StabilityDesignResults.cs =================================================================== diff -u --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/StabilityDesignResults.cs (revision 0) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/StabilityDesignResults.cs (revision 444) @@ -0,0 +1,261 @@ +// Copyright (C) Stichting Deltares 2017. 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.Data.Design; +using Deltares.DamEngine.Data.Geotechnics; + +namespace Deltares.DamEngine.Data.General.Results +{ + /// + /// Class holding the results for the Stability design calculation + /// + public class StabilityDesignResults + { + private int numberOfIterations; + private string resultMessage = ""; + private double? safetyFactor; + private double? failureProbability; + private double? zone1SafetyFactor; + private double? localZone1EntryPointX; + private double? localZone1ExitPointX; + private double? zone2SafetyFactor; + private double? localZone2EntryPointX; + private double? localZone2ExitPointX; + private UpliftSituation? upliftSituation; + private SurfaceLine2 redesignedSurfaceLine; + + /// + /// Gets or sets the number of iterations. + /// + /// + /// The number of iterations. + /// + public int NumberOfIterations + { + get + { + return numberOfIterations; + } + set + { + numberOfIterations = value; + } + } + + /// + /// Gets or sets the result message. + /// + /// + /// The result message. + /// + public string ResultMessage + { + get + { + return resultMessage; + } + set + { + resultMessage = value; + } + } + + /// + /// Gets or sets the stability safety factor. + /// + /// + /// The stability safety factor. + /// + public double? SafetyFactor + { + get + { + return safetyFactor; + } + set + { + safetyFactor = value; + } + } + + /// + /// Gets or sets the stability failure probability. + /// + /// + /// The stability failure probability. + /// + public double? FailureProbability + { + get + { + return failureProbability; + } + set + { + failureProbability = value; + } + } + + /// + /// Gets or sets the zone1 safety factor stability. + /// + /// + /// The zone1 safety factor stability. + /// + public double? Zone1SafetyFactor + { + get + { + return zone1SafetyFactor; + } + set + { + zone1SafetyFactor = value; + } + } + + /// + /// Gets or sets the local zone1 entry point x. + /// + /// + /// The local zone1 entry point x. + /// + public double? LocalZone1EntryPointX + { + get + { + return localZone1EntryPointX; + } + set + { + localZone1EntryPointX = value; + } + } + + /// + /// Gets or sets the local zone1 exit point x. + /// + /// + /// The local zone1 exit point x. + /// + public double? LocalZone1ExitPointX + { + get + { + return localZone1ExitPointX; + } + set + { + localZone1ExitPointX = value; + } + } + + /// + /// Gets or sets the zone2 safety factor stability. + /// + /// + /// The zone2 safety factor stability. + /// + public double? Zone2SafetyFactor + { + get + { + return zone2SafetyFactor; + } + set + { + zone2SafetyFactor = value; + } + } + + /// + /// Gets or sets the local zone2 entry point x. + /// + /// + /// The local zone2 entry point x. + /// + public double? LocalZone2EntryPointX + { + get + { + return localZone2EntryPointX; + } + set + { + localZone2EntryPointX = value; + } + } + + /// + /// Gets or sets the local zone2 exit point x. + /// + /// + /// The local zone2 exit point x. + /// + public double? LocalZone2ExitPointX + { + get + { + return localZone2ExitPointX; + } + set + { + localZone2ExitPointX = value; + } + } + + /// + /// Gets or sets the uplift situation. + /// + /// + /// The uplift situation. + /// + public UpliftSituation? UpliftSituation + { + get + { + return upliftSituation; + } + set + { + upliftSituation = value; + } + } + + /// + /// Gets or sets the redesigned surface line stability. + /// + /// + /// The redesigned surface line stability. + /// + public SurfaceLine2 RedesignedSurfaceLine + { + get + { + return redesignedSurfaceLine; + } + set + { + redesignedSurfaceLine = value; + } + } + } +} Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/PipingDesignResults.cs =================================================================== diff -u --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/PipingDesignResults.cs (revision 0) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/PipingDesignResults.cs (revision 444) @@ -0,0 +1,339 @@ +// Copyright (C) Stichting Deltares 2017. 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.Data.Design; +using Deltares.DamEngine.Data.Geotechnics; + +namespace Deltares.DamEngine.Data.General.Results +{ + public class PipingDesignResults + { + private string resultMessage = ""; + private double? failureProbability; + private double? upliftFactor; + private double? heaveFactor; + private double? blighFactor; + private double? blighHcritical; + private double? sellmeijer4ForcesFactor; + private double? sellmeijer4ForcesHcritical; + private double? sellmeijerVnkFactor; + private double? sellmeijerVnkHcritical; + private double? wti2017Factor; + private double? wti2017Hcritical; + + private double? localExitPointX; + private UpliftSituation? upliftSituation; + private SurfaceLine2 redesignedSurfaceLine; + private readonly PipingModelType pipingModelType; + + public PipingDesignResults(PipingModelType aPipingModelType) + { + pipingModelType = aPipingModelType; + } + + /// + /// Gets or sets the result message. + /// + /// + /// The result message. + /// + public string ResultMessage + { + get + { + return resultMessage; + } + set + { + resultMessage = value; + } + } + + public double? SafetyFactor() + { + switch (pipingModelType) + { + case PipingModelType.Bligh: + return blighFactor; + case PipingModelType.SellmeijerVnk: + return sellmeijerVnkFactor; + case PipingModelType.Sellmeijer4Forces: + return sellmeijer4ForcesFactor; + case PipingModelType.Wti2017: + return wti2017Factor; + default: + return null; + } + } + + /// + /// Gets or sets the failure probability. + /// + /// + /// The failure probability. + /// + public double? FailureProbability + { + get + { + return failureProbability; + } + set + { + failureProbability = value; + } + } + + /// + /// Gets or sets the uplift factor. + /// + /// + /// The uplift factor. + /// + public double? UpliftFactor + { + get + { + return upliftFactor; + } + set + { + upliftFactor = value; + } + } + + /// + /// Gets or sets the heave factor. + /// + /// + /// The heave factor. + /// + public double? HeaveFactor + { + get + { + return heaveFactor; + } + set + { + heaveFactor = value; + } + } + + /// + /// Gets or sets the bligh factor. + /// + /// + /// The bligh factor. + /// + public double? BlighFactor + { + get + { + return blighFactor; + } + set + { + blighFactor = value; + } + } + + /// + /// Gets or sets the bligh hcritical. + /// + /// + /// The bligh hcritical. + /// + public double? BlighHcritical + { + get + { + return blighHcritical; + } + set + { + blighHcritical = value; + } + } + + /// + /// Gets or sets the sellmeijer4 forces factor. + /// + /// + /// The sellmeijer4 forces factor. + /// + public double? Sellmeijer4ForcesFactor + { + get + { + return sellmeijer4ForcesFactor; + } + set + { + sellmeijer4ForcesFactor = value; + } + } + + /// + /// Gets or sets the sellmeijer4 forces hcritical. + /// + /// + /// The sellmeijer4 forces hcritical. + /// + public double? Sellmeijer4ForcesHcritical + { + get + { + return sellmeijer4ForcesHcritical; + } + set + { + sellmeijer4ForcesHcritical = value; + } + } + + /// + /// Gets or sets the sellmeijer VNK factor. + /// + /// + /// The sellmeijer VNK factor. + /// + public double? SellmeijerVnkFactor + { + get + { + return sellmeijerVnkFactor; + } + set + { + sellmeijerVnkFactor = value; + } + } + + /// + /// Gets or sets the sellmeijer VNK hcritical. + /// + /// + /// The sellmeijer VNK hcritical. + /// + public double? SellmeijerVnkHcritical + { + get + { + return sellmeijerVnkHcritical; + } + set + { + sellmeijerVnkHcritical = value; + } + } + + /// + /// Gets or sets the wti2017 factor. + /// + /// + /// The wti2017 factor. + /// + public double? Wti2017Factor + { + get + { + return wti2017Factor; + } + set + { + wti2017Factor = value; + } + } + + /// + /// Gets or sets the wti2017 hcritical. + /// + /// + /// The wti2017 hcritical. + /// + public double? Wti2017Hcritical + { + get + { + return wti2017Hcritical; + } + set + { + wti2017Hcritical = value; + } + } + + /// + /// Gets or sets the local exit point x. + /// + /// + /// The local exit point x. + /// + public double? LocalExitPointX + { + get + { + return localExitPointX; + } + set + { + localExitPointX = value; + } + } + + /// + /// Gets or sets the uplift situation. + /// + /// + /// The uplift situation. + /// + public UpliftSituation? UpliftSituation + { + get + { + return upliftSituation; + } + set + { + upliftSituation = value; + } + } + + /// + /// Gets or sets the redesigned surface line. + /// + /// + /// The redesigned surface line. + /// + public SurfaceLine2 RedesignedSurfaceLine + { + get + { + return redesignedSurfaceLine; + } + set + { + redesignedSurfaceLine = value; + } + } + } +} Index: dam engine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj =================================================================== diff -u -r435 -r444 --- dam engine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 435) +++ dam engine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 444) @@ -84,9 +84,11 @@ - + + + Index: dam engine/trunk/Xsds Liquid/DamDesignResult.xsd =================================================================== diff -u -r404 -r444 --- dam engine/trunk/Xsds Liquid/DamDesignResult.xsd (.../DamDesignResult.xsd) (revision 404) +++ dam engine/trunk/Xsds Liquid/DamDesignResult.xsd (.../DamDesignResult.xsd) (revision 444) @@ -1,16 +1,17 @@ + - + - - + + - + @@ -23,56 +24,69 @@ - + + + + - - - + + + - + - - - - - - - + - + + + + - - - - - - - - - + + - - - - - - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/NwoResults.cs =================================================================== diff -u -r404 -r444 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/NwoResults.cs (.../NwoResults.cs) (revision 404) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/NwoResults.cs (.../NwoDesignResults.cs) (revision 444) @@ -1,24 +1,335 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +// Copyright (C) Stichting Deltares 2017. 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. namespace Deltares.DamEngine.Data.General.Results { - public class NwoResults + /// + /// Class holding the results for the Nwo (design) calculation + /// + public class NwoDesignResults { - private readonly string nwoId; - private readonly int ResultIndex; + private string nwoId; + private int resultIndex; private double? locationXrdStart; private double? locationYrdStart; - private readonly double? locationZrdStart; + private double? locationZrdStart; private double? locationXrdEnd; private double? locationYrdEnd; - private readonly double? locationZrdEnd; - private string resultMessage = ""; + private double? locationZrdEnd; private int numberOfIterations; - private double? safetyFactorStability; + private double? safetyFactor; + private double? zone1SafetyFactor; + private double? localZone1EntryPointX; + private double? localZone1ExitPointX; + private double? zone2SafetyFactor; + private double? localZone2EntryPointX; + private double? localZone2ExitPointX; + + /// + /// Gets or sets the nwo identifier. + /// + /// + /// The nwo identifier. + /// + public string NwoId + { + get + { + return nwoId; + } + set + { + nwoId = value; + } + } + + /// + /// Gets or sets the index of the result. + /// + /// + /// The index of the result. + /// + public int ResultIndex + { + get + { + return resultIndex; + } + set + { + resultIndex = value; + } + } + + /// + /// Gets or sets the location XRD start. + /// + /// + /// The location XRD start. + /// + public double? LocationXrdStart + { + get + { + return locationXrdStart; + } + set + { + locationXrdStart = value; + } + } + + /// + /// Gets or sets the location yrd start. + /// + /// + /// The location yrd start. + /// + public double? LocationYrdStart + { + get + { + return locationYrdStart; + } + set + { + locationYrdStart = value; + } + } + + /// + /// Gets or sets the location ZRD start. + /// + /// + /// The location ZRD start. + /// + public double? LocationZrdStart + { + get + { + return locationZrdStart; + } + set + { + locationZrdStart = value; + } + } + + /// + /// Gets or sets the location XRD end. + /// + /// + /// The location XRD end. + /// + public double? LocationXrdEnd + { + get + { + return locationXrdEnd; + } + set + { + locationXrdEnd = value; + } + } + + /// + /// Gets or sets the location yrd end. + /// + /// + /// The location yrd end. + /// + public double? LocationYrdEnd + { + get + { + return locationYrdEnd; + } + set + { + locationYrdEnd = value; + } + } + + /// + /// Gets or sets the location ZRD end. + /// + /// + /// The location ZRD end. + /// + public double? LocationZrdEnd + { + get + { + return locationZrdEnd; + } + set + { + locationZrdEnd = value; + } + } + + /// + /// Gets or sets the number of iterations. + /// + /// + /// The number of iterations. + /// + public int NumberOfIterations + { + get + { + return numberOfIterations; + } + set + { + numberOfIterations = value; + } + } + + /// + /// Gets or sets the stability safety factor. + /// + /// + /// The stability safety factor. + /// + public double? SafetyFactor + { + get + { + return safetyFactor; + } + set + { + safetyFactor = value; + } + } + + /// + /// Gets or sets the zone1 safety factor stability. + /// + /// + /// The zone1 safety factor stability. + /// + public double? Zone1SafetyFactor + { + get + { + return zone1SafetyFactor; + } + set + { + zone1SafetyFactor = value; + } + } + + /// + /// Gets or sets the local zone1 entry point x. + /// + /// + /// The local zone1 entry point x. + /// + public double? LocalZone1EntryPointX + { + get + { + return localZone1EntryPointX; + } + set + { + localZone1EntryPointX = value; + } + } + + /// + /// Gets or sets the local zone1 exit point x. + /// + /// + /// The local zone1 exit point x. + /// + public double? LocalZone1ExitPointX + { + get + { + return localZone1ExitPointX; + } + set + { + localZone1ExitPointX = value; + } + } + + /// + /// Gets or sets the zone2 safety factor stability. + /// + /// + /// The zone2 safety factor stability. + /// + public double? Zone2SafetyFactor + { + get + { + return zone2SafetyFactor; + } + set + { + zone2SafetyFactor = value; + } + } + + /// + /// Gets or sets the local zone2 entry point x. + /// + /// + /// The local zone2 entry point x. + /// + public double? LocalZone2EntryPointX + { + get + { + return localZone2EntryPointX; + } + set + { + localZone2EntryPointX = value; + } + } + + /// + /// Gets or sets the local zone2 exit point x. + /// + /// + /// The local zone2 exit point x. + /// + public double? LocalZone2ExitPointX + { + get + { + return localZone2ExitPointX; + } + set + { + localZone2ExitPointX = value; + } + } } } Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs =================================================================== diff -u -r435 -r444 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 435) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 444) @@ -21,16 +21,17 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.IO; using Deltares.DamEngine.Data.Design; -using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.Data.Standard; using Deltares.DamEngine.Data.Standard.Calculation; namespace Deltares.DamEngine.Data.General.Results { + /// + /// Contains the results for the design calculations. + /// + /// public class DesignResult : ICloneable { private string id; @@ -40,143 +41,92 @@ private string locationName; private string scenarioName; - - - - private double? failureProbabilityPiping; - private double? localPipingExitPointX; - private SurfaceLine2 redesignedSurfaceLinePiping; - private double? safetyFactorStability; - private double? failureProbabilityStability; - private double? zone1SafetyFactorStability; - private double? localZone1EntryPointX; - private double? localZone1ExitPointX; - private double? zone2SafetyFactorStability; - private double? localZone2EntryPointX; - private double? localZone2ExitPointX; - private double? upliftFactor; - private double? heaveFactor; - private double? blighPipingFactor; - private double? blighHCritical; - private double? sellmeijer4ForcesPipingFactor; - private double? sellmeijer4ForcesHCritical; - private double? sellmeijerPipingFactor; - private double? sellmeijerHCritical; - private double? wti2017PipingFactor; - private double? wti2017HCritical; - private bool? isUplift; - private double? pl3MinUplift; - private double? pl3HeadAdjusted; - private double? pl3LocalLocationXMinUplift; - private double? pl4MinUplift; - private double? pl4HeadAdjusted; - private double? pl4LocalLocationXMinUplift; - private readonly string nwoId; - private readonly int nwoResultIndex; - private double? locationXrdStart; - private double? locationYrdStart; - private readonly double? locationZrdStart; - private double? locationXrdEnd; - private double? locationYrdEnd; - private readonly double? locationZrdEnd; + private string profileName; + private double? safetyFactor; + private double? failureProbability; private CalculationResult calculationResult = CalculationResult.NoRun; - private string resultMessage = ""; - private int numberOfIterations; - private SurfaceLine2 redesignedSurfaceLineStability; - public DesignResult() - { - } - - //temp place holders, must be removed/replaced as these are not realy part of results + private NwoDesignResults nwoDesignResults; + private StabilityDesignResults stabilityDesignResults; + private PipingDesignResults pipingDesignResults; + + + /// + /// Gets or sets the dam failure mechanisme calculation. + /// Note: this is a placeholder, not to be part of the results as written to xml + /// + /// + /// The dam failure mechanisme calculation. + /// public DamFailureMechanismeCalculationSpecification DamFailureMechanismeCalculation { get; set; } - public AnalysisType AnalysisType { get; set; } // if realy needed, move to proper location (stability) - public ProbabilisticType ProbabilisticType { get; set; } // if realy needed, move to proper location (stability) + + /// + /// Gets or sets the scenario. + /// Note: this is a placeholder, not to be part of the results as written to xml + /// + /// + /// The scenario. + /// public DesignScenario Scenario { get; set; } - public double? DikeLength { get; set; } - public CalculationResult CalculationResult // derived result, involves ResultMessage, mstabResults (stab) or PipingFactor == null && this.PipingFailureProbability + + /// + /// Gets or sets the length of the dike as derived value. + /// Note: this is a placeholder, not to be part of the results as written to xml. + /// It is currently used by the DamProjectCalculator. + /// + /// + /// The length of the dike. + /// + public double? DikeLength { - get { return calculationResult;} - set{calculationResult = value;} - } - public double? SafetyFactor // derived result - { get { - double? res = null; + double? maxDikeLength = null; + List dikeLengths = new List(); + SurfaceLine2 surfaceLine = Scenario.Location.SurfaceLine2; + if (surfaceLine != null) + dikeLengths.Add(surfaceLine.GetDikeLength()); switch (DamFailureMechanismeCalculation.FailureMechanismSystemType) { - case FailureMechanismSystemType.HorizontalBalance: - case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: - res = StabilitySafetyFactor; + if (stabilityDesignResults.RedesignedSurfaceLine != null) + dikeLengths.Add(stabilityDesignResults.RedesignedSurfaceLine.GetDikeLength()); break; case FailureMechanismSystemType.Piping: - res = PipingFactor; + if (pipingDesignResults.RedesignedSurfaceLine != null) + dikeLengths.Add(pipingDesignResults.RedesignedSurfaceLine.GetDikeLength()); break; } - return res; - } - } - public double? PipingFactor // derived result - { - get - { - double? res = null; - if (DamFailureMechanismeCalculation.FailureMechanismSystemType == FailureMechanismSystemType.Piping) - { - switch (DamFailureMechanismeCalculation.PipingModelType) - { - case PipingModelType.Bligh: - res = BlighPipingFactor; - break; - case PipingModelType.SellmeijerVnk: - res = SellmeijerPipingFactor; - break; - case PipingModelType.Sellmeijer4Forces: - res = Sellmeijer4ForcesPipingFactor; - break; - case PipingModelType.Wti2017: - res = Wti2017PipingFactor; - break; - } - } - return res; - } - } - public double? FailureProbability // derived result - { - get - { - double? res = null; - switch (DamFailureMechanismeCalculation.FailureMechanismSystemType) + foreach (double? dikeLength in dikeLengths) { - case FailureMechanismSystemType.HorizontalBalance: - case FailureMechanismSystemType.StabilityOutside: - case FailureMechanismSystemType.StabilityInside: - res = StabilityFailureProbability; - break; - case FailureMechanismSystemType.Piping: - res = PipingFailureProbability; - break; + if (dikeLength.HasValue && (!maxDikeLength.HasValue || maxDikeLength < dikeLength)) + maxDikeLength = dikeLength; } - return res; + return maxDikeLength; } } - //Identifiers, needed to retrace the origin of the result - public string LocationName - { - get { return locationName; } - } - public string ScenarioName // input, not result + /// + /// Initializes a new instance of the class. + /// Is only to be used by this.Clone(), nowhere else + /// + internal DesignResult() { - get { return scenarioName; } + // only for Clone() method } - public string StabilityProfileName { get; set; } //methode terughalen uit csvexport indien nodig - + /// + /// Initializes a new instance of the class. + /// + /// The identifier. + /// The dam failure mechanisme calculation specification. + /// The scenario. + /// The soil profile. + /// Name of the soil geometry2 d. + /// Type of the analysis. + /// Index of the nwo result. + /// Type of the probabilistic. public DesignResult(string id, DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification, DesignScenario scenario, SoilProfile1D soilProfile, string soilGeometry2DName, AnalysisType analysisType, int nwoResultIndex, ProbabilisticType probabilisticType) { @@ -185,491 +135,341 @@ yrd = scenario.Location.YRd; locationName = scenario.Location.Name; scenarioName = scenario.LocationScenarioID; // terughalen vanuit csvexport indien echt nodig - this.BaseFileName = ""; + baseFileName = ""; DamFailureMechanismeCalculation = damFailureMechanismeCalculationSpecification; -// this.scenario = scenario; -// this.soilProfile = soilProfile; -// this.SoilGeometry2DName = soilGeometry2DName; - this.failureProbabilityPiping = null; - this.redesignedSurfaceLinePiping = null; - this.safetyFactorStability = null; - this.failureProbabilityStability = null; - this.redesignedSurfaceLineStability = null; - this.zone1SafetyFactorStability = null; - this.LocalZone1EntryPointX = null; - this.LocalZone1ExitPointX = null; - this.zone2SafetyFactorStability = null; - this.LocalZone2EntryPointX = null; - this.LocalZone2ExitPointX = null; - this.blighPipingFactor = null; - this.blighHCritical = null; - this.sellmeijer4ForcesPipingFactor = null; - this.sellmeijer4ForcesHCritical = null; - this.sellmeijerPipingFactor = null; - this.sellmeijerHCritical = null; - this.wti2017PipingFactor = null; - this.wti2017HCritical = null; - this.isUplift = null; - this.pl3MinUplift = null; - this.pl3HeadAdjusted = null; - this.pl3LocalLocationXMinUplift = null; - this.pl4MinUplift = null; - this.pl4HeadAdjusted = null; - this.pl4LocalLocationXMinUplift = null; - this.nwoId = ""; - this.nwoResultIndex = nwoResultIndex; - this.locationXrdStart = null; - this.locationXrdEnd = null; - this.locationYrdStart = null; - this.locationYrdEnd = null; - this.locationZrdStart = null; - this.locationZrdEnd = null; - + Scenario = scenario; + if (damFailureMechanismeCalculationSpecification != null) { switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: case FailureMechanismSystemType.StabilityOutside: - + profileName = soilGeometry2DName; if (analysisType == AnalysisType.AdaptNWO) { // an index of 0 can also indicate an error message. That has no futher data so check if there actualy is any. if (scenario.NwoResults.Count > 0) { - this.nwoId = scenario.NwoResults[nwoResultIndex].NwoId; - this.locationXrdStart = scenario.NwoResults[nwoResultIndex].LocationXrdStart; - this.locationYrdStart = scenario.NwoResults[nwoResultIndex].LocationYrdStart; - this.locationZrdStart = scenario.NwoResults[nwoResultIndex].LocationZrdStart; - this.locationXrdEnd = scenario.NwoResults[nwoResultIndex].LocationXrdEnd; - this.locationYrdEnd = scenario.NwoResults[nwoResultIndex].LocationYrdEnd; - this.locationZrdEnd = scenario.NwoResults[nwoResultIndex].LocationZrdEnd; - this.BaseFileName = scenario.NwoResults[nwoResultIndex].MStabResults.CalculationName; - this.numberOfIterations = scenario.NwoResults[nwoResultIndex].MStabResults.IterationNumber; - this.safetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor; - this.zone1SafetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor; - this.LocalZone1EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.entryPointXCoordinate; - this.LocalZone1ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.exitPointXCoordinate; + nwoDesignResults = new NwoDesignResults + { + NwoId = scenario.NwoResults[nwoResultIndex].NwoId, + LocationXrdStart = scenario.NwoResults[nwoResultIndex].LocationXrdStart, + LocationYrdStart = scenario.NwoResults[nwoResultIndex].LocationYrdStart, + LocationZrdStart = scenario.NwoResults[nwoResultIndex].LocationZrdStart, + LocationXrdEnd = scenario.NwoResults[nwoResultIndex].LocationXrdEnd, + LocationYrdEnd = scenario.NwoResults[nwoResultIndex].LocationYrdEnd, + LocationZrdEnd = scenario.NwoResults[nwoResultIndex].LocationZrdEnd, + NumberOfIterations = scenario.NwoResults[nwoResultIndex].MStabResults.IterationNumber, + SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor, + Zone1SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor, + LocalZone1EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.entryPointXCoordinate, + LocalZone1ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.exitPointXCoordinate, + ResultIndex = nwoResultIndex + }; + if (scenario.NwoResults[nwoResultIndex].MStabResults.zone2 != null) { - this.zone2SafetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.safetyFactor; - this.LocalZone2EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.entryPointXCoordinate; - this.LocalZone2ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.exitPointXCoordinate; + nwoDesignResults.Zone2SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.safetyFactor; + nwoDesignResults.LocalZone2EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.entryPointXCoordinate; + nwoDesignResults.LocalZone2ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.exitPointXCoordinate; } + baseFileName = scenario.NwoResults[nwoResultIndex].MStabResults.CalculationName; } } else { + stabilityDesignResults = new StabilityDesignResults(); MStabResults? mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName); - this.resultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); - calculationResult = DetermineStabilityCalculationResult(this.resultMessage, mstabResults); + stabilityDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); + calculationResult = DetermineStabilityCalculationResult(stabilityDesignResults.ResultMessage, mstabResults); if (mstabResults != null) { - BaseFileName = mstabResults.Value.CalculationName; - numberOfIterations = mstabResults.Value.IterationNumber; - this.safetyFactorStability = mstabResults.Value.zone1.safetyFactor; - this.zone1SafetyFactorStability = mstabResults.Value.zone1.safetyFactor; - this.LocalZone1EntryPointX = mstabResults.Value.zone1.entryPointXCoordinate; - this.LocalZone1ExitPointX = mstabResults.Value.zone1.exitPointXCoordinate; + baseFileName = mstabResults.Value.CalculationName; + stabilityDesignResults.NumberOfIterations = mstabResults.Value.IterationNumber; + stabilityDesignResults.SafetyFactor = mstabResults.Value.zone1.safetyFactor; + stabilityDesignResults.Zone1SafetyFactor = mstabResults.Value.zone1.safetyFactor; + stabilityDesignResults.LocalZone1EntryPointX = mstabResults.Value.zone1.entryPointXCoordinate; + stabilityDesignResults.LocalZone1ExitPointX = mstabResults.Value.zone1.exitPointXCoordinate; if (mstabResults.Value.zone2 != null) { - this.zone2SafetyFactorStability = mstabResults.Value.zone2.Value.safetyFactor; - this.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate; - this.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate; + stabilityDesignResults.Zone2SafetyFactor = mstabResults.Value.zone2.Value.safetyFactor; + stabilityDesignResults.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate; + stabilityDesignResults.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate; } } } - this.failureProbabilityStability = scenario.GetFailureProbabilityStability(soilProfile, soilGeometry2DName); - this.redesignedSurfaceLineStability = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); + stabilityDesignResults.FailureProbability = scenario.GetFailureProbabilityStability(soilProfile, soilGeometry2DName); + failureProbability = stabilityDesignResults.FailureProbability; + stabilityDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); UpliftSituation? upliftSituation = scenario.GetStabilityUpliftSituation(soilProfile, soilGeometry2DName); if (upliftSituation != null) { - SetUpliftSituationResults(upliftSituation.Value); + stabilityDesignResults.UpliftSituation = upliftSituation; } - break; case FailureMechanismSystemType.Piping: - - this.failureProbabilityPiping = scenario.GetFailureProbabilityPiping(soilProfile, soilGeometry2DName); - this.resultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); - this.redesignedSurfaceLinePiping = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); + pipingDesignResults = new PipingDesignResults(damFailureMechanismeCalculationSpecification.PipingModelType); + profileName = soilProfile.Name; + pipingDesignResults.FailureProbability = scenario.GetFailureProbabilityPiping(soilProfile, soilGeometry2DName); + failureProbability = pipingDesignResults.FailureProbability; + pipingDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); + pipingDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); UpliftSituation? upliftSituationPiping = scenario.GetStabilityUpliftSituation(soilProfile, soilGeometry2DName); if (upliftSituationPiping != null) { - SetUpliftSituationResults(upliftSituationPiping.Value); + pipingDesignResults.UpliftSituation = upliftSituationPiping; } PipingResults? pipingResults = scenario.GetPipingResults(soilProfile, soilGeometry2DName); if (pipingResults != null) { - BaseFileName = pipingResults.Value.CalculationName; - this.blighPipingFactor = pipingResults.Value.BlighPipingFactor; - this.blighHCritical = pipingResults.Value.BlighHCritical; - this.sellmeijer4ForcesPipingFactor = pipingResults.Value.Sellmeijer4ForcesPipingFactor; - this.sellmeijer4ForcesHCritical = pipingResults.Value.Sellmeijer4ForcesHCritical; - this.sellmeijerPipingFactor = pipingResults.Value.SellmeijerVnkPipingFactor; - this.sellmeijerHCritical = pipingResults.Value.SellmeijerVnkHCritical; - this.wti2017PipingFactor = pipingResults.Value.Wti2017PipingFactor; - this.wti2017HCritical = pipingResults.Value.Wti2017HCritical; - this.localPipingExitPointX = pipingResults.Value.PipingExitPointX; - this.heaveFactor = pipingResults.Value.HeaveFactor; - this.upliftFactor = pipingResults.Value.UpliftFactor; + baseFileName = pipingResults.Value.CalculationName; + pipingDesignResults.BlighFactor = pipingResults.Value.BlighPipingFactor; + pipingDesignResults.BlighHcritical = pipingResults.Value.BlighHCritical; + pipingDesignResults.Sellmeijer4ForcesFactor = pipingResults.Value.Sellmeijer4ForcesPipingFactor; + pipingDesignResults.Sellmeijer4ForcesHcritical = pipingResults.Value.Sellmeijer4ForcesHCritical; + pipingDesignResults.SellmeijerVnkFactor = pipingResults.Value.SellmeijerVnkPipingFactor; + pipingDesignResults.SellmeijerVnkHcritical = pipingResults.Value.SellmeijerVnkHCritical; + pipingDesignResults.Wti2017Factor = pipingResults.Value.Wti2017PipingFactor; + pipingDesignResults.Wti2017Hcritical = pipingResults.Value.Wti2017HCritical; + pipingDesignResults.LocalExitPointX = pipingResults.Value.PipingExitPointX; + pipingDesignResults.HeaveFactor = pipingResults.Value.HeaveFactor; + pipingDesignResults.UpliftFactor = pipingResults.Value.UpliftFactor; } - this.calculationResult = (this.PipingFactor == null && PipingFailureProbability == null) ? CalculationResult.RunFailed : CalculationResult.Succeeded; + calculationResult = (pipingDesignResults.SafetyFactor() == null && pipingDesignResults.FailureProbability == null) ? CalculationResult.RunFailed : CalculationResult.Succeeded; break; } } } /// - /// Determines the stability calculation run result. + /// Gets the identifier. /// - /// The result message. - /// The mstab results. - /// - private CalculationResult DetermineStabilityCalculationResult(string message, MStabResults? mstabResults) + /// + /// The identifier. + /// + public string Id { - CalculationResult result; - if ((message != null) && message.Contains("FAIL")) - { - result = CalculationResult.UnexpectedError; - } - else - { - // If no failure and no results, then no run has been made - result = mstabResults != null ? CalculationResult.Succeeded : CalculationResult.NoRun; - } - return result; + get { return id; } } /// - /// Sets the uplift situation results. + /// Gets the XRD. /// - /// The uplift situation. - private void SetUpliftSituationResults(UpliftSituation upliftSituation) + /// + /// The XRD. + /// + public double Xrd { - this.isUplift = upliftSituation.IsUplift; - if (upliftSituation.Pl3MinUplift < double.MaxValue) - { - this.pl3MinUplift = upliftSituation.Pl3MinUplift; - } - if (upliftSituation.Pl3HeadAdjusted < double.MaxValue) - { - this.pl3HeadAdjusted = upliftSituation.Pl3HeadAdjusted; - } - if (upliftSituation.Pl3LocationXMinUplift < double.MaxValue) - { - this.pl3LocalLocationXMinUplift = upliftSituation.Pl3LocationXMinUplift; - } - if (upliftSituation.Pl4MinUplift < double.MaxValue) - { - this.pl4MinUplift = upliftSituation.Pl4MinUplift; - } - if (upliftSituation.Pl4HeadAdjusted < double.MaxValue) - { - this.pl4HeadAdjusted = upliftSituation.Pl4HeadAdjusted; - } - if (upliftSituation.Pl4LocationXMinUplift < double.MaxValue) - { - this.pl4LocalLocationXMinUplift = upliftSituation.Pl4LocationXMinUplift; - } - } - - public int NumberOfIterations // real results for NWo - { - get { return numberOfIterations; } - set { numberOfIterations = value; } - } - - public string ID - { - get { return this.id; } - } - - public string ResultMessage // real result - { - get { return resultMessage; } - set { resultMessage = value; } - } - - public double Xrd //Xrd iput but very usefull as output as well - { get { return xrd; } } - public double Yrd //Yrd iput but very usefull as output as well + /// + /// Gets the yrd. + /// + /// + /// The yrd. + /// + public double Yrd { get { return yrd; } } - public double? StabilitySafetyFactor // real result stab and nwostab + //Identifiers, needed to retrace the origin of the result + /// + /// Gets the name of the location. + /// For identification purpose + /// + /// + /// The name of the location. + /// + public string LocationName { - get { return this.safetyFactorStability; } - set { this.safetyFactorStability = value; } + get { return locationName; } } - public double? StabilityFailureProbability // real result stab + /// + /// Gets the name of the scenario. + /// For identification purpose + /// + /// + /// The name of the scenario. + /// + public string ScenarioName { - get { return this.failureProbabilityStability; } - set { this.failureProbabilityStability = value; } + get { return scenarioName; } } - public double? PipingFailureProbability // real result piping + /// + /// Gets or sets the name of the profile. + /// For identification purpose + /// + /// + /// The name of the profile. + /// + public string ProfileName { - get { return this.failureProbabilityPiping; } - set { this.failureProbabilityPiping = value; } + get + { + return profileName; + } + set + { + profileName = value; + } } - public double? Zone1SafetyFactorStability // real result for stab and nwostab + /// + /// Gets or sets the name of the base file. + /// + /// + /// The name of the base file. + /// Can be used to retrace results files. + /// + public string BaseFileName // real result for all. { - get { return this.zone1SafetyFactorStability; } - set { this.zone1SafetyFactorStability = value; } + get { return baseFileName; } + set { baseFileName = value; } } - public double? LocalZone1EntryPointX // real result for stab and nwostab + /// + /// Gets or sets the calculation result. + /// This is a derived result. + /// + /// + /// The calculation result. + /// + public CalculationResult CalculationResult { - get { return localZone1EntryPointX; } - set { localZone1EntryPointX = value; } + get { return calculationResult; } + set { calculationResult = value; } } - public double? LocalZone1ExitPointX // real result stab and nwostab + /// + /// Gets the safety factor (derived result). + /// + /// + /// The safety factor. + /// + public double? SafetyFactor { - get { return localZone1ExitPointX; } - set { localZone1ExitPointX = value; } + get + { + return safetyFactor; + } + set + { + safetyFactor = value; + } } - public double? Zone2SafetyFactorStability // real result stab and nwostab + /// + /// Gets or sets the failure probability (derived result). + /// + /// + /// The failure probability. + /// + public double? FailureProbability { - get { return this.zone2SafetyFactorStability; } - set { this.zone2SafetyFactorStability = value; } + get + { + return failureProbability; + } + set + { + failureProbability = value; + } } - - public double? LocalZone2EntryPointX // real result stab and nwostab + /// + /// Gets or sets the nwo design results. + /// + /// + /// The nwo design results. + /// + public NwoDesignResults NwoDesignResults { - get { return localZone2EntryPointX; } - set { localZone2EntryPointX = value; } + get + { + return nwoDesignResults; + } + set + { + nwoDesignResults = value; + } } - public double? LocalZone2ExitPointX // real result stab and nwostab - { - get { return localZone2ExitPointX; } - set { localZone2ExitPointX = value; } - } - - public bool? IsUplift // real result stab and piping - { - get { return this.isUplift; } - set { this.isUplift = value; } - } - - public double? Pl3MinUplift // real result stab and piping - { - get { return this.pl3MinUplift; } - set { this.pl3MinUplift = value; } - } - - public double? Pl3HeadAdjusted // real result stab and piping - { - get { return this.pl3HeadAdjusted; } - set { this.pl3HeadAdjusted = value; } - } - - public double? Pl3LocalLocationXMinUplift // real result stab and piping - { - get { return this.pl3LocalLocationXMinUplift; } - set { this.pl3LocalLocationXMinUplift = value; } - } - - public double? Pl4MinUplift // real result stab and piping - { - get { return this.pl4MinUplift; } - set { this.pl4MinUplift = value; } - } - - public double? Pl4HeadAdjusted // real result stab and piping - { - get { return this.pl4HeadAdjusted; } - set { this.pl4HeadAdjusted = value; } - } - - public double? Pl4LocalLocationXMinUplift // real result stab and piping - { - get { return this.pl4LocalLocationXMinUplift; } - set { this.pl4LocalLocationXMinUplift = value; } - } - - public double? UpliftFactor // real result piping - { - get { return this.upliftFactor; } - set { this.upliftFactor = value; } - } - - public double? HeaveFactor // real result piping - { - get { return this.heaveFactor; } - set { this.heaveFactor = value; } - } - - public double? BlighPipingFactor // real result piping - { - get { return this.blighPipingFactor; } - set { this.blighPipingFactor = value; } - } - - public double? BlighHCritical // real result piping - { - get { return this.blighHCritical; } - set { this.blighHCritical = value; } - } - - public double? Sellmeijer4ForcesPipingFactor // real result piping - { - get { return this.sellmeijer4ForcesPipingFactor; } - set { this.sellmeijer4ForcesPipingFactor = value; } - } - - public double? Sellmeijer4ForcesHCritical // real result piping - { - get { return this.sellmeijer4ForcesHCritical; } - set { this.sellmeijer4ForcesHCritical = value; } - } - - public double? SellmeijerPipingFactor // real result piping - { - get { return this.sellmeijerPipingFactor; } - set { this.sellmeijerPipingFactor = value; } - } - - public double? SellmeijerHCritical // real result piping - { - get { return this.sellmeijerHCritical; } - set { this.sellmeijerHCritical = value; } - } - /// - /// Gets or sets the wti2017 piping factor. + /// Gets or sets the stability design results. /// /// - /// The wti2017 piping factor. + /// The stability design results. /// - public double? Wti2017PipingFactor // real result piping + public StabilityDesignResults StabilityDesignResults { - get { return wti2017PipingFactor; } - set { wti2017PipingFactor = value; } + get + { + return stabilityDesignResults; + } + set + { + stabilityDesignResults = value; + } } /// - /// Gets or sets the wti2017 h critical. + /// Gets or sets the piping design results. /// /// - /// The wti2017 h critical. + /// The piping design results. /// - public double? Wti2017HCritical // real result piping + public PipingDesignResults PipingDesignResults { - get { return wti2017HCritical; } - set { wti2017HCritical = value; } + get + { + return pipingDesignResults; + } + set + { + pipingDesignResults = value; + } } - public string NwoId { get { return this.nwoId; } } // real result nwostab - - public int NwoResultIndex // real result nwostab - { - get { return this.nwoResultIndex; } - } - - public double? NWOLocationXrdStart // real result nwostab - { - get { return this.locationXrdStart; } - } - - public double? NWOLocationYrdStart // real result nwostab - { - get { return this.locationYrdStart; } - } - - public double? NWOLocationZrdStart // real result nwostab - { - get { return this.locationZrdStart; } - } - - public double? NWOLocationXrdEnd // real result nwostab - { - get { return this.locationXrdEnd; } - } - - public double? NWOLocationYrdEnd // real result nwostab - { - get { return this.locationYrdEnd; } - } - - public double? NWOLocationZrdEnd { get { return this.locationZrdEnd; } } // real result nwostab - //Note: using SurfaceLine instead of LocalXzSurfaceLine must give the proper RD coors. If this is not the case, error is somewhere else. Do not convert here! - - public SurfaceLine2 RedesignedSurfaceLine2Stability // real result stab - { - get { return redesignedSurfaceLineStability; } - set { redesignedSurfaceLineStability = value; } - } - - public SurfaceLine2 RedesignedSurfaceLine2Piping // real result piping - { - get { return redesignedSurfaceLinePiping; } - set { redesignedSurfaceLinePiping = value; } - } - - public double? LocalPipingExitPointX // real result piping - { - get { return localPipingExitPointX; } - set { localPipingExitPointX = value; } - } - - public string BaseFileName // real result for all. - { - get { return baseFileName; } - set { baseFileName = value; } - } - /// /// Copy data /// /// - public void Assign(DesignResult designResult) + private void Assign(DesignResult designResult) { - this.id = designResult.id; - this.BaseFileName = designResult.BaseFileName; - this.NumberOfIterations = designResult.NumberOfIterations; -// this.damFailureMechanismeCalculationSpecification = designResult.damFailureMechanismeCalculationSpecification; -// this.Scenario = designResult.Scenario; -// this.SoilProfile = designResult.SoilProfile; -// this.SoilGeometry2DName = designResult.SoilGeometry2DName; - this.failureProbabilityPiping = designResult.failureProbabilityPiping; - this.redesignedSurfaceLinePiping = designResult.redesignedSurfaceLinePiping; - this.safetyFactorStability = designResult.safetyFactorStability; - this.failureProbabilityStability = designResult.failureProbabilityStability; - this.zone1SafetyFactorStability = designResult.zone1SafetyFactorStability; - this.LocalZone1EntryPointX = designResult.LocalZone1EntryPointX; - this.LocalZone1ExitPointX = designResult.LocalZone1ExitPointX; - this.zone2SafetyFactorStability = designResult.zone2SafetyFactorStability; - this.LocalZone2EntryPointX = designResult.LocalZone2EntryPointX; - this.LocalZone2ExitPointX = designResult.LocalZone2ExitPointX; - this.blighPipingFactor = designResult.blighPipingFactor; - this.blighHCritical = designResult.blighHCritical; - this.sellmeijer4ForcesPipingFactor = designResult.sellmeijer4ForcesPipingFactor; - this.sellmeijer4ForcesHCritical = designResult.sellmeijer4ForcesHCritical; - this.sellmeijerPipingFactor = designResult.sellmeijerPipingFactor; - this.sellmeijerHCritical = designResult.sellmeijerHCritical; - this.wti2017PipingFactor = designResult.wti2017PipingFactor; - this.wti2017HCritical = designResult.wti2017HCritical; - this.redesignedSurfaceLineStability = designResult.redesignedSurfaceLineStability; - this.calculationResult = designResult.calculationResult; + // copy place holders + DamFailureMechanismeCalculation = designResult.DamFailureMechanismeCalculation; + Scenario = designResult.Scenario; + + // copy direct data + id = designResult.id; + xrd = designResult.Xrd; + yrd = designResult.Yrd; + baseFileName = designResult.BaseFileName; + locationName = designResult.LocationName; + scenarioName = designResult.ScenarioName; + profileName = designResult.ProfileName; + safetyFactor = designResult.SafetyFactor; + failureProbability = designResult.FailureProbability; + calculationResult = designResult.calculationResult; + nwoDesignResults = new NwoDesignResults(); + designResult.NwoDesignResults.CloneProperties(nwoDesignResults); + stabilityDesignResults = new StabilityDesignResults(); + designResult.StabilityDesignResults.CloneProperties(stabilityDesignResults); + pipingDesignResults = new PipingDesignResults(DamFailureMechanismeCalculation.PipingModelType); + designResult.PipingDesignResults.CloneProperties(pipingDesignResults); } /// @@ -678,14 +478,32 @@ /// public object Clone() { - var soilProfile = new SoilProfile1D(); - var soilGeometry2DName = ""; - DesignResult designResult = new DesignResult(id, DamFailureMechanismeCalculation, Scenario, - soilProfile, soilGeometry2DName, AnalysisType, nwoResultIndex, ProbabilisticType); + DesignResult designResult = new DesignResult(); designResult.Assign(this); return designResult; - } + } + + /// + /// Determines the stability calculation run result. + /// + /// The result message. + /// The mstab results. + /// + private CalculationResult DetermineStabilityCalculationResult(string message, MStabResults? mstabResults) + { + CalculationResult result; + if ((message != null) && message.Contains("FAIL")) + { + result = CalculationResult.UnexpectedError; + } + else + { + // If no failure and no results, then no run has been made + result = mstabResults != null ? CalculationResult.Succeeded : CalculationResult.NoRun; + } + return result; + } } } \ No newline at end of file