Index: DamEngine/trunk/src/Deltares.DamEngine.Data/RWScenarios/HydraulicShortcutRWEvaluator.cs =================================================================== diff -u -r877 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Data/RWScenarios/HydraulicShortcutRWEvaluator.cs (.../HydraulicShortcutRWEvaluator.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/RWScenarios/HydraulicShortcutRWEvaluator.cs (.../HydraulicShortcutRWEvaluator.cs) (revision 1007) @@ -239,7 +239,7 @@ // plLinesCreator.WaterLevelPolder = location.PolderLevel; // plLinesCreator.ModelParametersForPLLines = location.CreateModelParametersForPLLines(); // plLinesCreator.SoilProfile1D = soilGeometry.SoilProfile1D; -// plLinesCreator.StiFileName = null; +// plLinesCreator.FullStiFileName = null; // plLinesCreator.SoilProfileType = SoilProfileType.ProfileType1D; // plLinesCreator.GaugePLLines = null; // plLinesCreator.Gauges = null; @@ -268,7 +268,7 @@ // { // SurfaceLine = location.SurfaceLine2, // SoilProfile1D = soilGeometry.SoilProfile1D, -// StiFileName = null, +// FullStiFileName = null, // SoilBaseDB = null, //soilbase, // DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), // PLLines = CreatePLLines(), Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r999 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 999) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 1007) @@ -110,7 +110,8 @@ damKernelInput.Location = location; damKernelInput.DesignScenario = scenario; damKernelInput.SubSoilScenario = subSoilScenario; - damKernelInput.WorkingDir = workingDir; + damKernelInput.ProjectDir = projectPath; + damKernelInput.CalculationDir = workingDir; return damKernelInput; } Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs =================================================================== diff -u -r941 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 941) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 1007) @@ -82,7 +82,7 @@ orderby spp.Probability descending select spp; if (spps.Any()) - return spps.First().StiFileName; + return spps.First().FullStiFileName; else return null; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs =================================================================== diff -u -r962 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 962) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 1007) @@ -74,7 +74,7 @@ errorMessages = new List(); var profile1D = subSoilScenario.SoilProfile1D; - var soilGeometry2DName = subSoilScenario.StiFileName; + var soilGeometry2DName = subSoilScenario.FullStiFileName; ConsistencyCheck(scenario, profile1D); Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/MacroStabilityTests.cs =================================================================== diff -u -r1004 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/MacroStabilityTests.cs (.../MacroStabilityTests.cs) (revision 1004) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/MacroStabilityTests.cs (.../MacroStabilityTests.cs) (revision 1007) @@ -44,6 +44,10 @@ { Directory.Delete(calcDir, true); // delete previous results } + + Directory.CreateDirectory(calcDir); + + const string fileName = @"TestFiles\MacroStabilityTutorialDesignInputFile.xml"; string inputString = File.ReadAllText(fileName); inputString = ChangeValueInXml(inputString, "ProjectPath", ""); // Current directory will be used @@ -78,8 +82,12 @@ // ResultMessage "" Assert.AreEqual("", output.Results.CalculationResults.DesignResults[0].StabilityDesignResults.ResultMessage); + // Check that a line is specified Assert.IsNotNull(output.Results.CalculationResults.DesignResults[0].StabilityDesignResults.RedesignedSurfaceLine); + // Profile name = DWP_1.sti + Assert.AreEqual("DWP_1.sti", output.Results.CalculationResults.DesignResults[0].ProfileName); + // Calculation Result Assert.AreEqual(CalculationResult.Succeeded, ConversionHelper.ConvertToCalculationResult(output.Results.CalculationResults.DesignResults[0].CalculationResult)); } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs =================================================================== diff -u -r916 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 916) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 1007) @@ -30,14 +30,22 @@ public class DamKernelInput { /// - /// Gets or sets the working directory. + /// Gets or sets the calculation directory. /// /// - /// The working directory. + /// The calculation directory. /// - public string WorkingDir { get; set; } + public string CalculationDir { get; set; } /// + /// Gets or sets the project directory. + /// + /// + /// The project directory. + /// + public string ProjectDir { get; set; } + + /// /// Gets or sets the location. /// /// Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs =================================================================== diff -u -r877 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 1007) @@ -44,7 +44,7 @@ MStabModelType model, string projectWorkingPath) { // Assume 2D sti-file, then check on type being 1D - string soilGeometryName = Path.GetFileNameWithoutExtension(damKernelInput.SubSoilScenario.StiFileName); + string soilGeometryName = Path.GetFileNameWithoutExtension(damKernelInput.SubSoilScenario.FullStiFileName); if (damKernelInput.SubSoilScenario.SoilProfileType == SoilProfileType.ProfileType1D) { soilGeometryName = damKernelInput.SubSoilScenario.SoilProfile1DName; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs =================================================================== diff -u -r938 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 938) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 1007) @@ -69,7 +69,7 @@ scenario.Location.StabilityOptions.SoilDatabaseName = soilDbName; var subSoilScenario = new SoilGeometryProbability(); - subSoilScenario.StiFileName = soilGeometry2DName; + subSoilScenario.FullStiFileName = soilGeometry2DName; subSoilScenario.SoilProfileType = SoilProfileType.ProfileTypeStiFile; subSoilScenario.SegmentFailureMechanismType = FailureMechanismSystemType.StabilityInside; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r992 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 992) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1007) @@ -65,7 +65,8 @@ // Prepare input var damKernelInput = new DamKernelInput(); var projectPath = damProjectData.ProjectPath != "" ? damProjectData.ProjectPath : Directory.GetCurrentDirectory(); - damKernelInput.WorkingDir = Path.Combine(projectPath, damProjectData.CalculationMap); + damKernelInput.ProjectDir = projectPath; + damKernelInput.CalculationDir = Path.Combine(projectPath, damProjectData.CalculationMap); damKernelInput.Location = location; damKernelInput.SubSoilScenario = soiProfileProbability; damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/SoilGeometryProbability.cs =================================================================== diff -u -r941 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/SoilGeometryProbability.cs (.../SoilGeometryProbability.cs) (revision 941) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/SoilGeometryProbability.cs (.../SoilGeometryProbability.cs) (revision 1007) @@ -61,6 +61,15 @@ public virtual SoilProfile2D SoilProfile2D { get; set; } /// + /// Gets or sets the name of the sti file (that holds the 2D profile) including full path. + /// + /// + /// The name of the soilgeometry2d including full path. + /// + + public virtual string FullStiFileName { get; set; } + + /// /// Gets or sets the name of the sti file (that holds the 2D profile). /// /// Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r1001 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1001) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 1007) @@ -85,20 +85,16 @@ { // Make sure the gridposition is Left. FailureMechanismParametersMStab.MStabParameters.GridPosition = MStabGridPosition.Left; - if (string.IsNullOrEmpty(damKernelInput.WorkingDir)) - { - FailureMechanismParametersMStab.ProjectWorkingPath = Directory.GetCurrentDirectory(); - } - else - { - FailureMechanismParametersMStab.ProjectWorkingPath = damKernelInput.WorkingDir; - } + + FailureMechanismParametersMStab.ProjectWorkingPath = damKernelInput.CalculationDir; + if (damKernelInput.SubSoilScenario.SoilProfileType == SoilProfileType.ProfileTypeStiFile) { - damKernelInput.SubSoilScenario.StiFileName = Path.Combine( - damKernelInput.Location.StabilityOptions.SoilGeometries2DPath, - damKernelInput.SubSoilScenario.StiFileName); + damKernelInput.SubSoilScenario.FullStiFileName = Path.Combine(damKernelInput.ProjectDir, + Path.Combine(damKernelInput.Location.StabilityOptions.SoilGeometries2DPath, + damKernelInput.SubSoilScenario.StiFileName)); } + var damMacroStabilityInput = new DamMacroStabilityInput() { DGeoStabilityExePath = FailureMechanismParametersMStab.DGeoStabilityExePath, Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1004 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1004) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1007) @@ -77,20 +77,13 @@ model = MStabModelType.Bishop; } - if (string.IsNullOrEmpty(damKernelInput.WorkingDir)) - { - FailureMechanismParametersMStab.ProjectWorkingPath = Directory.GetCurrentDirectory(); - } - else - { - FailureMechanismParametersMStab.ProjectWorkingPath = damKernelInput.WorkingDir; - } + FailureMechanismParametersMStab.ProjectWorkingPath = damKernelInput.CalculationDir; if (damKernelInput.SubSoilScenario.SoilProfileType == SoilProfileType.ProfileTypeStiFile) { - damKernelInput.SubSoilScenario.StiFileName = + damKernelInput.SubSoilScenario.FullStiFileName = Path.Combine(damKernelInput.ProjectDir, Path.Combine(damKernelInput.Location.StabilityOptions.SoilGeometries2DPath, - damKernelInput.SubSoilScenario.StiFileName); + damKernelInput.SubSoilScenario.StiFileName)); } var damMacroStabilityInput = new DamMacroStabilityInput() @@ -180,14 +173,8 @@ /// public int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { - var calculator = StabilityCalculator(kernelDataInput); - //ToDo zant calculator has no Validate. -// List kernelMessages = calculator.Validate(); + // calculator has no Validate. messages = new List(); -// foreach (string stringMessage in kernelMessages) -// { -// messages.Add(new LogMessage() { Message = stringMessage, MessageType = LogMessageType.Error }); -// } return messages.Count; } @@ -385,6 +372,7 @@ }; var stabilityDesignResults = new StabilityDesignResults(); stabilityDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; + designResult.ProfileName = soilProfile2DName; designResult.StabilityDesignResults = stabilityDesignResults; return designResult; } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs =================================================================== diff -u -r1001 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1001) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapperTests.cs (.../DamMacroStabilityOutwardsKernelWrapperTests.cs) (revision 1007) @@ -60,7 +60,7 @@ } var damKernelInput = CreateDamKernelInput(); - damKernelInput.WorkingDir = workingDir; + damKernelInput.CalculationDir = workingDir; var failureMechanismParametersMStab = new FailureMechanismParametersMStab { MStabParameters = @@ -103,7 +103,8 @@ } var damKernelInput = CreateDamKernelInput(); - damKernelInput.WorkingDir = workingDir; + damKernelInput.ProjectDir = absoluteFolder; + damKernelInput.CalculationDir = workingDir; var failureMechanismParametersMStab = new FailureMechanismParametersMStab { MStabParameters = @@ -161,7 +162,8 @@ } var damKernelInput = CreateDamKernelInput(true); - damKernelInput.WorkingDir = workingDir; + damKernelInput.ProjectDir = absoluteFolder; + damKernelInput.CalculationDir = workingDir; damKernelInput.DesignScenario.Location.DikeEmbankmentMaterial = "Del_Ppp"; damKernelInput.DesignScenario.Location.ShoulderEmbankmentMaterial = "Del_Ppp"; damKernelInput.DesignScenario.Location.StabilityOptions.MinimalCircleDepth = 1.0; @@ -202,13 +204,14 @@ private static DamKernelInput CreateDamKernelInput(bool realOut = false) { + var absoluteFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), testFolder)); var soilDbName = Path.Combine(testFolder, "soilmaterials.mdb"); var soilGeometry2DName = "1D1.sti"; var line = FactoryForSurfaceLines.CreateSurfaceLineTutorial1(); var location = new Location(); if (realOut) { - soilDbName = Path.Combine(testFolder, "soilmaterialsOutwards.mdb"); + soilDbName = Path.Combine(absoluteFolder, "soilmaterialsOutwards.mdb"); soilGeometry2DName = "OutwardsZones.sti"; foreach (var characteristicPoint in line.CharacteristicPoints) { @@ -221,7 +224,7 @@ scenario.Location.StabilityOptions = new StabilityOptions { TrafficLoad = 10.0, - SoilGeometries2DPath = testFolder + SoilGeometries2DPath = absoluteFolder }; scenario.Location.StabilityOptions.SoilDatabaseName = soilDbName; scenario.ModelFactors.RequiredSafetyFactorStabilityOuterSlope = 1.1; @@ -418,7 +421,7 @@ // expected results are based on test CanCalculateStabilitySafetyFactorGeometry2D // in 'https://repos.deltares.nl/repos/dam/dam classic' revision 190 var soilDbName = Path.Combine(testFolder, "soilmaterials.mdb"); - var soilGeometry2DName = Path.Combine(testFolder, "1D1.sti"); + var soilGeometry2DName = "1D1.sti"; var absoluteFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), testFolder)); var workingDir = Path.Combine(absoluteFolder, "FullOut"); @@ -465,7 +468,9 @@ { Location = location, DesignScenario = scenario, - SubSoilScenario = subSoilScenario + SubSoilScenario = subSoilScenario, + ProjectDir = absoluteFolder, + CalculationDir = workingDir }; var kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs =================================================================== diff -u -r958 -r1007 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs (.../PLLinesCreator.cs) (revision 958) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/PLLinesCreator.cs (.../PLLinesCreator.cs) (revision 1007) @@ -272,7 +272,7 @@ ((SoilProfileType == SoilProfileType.ProfileType2D) && (SoilProfile2D == null || DikeEmbankmentMaterial == null)); if (hasNoGeometry1DData && hasNoGeometry2DData) { - throw new PLLinesCreatorException("PLLinesCreator contains not enough soil geometry information (SoilProfile1D, StiFileName, dikeEmbankmentMaterial or soilBase)"); + throw new PLLinesCreatorException("PLLinesCreator contains not enough soil geometry information (SoilProfile1D, FullStiFileName, dikeEmbankmentMaterial or soilBase)"); } }