Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Dike.cs =================================================================== diff -u -r4199 -r4204 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Dike.cs (.../Dike.cs) (revision 4199) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Dike.cs (.../Dike.cs) (revision 4204) @@ -209,30 +209,7 @@ } } - public void CreateSoilBase() - { - if ((SoilDatabaseName == null) || !File.Exists(SoilDatabaseName)) - { - throw new DikeException($"The soil database '{SoilDatabaseName}' cannot be found"); - } - - SoilBaseDB = SoilbaseDB.Create(SoilDatabaseName); - } - /// - /// Read all the soils and their parameters from the database - /// - public void FillDataBaseSoilListFromSoilBase() - { - using (var geoDatabase = new GeoDatabase(SoilDatabaseName)) - { - geoDatabase.ReUseSoils = true; - SoilList newSoilList = geoDatabase.ReadSoils(soilList.Soils); - ImportedCsvSoils = newSoilList.Soils; - } - } - - /// /// Add to soil data as read from the csv-file to the dike soils /// public void FillImportedCsvSoilsFromCsvFile(IEnumerable soilRecords) Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/FactoryForStabilityTests.cs =================================================================== diff -u -r4070 -r4204 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/FactoryForStabilityTests.cs (.../FactoryForStabilityTests.cs) (revision 4070) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.TestHelper/FactoryForStabilityTests.cs (.../FactoryForStabilityTests.cs) (revision 4204) @@ -19,119 +19,27 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System.IO; using Deltares.Dam.Data; -using Deltares.Dam.TestHelper.TestUtils; -using Deltares.Geometry; -using Deltares.Geotechnics.Soils; -using Deltares.Geotechnics.SurfaceLines; namespace Deltares.Dam.TestHelper { public static class FactoryForStabilityTests { - public const string cSoilDatabaseName = @"TestData\soilmaterials.mdb"; - - public static Dike CreateDike() - { - var dike = new Dike(); - - SurfaceLine2 surfaceLineTutorial1 = FactoryForSurfaceLineTests.CreateSurfaceLineTutorial1(); - Location location = CreateLocation(surfaceLineTutorial1); - dike.Locations.Add(location); - dike.SurfaceLines2.Add(surfaceLineTutorial1); - // Define soil probability of 1.0 for single profile for stability - var soilGeometryProbability = new SoilGeometryProbability - { - SoilProfile = CreateSoilProfile(), - Probability = 1.0, - SegmentFailureMechanismType = FailureMechanismSystemType.StabilityInside - }; - // Define segment - var segment = new Segment(); - segment.Name = "SegmentName"; - segment.SoilProfileProbabilities.Add(soilGeometryProbability); - // dike.Segments.Add(segment); - dike.Locations[0].Segment = segment; - dike.SoilDatabaseName = cSoilDatabaseName; - dike.CreateSoilBase(); - - return dike; - } - - /// - /// Create scenario with location for tests - /// - /// - public static Scenario CreateScenarioForLocation(Location location, SurfaceLine2 surfaceLine) - { - var scenario = new Scenario(); - scenario.Location = location; - scenario.Location.Name = "LocationName"; - scenario.Location.DikeEmbankmentMaterial = "OB1"; - scenario.Location.ShoulderEmbankmentMaterial = "OB2"; - scenario.Location.SoildatabaseName = Path.Combine(@".\", cSoilDatabaseName); - scenario.Location.SoilList = scenario.Location.SoilbaseDB.CreateSoilList(); - scenario.LocationScenarioID = "ScenarioID"; - scenario.Location.SurfaceLine2 = surfaceLine; - var coordinateSystemConverter = new CoordinateSystemConverter(); - SurfaceLine2 localSurfaceLine = scenario.Location.SurfaceLine2.FullDeepClone(); - coordinateSystemConverter.ConvertGlobalXYZToLocalXZ(localSurfaceLine.Geometry); - scenario.Location.LocalXZSurfaceLine2 = localSurfaceLine; - return scenario; - } - /// /// Create standard calculation parameters for tests /// /// public static MStabParameters CreateMStabParameters() { - var mstabParameters = new MStabParameters(); - mstabParameters.Model = MStabModelType.Bishop; - mstabParameters.ShearStrength = MStabShearStrength.CPhi; - mstabParameters.IsProbabilistic = false; - mstabParameters.SoilDatabaseName = Path.Combine(@".\", cSoilDatabaseName); - mstabParameters.SearchMethod = MStabSearchMethod.GeneticAlgorithm; - mstabParameters.GridPosition = MStabGridPosition.Right; - mstabParameters.CalculationOptions = new MStabCalculationOptions(); - return mstabParameters; + return new MStabParameters + { + Model = MStabModelType.Bishop, + ShearStrength = MStabShearStrength.CPhi, + IsProbabilistic = false, + SearchMethod = MStabSearchMethod.GeneticAlgorithm, + GridPosition = MStabGridPosition.Right, + CalculationOptions = new MStabCalculationOptions() + }; } - - /// - /// Create location for tests - /// - /// The instance to be set on . - /// - private static Location CreateLocation(SurfaceLine2 surfaceLine) - { - var location = new Location(); - location.Name = "LocationName"; - location.DikeEmbankmentMaterial = "OB1"; - location.ShoulderEmbankmentMaterial = "OB2"; - location.SoildatabaseName = Path.Combine(@".\", cSoilDatabaseName); - location.SurfaceLine2 = surfaceLine; - SurfaceLine2 localSurfaceLine = location.SurfaceLine2.FullDeepClone(); - var coordinateSystemConverter = new CoordinateSystemConverter(); - coordinateSystemConverter.ConvertGlobalXYZToLocalXZ(localSurfaceLine.Geometry); - location.LocalXZSurfaceLine2 = localSurfaceLine; - - return location; - } - - /// - /// Create standard 4 layer soilprofile for tests - /// - /// - private static SoilProfile1D CreateSoilProfile() - { - SoilProfile1D soilProfile = FactoryForSoilProfileTests.CreateClaySandClaySandProfile(); - soilProfile.Name = "SoilProfileName"; - soilProfile.Layers[0].Soil.Name = "DKN3"; - soilProfile.Layers[1].Soil.Name = "zand"; - soilProfile.Layers[2].Soil.Name = "DKN3"; - soilProfile.Layers[3].Soil.Name = "zand"; - return soilProfile; - } } } \ No newline at end of file