// Copyright (C) Stichting Deltares 2016. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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 General Public License for more details.
//
// You should have received a copy of the GNU 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 System.Collections.Generic;
using System.Linq;
using Core.Common.Base;
using Core.Common.Base.Data;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.HydraRing.Data;
namespace Ringtoets.GrassCoverErosionInwards.Data
{
///
/// Class that holds all grass cover erosion inwards calculation specific input parameters.
///
public class GrassCoverErosionInwardsInput : Observable, ICalculationInput
{
private readonly LognormalDistribution criticalFlowRate;
private readonly GeneralGrassCoverErosionInwardsInput generalInputParameters;
private RoundedDouble orientation;
private RoundedDouble dikeHeight;
///
/// Creates a new instance of .
///
/// General grass cover erosion inwards calculation input parameters that apply to each calculation.
/// When is null.
public GrassCoverErosionInwardsInput(GeneralGrassCoverErosionInwardsInput generalInputParameters)
{
if (generalInputParameters == null)
{
throw new ArgumentNullException("generalInputParameters");
}
this.generalInputParameters = generalInputParameters;
orientation = new RoundedDouble(2);
dikeHeight = new RoundedDouble(2);
BreakWater = new BreakWater(BreakWaterType.Caisson, 0);
criticalFlowRate = new LognormalDistribution(4)
{
Mean = new RoundedDouble(4, 0.004), StandardDeviation = new RoundedDouble(4, 0.0006)
};
DikeGeometry = Enumerable.Empty();
ForeshoreGeometry = Enumerable.Empty();
}
///
/// Gets the dike's geometry (without foreshore geometry).
///
public IEnumerable DikeGeometry { get; private set; }
///
/// Gets the dike's foreshore geometry.
///
public IEnumerable ForeshoreGeometry { get; private set; }
///
/// Gets or sets the dike's orientation
///
public RoundedDouble Orientation
{
get
{
return orientation;
}
set
{
orientation = value.ToPrecision(orientation.NumberOfDecimalPlaces);
}
}
///
/// Gets or sets the dike's critical flow rate.
///
public LognormalDistribution CriticalFlowRate
{
get
{
return criticalFlowRate;
}
set
{
criticalFlowRate.Mean = value.Mean.ToPrecision(criticalFlowRate.Mean.NumberOfDecimalPlaces);
criticalFlowRate.StandardDeviation = value.StandardDeviation.ToPrecision(criticalFlowRate.StandardDeviation.NumberOfDecimalPlaces);
}
}
///
/// Gets or sets if needs to be taken into account.
///
/// Value of must not be reset when is set to false.
public bool UseForeshore { get; set; }
///
/// Gets or sets the dike height.
///
public RoundedDouble DikeHeight
{
get
{
return dikeHeight;
}
set
{
dikeHeight = value.ToPrecision(dikeHeight.NumberOfDecimalPlaces);
}
}
///
/// Gets or sets if needs to be taken into account.
///
public bool UseBreakWater { get; set; }
///
/// Gets the .
///
public BreakWater BreakWater { get; private set; }
///
/// Gets or set the hydraulic boundary location from which to use the assessment level.
///
public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; }
///
/// Sets the grass cover erosion inwards dike geometry.
///
/// The grass cover erosion inwards geometry points.
public void SetDikeGeometry(IEnumerable profileSections)
{
if (profileSections == null)
{
throw new ArgumentNullException("profileSections");
}
DikeGeometry = profileSections;
}
///
/// Sets the grass cover erosion inwards foreshore geometry.
///
/// The grass cover erosion inwards geometry points.
public void SetForeshoreGeometry(IEnumerable profileSections)
{
if (profileSections == null)
{
throw new ArgumentNullException("profileSections");
}
ForeshoreGeometry = profileSections;
}
#region General input parameters
///
/// Gets the model factor critical overtopping.
///
public double CriticalOvertoppingModelFactor
{
get
{
return generalInputParameters.CriticalOvertoppingModelFactor;
}
}
///
/// Gets the factor fb variable.
///
public NormalDistribution FbFactor
{
get
{
return generalInputParameters.FbFactor;
}
}
///
/// Gets the factor fn variable.
///
public NormalDistribution FnFactor
{
get
{
return generalInputParameters.FnFactor;
}
}
///
/// Gets the model factor overtopping.
///
public double OvertoppingModelFactor
{
get
{
return generalInputParameters.OvertoppingModelFactor;
}
}
///
/// Gets the factor mz2 (or frunup) variable.
///
public NormalDistribution FrunupModelFactor
{
get
{
return generalInputParameters.FrunupModelFactor;
}
}
///
/// Gets the factor fshallow variable.
///
public NormalDistribution FshallowModelFactor
{
get
{
return generalInputParameters.FshallowModelFactor;
}
}
#endregion
}
}