//-----------------------------------------------------------------------
//
// Copyright (c) 2010 Deltares. All rights reserved.
//
// B.S.T. The
// tom.the@deltares.nl
// 04-11-2010
// Calculation scenario class
//-----------------------------------------------------------------------
using System.ComponentModel;
using System.Globalization;
using System.Xml.Serialization;
using Deltares.Geotechnics;
using Deltares.Standard;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Language;
using System.Collections.Generic;
using System;
using System.Collections.Specialized;
using System.Linq.Expressions;
using Deltares.Geotechnics.Soils;
using Deltares.Geotechnics.SurfaceLines;
using Deltares.Standard.Attributes;
using Deltares.Standard.Units;
using Deltares.Standard.Validation;
namespace Deltares.Dam.Data
{
///
/// Does uplift occur or not
///
public struct UpliftSituation
{
public bool IsUplift;
public double Pl3MinUplift;
public double Pl3HeadAdjusted;
public double Pl3LocationXMinUplift;
public double Pl4MinUplift;
public double Pl4HeadAdjusted;
public double Pl4LocationXMinUplift;
}
[Serializable]
public class ScenarioException : Exception
{
public ScenarioException(string message) : base(message)
{
}
}
///
/// Calculation scenario class
///
public class Scenario : IVisibleEnabled, IRepairer
{
#region Performance optimization: Extract expression so it only has to be generated once.
private static readonly Expression> ExpressionLocationScenarioId = x => x.LocationScenarioID;
private static readonly Expression> ExpressionRiverLevel = x => x.RiverLevel;
private static readonly Expression> ExpressionRiverLevelLow = x => x.RiverLevelLow;
private static readonly Expression> ExpressionDikeTableHeight = x => x.DikeTableHeight;
private static readonly Expression> ExpressionRequiredSafetyFactorStabilityInnerSlope = x => x.RequiredSafetyFactorStabilityInnerSlope;
private static readonly Expression> ExpressionRequiredSafetyFactorStabilityOuterSlope = x => x.RequiredSafetyFactorStabilityOuterSlope;
private static readonly Expression> ExpressionRequiredSafetyFactorPiping = x => x.RequiredSafetyFactorPiping;
private static readonly Expression> ExpressionRequiredProbabilityOfFailurePiping = x => x.RequiredProbabilityOfFailurePiping;
private static readonly Expression> ExpressionUpliftCriterionPiping = x => x.UpliftCriterionPiping;
private static readonly Expression> ExpressionUpliftCriterionStability = x => x.UpliftCriterionStability;
private static readonly Expression> ExpressionPlLineOffsetBelowDikeTopAtRiver = x => x.PlLineOffsetBelowDikeTopAtRiver;
private static readonly Expression> ExpressionPlLineOffsetBelowDikeTopAtPolder = x => x.PlLineOffsetBelowDikeTopAtPolder;
private static readonly Expression> ExpressionPlLineOffsetBelowShoulderBaseInside = x => x.PlLineOffsetBelowShoulderBaseInside;
private static readonly Expression> ExpressionPlLineOffsetBelowDikeToeAtPolder = x => x.PlLineOffsetBelowDikeToeAtPolder;
private static readonly Expression> ExpressionUsePlLineOffsetBelowDikeCrestMiddle = x => x.UsePlLineOffsetBelowDikeCrestMiddle;
private static readonly Expression> ExpressionPlLineOffsetBelowDikeCrestMiddle = x => x.PlLineOffsetBelowDikeCrestMiddle;
private static readonly Expression> ExpressionUsePlLineOffsetFactorBelowShoulderCrest = x => x.UsePlLineOffsetFactorBelowShoulderCrest;
private static readonly Expression> ExpressionPlLineOffsetFactorBelowShoulderCrest = x => x.PlLineOffsetFactorBelowShoulderCrest;
private static readonly Expression> ExpressionHeadPl3 = x => x.HeadPl3;
private static readonly Expression> ExpressionHeadPl4 = x => x.HeadPl4;
private static readonly Expression> ExpressionWaterHeightDecimeringsHoogte = x => x.WaterHeightDecimeringsHoogte;
private static readonly Expression> ExpressionMaxWaterLevel = x => x.MaxWaterLevel;
#endregion
private CalculationResult calculationResult = CalculationResult.NoRun;
private Location location = null;
private readonly List calculationResults = new List();
private Dictionary