using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Deltares.Geotechnics;
using Deltares.Probabilistic;
using Deltares.Standard;
using Deltares.Standard.Attributes;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Extensions;
using Deltares.Standard.Reflection;
using Deltares.Standard.Units;
namespace Deltares.DeltaModel
{
///
/// Contains the characteristics of asphalt.
///
public class AsphaltDescription : ISegmentDescription
{
private double cSpring;
private double crackTension;
private double fatigueParameterAlpha;
private double fatigueParameterBeta;
private bool isCrackTensionMeasured;
private string name;
private double nu = 0.35;
private double thicknessLayer;
private double youngsModulusLayer;
///
/// Initializes a new instance of the class and sets default values.
///
public AsphaltDescription()
{
ThicknessLayerStochast = new Stochast(DistributionType.LogNormal, 0, 0)
{
Owner = this
};
YoungsModulusLayerStochast = new Stochast(DistributionType.LogNormal, 0, 0)
{
Owner = this
};
CrackTensionStochast = new Stochast(DistributionType.StudentT, 0, 0)
{
Owner = this
};
CSpringStochast = new Stochast(DistributionType.LogNormal, 0, 0)
{
Owner = this
};
}
// Laagdikte [m]
///
/// Gets or sets the thickness of the first asphalt layer.
///
///
/// Old parameter name : d1/h1.
///
[XmlIgnore]
[Unit(UnitType.Length)]
public double ThicknessLayer
{
get
{
return TransformerManager.GetTransformedValue(this, s => s.ThicknessLayer, ThicknessLayerStochast.Mean);
}
set
{
value = TransformerManager.SetTransformedValue(this, s => s.ThicknessLayer, value);
if (value != ThicknessLayerStochast.Mean)
{
DataEventPublisher.BeforeChange(this, x => x.ThicknessLayer);
ThicknessLayerStochast.Mean = value;
DataEventPublisher.AfterChange(this, x => x.ThicknessLayer);
}
}
}
///
/// Gets the for the .
///
[Category("TopLayer")]
[PropertyOrder(1, 1)]
[Format("F2")]
[Stochast(AutoAssociatedProperty = true)]
[Unit(UnitType.Length)]
[Translation("ThicknessLayer")]
public Stochast ThicknessLayerStochast { get; private set; }
///
/// Gets or sets the young's modulus of the first asphalt layer.
///
///
/// Stijfheidsmodulus (E1) [Mpa]
///
[XmlIgnore]
[Unit(UnitType.Pressure)]
public double YoungsModulusLayer
{
get
{
return TransformerManager.GetTransformedValue(this, s => s.YoungsModulusLayer, YoungsModulusLayerStochast.Mean);
}
set
{
value = TransformerManager.SetTransformedValue(this, s => s.YoungsModulusLayer, value);
if (value != YoungsModulusLayerStochast.Mean)
{
DataEventPublisher.BeforeChange(this, x => x.YoungsModulusLayer);
YoungsModulusLayerStochast.Mean = value;
DataEventPublisher.AfterChange(this, x => x.YoungsModulusLayer);
}
}
}
///
/// Gets the for .
///
[Category("TopLayer")]
[PropertyOrder(1, 2)]
[Unit(UnitType.Pressure)]
[Format("F2")]
[Stochast(AutoAssociatedProperty = true)]
[Translation("YoungsModulusLayer")]
public Stochast YoungsModulusLayerStochast { get; private set; }
///
/// Poisson constant of asphalt.
///
///
/// Poissonconstante (nu) [-].
///
[Category("TopLayer")]
[PropertyOrder(1, 3)]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Format("F2")]
public double Nu
{
get
{
return nu;
}
set
{
this.SetAndNotify2(out nu, value, x => x.Nu);
}
}
///
/// Gets or sets the fatigue parameter alpha.
///
///
/// Vermoeiingsparameter alfa (alfa) [-]
///
[Category("TopLayer")]
[PropertyOrder(1, 4)]
[Format("F2")]
[Unit(UnitType.None)]
public double FatigueParameterAlpha
{
get
{
return fatigueParameterAlpha;
}
set
{
this.SetAndNotify2(out fatigueParameterAlpha, value, x => x.FatigueParameterAlpha);
}
}
///
/// Gets or sets the fatigue parameter beta.
///
///
/// Vermoeiingsparameter beta (beta) [-]
///
[Category("TopLayer")]
[PropertyOrder(1, 5)]
[Format("F2")]
[Unit(UnitType.None)]
public double FatigueParameterBeta
{
get
{
return fatigueParameterBeta;
}
set
{
this.SetAndNotify2(out fatigueParameterBeta, value, x => x.FatigueParameterBeta);
}
}
///
/// Gets or sets whether the crack tension of the asphalt is measured.
///
///
/// Is crack tension asphalt measured?.
///
[Category("TopLayer")]
[PropertyOrder(1, 6)]
public bool IsCrackTensionMeasured
{
get
{
return isCrackTensionMeasured;
}
set
{
this.SetAndNotify2(out isCrackTensionMeasured, value, x => x.IsCrackTensionMeasured);
}
}
///
/// Tension at which the asphalt cracks.
///
///
/// Breuksterkte asfalt (sigmaB) [Mpa]
///
[XmlIgnore]
[Unit(UnitType.Pressure)]
public double CrackTension
{
get
{
return TransformerManager.GetTransformedValue(this, s => s.CrackTension, CrackTensionStochast.Mean);
}
set
{
value = TransformerManager.SetTransformedValue(this, s => s.CrackTension, value);
if (value != CrackTensionStochast.Mean)
{
DataEventPublisher.BeforeChange(this, x => x.CrackTension);
CrackTensionStochast.Mean = value;
DataEventPublisher.AfterChange(this, x => x.CrackTension);
}
}
}
///
/// Gets the for .
///
[Category("TopLayer")]
[Unit(UnitType.Pressure)]
[PropertyOrder(1, 7)]
[Format("F2")]
[Stochast(AutoAssociatedProperty = true)]
[Translation("CrackTension")]
public Stochast CrackTensionStochast { get; private set; }
///
/// Gets or sets the bedding constant (stiffness of subsoil).
///
///
/// Veerconstante (c) [Mpa/m].
/// Name in functional document semi-probabilistic assessments 2015/05/26: soil modulus / Beddingscoëfficiënt
///
[XmlIgnore]
[Unit(UnitType.PressurePerLength)]
public double CSpring
{
get
{
return TransformerManager.GetTransformedValue(this, s => s.CSpring, CSpringStochast.Mean);
}
set
{
value = TransformerManager.SetTransformedValue(this, s => s.CSpring, value);
if (value != CSpringStochast.Mean)
{
DataEventPublisher.BeforeChange(this, x => x.CSpring);
CSpringStochast.Mean = value;
DataEventPublisher.AfterChange(this, x => x.CSpring);
}
}
}
///
/// Gets the for .
///
[Category("Subsoil")]
[Unit(UnitType.PressurePerLength)]
[PropertyOrder(2, 1)]
[Format("F2")]
[Stochast(AutoAssociatedProperty = true)]
[Translation("CSpring")]
public Stochast CSpringStochast { get; private set; }
[PropertyOrder(0, 1)]
public string Name
{
get
{
return name;
}
set
{
this.SetAndNotify2(out name, value, x => x.Name);
}
}
public ISegmentDescription Clone()
{
var clone = new AsphaltDescription
{
name = Name,
thicknessLayer = thicknessLayer,
youngsModulusLayer = youngsModulusLayer,
nu = nu,
fatigueParameterAlpha = fatigueParameterAlpha,
fatigueParameterBeta = fatigueParameterBeta,
isCrackTensionMeasured = isCrackTensionMeasured,
crackTension = crackTension,
cSpring = cSpring
};
List stochastIgnoreProperties = new List(new []
{
StaticReflection.GetMemberName(ad => ad.XMLVariation),
StaticReflection.GetMemberName(ad => ad.XmlCorrelation),
StaticReflection.GetMemberName(ad => ad.XMLMean),
StaticReflection.GetMemberName(ad => ad.XMLMinimum),
StaticReflection.GetMemberName(ad => ad.XMLMaximum),
StaticReflection.GetMemberName(ad => ad.XMLLocation),
StaticReflection.GetMemberName(ad => ad.XMLScale),
StaticReflection.GetMemberName(ad => ad.Location),
StaticReflection.GetMemberName(ad => ad.Scale),
StaticReflection.GetMemberName(ad => ad.Owner)
});
CrackTensionStochast.CloneProperties(clone.CrackTensionStochast, stochastIgnoreProperties.ToArray());
YoungsModulusLayerStochast.CloneProperties(clone.YoungsModulusLayerStochast, stochastIgnoreProperties.ToArray());
ThicknessLayerStochast.CloneProperties(clone.ThicknessLayerStochast, stochastIgnoreProperties.ToArray());
CSpringStochast.CloneProperties(clone.CSpringStochast, stochastIgnoreProperties.ToArray());
return clone;
}
}
}