Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r787 -r805 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 787) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 805) @@ -92,7 +92,8 @@ var damMacroStabilityInput = new DamMacroStabilityInput() { DGeoStabilityExePath = Path.Combine(DamMacroStabilityFolder, DGeoStabilityExe), - DGeoStabilityInputFileName = stiFileName + DGeoStabilityInputFileName = stiFileName, + FailureMechanismeParamatersMStab = FailureMechanismeParamatersMStab }; kernelDataInput = damMacroStabilityInput; @@ -182,7 +183,7 @@ var riverLevel = scenario.RiverLevel; var surfaceLine = scenario.Location.SurfaceLine; var trafficLoad = scenario.Location.StabilityOptions.TrafficLoad; - var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityInnerSlope; + var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityOuterSlope; if (requiredSafetyFactor == null) { throw new MacroStabilityException("Required safety factor must be specified"); @@ -195,8 +196,8 @@ scenario.Location.DikeEmbankmentMaterial = "dijksmateriaal_klei"; XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, - FailureMechanismeParamatersMStab, out errorMessages); + riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, + kernelDataInput.FailureMechanismeParamatersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); return mstabXml; Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs =================================================================== diff -u -r787 -r805 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 787) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 805) @@ -34,6 +34,7 @@ using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.Data.Standard.Calculation; using Deltares.DamEngine.Data.Standard.Logging; using Deltares.DamMacroStability.Calculator; @@ -64,33 +65,43 @@ /// public PrepareResult Prepare(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) { - // ToDo zant set stiFileName -// string stabilityDirectory = GetStabilityCalculationDirectory(); -// string filenameExtension = GetFilenameExtension(); -// string fileName = calculationName + filenameExtension; -// var stabilityProjectFilename = Path.Combine(stabilityDirectory, fileName); - - const string testFolder = @"..\..\Deltares.DamEngine.Calculators.Tests\Files\MacroStability"; - // Relative paths in ini file do not work yet in DGeoStability 16.2. This is fixed in 18.1. - var absoluteFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), testFolder)); - var stiFileName = Path.Combine(absoluteFolder, "test.sti"); - - - var damPipingInput = new DamMacroStabilityInput() + var damMacroStabilityOutput = new DamMacroStabilityOutput() { - DGeoStabilityExePath = Path.Combine(DamMacroStabilityFolder, DGeoStabilityExe), - DGeoStabilityInputFileName = stiFileName + CalculationResult = CalculationResult.NoRun }; - kernelDataInput = damPipingInput; - kernelDataOutput = new DamMacroStabilityOutput(); + kernelDataOutput = damMacroStabilityOutput; + if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType == FailureMechanismSystemType.StabilityInside) + { + // ToDo zant set stiFileName + // string stabilityDirectory = GetStabilityCalculationDirectory(); + // string filenameExtension = GetFilenameExtension(); + // string fileName = calculationName + filenameExtension; + // var stabilityProjectFilename = Path.Combine(stabilityDirectory, fileName); - // Write xml file - XDocument xmlDocument = CreateMstabDamXmlDocument(damKernelInput, damPipingInput); + const string testFolder = @"..\..\Deltares.DamEngine.Calculators.Tests\Files\MacroStability"; + // Relative paths in ini file do not work yet in DGeoStability 16.2. This is fixed in 18.1. + var absoluteFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), testFolder)); + var stiFileName = Path.Combine(absoluteFolder, "test.sti"); - // Use xml file to create sti file - CreateStiFile(xmlDocument); - return PrepareResult.Successful; + var damPipingInput = new DamMacroStabilityInput() + { + DGeoStabilityExePath = Path.Combine(DamMacroStabilityFolder, DGeoStabilityExe), + DGeoStabilityInputFileName = stiFileName, + FailureMechanismeParamatersMStab = FailureMechanismeParamatersMStab + }; + kernelDataInput = damPipingInput; + + // Write xml file + XDocument xmlDocument = CreateMstabDamXmlDocument(damKernelInput, damPipingInput); + + // Use xml file to create sti file + CreateStiFile(xmlDocument); + + return PrepareResult.Successful; + } + kernelDataInput = null; + return PrepareResult.NotRelevant; } /// @@ -180,8 +191,8 @@ scenario.Location.DikeEmbankmentMaterial = "dijksmateriaal_klei"; XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, - FailureMechanismeParamatersMStab, out errorMessages); + riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, + kernelDataInput.FailureMechanismeParamatersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); return mstabXml; Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityInput.cs =================================================================== diff -u -r583 -r805 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityInput.cs (.../DamMacroStabilityInput.cs) (revision 583) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityInput.cs (.../DamMacroStabilityInput.cs) (revision 805) @@ -1,10 +1,57 @@ -using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +// Copyright (C) Stichting Deltares 2017. 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. +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.General; + namespace Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStability { + /// + /// Class implementing the kernel input data interface for Macrostabilty. + /// + /// public class DamMacroStabilityInput : IKernelDataInput { + /// + /// Gets or sets the name of the d geo stability input file. + /// + /// + /// The name of the d geo stability input file. + /// public string DGeoStabilityInputFileName { get; set; } + + /// + /// Gets or sets the d geo stability executable path. + /// + /// + /// The d geo stability executable path. + /// public string DGeoStabilityExePath { get; set; } + + /// + /// Gets or sets the failure mechanisme paramaters m stab. + /// + /// + /// The failure mechanisme paramaters m stab. + /// + public FailureMechanismeParamatersMStab FailureMechanismeParamatersMStab { get; set; } } }