// Copyright (C) Stichting Deltares 2017. 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;
namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input
{
///
/// The uplift Van slip plane that is used to perform a calculation.
///
public class UpliftVanSlipPlane
{
///
/// Creates a new instance of .
///
/// The following values are set:
///
/// - is set to true;
/// - is set to null;
/// - is set to null;
/// - is set to true;
/// - is set to ;
/// - is set to ;
/// - is set to 0;
/// - is set to .
///
///
public UpliftVanSlipPlane() : this(double.NaN, double.NaN, 0, double.NaN)
{
GridAutomaticDetermined = true;
TangentLinesAutomaticAtBoundaries = true;
}
///
/// Creates a new instance of .
///
/// Thrown when any parameter is null.
/// The following values are set:
///
/// - is set to false;
/// - is set to true;
/// - is set to ;
/// - is set to ;
/// - is set to 0;
/// - is set to .
///
///
public UpliftVanSlipPlane(UpliftVanGrid leftGrid, UpliftVanGrid rightGrid)
: this(double.NaN, double.NaN, 0, double.NaN)
{
SetGrids(leftGrid, rightGrid);
TangentLinesAutomaticAtBoundaries = true;
}
///
/// Creates a new instance of .
///
/// Thrown when
/// or is null.
/// The following values are set:
///
/// - is set to false;
/// - is set to false.
///
///
public UpliftVanSlipPlane(UpliftVanGrid leftGrid, UpliftVanGrid rightGrid, double tangentZTop,
double tangentZBottom, int tangentLineNumber, double maxSpacingBetweenBoundaries)
: this(tangentZTop, tangentZBottom, tangentLineNumber, maxSpacingBetweenBoundaries)
{
SetGrids(leftGrid, rightGrid);
}
private UpliftVanSlipPlane(double tangentZTop, double tangentZBottom, int tangentLineNumber, double maxSpacingBetweenBoundaries)
{
TangentZTop = tangentZTop;
TangentZBottom = tangentZBottom;
TangentLineNumber = tangentLineNumber;
MaxSpacingBetweenBoundaries = maxSpacingBetweenBoundaries;
}
///
/// Gets whether the grid is automatic determined.
///
public bool GridAutomaticDetermined { get; }
///
/// Gets the left grid.
///
public UpliftVanGrid LeftGrid { get; private set; }
///
/// Gets the right grid.
///
public UpliftVanGrid RightGrid { get; private set; }
///
/// Gets whether the tangent line boundaries should be defined automatically.
///
public bool TangentLinesAutomaticAtBoundaries { get; }
///
/// Gets the tangent line z top.
/// [m+NAP]
///
public double TangentZTop { get; }
///
/// Gets the tangent line z bottom.
/// [m+NAP]
///
public double TangentZBottom { get; }
///
/// Gets the number of tangent lines.
///
public int TangentLineNumber { get; }
///
/// Gets the max spacing between boundaries.
///
public double MaxSpacingBetweenBoundaries { get; }
private void SetGrids(UpliftVanGrid leftGrid, UpliftVanGrid rightGrid)
{
if (leftGrid == null)
{
throw new ArgumentNullException(nameof(leftGrid));
}
if (rightGrid == null)
{
throw new ArgumentNullException(nameof(rightGrid));
}
LeftGrid = leftGrid;
RightGrid = rightGrid;
}
}
}