Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs =================================================================== diff -u -rf7f2fb5812d9a3c71a95f13140e8dd22f85768fa -ree2de5ec60ef4ef9bed939798eacddd0084a4bae --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs (.../MacroStabilityInwardsSlice.cs) (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Output/MacroStabilityInwardsSlice.cs (.../MacroStabilityInwardsSlice.cs) (revision ee2de5ec60ef4ef9bed939798eacddd0084a4bae) @@ -36,9 +36,12 @@ /// The top right point of the slice. /// The bottom left point of the slice. /// The bottom right point of the slice. + /// The object containing the values for the properties + /// of the new . /// Thrown when any parameter is null. public MacroStabilityInwardsSlice(Point2D topLeftPoint, Point2D topRightPoint, - Point2D bottomLeftPoint, Point2D bottomRightPoint) + Point2D bottomLeftPoint, Point2D bottomRightPoint, + ConstructionProperties properties) { if (topLeftPoint == null) { @@ -56,31 +59,454 @@ { throw new ArgumentNullException(nameof(bottomRightPoint)); } + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } TopLeftPoint = topLeftPoint; TopRightPoint = topRightPoint; BottomLeftPoint = bottomLeftPoint; BottomRightPoint = bottomRightPoint; + + Cohesion = properties.Cohesion; + FrictionAngle = properties.FrictionAngle; + CriticalPressure = properties.CriticalPressure; + OverConsolidationRatio = properties.OverConsolidationRatio; + Pop = properties.Pop; + DegreeOfConsolidationPorePressureSoil = properties.DegreeOfConsolidationPorePressureSoil; + DegreeOfConsolidationPorePressureLoad = properties.DegreeOfConsolidationPorePressureLoad; + Dilatancy = properties.Dilatancy; + ExternalLoad = properties.ExternalLoad; + HydrostaticPorePressure = properties.HydrostaticPorePressure; + LeftForce = properties.LeftForce; + LeftForceAngle = properties.LeftForceAngle; + LeftForceY = properties.LeftForceY; + RightForce = properties.RightForce; + RightForceAngle = properties.RightForceAngle; + RightForceY = properties.RightForceY; + LoadStress = properties.LoadStress; + NormalStress = properties.NormalStress; + PorePressure = properties.PorePressure; + HorizontalPorePressure = properties.HorizontalPorePressure; + VerticalPorePressure = properties.VerticalPorePressure; + PiezometricPorePressure = properties.PiezometricPorePressure; + EffectiveStress = properties.EffectiveStress; + EffectiveStressDaily = properties.EffectiveStressDaily; + ExcessPorePressure = properties.ExcessPorePressure; + ShearStress = properties.ShearStress; + SoilStress = properties.SoilStress; + TotalPorePressure = properties.TotalPorePressure; + TotalStress = properties.TotalStress; + Weight = properties.Weight; } /// - /// Gets the top left point of the slice. + /// Gets the top left point. /// public Point2D TopLeftPoint { get; } /// - /// Gets the top right point of the slice. + /// Gets the top right point. /// public Point2D TopRightPoint { get; } /// - /// Gets the bottom left point of the slice. + /// Gets the bottom left point. /// public Point2D BottomLeftPoint { get; } /// - /// Gets the bottom right point of the slice. + /// Gets the bottom right point. /// public Point2D BottomRightPoint { get; } + + /// + /// Gets the cohesion. + /// [kN/m²] + /// + public double Cohesion { get; } + + /// + /// Gets the friction angle. + /// [°] + /// + public double FrictionAngle { get; } + + /// + /// Gets the critical pressure. + /// + public double CriticalPressure { get; } + + /// + /// Gets the OCR. + /// [-] + /// + public double OverConsolidationRatio { get; } + + /// + /// Gets the POP. + /// [kN/m²] + /// + public double Pop { get; } + + /// + /// Gets the pore pressure from degree of consolidation soil. + /// [kN/m²] + /// + public double DegreeOfConsolidationPorePressureSoil { get; } + + /// + /// Gets the pore pressure from degree of consolidation load. + /// [kN/m²] + /// + public double DegreeOfConsolidationPorePressureLoad { get; } + + /// + /// Gets the dilatancy of the slice. + /// + public double Dilatancy { get; } + + /// + /// Gets the external load. + /// [kN/m²] + /// + public double ExternalLoad { get; } + + /// + /// Gets the hydraostatic pore pressure. + /// [kN/m²] + /// + public double HydrostaticPorePressure { get; } + + /// + /// Gets the left force. + /// + public double LeftForce { get; } + + /// + /// Gets the left force angle. + /// [°] + /// + public double LeftForceAngle { get; } + + /// + /// Gets the left force y. + /// + public double LeftForceY { get; } + + /// + /// Gets the right force. + /// + public double RightForce { get; } + + /// + /// Gets the right force angle. + /// [°] + /// + public double RightForceAngle { get; } + + /// + /// Gets the right force y. + /// + public double RightForceY { get; } + + /// + /// Gets the load stress. + /// [kN/m²] + /// + public double LoadStress { get; } + + /// + /// Gets the normal stress. + /// [kN/m²] + /// + public double NormalStress { get; } + + /// + /// Gets the pore pressure. + /// [kN/m²] + /// + public double PorePressure { get; } + + /// + /// Gets the horizontal pore pressure. + /// [kN/m²] + /// + public double HorizontalPorePressure { get; } + + /// + /// Gets the vertical pore pressure. + /// [kN/m²] + /// + public double VerticalPorePressure { get; } + + /// + /// Gets the piezometric pore pressure. + /// [kN/m²] + /// + public double PiezometricPorePressure { get; } + + /// + /// Gets the effective stress. + /// [kN/m²] + /// + public double EffectiveStress { get; } + + /// + /// Gets the daily effective stress. + /// [kN/m²] + /// + public double EffectiveStressDaily { get; } + + /// + /// Gets the excess pore pressure. + /// [kN/m²] + /// + public double ExcessPorePressure { get; } + + /// + /// Gets the shear stress. + /// [kN/m²] + /// + public double ShearStress { get; } + + /// + /// Gets the soil stress. + /// [kN/m²] + /// + public double SoilStress { get; } + + /// + /// Gets the total pore pressure. + /// [kN/m²] + /// + public double TotalPorePressure { get; } + + /// + /// Gets the total stress. + /// [kN/m²] + /// + public double TotalStress { get; } + + /// + /// Gets the weight. + /// [kN/m] + /// + public double Weight { get; } + + public class ConstructionProperties + { + /// + /// Creates a new instance of . + /// + public ConstructionProperties() + { + Cohesion = double.NaN; + FrictionAngle = double.NaN; + CriticalPressure = double.NaN; + OverConsolidationRatio = double.NaN; + Pop = double.NaN; + DegreeOfConsolidationPorePressureSoil = double.NaN; + DegreeOfConsolidationPorePressureLoad = double.NaN; + Dilatancy = double.NaN; + ExternalLoad = double.NaN; + HydrostaticPorePressure = double.NaN; + LeftForce = double.NaN; + LeftForceAngle = double.NaN; + LeftForceY = double.NaN; + RightForce = double.NaN; + RightForceAngle = double.NaN; + RightForceY = double.NaN; + LoadStress = double.NaN; + NormalStress = double.NaN; + PorePressure = double.NaN; + HorizontalPorePressure = double.NaN; + VerticalPorePressure = double.NaN; + PiezometricPorePressure = double.NaN; + EffectiveStress = double.NaN; + EffectiveStressDaily = double.NaN; + ExcessPorePressure = double.NaN; + ShearStress = double.NaN; + SoilStress = double.NaN; + TotalPorePressure = double.NaN; + TotalStress = double.NaN; + Weight = double.NaN; + } + + /// + /// Gets or sets the cohesion. + /// [kN/m²] + /// + public double Cohesion { internal get; set; } + + /// + /// Gets or sets the friction angle. + /// [°] + /// + public double FrictionAngle { internal get; set; } + + /// + /// Gets or sets the critical pressure. + /// + public double CriticalPressure { internal get; set; } + + /// + /// Gets or sets the OCR. + /// [-] + /// + public double OverConsolidationRatio { internal get; set; } + + /// + /// Gets or sets the POP. + /// [kN/m²] + /// + public double Pop { internal get; set; } + + /// + /// Gets or sets the pore pressure from degree of consolidation soil. + /// [kN/m²] + /// + public double DegreeOfConsolidationPorePressureSoil { internal get; set; } + + /// + /// Gets or sets the pore pressure from degree of consolidation load. + /// [kN/m²] + /// + public double DegreeOfConsolidationPorePressureLoad { internal get; set; } + + /// + /// Gets or sets the dilatancy of the slice. + /// + public double Dilatancy { internal get; set; } + + /// + /// Gets or sets the external load. + /// [kN/m²] + /// + public double ExternalLoad { internal get; set; } + + /// + /// Gets or sets the hydraostatic pore pressure. + /// [kN/m²] + /// + public double HydrostaticPorePressure { internal get; set; } + + /// + /// Gets or sets the left force. + /// + public double LeftForce { internal get; set; } + + /// + /// Gets or sets the left force angle. + /// [°] + /// + public double LeftForceAngle { internal get; set; } + + /// + /// Gets or sets the left force y. + /// + public double LeftForceY { internal get; set; } + + /// + /// Gets or sets the right force. + /// + public double RightForce { internal get; set; } + + /// + /// Gets or sets the right force angle. + /// [°] + /// + public double RightForceAngle { internal get; set; } + + /// + /// Gets or sets the right force y. + /// + public double RightForceY { internal get; set; } + + /// + /// Gets or sets the load stress. + /// [kN/m²] + /// + public double LoadStress { internal get; set; } + + /// + /// Gets or sets the normal stress. + /// [kN/m²] + /// + public double NormalStress { internal get; set; } + + /// + /// Gets or sets the pore pressure. + /// [kN/m²] + /// + public double PorePressure { internal get; set; } + + /// + /// Gets or sets the horizontal pore pressure. + /// [kN/m²] + /// + public double HorizontalPorePressure { internal get; set; } + + /// + /// Gets or sets the vertical pore pressure. + /// [kN/m²] + /// + public double VerticalPorePressure { internal get; set; } + + /// + /// Gets or sets the piezometric pore pressure. + /// [kN/m²] + /// + public double PiezometricPorePressure { internal get; set; } + + /// + /// Gets or sets the effective stress. + /// [kN/m²] + /// + public double EffectiveStress { internal get; set; } + + /// + /// Gets or sets the daily effective stress. + /// [kN/m²] + /// + public double EffectiveStressDaily { internal get; set; } + + /// + /// Gets or sets the excess pore pressure. + /// [kN/m²] + /// + public double ExcessPorePressure { internal get; set; } + + /// + /// Gets or sets the shear stress. + /// [kN/m²] + /// + public double ShearStress { internal get; set; } + + /// + /// Gets or sets the soil stress. + /// [kN/m²] + /// + public double SoilStress { internal get; set; } + + /// + /// Gets or sets the total pore pressure. + /// [kN/m²] + /// + public double TotalPorePressure { internal get; set; } + + /// + /// Gets or sets the total stress. + /// [kN/m²] + /// + public double TotalStress { internal get; set; } + + /// + /// Gets or sets the weight. + /// [kN/m] + /// + public double Weight { internal get; set; } + } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs =================================================================== diff -u -rf7f2fb5812d9a3c71a95f13140e8dd22f85768fa -ree2de5ec60ef4ef9bed939798eacddd0084a4bae --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs (.../MacroStabilityInwardsSliceTest.cs) (revision f7f2fb5812d9a3c71a95f13140e8dd22f85768fa) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/Output/MacroStabilityInwardsSliceTest.cs (.../MacroStabilityInwardsSliceTest.cs) (revision ee2de5ec60ef4ef9bed939798eacddd0084a4bae) @@ -33,7 +33,8 @@ public void Constructor_TopLeftPointNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MacroStabilityInwardsSlice(null, new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0)); + TestDelegate call = () => new MacroStabilityInwardsSlice(null, new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), + new MacroStabilityInwardsSlice.ConstructionProperties()); // Assert var exception = Assert.Throws(call); @@ -44,7 +45,8 @@ public void Constructor_TopRightPointNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), null, new Point2D(0, 0), new Point2D(0, 0)); + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), null, new Point2D(0, 0), new Point2D(0, 0), + new MacroStabilityInwardsSlice.ConstructionProperties()); // Assert var exception = Assert.Throws(call); @@ -55,7 +57,8 @@ public void Constructor_BottomLeftPointNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), null, new Point2D(0, 0)); + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), null, new Point2D(0, 0), + new MacroStabilityInwardsSlice.ConstructionProperties()); // Assert var exception = Assert.Throws(call); @@ -66,14 +69,26 @@ public void Constructor_BottomRightPointNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), null); + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), null, + new MacroStabilityInwardsSlice.ConstructionProperties()); // Assert var exception = Assert.Throws(call); Assert.AreEqual("bottomRightPoint", exception.ParamName); } [Test] + public void Constructor_ConstructionPropertiesNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("properties", exception.ParamName); + } + + [Test] public void Constructor_WithCoordinates_ExpectedValues() { // Setup @@ -83,13 +98,162 @@ var bottomRightPoint = new Point2D(3, 3); // Call - var slice = new MacroStabilityInwardsSlice(topLeftPoint, topRightPoint, bottomLeftPoint, bottomRightPoint); + var slice = new MacroStabilityInwardsSlice(topLeftPoint, topRightPoint, bottomLeftPoint, bottomRightPoint, + new MacroStabilityInwardsSlice.ConstructionProperties()); // Assert Assert.AreEqual(topLeftPoint, slice.TopLeftPoint); Assert.AreEqual(topRightPoint, slice.TopRightPoint); Assert.AreEqual(bottomLeftPoint, slice.BottomLeftPoint); Assert.AreEqual(bottomRightPoint, slice.BottomRightPoint); } + + [Test] + public void Constructor_ConstructionPropertiesEmpty_ExpectedValues() + { + // Call + var slice = new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), new Point2D(0, 0), + new MacroStabilityInwardsSlice.ConstructionProperties()); + + // Assert + Assert.IsNaN(slice.Cohesion); + Assert.IsNaN(slice.FrictionAngle); + Assert.IsNaN(slice.CriticalPressure); + Assert.IsNaN(slice.OverConsolidationRatio); + Assert.IsNaN(slice.Pop); + Assert.IsNaN(slice.DegreeOfConsolidationPorePressureSoil); + Assert.IsNaN(slice.DegreeOfConsolidationPorePressureLoad); + Assert.IsNaN(slice.Dilatancy); + Assert.IsNaN(slice.ExternalLoad); + Assert.IsNaN(slice.HydrostaticPorePressure); + Assert.IsNaN(slice.LeftForce); + Assert.IsNaN(slice.LeftForceAngle); + Assert.IsNaN(slice.LeftForceY); + Assert.IsNaN(slice.RightForce); + Assert.IsNaN(slice.RightForceAngle); + Assert.IsNaN(slice.RightForceY); + Assert.IsNaN(slice.LoadStress); + Assert.IsNaN(slice.NormalStress); + Assert.IsNaN(slice.PorePressure); + Assert.IsNaN(slice.HorizontalPorePressure); + Assert.IsNaN(slice.VerticalPorePressure); + Assert.IsNaN(slice.PiezometricPorePressure); + Assert.IsNaN(slice.EffectiveStress); + Assert.IsNaN(slice.EffectiveStressDaily); + Assert.IsNaN(slice.ExcessPorePressure); + Assert.IsNaN(slice.ShearStress); + Assert.IsNaN(slice.SoilStress); + Assert.IsNaN(slice.TotalPorePressure); + Assert.IsNaN(slice.TotalStress); + Assert.IsNaN(slice.Weight); + } + + [Test] + public void Constructor_ConstructionPropertiesSet_ExpectedValues() + { + // Setup + var random = new Random(21); + double cohesion = random.NextDouble(); + double frictionAngle = random.NextDouble(); + double criticalPressure = random.NextDouble(); + double overConsolidationRatio = random.NextDouble(); + double pop = random.NextDouble(); + double degreeOfConsolidationPorePressureSoil = random.NextDouble(); + double degreeOfConsolidationPorePressureLoad = random.NextDouble(); + double dilatancy = random.NextDouble(); + double externalLoad = random.NextDouble(); + double hydrostaticPorePressure = random.NextDouble(); + double leftForce = random.NextDouble(); + double leftForceAngle = random.NextDouble(); + double leftForceY = random.NextDouble(); + double rightForce = random.NextDouble(); + double rightForceAngle = random.NextDouble(); + double rightForceY = random.NextDouble(); + double loadStress = random.NextDouble(); + double normalStress = random.NextDouble(); + double porePressure = random.NextDouble(); + double horizontalPorePressure = random.NextDouble(); + double verticalPorePressure = random.NextDouble(); + double piezometricPorePressure = random.NextDouble(); + double effectiveStress = random.NextDouble(); + double effectiveStressDaily = random.NextDouble(); + double excessPorePressure = random.NextDouble(); + double shearStress = random.NextDouble(); + double soilStress = random.NextDouble(); + double totalPorePressure = random.NextDouble(); + double totalStress = random.NextDouble(); + double weight = random.NextDouble(); + + var properties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Cohesion = cohesion, + FrictionAngle = frictionAngle, + CriticalPressure = criticalPressure, + OverConsolidationRatio = overConsolidationRatio, + DegreeOfConsolidationPorePressureSoil = degreeOfConsolidationPorePressureSoil, + DegreeOfConsolidationPorePressureLoad = degreeOfConsolidationPorePressureLoad, + Pop = pop, + Dilatancy = dilatancy, + ExternalLoad = externalLoad, + HydrostaticPorePressure = hydrostaticPorePressure, + LeftForce = leftForce, + LeftForceAngle = leftForceAngle, + LeftForceY = leftForceY, + RightForce = rightForce, + RightForceAngle = rightForceAngle, + RightForceY = rightForceY, + LoadStress = loadStress, + NormalStress = normalStress, + PorePressure = porePressure, + HorizontalPorePressure = horizontalPorePressure, + VerticalPorePressure = verticalPorePressure, + PiezometricPorePressure = piezometricPorePressure, + EffectiveStress = effectiveStress, + EffectiveStressDaily = effectiveStressDaily, + ExcessPorePressure = excessPorePressure, + ShearStress = shearStress, + SoilStress = soilStress, + TotalPorePressure = totalPorePressure, + TotalStress = totalStress, + Weight = weight + }; + + // Call + var slice = new MacroStabilityInwardsSlice(new Point2D(0, 0), new Point2D(0, 0), + new Point2D(0, 0), new Point2D(0, 0), + properties); + + // Assert + Assert.AreEqual(cohesion, slice.Cohesion); + Assert.AreEqual(frictionAngle, slice.FrictionAngle); + Assert.AreEqual(criticalPressure, slice.CriticalPressure); + Assert.AreEqual(overConsolidationRatio, slice.OverConsolidationRatio); + Assert.AreEqual(pop, slice.Pop); + Assert.AreEqual(degreeOfConsolidationPorePressureSoil, slice.DegreeOfConsolidationPorePressureSoil); + Assert.AreEqual(degreeOfConsolidationPorePressureLoad, slice.DegreeOfConsolidationPorePressureLoad); + Assert.AreEqual(dilatancy, slice.Dilatancy); + Assert.AreEqual(externalLoad, slice.ExternalLoad); + Assert.AreEqual(hydrostaticPorePressure, slice.HydrostaticPorePressure); + Assert.AreEqual(leftForce, slice.LeftForce); + Assert.AreEqual(leftForceAngle, slice.LeftForceAngle); + Assert.AreEqual(leftForceY, slice.LeftForceY); + Assert.AreEqual(rightForce, slice.RightForce); + Assert.AreEqual(rightForceAngle, slice.RightForceAngle); + Assert.AreEqual(rightForceY, slice.RightForceY); + Assert.AreEqual(loadStress, slice.LoadStress); + Assert.AreEqual(normalStress, slice.NormalStress); + Assert.AreEqual(porePressure, slice.PorePressure); + Assert.AreEqual(horizontalPorePressure, slice.HorizontalPorePressure); + Assert.AreEqual(verticalPorePressure, slice.VerticalPorePressure); + Assert.AreEqual(piezometricPorePressure, slice.PiezometricPorePressure); + Assert.AreEqual(effectiveStress, slice.EffectiveStress); + Assert.AreEqual(effectiveStressDaily, slice.EffectiveStressDaily); + Assert.AreEqual(excessPorePressure, slice.ExcessPorePressure); + Assert.AreEqual(shearStress, slice.ShearStress); + Assert.AreEqual(soilStress, slice.SoilStress); + Assert.AreEqual(totalPorePressure, slice.TotalPorePressure); + Assert.AreEqual(totalStress, slice.TotalStress); + Assert.AreEqual(weight, slice.Weight); + } } } \ No newline at end of file