Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r781 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 781) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 787) @@ -38,12 +38,24 @@ namespace Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityOutwards { + /// + /// Class for the wrapper around the Stability Outwards calculator + /// + /// public class DamMacroStabilityOutwardsKernelWrapper : IKernelWrapper { private const string DamMacroStabilityFolder = @".\KernelWrappers\DamMacroStability"; private const string DGeoStabilityExe = "DGeoStability.exe"; /// + /// Gets or sets the failure mechanisme paramaters for mstab. + /// + /// + /// The failure mechanisme paramaters mstab. + /// + public FailureMechanismeParamatersMStab FailureMechanismeParamatersMStab { get; set; } + + /// /// Prepares the specified dam kernel input. /// /// The dam kernel input. @@ -61,6 +73,9 @@ kernelDataOutput = damMacroStabilityOutput; if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType == FailureMechanismSystemType.StabilityOutside) { + // Make sure the gridposition is Left. + FailureMechanismeParamatersMStab.MStabParameters.GridPosition = MStabGridPosition.Left; + //damKernelInput.Location.StabilityOptions. // ToDo zant set stiFileName // string stabilityDirectory = GetStabilityCalculationDirectory(); @@ -180,7 +195,8 @@ scenario.Location.DikeEmbankmentMaterial = "dijksmateriaal_klei"; XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, out errorMessages); + riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, + FailureMechanismeParamatersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); return mstabXml; Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs =================================================================== diff -u -r785 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 785) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/MStabXmlDoc.cs (.../MStabXmlDoc.cs) (revision 787) @@ -1,4 +1,25 @@ -using System; +// 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 System; using System.Collections.Generic; using System.IO; using System.Xml.Linq; @@ -26,12 +47,14 @@ /// /// /// + /// /// /// public static XDocument CreateMStabXmlDoc(string mstabProjectFilename, DesignScenario scenario, SoilGeometryProbability subSoilScenario, double riverLevel, MStabDesignEmbankment mstabDesignEmbankment, SurfaceLine2 surfaceLine, - double? trafficLoad, double requiredSafetyFactor, out List errorMessages) + double? trafficLoad, double requiredSafetyFactor, FailureMechanismeParamatersMStab failureMechanismeParamatersMStab, + out List errorMessages) { errorMessages = new List(); @@ -40,8 +63,6 @@ ConsistencyCheck(scenario, profile1D, soilGeometry2DName); - FailureMechanismeParamatersMStab failureMechanismeParamatersMStab = new FailureMechanismeParamatersMStab(); - failureMechanismeParamatersMStab.Location = scenario.Location; if (profile1D != null) { Index: dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStability/MStabXmlDocTests.cs =================================================================== diff -u -r786 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStability/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 786) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStability/MStabXmlDocTests.cs (.../MStabXmlDocTests.cs) (revision 787) @@ -1,4 +1,25 @@ -using System; +// 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 System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -41,9 +62,17 @@ subSoilScenario.SoilProfileType = SoilProfileType.ProfileTypeStiFile; subSoilScenario.SegmentFailureMechanismType = FailureMechanismSystemType.StabilityInside; + var failureMechanismeParamatersMStab = new FailureMechanismeParamatersMStab + { + MStabParameters = + { + GridPosition = MStabGridPosition.Right + } + }; // ToDo mStabDesignEmbankment for now set to null XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - scenario.RiverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor, out errorMessages); + scenario.RiverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor, failureMechanismeParamatersMStab, + out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); XElement inputElement = (from element in mstabXml.Root.Descendants() Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs =================================================================== diff -u -r587 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 587) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamKernelInput.cs (.../DamKernelInput.cs) (revision 787) @@ -1,4 +1,25 @@ -using Deltares.DamEngine.Data.Design; +// 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.Data.Design; using Deltares.DamEngine.Data.General; namespace Deltares.DamEngine.Calculators.KernelWrappers.Common @@ -15,20 +36,21 @@ /// The location. /// public Location Location { get; set; } + /// /// Gets or sets the design scenario. /// /// /// The design scenario. /// public DesignScenario DesignScenario { get; set; } + /// /// Gets or sets the sub soil scenario. /// /// /// The sub soil scenario. /// public SoilGeometryProbability SubSoilScenario { get; set; } - } } Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs =================================================================== diff -u -r781 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 781) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStability/DamMacroStabilityKernelWrapper.cs (.../DamMacroStabilityKernelWrapper.cs) (revision 787) @@ -1,4 +1,25 @@ -using System; +// 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 System; using System.Collections.Generic; using System.Data; using System.Diagnostics; @@ -23,7 +44,16 @@ private const string DamMacroStabilityFolder = @".\KernelWrappers\DamMacroStability"; private const string DGeoStabilityExe = "DGeoStability.exe"; + /// + /// Gets or sets the failure mechanisme paramaters for mstab. + /// + /// + /// The failure mechanisme paramaters mstab. + /// + public FailureMechanismeParamatersMStab FailureMechanismeParamatersMStab { get; set; } + + /// /// Prepares the specified dam kernel input. /// /// The dam kernel input. @@ -150,7 +180,8 @@ scenario.Location.DikeEmbankmentMaterial = "dijksmateriaal_klei"; XDocument mstabXml = MStabXmlDoc.CreateMStabXmlDoc(stabilityProjectFilename, scenario, subSoilScenario, - riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, out errorMessages); + riverLevel, null, surfaceLine, trafficLoad, requiredSafetyFactor.Value, + FailureMechanismeParamatersMStab, out errorMessages); mstabXml.Save(stabilityProjectFilename + ".xml"); return mstabXml; Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs =================================================================== diff -u -r781 -r787 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (.../DesignCalculator.cs) (revision 781) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Dikes Design/DesignCalculator.cs (.../DesignCalculator.cs) (revision 787) @@ -1,4 +1,25 @@ -using System; +// 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 System; using System.Collections.Generic; using System.Text; using Deltares.DamEngine.Calculators.KernelWrappers.Common; @@ -26,7 +47,7 @@ /// public List Execute(DamProjectData damProjectData) { - IKernelWrapper kernelWrapper = CreateKernelWrapper(damProjectData.DamProjectCalculationSpecification.CurrentSpecification.FailureMechanismSystemType, damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType); + IKernelWrapper kernelWrapper = CreateKernelWrapper(damProjectData.DamProjectCalculationSpecification.CurrentSpecification); if (kernelWrapper == null) { throw new NotImplementedException(Resources.DesignCalculatorKernelNotImplemented); @@ -48,6 +69,7 @@ damKernelInput.Location = location; damKernelInput.SubSoilScenario = soiProfileProbability; damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; + IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; PrepareResult prepareResult = kernelWrapper.Prepare(damKernelInput, out kernelDataInput, out kernelDataOutput); @@ -93,21 +115,25 @@ return calculationMessages; } - private IKernelWrapper CreateKernelWrapper(FailureMechanismSystemType failureMechanismSystemType, PipingModelType pipingModelType) + private IKernelWrapper CreateKernelWrapper(DamFailureMechanismeCalculationSpecification currentSpecification) { IKernelWrapper kernelWrapper = null; - switch (failureMechanismSystemType) + switch (currentSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.HorizontalBalance: throw new NotImplementedException(Resources.DesignCalculatorKernelNotImplemented); case FailureMechanismSystemType.StabilityOutside: kernelWrapper = new DamMacroStabilityOutwardsKernelWrapper(); + var damMacroStabilityOutwardsKernelWrapper = (DamMacroStabilityOutwardsKernelWrapper) kernelWrapper; + damMacroStabilityOutwardsKernelWrapper.FailureMechanismeParamatersMStab = currentSpecification.FailureMechanismeParamatersMStab; break; case FailureMechanismSystemType.StabilityInside: kernelWrapper = new DamMacroStabilityKernelWrapper(); + var damMacroStabilityKernelWrapper = (DamMacroStabilityKernelWrapper) kernelWrapper; + damMacroStabilityKernelWrapper.FailureMechanismeParamatersMStab = currentSpecification.FailureMechanismeParamatersMStab; break; case FailureMechanismSystemType.Piping: - switch (pipingModelType) + switch (currentSpecification.PipingModelType) { case PipingModelType.SellmeijerVnk: case PipingModelType.Wti2017: