Index: dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs
===================================================================
diff -u -r469 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs (.../FillXmlOutputFromDamTests.cs) (revision 469)
+++ dam engine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs (.../FillXmlOutputFromDamTests.cs) (revision 586)
@@ -67,13 +67,11 @@
};
for (int i = 0; i < resultsCount; i++)
{
- var result = new DesignResult("res " + i, i * 2.2, i * 3.3, "location " + i, "Scenario " + (i * 2))
+ var result = new DesignResult("location " + i, "Scenario " + (i * 2))
{
BaseFileName = "my basefilename " + i,
ProfileName = "profile" + i
};
- result.SetSafetyFactor(0.67 * i);
- result.FailureProbability = 0.004 * i;
result.CalculationResult = CalculationResult.RunFailed;
result.PipingDesignResults = new PipingDesignResults(PipingModelType.Bligh)
{
Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs
===================================================================
diff -u -r502 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 502)
+++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 586)
@@ -52,14 +52,12 @@
for (int i = 0; i < output.Results.CalculationResults.DesignResults.Length; i++)
{
var designResult = output.Results.CalculationResults.DesignResults[i];
- var desResult = new Data.General.Results.DesignResult(designResult.Id, designResult.Xrd, designResult.Yrd, designResult.LocationName, designResult.ScenarioName)
+ var desResult = new Data.General.Results.DesignResult(designResult.LocationName, designResult.ScenarioName)
{
BaseFileName = designResult.BaseFileName,
ProfileName = designResult.ProfileName
};
- if (designResult.SafetyFactorSpecified) desResult.SetSafetyFactor(designResult.SafetyFactor);
- if (designResult.FailureProbabilitySpecified) desResult.FailureProbability = designResult.FailureProbability;
desResult.CalculationResult = ConversionHelper.ConvertToCalculationResult(designResult.CalculationResult);
if (designResult.PipingDesignResults != null)
Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs
===================================================================
diff -u -r576 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 576)
+++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 586)
@@ -34,24 +34,53 @@
///
public class DesignResult : ICloneable
{
- private string id;
- private double xrd;
- private double yrd;
+ private double? safetyFactor;
+ private double? failureProbability;
+
private string baseFileName;
private string locationName;
private string scenarioName;
private string profileName;
- private double? safetyFactor;
- private double? failureProbability;
private CalculationResult calculationResult = CalculationResult.NoRun;
- private NwoDesignResults nwoDesignResults;
private StabilityDesignResults stabilityDesignResults;
private PipingDesignResults pipingDesignResults;
-
-
+
///
+ /// Gets the safety factor (derived result).
+ /// Note: this is a placeholder, not to be part of the results as written to xml
+ ///
+ ///
+ /// The safety factor.
+ ///
+ public double? SafetyFactor
+ {
+ get
+ {
+ return safetyFactor;
+ }
+ }
+
+ ///
+ /// Gets or sets the failure probability (derived result).
+ /// Note: this is a placeholder, not to be part of the results as written to xml
+ ///
+ ///
+ /// The failure probability.
+ ///
+ public double? FailureProbability
+ {
+ get
+ {
+ return failureProbability;
+ }
+ set
+ {
+ failureProbability = value;
+ }
+ }
+ ///
/// Gets or sets the dam failure mechanisme calculation.
/// Note: this is a placeholder, not to be part of the results as written to xml
///
@@ -125,16 +154,10 @@
/// Initializes a new instance of the class.
/// Needed for testing purposes.
///
- /// The identifier.
- /// The x rd.
- /// The y rd.
/// Name of the location.
/// Name of the scenario.
- internal DesignResult(string id, double xRd, double yRd, string locationName, string scenarioName)
+ internal DesignResult(string locationName, string scenarioName)
{
- this.id = id;
- xrd = xRd;
- yrd = yRd;
this.locationName = locationName;
this.scenarioName = scenarioName;
}
@@ -149,12 +172,9 @@
/// Name of the soil geometry2 d.
/// Type of the analysis.
/// Index of the nwo result.
- public DesignResult(string id, DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification,
+ public DesignResult(DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification,
DesignScenario scenario, SoilProfile1D soilProfile, string soilGeometry2DName, AnalysisType analysisType, int nwoResultIndex)
{
- this.id = id;
- xrd = scenario.Location.XRd;
- yrd = scenario.Location.YRd;
locationName = scenario.Location.Name;
scenarioName = scenario.LocationScenarioID; // terughalen vanuit csvexport indien echt nodig
baseFileName = "";
@@ -168,66 +188,30 @@
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)
+
+ stabilityDesignResults = new StabilityDesignResults();
+ MStabResults? mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName);
+ stabilityDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName);
+ calculationResult = DetermineStabilityCalculationResult(stabilityDesignResults.ResultMessage, mstabResults);
+ if (mstabResults != null)
+ {
+ 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)
{
- 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)
- {
- 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;
- safetyFactor = nwoDesignResults.SafetyFactor;
+ stabilityDesignResults.Zone2SafetyFactor = mstabResults.Value.zone2.Value.safetyFactor;
+ stabilityDesignResults.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate;
+ stabilityDesignResults.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate;
}
}
- else
- {
- stabilityDesignResults = new StabilityDesignResults();
- MStabResults? mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName);
- stabilityDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName);
- calculationResult = DetermineStabilityCalculationResult(stabilityDesignResults.ResultMessage, mstabResults);
- if (mstabResults != null)
- {
-
- 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)
- {
- stabilityDesignResults.Zone2SafetyFactor = mstabResults.Value.zone2.Value.safetyFactor;
- stabilityDesignResults.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate;
- stabilityDesignResults.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate;
- }
- }
- }
stabilityDesignResults.FailureProbability = scenario.GetFailureProbabilityStability(soilProfile, soilGeometry2DName);
+ stabilityDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName);
failureProbability = stabilityDesignResults.FailureProbability;
safetyFactor = stabilityDesignResults.SafetyFactor;
- stabilityDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName);
-
UpliftSituation? upliftSituation = scenario.GetStabilityUpliftSituation(soilProfile, soilGeometry2DName);
if (upliftSituation != null)
{
@@ -270,45 +254,6 @@
}
}
- ///
- /// Gets the identifier.
- ///
- ///
- /// The identifier.
- ///
- public string Id
- {
- get { return id; }
- }
-
- ///
- /// Gets the XRD.
- ///
- ///
- /// The XRD.
- ///
- public double Xrd
- {
- get
- {
- return xrd;
- }
- }
-
- ///
- /// Gets the yrd.
- ///
- ///
- /// The yrd.
- ///
- public double Yrd
- {
- get
- {
- return yrd;
- }
- }
-
//Identifiers, needed to retrace the origin of the result
///
/// Gets the name of the location.
@@ -380,65 +325,6 @@
}
///
- /// Gets the safety factor (derived result).
- ///
- ///
- /// The safety factor.
- ///
- public double? SafetyFactor
- {
- get
- {
- return safetyFactor;
- }
- }
-
- ///
- /// Sets the safety factor.
- /// Needed for testing purposes.
- ///
- /// The value.
- internal void SetSafetyFactor(double value)
- {
- safetyFactor = value;
- }
-
- ///
- /// Gets or sets the failure probability (derived result).
- ///
- ///
- /// The failure probability.
- ///
- public double? FailureProbability
- {
- get
- {
- return failureProbability;
- }
- set
- {
- failureProbability = value;
- }
- }
- ///
- /// Gets or sets the nwo design results.
- ///
- ///
- /// The nwo design results.
- ///
- public NwoDesignResults NwoDesignResults
- {
- get
- {
- return nwoDesignResults;
- }
- set
- {
- nwoDesignResults = value;
- }
- }
-
- ///
/// Gets or sets the stability design results.
///
///
@@ -485,18 +371,13 @@
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;
+ calculationResult = designResult.calculationResult;
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);
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs
===================================================================
diff -u -r578 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 578)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculator.cs (.../DamProjectCalculator.cs) (revision 586)
@@ -616,7 +616,7 @@
soilGeometryName);
scenario.SetResultMessage(soilProfileProbability.SoilProfile1D,
soilProfileProbability.StiFileName, exception.Message);
- var resultRecord = new DesignResult("Error: " + exception.Message,
+ var resultRecord = new DesignResult(
damProjectData.DamProjectCalculationSpecification.DamCalculationSpecifications[0],
scenario,
soilProfileProbability.SoilProfile1D,
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs
===================================================================
diff -u -r564 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 564)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 586)
@@ -119,7 +119,7 @@
var s = new DesignScenario();
s.Location = new Location();
var p = new SoilProfile1D();
- designResult = new DesignResult(id, d, s, p, soilProfile2DName, AnalysisType.NoAdaption, 0);
+ designResult = new DesignResult(d, s, p, soilProfile2DName, AnalysisType.NoAdaption, 0);
var pipingDesignResults = new PipingDesignResults(PipingModelType.Sellmeijer4Forces);
pipingDesignResults.Sellmeijer4ForcesFactor = damPipingOutput.FoSp;
Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlOutputFromDam.cs
===================================================================
diff -u -r520 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlOutputFromDam.cs (.../FillXmlOutputFromDam.cs) (revision 520)
+++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlOutputFromDam.cs (.../FillXmlOutputFromDam.cs) (revision 586)
@@ -21,7 +21,6 @@
using System;
using Deltares.DamEngine.Data.General;
-using Deltares.DamEngine.Data.Standard;
using Deltares.DamEngine.Io.XmlOutput;
namespace Deltares.DamEngine.Interface
@@ -159,19 +158,12 @@
{
var desResult = new DesignResult
{
- Id = designResult.Id,
- Xrd = designResult.Xrd,
- Yrd = designResult.Yrd,
BaseFileName = designResult.BaseFileName,
LocationName = designResult.LocationName,
ScenarioName = designResult.ScenarioName,
- ProfileName = designResult.ProfileName,
- SafetyFactorSpecified = designResult.SafetyFactor.HasValue
+ ProfileName = designResult.ProfileName,
};
- if (designResult.SafetyFactor.HasValue) desResult.SafetyFactor = designResult.SafetyFactor.Value;
-
- desResult.FailureProbabilitySpecified = designResult.FailureProbability.HasValue;
- if (designResult.FailureProbability.HasValue) desResult.FailureProbability = designResult.FailureProbability.Value;
+
desResult.CalculationResult = ConversionHelper.ConvertToOutputCalculationResult(designResult.CalculationResult);
if (designResult.PipingDesignResults != null)
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculatorCsvExportDataBuilder.cs
===================================================================
diff -u -r578 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculatorCsvExportDataBuilder.cs (.../DamProjectCalculatorCsvExportDataBuilder.cs) (revision 578)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/General/DamProjectCalculatorCsvExportDataBuilder.cs (.../DamProjectCalculatorCsvExportDataBuilder.cs) (revision 586)
@@ -85,7 +85,6 @@
private DesignResult Build(SoilGeometryProbability soilGeometryProbability, StabilityKernelType kernelType, int index)
{
var data = new DesignResult(
- Message.ToString(),
FailureMechanismSystemType,
Scenario,
soilGeometryProbability.SoilProfile1D,
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs
===================================================================
diff -u -r564 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 564)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 586)
@@ -111,7 +111,7 @@
var s = new DesignScenario();
var p = new SoilProfile1D();
- designResult = new DesignResult(id, d, s, p, soilProfile2DName, AnalysisType.NoAdaption,0);
+ designResult = new DesignResult(d, s, p, soilProfile2DName, AnalysisType.NoAdaption,0);
var pipingDesignResults = new PipingDesignResults(PipingModelType.Bligh);
pipingDesignResults.BlighFactor = damPipingBlighOutput.FoSp;
pipingDesignResults.BlighHcritical = damPipingBlighOutput.Hc;
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs
===================================================================
diff -u -r583 -r586
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 583)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 586)
@@ -148,7 +148,7 @@
var s = new DesignScenario();
s.Location = new Location();
var p = new SoilProfile1D();
- designResult = new DesignResult(id, d, s, p, soilProfile2DName, AnalysisType.NoAdaption, 0);
+ designResult = new DesignResult(d, s, p, soilProfile2DName, AnalysisType.NoAdaption, 0);
var stabilityDesignResults = new StabilityDesignResults();
// ToDo zant