Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityOutputItem.cs =================================================================== diff -u -r6404 -r6505 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityOutputItem.cs (.../MacroStabilityOutputItem.cs) (revision 6404) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityOutputItem.cs (.../MacroStabilityOutputItem.cs) (revision 6505) @@ -121,36 +121,18 @@ public List ResultSlices { get; set; } /// - /// Gets or sets the Bishop calculation circle. + /// Gets or sets the Bishop calculation circle used for the input. /// /// - /// The bishop calculation circle. + /// The bishop calculation circle used for the input. /// - // TODO: Remove this property to make this class independent of the CSharpWrapper - public BishopCalculationCircle BishopCalculationCircle { get; set; } - - /// - /// Gets or sets the Uplift Van calculation grid. - /// - /// - /// The Uplift Van calculation grid. - /// - // TODO: Remove this property to make this class independent of the CSharpWrapper - public UpliftVanCalculationGrid UpliftVanCalculationGrid { get; set; } - - /// - /// Gets or sets the Bishop calculation circle. - /// - /// - /// The bishop calculation circle. - /// public BishopCalculationGrid InputBishopCalculationGrid { get; set; } /// - /// Gets or sets the Uplift Van calculation grid. + /// Gets or sets the Uplift Van calculation grid used for the input. /// /// - /// The Uplift Van calculation grid. + /// The Uplift Van calculation grid used for the input. /// public MacroStabilityCommon.UpliftVanCalculationGrid InputUpliftVanCalculationGrid { get; set; } } \ No newline at end of file Fisheye: Tag 6505 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillEngineFromMacroStabilityWrapperOutput.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs =================================================================== diff -u -r6479 -r6505 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 6479) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 6505) @@ -110,53 +110,6 @@ //Todo : add and or implement comparer per item as these are added to the code } - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - public void GivenCSharpWrapperOutputWhenGoingToAndFromEngineTheDataIsEqual(int testNumber) - { - //ToDo fill this - MacroStabilityOutput expectedKernelOutput = CreateKernelOutputForTest(testNumber); - var engineOutput = new Calculators.KernelWrappers.MacroStabilityInwards.MacroStabilityOutput(); - FillEngineFromMacroStabilityWrapperOutput.FillEngineDataWithResults(expectedKernelOutput, engineOutput, out List logMessages); - MacroStabilityOutput kernelOutput = FillMacroStabilityWrapperOutputFromEngine.FillMacroStabilityWrapperOutput(engineOutput, logMessages); - - var compare = new CompareLogic - { - Config = - { - MaxDifferences = 100 - } - }; - ComparisonResult result = compare.Compare(expectedKernelOutput, kernelOutput); - Assert.That(result.Differences, Is.Empty, "Differences found read/write kernel Output"); - } - - private static UpliftVanCalculationGrid CreateExampleUpliftVanCalculationGrid() - { - var random = new Random(21); - var upliftVanCalculationGrid = new UpliftVanCalculationGrid - { - LeftGridXLeft = random.NextDouble(), - LeftGridXRight = random.NextDouble(), - LeftGridZTop = random.NextDouble(), - LeftGridZBottom = random.NextDouble(), - LeftGridXCount = random.Next(), - LeftGridZCount = random.Next(), - RightGridXLeft = random.NextDouble(), - RightGridXRight = random.NextDouble(), - RightGridZTop = random.NextDouble(), - RightGridZBottom = random.NextDouble(), - RightGridXCount = random.Next(), - RightGridZCount = random.Next(), - TangentLinesCreationMethod = TangentLinesDefinition.OnBoundaryLines, - TangentLineZBottom = 0, - TangentLineZTop = 10, - TangentLineCount = 10 - }; - return upliftVanCalculationGrid; - } - private static Waternet CreateExampleWaternet() { var waterNet = new Waternet @@ -407,143 +360,7 @@ }); } - private static MacroStabilityOutput CreateKernelOutputForTest(int choice) - { - var output = new MacroStabilityOutput(); - var messagesOutput = new List(); - if (choice == 1) - { - // Result 1: succeeded, has a SafetyFactor of ca. 3.856, no messages - output.ResultType = CalculationResultType.Succeeded; - output.PreprocessingOutputBase = new UpliftVanPreprocessingOutput(); - output.StabilityOutput = new StabilityOutput - { - SafetyFactor = 3.856, - ModelOptionType = StabilityModelOptionType.UpliftVan - }; - output.StabilityOutput.MinimumSafetyCurve = SetupUpliftDualSlidingCircle(); - } - else if (choice == 2) - { - // Result 2: succeeded, has a SafetyFactor of ca. 1.857, has info and warning, but no error messages - messagesOutput.Clear(); - var infoMessage = new Message(); - infoMessage.Content = "Info"; - infoMessage.MessageType = MessageType.Info; - messagesOutput.Add(infoMessage); - var warningMessage = new Message(); - warningMessage.Content = "Warning"; - warningMessage.MessageType = MessageType.Warning; - messagesOutput.Add(warningMessage); - output.ResultType = CalculationResultType.Succeeded; - output.PreprocessingOutputBase = new UpliftVanPreprocessingOutput(); - output.StabilityOutput = new StabilityOutput - { - SafetyFactor = 1.857, - Messages = messagesOutput, - ModelOptionType = StabilityModelOptionType.UpliftVan - }; - } - else - { - // Result 3 failed - has a SafetyFactor of NaN, has an error message - messagesOutput.Clear(); - var errorMessage = new Message(); - errorMessage.Content = "Error"; - errorMessage.MessageType = MessageType.Error; - messagesOutput.Add(errorMessage); - output.StabilityOutput = new StabilityOutput(); - output.ResultType = CalculationResultType.RunFailed; - output.StabilityOutput.SafetyFactor = double.NaN; - output.StabilityOutput.Messages = messagesOutput; - } - return output; - } - - private static DualSlidingCircleMinimumSafetyCurve SetupUpliftDualSlidingCircle() - { - var dualSlidingCircleMinimumSafetyCurve = new DualSlidingCircleMinimumSafetyCurve - { - ActiveCircleCenter = new MacroStability.CSharpWrapper.Point2D(10, 10), - ActiveCircleRadius = 8, - PassiveCircleCenter = new MacroStability.CSharpWrapper.Point2D(22, 11), - PassiveCircleRadius = 7 - }; - List slices = CreateSlices(); - dualSlidingCircleMinimumSafetyCurve.Slices = slices; - - return dualSlidingCircleMinimumSafetyCurve; - } - - private static List CreateSlices() - { - var slices = new List(); - for (var i = 1; i < 6; i++) - { - var slice = new Slice - { - BottomLeftPoint = new MacroStability.CSharpWrapper.Point2D(-1 * i, 1 * i), - BottomRightPoint = new MacroStability.CSharpWrapper.Point2D(-2 * i, 2 * i), - TopLeftPoint = new MacroStability.CSharpWrapper.Point2D(-3 * i, 3 * i), - TopRightPoint = new MacroStability.CSharpWrapper.Point2D(-4 * i, 4 * i), - Name = "Slice" + i, - POP = 1.11 * i, - YieldStress = 2.22 * i, - OCR = 3.33 * i, - ResultantForce = 4.44 * i, - ResultantMoment = 5.55 * i, - ResultantAngle = 6.66 * i, - CohesionInput = 7.77 * i, - CohesionOutput = 8.88 * i, - FrictionAngleInput = 9.99 * i, - FrictionAngleOutput = 10.10 * i, - DilatancyInput = 11.11 * i, - SuInput = 12.12 * i, - SuOutput = 13.13 * i, - ShearStrengthModelType = ShearStrengthModelType.MohrCoulomb, - ShearStressInput = 14.14 * i, - ShearStressOutput = 15.15 * i, - Weight = 16.16 * i, - TotalPorePressure = 17.17 * i, - EffectiveStress = 18.18 * i, - HydrostaticPorePressure = 19.19 * i, - PiezometricPorePressure = 20.20 * i, - ExcessPorePressure = 21.21 * i, - DegreeOfConsolidationPorePressure = 22.22 * i, - PorePressureDueToDegreeOfConsolidationLoad = 23.23 * i, - LoadStress = 24.24 * i, - SoilStress = 25.25 * i, - TotalStress = 26.26 * i, - PorePressure = 27.27 * i, - VerticalPorePressure = 28.28 * i, - HorizontalPorePressure = 29.29 * i, - ExternalLoad = 30.30 * i, - NormalStress = 31.31 * i, - LeftForce = 32.32 * i, - LeftForceY = 33.33 * i, - LeftForceAngle = 34.34 * i, - RightForce = 35.35 * i, - RightForceY = 36.36 * i, - RightForceAngle = 37.37 * i, - HorizontalSoilQuakeStress = 38.38 * i, - VerticalSoilQuakeStress = 39.39 * i, - WaterQuakeStress = 40.40 * i, - RatioCuPc = 41.41 * i, - StrengthIncreaseExponent = 42.42 * i, - UpliftFactor = 43.43 * i, - UpliftReductionFactor = 44.44 * i, - ArcLength = 45.45 * i, - BottomAngle = 46.46 * i, - TopAngle = 47.47 * i, - Width = 48.48 * i - }; - slices.Add(slice); - } - - return slices; - } - public class GivenDamKernelInput { private readonly DamKernelInput damKernelInput = CreateDamKernelInputWithForbiddenZone();