Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs =================================================================== diff -u -rda5614e4f69e43e5ae930bf74fb76a6d2d00058d -r9bb52a5c5ee233271ee2f3e6f1e62437b105762e --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision da5614e4f69e43e5ae930bf74fb76a6d2d00058d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/UpliftVanCalculator.cs (.../UpliftVanCalculator.cs) (revision 9bb52a5c5ee233271ee2f3e6f1e62437b105762e) @@ -121,6 +121,10 @@ SurfaceLine2 surfaceLine2 = SurfaceLineCreator.Create(input.SurfaceLine); SoilProfile2D soilProfile2D = SoilProfileCreator.Create(input.SoilProfile.PreconsolidationStresses, layersWithSoil); + upliftVanKernel.SetSlipPlaneUpliftVan(SlipPlaneUpliftVanCreator.Create(input.SlipPlane)); + upliftVanKernel.SetSlipPlaneConstraints(SlipPlaneConstraintsCreator.Create(input.SlipPlaneConstraints)); + upliftVanKernel.SetGridAutomaticDetermined(input.SlipPlane.GridAutomaticDetermined); + upliftVanKernel.SetTangentLinesAutomaticDetermined(input.SlipPlane.TangentLinesAutomaticAtBoundaries); upliftVanKernel.SetMoveGrid(input.MoveGrid); upliftVanKernel.SetMaximumSliceWidth(input.MaximumSliceWidth); upliftVanKernel.SetSurfaceLine(surfaceLine2); @@ -140,11 +144,7 @@ waternetExtremeKernelWrapper.SetSurfaceLine(surfaceLine2); waternetExtremeKernelWrapper.Calculate(); upliftVanKernel.SetWaternetExtreme(waternetExtremeKernelWrapper.Waternet); - - upliftVanKernel.SetSlipPlaneUpliftVan(SlipPlaneUpliftVanCreator.Create(input.SlipPlane)); - upliftVanKernel.SetSlipPlaneConstraints(SlipPlaneConstraintsCreator.Create(input.SlipPlaneConstraints)); - upliftVanKernel.SetGridAutomaticDetermined(input.SlipPlane.GridAutomaticDetermined); - + return upliftVanKernel; } } Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs =================================================================== diff -u -r3a03f421a9936d6b23596533aa1d130485ea41e7 -r9bb52a5c5ee233271ee2f3e6f1e62437b105762e --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision 3a03f421a9936d6b23596533aa1d130485ea41e7) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/IUpliftVanKernel.cs (.../IUpliftVanKernel.cs) (revision 9bb52a5c5ee233271ee2f3e6f1e62437b105762e) @@ -128,6 +128,11 @@ void SetGridAutomaticDetermined(bool gridAutomaticDetermined); /// + /// Sets whether the tangent lines are automatically determined or not. + /// + void SetTangentLinesAutomaticDetermined(bool slipPlaneTangentLinesAutomaticAtBoundaries); + + /// /// Performs the Uplift Van calculation. /// /// Thrown when Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs =================================================================== diff -u -r0aa21164a7e21de370e4f301103d020fbeb2966c -r9bb52a5c5ee233271ee2f3e6f1e62437b105762e --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision 0aa21164a7e21de370e4f301103d020fbeb2966c) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Kernels/UpliftVan/UpliftVanKernelWrapper.cs (.../UpliftVanKernelWrapper.cs) (revision 9bb52a5c5ee233271ee2f3e6f1e62437b105762e) @@ -70,14 +70,6 @@ ForbiddenZonesXEntryMax = double.NaN; } - private void AddPreProcessingConstructionStages() - { - kernelModel.PreprocessingModel.PreProcessingConstructionStages.Add(new PreprocessingConstructionStage - { - StabilityModel = kernelModel.StabilityModel - }); - } - public double FactorOfStability { get; private set; } public double ZValue { get; private set; } @@ -127,6 +119,11 @@ kernelModel.PreprocessingModel.SearchAreaConditions.AutoSearchArea = gridAutomaticDetermined; } + public void SetTangentLinesAutomaticDetermined(bool tangentLinesAutomaticDetermined) + { + kernelModel.PreprocessingModel.SearchAreaConditions.AutoTangentLines = tangentLinesAutomaticDetermined; + } + public void SetSoilModel(IList soilModel) { kernelModel.StabilityModel.Soils.AddRange(soilModel); @@ -162,6 +159,12 @@ { try { + // The following lines are necessary as a workaround for the kernel. + // The kernel validates before generating the grid, with calling Update, this is prevented. + PreprocessingModel preprocessingModel = kernelModel.PreprocessingModel; + var preprocessor = new StabilityPreprocessor(); + preprocessor.Update(kernelModel.StabilityModel, preprocessingModel); + IValidationResult[] validationResults = Validator.Validate(kernelModel); return validationResults; } @@ -171,6 +174,14 @@ } } + private void AddPreProcessingConstructionStages() + { + kernelModel.PreprocessingModel.PreProcessingConstructionStages.Add(new PreprocessingConstructionStage + { + StabilityModel = kernelModel.StabilityModel + }); + } + private void ReadLogMessages(List kernelCalculationLogMessages) { CalculationMessages = kernelCalculationLogMessages ?? Enumerable.Empty(); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs =================================================================== diff -u -r0aa21164a7e21de370e4f301103d020fbeb2966c -r9bb52a5c5ee233271ee2f3e6f1e62437b105762e --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision 0aa21164a7e21de370e4f301103d020fbeb2966c) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Kernels/UpliftVan/UpliftVanKernelWrapperTest.cs (.../UpliftVanKernelWrapperTest.cs) (revision 9bb52a5c5ee233271ee2f3e6f1e62437b105762e) @@ -210,13 +210,13 @@ public void Validate_InvalidInput_GeneratesValidationMessages() { // Setup - UpliftVanKernelWrapper kernel = CreateInvalidKernel(null); + UpliftVanKernelWrapper kernel = CreateInvalidKernel(new Soil()); // Call var validationMessages = kernel.Validate(); // Assert - Assert.AreEqual(13, validationMessages.Count()); + Assert.AreEqual(12, validationMessages.Count()); } private static UpliftVanKernelWrapper CreateValidKernel(Soil soil) Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs =================================================================== diff -u -r3a03f421a9936d6b23596533aa1d130485ea41e7 -r9bb52a5c5ee233271ee2f3e6f1e62437b105762e --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs (.../UpliftVanKernelStub.cs) (revision 3a03f421a9936d6b23596533aa1d130485ea41e7) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil/Kernels/UpliftVan/UpliftVanKernelStub.cs (.../UpliftVanKernelStub.cs) (revision 9bb52a5c5ee233271ee2f3e6f1e62437b105762e) @@ -24,7 +24,6 @@ using Deltares.MacroStability.Data; using Deltares.MacroStability.Geometry; using Deltares.MacroStability.Standard; -using Deltares.MacroStability.WaternetCreator; using Riskeer.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using WtiStabilityWaternet = Deltares.MacroStability.Geometry.Waternet; @@ -81,6 +80,8 @@ public bool GridAutomaticDetermined { get; private set; } + public bool TangentLinesAutomaticDetermined { get; private set; } + public WtiStabilityWaternet WaternetDaily { get; private set; } public WtiStabilityWaternet WaternetExtreme { get; private set; } @@ -149,6 +150,11 @@ GridAutomaticDetermined = gridAutomaticDetermined; } + public void SetTangentLinesAutomaticDetermined(bool slipPlaneTangentLinesAutomaticAtBoundaries) + { + TangentLinesAutomaticDetermined = slipPlaneTangentLinesAutomaticAtBoundaries; + } + public void Calculate() { if (ThrowExceptionOnCalculate)