Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlane.cs =================================================================== diff -u -re2da467f67f436ca9923eb99821e3750d72c9cc1 -r476c10932cea472a1475d63d32c2ad019bc5c57a --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlane.cs (.../UpliftVanSlipPlane.cs) (revision e2da467f67f436ca9923eb99821e3750d72c9cc1) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanSlipPlane.cs (.../UpliftVanSlipPlane.cs) (revision 476c10932cea472a1475d63d32c2ad019bc5c57a) @@ -46,6 +46,7 @@ { GridAutomaticDetermined = true; TangentLinesAutomaticAtBoundaries = true; + GridNumberOfRefinements = 1; } /// @@ -67,6 +68,7 @@ { SetGrids(leftGrid, rightGrid); TangentLinesAutomaticAtBoundaries = true; + GridNumberOfRefinements = 0; } /// @@ -85,6 +87,7 @@ : this(tangentZTop, tangentZBottom, tangentLineNumber) { SetGrids(leftGrid, rightGrid); + GridNumberOfRefinements = 0; } private UpliftVanSlipPlane(double tangentZTop, double tangentZBottom, int tangentLineNumber) @@ -111,6 +114,11 @@ public UpliftVanGrid RightGrid { get; private set; } /// + /// Gets the number of grid refinements. + /// + public int GridNumberOfRefinements { get; } + + /// /// Gets whether the tangent line boundaries should be determined automatically. /// public bool TangentLinesAutomaticAtBoundaries { get; } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs =================================================================== diff -u -re2da467f67f436ca9923eb99821e3750d72c9cc1 -r476c10932cea472a1475d63d32c2ad019bc5c57a --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision e2da467f67f436ca9923eb99821e3750d72c9cc1) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SlipPlaneUpliftVanCreator.cs (.../SlipPlaneUpliftVanCreator.cs) (revision 476c10932cea472a1475d63d32c2ad019bc5c57a) @@ -46,18 +46,36 @@ throw new ArgumentNullException(nameof(slipPlane)); } - var kernelSlipPlane = new SlipPlaneUpliftVan(); + var kernelSlipPlane = new SlipPlaneUpliftVan + { + SlipPlaneLeftGrid = CreateGrid(slipPlane, slipPlane.LeftGrid), + SlipPlaneRightGrid = CreateGrid(slipPlane, slipPlane.RightGrid), + SlipPlaneTangentLine = CreateTangentLine(slipPlane) + }; + + return kernelSlipPlane; + } + + private static SlipCircleGrid CreateGrid(UpliftVanSlipPlane slipPlane, UpliftVanGrid grid) + { + var slipCircleGrid = new SlipCircleGrid + { + NumberOfRefinements = slipPlane.GridNumberOfRefinements + }; + if (!slipPlane.GridAutomaticDetermined) { - kernelSlipPlane.SlipPlaneLeftGrid = CreateGrid(slipPlane.LeftGrid); - kernelSlipPlane.SlipPlaneRightGrid = CreateGrid(slipPlane.RightGrid); + slipCircleGrid.GridXLeft = grid.XLeft; + slipCircleGrid.GridXRight = grid.XRight; + slipCircleGrid.GridZTop = grid.ZTop; + slipCircleGrid.GridZBottom = grid.ZBottom; + slipCircleGrid.GridXNumber = grid.NumberOfHorizontalPoints; + slipCircleGrid.GridZNumber = grid.NumberOfVerticalPoints; } - kernelSlipPlane.SlipPlaneTangentLine = CreateTangentLine(slipPlane); - - return kernelSlipPlane; + return slipCircleGrid; } - + private static SlipCircleTangentLine CreateTangentLine(UpliftVanSlipPlane slipPlane) { var tangentLine = new SlipCircleTangentLine @@ -74,18 +92,5 @@ return tangentLine; } - - private static SlipCircleGrid CreateGrid(UpliftVanGrid grid) - { - return new SlipCircleGrid - { - GridXLeft = grid.XLeft, - GridXRight = grid.XRight, - GridZTop = grid.ZTop, - GridZBottom = grid.ZBottom, - GridXNumber = grid.NumberOfHorizontalPoints, - GridZNumber = grid.NumberOfVerticalPoints - }; - } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneTest.cs =================================================================== diff -u -re2da467f67f436ca9923eb99821e3750d72c9cc1 -r476c10932cea472a1475d63d32c2ad019bc5c57a --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneTest.cs (.../UpliftVanSlipPlaneTest.cs) (revision e2da467f67f436ca9923eb99821e3750d72c9cc1) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanSlipPlaneTest.cs (.../UpliftVanSlipPlaneTest.cs) (revision 476c10932cea472a1475d63d32c2ad019bc5c57a) @@ -45,6 +45,7 @@ Assert.IsNaN(slipPlane.TangentZBottom); Assert.AreEqual(0, slipPlane.TangentLineNumber); Assert.AreEqual(4, slipPlane.TangentLineNumberOfRefinements); + Assert.AreEqual(1, slipPlane.GridNumberOfRefinements); } [Test] @@ -94,6 +95,7 @@ Assert.IsNaN(slipPlane.TangentZBottom); Assert.AreEqual(0, slipPlane.TangentLineNumber); Assert.AreEqual(4, slipPlane.TangentLineNumberOfRefinements); + Assert.AreEqual(0, slipPlane.GridNumberOfRefinements); } [Test] @@ -103,10 +105,10 @@ UpliftVanGrid grid = UpliftVanGridTestFactory.Create(); // Call - TestDelegate test = () => new UpliftVanSlipPlane(null, grid, 0, 0, 0); + void Call() => new UpliftVanSlipPlane(null, grid, 0, 0, 0); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("leftGrid", exception.ParamName); } @@ -148,6 +150,7 @@ Assert.AreEqual(tangentZBottom, slipPlane.TangentZBottom); Assert.AreEqual(tangentLineNumber, slipPlane.TangentLineNumber); Assert.AreEqual(4, slipPlane.TangentLineNumberOfRefinements); + Assert.AreEqual(0, slipPlane.GridNumberOfRefinements); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneUpliftVanCreatorTest.cs =================================================================== diff -u -re2da467f67f436ca9923eb99821e3750d72c9cc1 -r476c10932cea472a1475d63d32c2ad019bc5c57a --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneUpliftVanCreatorTest.cs (.../SlipPlaneUpliftVanCreatorTest.cs) (revision e2da467f67f436ca9923eb99821e3750d72c9cc1) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SlipPlaneUpliftVanCreatorTest.cs (.../SlipPlaneUpliftVanCreatorTest.cs) (revision 476c10932cea472a1475d63d32c2ad019bc5c57a) @@ -78,12 +78,14 @@ Assert.AreEqual(leftGridZBottom, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZBottom); Assert.AreEqual(leftGridXNumber, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridXNumber); Assert.AreEqual(leftGridZNumber, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneLeftGrid.NumberOfRefinements); Assert.AreEqual(rightGridXLeft, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXLeft); Assert.AreEqual(rightGridXRight, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXRight); Assert.AreEqual(rightGridZTop, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZTop); Assert.AreEqual(rightGridZBottom, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZBottom); Assert.AreEqual(rightGridXNumber, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXNumber); Assert.AreEqual(rightGridZNumber, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneRightGrid.NumberOfRefinements); Assert.AreEqual(tangentLineZTop, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZTop); Assert.AreEqual(tangentLineZBottom, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZBottom); Assert.AreEqual(tangentLineNumber, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineNumber); @@ -109,13 +111,15 @@ Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZBottom); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridXNumber); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneLeftGrid.NumberOfRefinements); Assert.IsNotNull(slipPlaneUpliftVan.SlipPlaneRightGrid); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXLeft); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXRight); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZTop); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZBottom); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXNumber); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneRightGrid.NumberOfRefinements); Assert.IsNotNull(slipPlaneUpliftVan.SlipPlaneTangentLine); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZTop); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZBottom); @@ -155,12 +159,14 @@ Assert.AreEqual(leftGridZBottom, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZBottom); Assert.AreEqual(leftGridXNumber, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridXNumber); Assert.AreEqual(leftGridZNumber, slipPlaneUpliftVan.SlipPlaneLeftGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneLeftGrid.NumberOfRefinements); Assert.AreEqual(rightGridXLeft, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXLeft); Assert.AreEqual(rightGridXRight, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXRight); Assert.AreEqual(rightGridZTop, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZTop); Assert.AreEqual(rightGridZBottom, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZBottom); Assert.AreEqual(rightGridXNumber, slipPlaneUpliftVan.SlipPlaneRightGrid.GridXNumber); Assert.AreEqual(rightGridZNumber, slipPlaneUpliftVan.SlipPlaneRightGrid.GridZNumber); + Assert.AreEqual(slipPlane.GridNumberOfRefinements, slipPlaneUpliftVan.SlipPlaneRightGrid.NumberOfRefinements); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZTop); Assert.AreEqual(0, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineZBottom); Assert.AreEqual(1, slipPlaneUpliftVan.SlipPlaneTangentLine.TangentLineNumber);