Index: dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs
===================================================================
diff -u -r830 -r832
--- dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 830)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapperTests.cs (.../DamMacroStabilityInwardsKernelWrapperTests.cs) (revision 832)
@@ -45,19 +45,30 @@
private const string TestFolder = @"..\..\Deltares.DamEngine.Calculators.Tests\KernelWrappers\DamMacroStabilityCommon\TestData";
[Test]
- [Category(Categories.WorkInProgress)]
public void TestFullCalculation()
{
const double diff = 0.01;
var soilDbName = Path.Combine(TestFolder, "soilmaterials.mdb");
var soilGeometry2DName = Path.Combine(TestFolder, "1D1.sti");
+ var exeName = @".\KernelWrappers\DamMacroStabilityCommon\DGeoStability.exe";
+ var absoluteFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), TestFolder));
+ var workingDir = Path.Combine(absoluteFolder, "FullOut");
+ // Relative paths in ini file do not work yet in DGeoStability 16.2. This is fixed in 18.1.
+
+ if (Directory.Exists(workingDir))
+ {
+ Directory.Delete(workingDir, true);
+ }
+
var line = FactoryForSurfaceLines.CreateSurfaceLineTutorial1();
var location = new Location();
var scenario = DamMacroStabilityTestHelper.CreateScenarioForLocation(location, line);
scenario.Location.SoildatabaseName = soilDbName;
+ scenario.Location.StabilityOptions = new StabilityOptions();
+ scenario.Location.StabilityOptions.TrafficLoad = 10.0;
+ scenario.Location.StabilityOptions.MapForSoilGeometries2D = TestFolder;
- var trafficLoad = 10.0;
var subSoilScenario = new SoilGeometryProbability();
subSoilScenario.StiFileName = soilGeometry2DName;
subSoilScenario.SoilProfileType = SoilProfileType.ProfileTypeStiFile;
@@ -67,7 +78,9 @@
failureMechanismeParamatersMStab.MStabParameters.GridPosition = MStabGridPosition.Right;
failureMechanismeParamatersMStab.MStabParameters.SearchMethod = MStabSearchMethod.GeneticAlgorithm;
failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.MinimalCircleDepth = 1.0;
- failureMechanismeParamatersMStab.ProjectWorkingPath = TestFolder; // ToDo zant: is this the desired folder?
+ failureMechanismeParamatersMStab.MStabParameters.CalculationOptions.RequiredSafetyFactor = 1.1;
+ failureMechanismeParamatersMStab.DGeoStabilityExePath = exeName;
+ failureMechanismeParamatersMStab.ProjectWorkingPath = workingDir;
var damKernelInput = new DamKernelInput();
damKernelInput.Location = location;
Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/FailureMechanismeParamatersMStab.cs
===================================================================
diff -u -r830 -r832
--- dam engine/trunk/src/Deltares.DamEngine.Data/General/FailureMechanismeParamatersMStab.cs (.../FailureMechanismeParamatersMStab.cs) (revision 830)
+++ dam engine/trunk/src/Deltares.DamEngine.Data/General/FailureMechanismeParamatersMStab.cs (.../FailureMechanismeParamatersMStab.cs) (revision 832)
@@ -37,6 +37,7 @@
this.IsStabilityCheckOnUplift = false;
}
public string ProjectWorkingPath { get; set; }
+ public string DGeoStabilityExePath { get; set; }
public Location Location { get; set; }
public SurfaceLine2 SurfaceLine { get; set; }
public PLLines PLLines { get; set; }
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs
===================================================================
diff -u -r830 -r832
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 830)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 832)
@@ -40,10 +40,6 @@
{
public class DamMacroStabilityInwardsKernelWrapper : IKernelWrapper
{
- private const string DamMacroStabilityFolder = @".\KernelWrappers\DamMacroStability";
- private const string DGeoStabilityExe = "DGeoStability.exe";
-
-
///
/// Gets or sets the failure mechanisme paramaters for mstab.
///
@@ -80,7 +76,7 @@
}
var damMacroStabilityInput = new DamMacroStabilityInput()
{
- DGeoStabilityExePath = Path.Combine(DamMacroStabilityFolder, DGeoStabilityExe),
+ DGeoStabilityExePath = FailureMechanismeParamatersMStab.DGeoStabilityExePath,
DGeoStabilityInputFileName = DamMacroStabilityUtils.GetStabilityInputFileName(
damKernelInput, iterationIndex, model, FailureMechanismeParamatersMStab.ProjectWorkingPath),
FailureMechanismeParamatersMStab = FailureMechanismeParamatersMStab
@@ -235,30 +231,18 @@
internal XDocument CreateMstabDamXmlDocument(DamKernelInput damKernelInput, DamMacroStabilityInput kernelDataInput)
{
- const string testFolder = @"..\..\Deltares.DamEngine.Calculators.Tests\Files\MacroStability";
- // var stabilityProjectFilename = Path.Combine(testFolder, "test.sti");
- // var soilDbName =
-
var stabilityProjectFilename = kernelDataInput.DGeoStabilityInputFileName;
var scenario = damKernelInput.DesignScenario;
var subSoilScenario = damKernelInput.SubSoilScenario;
var riverLevel = scenario.RiverLevel;
var surfaceLine = scenario.Location.SurfaceLine;
var trafficLoad = scenario.Location.StabilityOptions.TrafficLoad;
- var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityInnerSlope;
- if (requiredSafetyFactor == null)
- {
- throw new MacroStabilityException("Required safety factor must be specified");
- }
+ var requiredSafetyFactor =
+ FailureMechanismeParamatersMStab.MStabParameters.CalculationOptions.RequiredSafetyFactor;
List errorMessages;
- // ToDo zant
- scenario.Location.StabilityOptions.MapForSoilGeometries2D = testFolder;
- scenario.Location.SoildatabaseName = Path.Combine(testFolder, "DAM Tutorial Design0.soilmaterials.mdb");
- scenario.Location.DikeEmbankmentMaterial = "dijksmateriaal_klei";
-
XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario,
- riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value,
+ riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor,
kernelDataInput.FailureMechanismeParamatersMStab, out errorMessages);
mstabXml.Save(stabilityProjectFilename + ".xml");
Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/MStabParameters.cs
===================================================================
diff -u -r578 -r832
--- dam engine/trunk/src/Deltares.DamEngine.Data/General/MStabParameters.cs (.../MStabParameters.cs) (revision 578)
+++ dam engine/trunk/src/Deltares.DamEngine.Data/General/MStabParameters.cs (.../MStabParameters.cs) (revision 832)
@@ -442,7 +442,8 @@
public class MStabCalculationOptions : IAssignable, ICloneable
{
public double MinimalCircleDepth { get; set; }
-
+ public double RequiredSafetyFactor { get; set; }
+
public MStabZonesType ZonesType { get; set; }
public void Assign(MStabCalculationOptions mstabCalculationOptions)
Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs
===================================================================
diff -u -r830 -r832
--- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 830)
+++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 832)
@@ -44,7 +44,7 @@
MStabModelType model, string projectWorkingPath)
{
// Assume 2D sti-file, then check on type being 1D
- string soilGeometryName = damKernelInput.SubSoilScenario.StiFileName;
+ string soilGeometryName = Path.GetFileNameWithoutExtension(damKernelInput.SubSoilScenario.StiFileName);
if (damKernelInput.SubSoilScenario.SoilProfileType == SoilProfileType.ProfileType1D)
{
soilGeometryName = damKernelInput.SubSoilScenario.SoilProfile1DName;