Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj =================================================================== diff -u -r2030 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 2030) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 2044) @@ -102,6 +102,7 @@ + Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj =================================================================== diff -u -r2018 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 2018) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 2044) @@ -55,6 +55,10 @@ False + + False + ..\..\lib\FailureMechanisms\Macrostability\Deltares.SoilStress.Data.dll + False ..\..\lib\FailureMechanisms\WbiPipingMerged\Deltares.WTIPiping.Merged.dll Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/TrafficLoad.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/TrafficLoad.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/TrafficLoad.cs (revision 2044) @@ -0,0 +1,37 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero 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. + +namespace Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon +{ + /// Traffic load + public class TrafficLoad + { + /// Gets or sets the pressure. + /// The pressure. + public double Pressure { get; set; } + /// Gets or sets the x start. + /// The x start. + public double XStart{ get; set; } + /// Gets or sets the x end. + /// The x end. + public double XEnd { get; set; } + } +} Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillWtiKernelData.cs =================================================================== diff -u -r2033 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillWtiKernelData.cs (.../FillWtiKernelData.cs) (revision 2033) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillWtiKernelData.cs (.../FillWtiKernelData.cs) (revision 2044) @@ -58,9 +58,12 @@ /// Gets or sets the UpliftVan calculation grid. /// The uplift van calculation grid. public UpliftVanCalculationGrid UpliftVanCalculationGrid { get; set; } - /// Gets or sets the MStab failure mechanism parameters. - /// The MStab failure mechanism parameters. - public FailureMechanismParametersMStab FailureMechanismParametersMStab { get; set; } + /// Gets or sets the traffic load. + /// The traffic load. + public TrafficLoad TrafficLoad { get; set; } + /// Gets or sets the MStab failure mechanism parameters. + /// The MStab failure mechanism parameters. + public FailureMechanismParametersMStab FailureMechanismParametersMStab { get; set; } private Dictionary dictSoils = new Dictionary(); private Dictionary dictPoints = new Dictionary(); @@ -85,11 +88,27 @@ TransferSurfaceLine(SurfaceLine2, kernelModel.PreprocessingModel.LastStage.SurfaceLine); kernelModel.PreprocessingModel.ConstructionStages.Add(new PreprocessingConstructionStage()); kernelModel.PreprocessingModel.LastStage.Locations.Add(new Location()); - TransferWaternet(Waternet, kernelModel.StabilityModel.ConstructionStages[0].GeotechnicsData.CurrentWaternet); + TransferWaternet(Waternet, kernelModel.StabilityModel.LastStage.GeotechnicsData.CurrentWaternet); TransferUpliftVanCalculationGrid(UpliftVanCalculationGrid, kernelModel.StabilityModel.SlipPlaneUpliftVan, kernelModel.PreprocessingModel.SearchAreaConditions); + TransferUniformLoads(TrafficLoad, kernelModel.StabilityModel.LastStage.UniformLoads); return kernelModel; } + private void TransferUniformLoads(TrafficLoad trafficLoad, List uniformLoads) + { + uniformLoads.Clear(); + if (trafficLoad != null) + { + uniformLoads.Add(new SoilStress.Data.UniformLoad() + { + XStart = trafficLoad.XStart, + XEnd = trafficLoad.XEnd, + Pressure = trafficLoad.Pressure, + DistributionAngle = 0.0, + }); + } + } + private void TransferUpliftVanCalculationGrid(UpliftVanCalculationGrid damUpliftVanCalculationGrid, SlipPlaneUpliftVan kernelSlipPlaneUpliftVan, SearchAreaConditions kernelSearchAreaConditions) { if (damUpliftVanCalculationGrid == null) throw new ArgumentNullException(nameof(damUpliftVanCalculationGrid)); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs =================================================================== diff -u -r2033 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 2033) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 2044) @@ -32,8 +32,10 @@ using Deltares.MacroStability.Data; using Deltares.MacroStability.Geometry; using Deltares.MacroStability.Standard; +using Deltares.SoilStress.Data; using KellermanSoftware.CompareNetObjects; using CharacteristicPointSet = Deltares.MacroStability.Geometry.CharacteristicPointSet; +using CharacteristicPointType = Deltares.DamEngine.Data.Geotechnics.CharacteristicPointType; using HeadLine = Deltares.DamEngine.Data.Geometry.HeadLine; using Soil = Deltares.MacroStability.Geometry.Soil; using SoilProfile2D = Deltares.DamEngine.Data.Geotechnics.SoilProfile2D; @@ -90,6 +92,13 @@ SoilProfile2D expectedSoilProfile2D = expectedLocation.Segment.SoilProfileProbabilities[0].SoilProfile2D; SurfaceLine2 expectedSurfaceLine2D = expectedLocation.SurfaceLine; FailureMechanismParametersMStab expectedParametersMStab = expectedDamProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismParametersMStab; + TrafficLoad expectedTrafficLoad = new TrafficLoad() + { + Pressure = 6.0, + XStart = expectedSurfaceLine2D.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.TrafficLoadInside).X, + XEnd = expectedSurfaceLine2D.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.TrafficLoadOutside).X, + + }; FillWtiKernelData fillWtiKernelData = new FillWtiKernelData() { SoilList = expectedSoilList, @@ -98,7 +107,8 @@ SoilProfile2D = expectedSoilProfile2D, SurfaceLine2 = expectedSurfaceLine2D, Waternet = expectedWaternet, - UpliftVanCalculationGrid = expectedUpliftVanCalculationGrid + UpliftVanCalculationGrid = expectedUpliftVanCalculationGrid, + TrafficLoad = expectedTrafficLoad }; KernelModel expectedKernelModel = fillWtiKernelData.CreateKernelModel(); @@ -199,7 +209,8 @@ Location = fillDamEngineFromWti.Location, SoilProfile2D = fillDamEngineFromWti.SoilProfile2D, SurfaceLine2 = fillDamEngineFromWti.SurfaceLine2, - UpliftVanCalculationGrid = fillDamEngineFromWti.UpliftVanCalculationGrid + UpliftVanCalculationGrid = fillDamEngineFromWti.UpliftVanCalculationGrid, + TrafficLoad = fillDamEngineFromWti.TrafficLoad }; KernelModel actualKernelModel = fillWtiKernelData.CreateKernelModel(); string xmlOutput = WtiSerializer.Serialize(actualKernelModel); @@ -213,11 +224,26 @@ CompareSoilProfile2D(expectedKernelModel.StabilityModel.SoilProfile, actualKernelModel.StabilityModel.SoilProfile); CompareSoilSurfaceLine(expectedKernelModel.PreprocessingModel.LastStage.SurfaceLine.CharacteristicPoints, actualKernelModel.PreprocessingModel.LastStage.SurfaceLine.CharacteristicPoints); - CompareWaternet(expectedKernelModel.StabilityModel.ConstructionStages[0].GeotechnicsData.CurrentWaternet, - actualKernelModel.StabilityModel.ConstructionStages[0].GeotechnicsData.CurrentWaternet); + CompareWaternet(expectedKernelModel.StabilityModel.LastStage.GeotechnicsData.CurrentWaternet, + actualKernelModel.StabilityModel.LastStage.GeotechnicsData.CurrentWaternet); CompareUpliftVanCalculationGrid(expectedKernelModel.StabilityModel.SlipPlaneUpliftVan, actualKernelModel.StabilityModel.SlipPlaneUpliftVan); + CompareTrafficLoad(expectedKernelModel.StabilityModel.LastStage.UniformLoads, actualKernelModel.StabilityModel.LastStage.UniformLoads); } + private void CompareTrafficLoad(List expectedUniformLoads, List actualUniformLoads) + { + var compare = new CompareLogic { Config = { MaxDifferences = 100 } }; + compare.Config.MembersToInclude = new List() + { + "XEnd", + "XStart", + "Pressure" + }; + ComparisonResult result; + result = compare.Compare(expectedUniformLoads, actualUniformLoads); + Assert.AreEqual(0, result.Differences.Count, "Differences found read/write kernel Traffic Load"); + } + private void CompareUpliftVanCalculationGrid(SlipPlaneUpliftVan expectedSlipPlaneUpliftVan, SlipPlaneUpliftVan actualSlipPlaneUpliftVan) { var compare = new CompareLogic { Config = { MaxDifferences = 100 } }; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/TestFiles/Benchmark 1-01b.wti =================================================================== diff -u -r1973 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/TestFiles/Benchmark 1-01b.wti (.../Benchmark 1-01b.wti) (revision 1973) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/TestFiles/Benchmark 1-01b.wti (.../Benchmark 1-01b.wti) (revision 2044) @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillDamEngineFromWti.cs =================================================================== diff -u -r2030 -r2044 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillDamEngineFromWti.cs (.../FillDamEngineFromWti.cs) (revision 2030) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/FillDamEngineFromWti.cs (.../FillDamEngineFromWti.cs) (revision 2044) @@ -19,13 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; using Deltares.MacroStability.Data; using Deltares.MacroStability.Kernel; using Deltares.MacroStability.Preprocessing; +using Deltares.SoilStress.Data; using Soil = Deltares.MacroStability.Geometry.Soil; using CharacteristicPoint = Deltares.DamEngine.Data.Geotechnics.CharacteristicPoint; using GeometryCurve = Deltares.MacroStability.Geometry.GeometryCurve; @@ -59,6 +61,9 @@ /// Gets or sets the UpliftVan calculation grid. /// The uplift van calculation grid. public UpliftVanCalculationGrid UpliftVanCalculationGrid { get; set; } + /// Gets or sets the traffic load. + /// The traffic load. + public TrafficLoad TrafficLoad { get; set; } /// Gets or sets the failure mechanism parameters m stab. /// The failure mechanism parameters for macrostability DamEngine object. public FailureMechanismParametersMStab FailureMechanismParametersMStab { get; set; } @@ -82,9 +87,31 @@ TransferSoilProfile2D(kernelModel.StabilityModel.SoilProfile); TransferSurfaceLine(kernelModel.PreprocessingModel.LastStage.SurfaceLine, SurfaceLine2); TransferWaternet(kernelModel.StabilityModel.LastStage.GeotechnicsData.CurrentWaternet, Waternet); - TransferUpliftVanCalculationGrid(kernelModel.StabilityModel.SlipPlaneUpliftVan, kernelModel.PreprocessingModel.SearchAreaConditions , UpliftVanCalculationGrid); + TransferUpliftVanCalculationGrid(kernelModel.StabilityModel.SlipPlaneUpliftVan, kernelModel.PreprocessingModel.SearchAreaConditions, UpliftVanCalculationGrid); + TransferTrafficLoad(kernelModel.StabilityModel.LastStage.UniformLoads); } + private void TransferTrafficLoad(List kernelUniformLoads) + { + TrafficLoad = null; + if ((kernelUniformLoads != null) && (kernelUniformLoads.Count > 0)) + { + if (kernelUniformLoads.Count > 1) + { + throw new ArgumentException(string.Format( + "Trafficload cannot be constructed because there are too many uniform loads defined ({0}", + kernelUniformLoads.Count)); + } + var kernelUniformLoad = kernelUniformLoads[0]; + TrafficLoad = new TrafficLoad() + { + XStart = kernelUniformLoad.XStart, + XEnd = kernelUniformLoad.XEnd, + Pressure = kernelUniformLoad.Pressure + }; + } + } + private void TransferUpliftVanCalculationGrid(SlipPlaneUpliftVan kernelSlipPlaneUpliftVan, SearchAreaConditions kernelSearchAreaConditions, UpliftVanCalculationGrid damUpliftVanCalculationGrid)