Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -r267be1d4fd22c83ba0ed078df17922adab0658ac -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 267be1d4fd22c83ba0ed078df17922adab0658ac) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -129,10 +129,10 @@ StandardDeviation = originalPhreaticLevelExit.StandardDeviation }; calculation.InputParameters.SurfaceLine = pipingFailureMechanism.SurfaceLines.First(sl => sl.Name == "PK001_0001"); - calculation.InputParameters.SoilProfile = pipingFailureMechanism + calculation.InputParameters.StochasticSoilProfile = pipingFailureMechanism .StochasticSoilModels - .SelectMany(sm => sm.StochasticSoilProfiles.Select(ssp => ssp.SoilProfile)) - .First(sp => sp.Name == "W1-6_0_1D1"); + .SelectMany(sm => sm.StochasticSoilProfiles) + .First(sp => sp.SoilProfile.Name == "W1-6_0_1D1"); calculation.InputParameters.HydraulicBoundaryLocation = demoAssessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001); calculation.InputParameters.NotifyObservers(); Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs =================================================================== diff -u -r8b5a6f938fe2b04cd78623649df37580e145055f -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 8b5a6f938fe2b04cd78623649df37580e145055f) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -120,39 +120,39 @@ var surfaceLine2 = surfaceLines.FirstOrDefault(s => s.Name == "PK001_0002"); var surfaceLine3 = surfaceLines.FirstOrDefault(s => s.Name == "PK001_0003"); var surfaceLine4 = surfaceLines.FirstOrDefault(s => s.Name == "PK001_0004"); - + Assert.IsNotNull(surfaceLine1); Assert.IsNotNull(surfaceLine2); Assert.IsNotNull(surfaceLine3); Assert.IsNotNull(surfaceLine4); - Assert.AreEqual(new Point3D (155883.762, 569864.416, 0.53), surfaceLine1.DitchPolderSide); - Assert.AreEqual(new Point3D (155882.067, 569866.157, -1.9), surfaceLine1.BottomDitchPolderSide); - Assert.AreEqual(new Point3D (155874.184, 569874.252, -1.9), surfaceLine1.BottomDitchDikeSide); - Assert.AreEqual(new Point3D (155872.224, 569876.265, 0.91), surfaceLine1.DitchDikeSide); - Assert.AreEqual(new Point3D (155864.173, 569884.532, 0.95), surfaceLine1.DikeToeAtPolder); - Assert.AreEqual(new Point3D (155797.109, 569953.4, -4), surfaceLine1.DikeToeAtRiver); - + Assert.AreEqual(new Point3D(155883.762, 569864.416, 0.53), surfaceLine1.DitchPolderSide); + Assert.AreEqual(new Point3D(155882.067, 569866.157, -1.9), surfaceLine1.BottomDitchPolderSide); + Assert.AreEqual(new Point3D(155874.184, 569874.252, -1.9), surfaceLine1.BottomDitchDikeSide); + Assert.AreEqual(new Point3D(155872.224, 569876.265, 0.91), surfaceLine1.DitchDikeSide); + Assert.AreEqual(new Point3D(155864.173, 569884.532, 0.95), surfaceLine1.DikeToeAtPolder); + Assert.AreEqual(new Point3D(155797.109, 569953.4, -4), surfaceLine1.DikeToeAtRiver); + Assert.IsNull(surfaceLine2.DitchPolderSide); Assert.IsNull(surfaceLine2.BottomDitchPolderSide); Assert.IsNull(surfaceLine2.BottomDitchDikeSide); Assert.IsNull(surfaceLine2.DitchDikeSide); - Assert.AreEqual(new Point3D (155558.754, 569618.729, 1.45), surfaceLine2.DikeToeAtPolder); - Assert.AreEqual(new Point3D (155505.259, 569701.229, -4), surfaceLine2.DikeToeAtRiver); - - Assert.AreEqual(new Point3D (155063.763, 569276.113, -0.5), surfaceLine3.DitchPolderSide); - Assert.AreEqual(new Point3D (155063.272, 569276.926, -1.45), surfaceLine3.BottomDitchPolderSide); - Assert.AreEqual(new Point3D (155056.855, 569287.56, -1.45), surfaceLine3.BottomDitchDikeSide); - Assert.AreEqual(new Point3D (155056.297, 569288.485, -0.37), surfaceLine3.DitchDikeSide); - Assert.AreEqual(new Point3D (155047.587, 569302.917, 1.42), surfaceLine3.DikeToeAtPolder); - Assert.AreEqual(new Point3D (154999.006, 569383.419, -4), surfaceLine3.DikeToeAtRiver); + Assert.AreEqual(new Point3D(155558.754, 569618.729, 1.45), surfaceLine2.DikeToeAtPolder); + Assert.AreEqual(new Point3D(155505.259, 569701.229, -4), surfaceLine2.DikeToeAtRiver); + Assert.AreEqual(new Point3D(155063.763, 569276.113, -0.5), surfaceLine3.DitchPolderSide); + Assert.AreEqual(new Point3D(155063.272, 569276.926, -1.45), surfaceLine3.BottomDitchPolderSide); + Assert.AreEqual(new Point3D(155056.855, 569287.56, -1.45), surfaceLine3.BottomDitchDikeSide); + Assert.AreEqual(new Point3D(155056.297, 569288.485, -0.37), surfaceLine3.DitchDikeSide); + Assert.AreEqual(new Point3D(155047.587, 569302.917, 1.42), surfaceLine3.DikeToeAtPolder); + Assert.AreEqual(new Point3D(154999.006, 569383.419, -4), surfaceLine3.DikeToeAtRiver); + Assert.IsNull(surfaceLine4.DitchPolderSide); Assert.IsNull(surfaceLine4.BottomDitchPolderSide); Assert.IsNull(surfaceLine4.BottomDitchDikeSide); Assert.IsNull(surfaceLine4.DitchDikeSide); - Assert.AreEqual(new Point3D (154682.383, 568112.623, 1.55), surfaceLine4.DikeToeAtPolder); - Assert.AreEqual(new Point3D (154586.088, 568119.17, -4), surfaceLine4.DikeToeAtRiver); + Assert.AreEqual(new Point3D(154682.383, 568112.623, 1.55), surfaceLine4.DikeToeAtPolder); + Assert.AreEqual(new Point3D(154586.088, 568119.17, -4), surfaceLine4.DikeToeAtRiver); } private void AssertCalculationAbleToCalculate(PipingCalculation calculation) @@ -187,7 +187,7 @@ Assert.AreEqual(37, inputParameters.BeddingAngle, 1e-3); Assert.AreEqual("PK001_0001", inputParameters.SurfaceLine.Name); - Assert.AreEqual("W1-6_0_1D1", inputParameters.SoilProfile.Name); + Assert.AreEqual("W1-6_0_1D1", inputParameters.StochasticSoilProfile.SoilProfile.Name); Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); Assert.AreEqual(5.78, inputParameters.HydraulicBoundaryLocation.DesignWaterLevel, 1e-3); Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs =================================================================== diff -u -r16b01f208966fa77f73b7977db23da94786f08d1 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -89,8 +89,8 @@ double seepageLengthMean = input.ExitPointL - input.EntryPointL; if (seepageLengthMean > 0) { - seepageLength.Mean = (RoundedDouble)seepageLengthMean; - seepageLength.StandardDeviation = (RoundedDouble)seepageLengthMean * seepageLengthStandardDeviationFraction; + seepageLength.Mean = (RoundedDouble) seepageLengthMean; + seepageLength.StandardDeviation = (RoundedDouble) seepageLengthMean*seepageLengthStandardDeviationFraction; } else { @@ -113,7 +113,7 @@ { StandardDeviation = (RoundedDouble) 0.5 }; - if (input.SurfaceLine != null && input.SoilProfile != null & !double.IsNaN(input.ExitPointL)) + if (input.SurfaceLine != null && input.StochasticSoilProfile != null && input.StochasticSoilProfile.SoilProfile != null & !double.IsNaN(input.ExitPointL)) { TrySetThicknessCoverageLayer(thicknessCoverageLayer); } @@ -125,7 +125,7 @@ return thicknessCoverageLayer; } } - + /// /// gets the thickness aquifer layer. /// @@ -138,18 +138,19 @@ StandardDeviation = (RoundedDouble) 0.5 }; - PipingSoilProfile soilProfile = input.SoilProfile; + StochasticSoilProfile stochasticSoilProfile = input.StochasticSoilProfile; + RingtoetsPipingSurfaceLine surfaceLine = input.SurfaceLine; double exitPointL = input.ExitPointL; - if (soilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) + if (stochasticSoilProfile != null && stochasticSoilProfile.SoilProfile != null && surfaceLine != null && !double.IsNaN(exitPointL)) { - double thicknessTopAquiferLayer = GetThicknessTopAquiferLayer(soilProfile, surfaceLine, exitPointL); + double thicknessTopAquiferLayer = GetThicknessTopAquiferLayer(stochasticSoilProfile.SoilProfile, surfaceLine, exitPointL); TrySetThicknessAquiferLayerMean(thicknessAquiferLayer, thicknessTopAquiferLayer); } else { - thicknessAquiferLayer.Mean = (RoundedDouble)double.NaN; + thicknessAquiferLayer.Mean = (RoundedDouble) double.NaN; } return thicknessAquiferLayer; @@ -158,13 +159,13 @@ private static void TrySetThicknessAquiferLayerMean(LognormalDistribution thicknessAquiferLayer, double thicknessTopAquiferLayer) { - if(thicknessTopAquiferLayer > 0) + if (thicknessTopAquiferLayer > 0) { - thicknessAquiferLayer.Mean = (RoundedDouble)thicknessTopAquiferLayer; + thicknessAquiferLayer.Mean = (RoundedDouble) thicknessTopAquiferLayer; } else { - thicknessAquiferLayer.Mean = (RoundedDouble)double.NaN; + thicknessAquiferLayer.Mean = (RoundedDouble) double.NaN; } } @@ -185,16 +186,15 @@ } } - private void TrySetThicknessCoverageLayer(LognormalDistribution thicknessCoverageLayer) { try { - thicknessCoverageLayer.Mean = (RoundedDouble)InputParameterCalculationService.CalculateThicknessCoverageLayer(input.WaterVolumetricWeight, PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(input).GetDesignValue(), input.ExitPointL, input.SurfaceLine, input.SoilProfile); + thicknessCoverageLayer.Mean = (RoundedDouble) InputParameterCalculationService.CalculateThicknessCoverageLayer(input.WaterVolumetricWeight, PipingSemiProbabilisticDesignValueFactory.GetPhreaticLevelExit(input).GetDesignValue(), input.ExitPointL, input.SurfaceLine, input.StochasticSoilProfile.SoilProfile); } catch (ArgumentOutOfRangeException) { - thicknessCoverageLayer.Mean = (RoundedDouble)double.NaN; + thicknessCoverageLayer.Mean = (RoundedDouble) double.NaN; } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r16b01f208966fa77f73b7977db23da94786f08d1 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -47,9 +47,6 @@ private RoundedDouble entryPointL; private RingtoetsPipingSurfaceLine surfaceLine; - private PipingSoilProfile soilProfile; - private HydraulicBoundaryLocation hydraulicBoundaryLocation; - /// /// Initializes a new instance of the class. /// @@ -150,30 +147,41 @@ /// /// Gets or sets the profile which contains a 1 dimensional definition of soil layers with properties. /// - public PipingSoilProfile SoilProfile - { - get - { - return soilProfile; - } - set - { - soilProfile = value; - } - } + public StochasticSoilProfile StochasticSoilProfile { get; set; } /// /// Gets or set the hydraulic boundary location from which to use the assessment level. /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation + public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + + private void UpdateEntryAndExitPoint() { - get + if (SurfaceLine == null) { - return hydraulicBoundaryLocation; + ExitPointL = (RoundedDouble) double.NaN; } - set + else { - hydraulicBoundaryLocation = value; + int entryPointIndex = Array.IndexOf(SurfaceLine.Points, SurfaceLine.DikeToeAtRiver); + int exitPointIndex = Array.IndexOf(SurfaceLine.Points, SurfaceLine.DikeToeAtPolder); + + Point2D[] localGeometry = SurfaceLine.ProjectGeometryToLZ().ToArray(); + + double tempEntryPointL = localGeometry[0].X; + double tempExitPointL = localGeometry[localGeometry.Length - 1].X; + + bool isDifferentPoints = entryPointIndex < 0 || exitPointIndex < 0 || entryPointIndex < exitPointIndex; + if (isDifferentPoints && exitPointIndex > 0) + { + tempExitPointL = localGeometry.ElementAt(exitPointIndex).X; + } + if (isDifferentPoints && entryPointIndex > -1) + { + tempEntryPointL = localGeometry.ElementAt(entryPointIndex).X; + } + + ExitPointL = (RoundedDouble) tempExitPointL; + EntryPointL = (RoundedDouble) tempEntryPointL; } } @@ -459,36 +467,5 @@ } #endregion - - private void UpdateEntryAndExitPoint() - { - if (SurfaceLine == null) - { - ExitPointL = (RoundedDouble)double.NaN; - } - else - { - int entryPointIndex = Array.IndexOf(SurfaceLine.Points, SurfaceLine.DikeToeAtRiver); - int exitPointIndex = Array.IndexOf(SurfaceLine.Points, SurfaceLine.DikeToeAtPolder); - - Point2D[] localGeometry = SurfaceLine.ProjectGeometryToLZ().ToArray(); - - double tempEntryPointL = localGeometry[0].X; - double tempExitPointL = localGeometry[localGeometry.Length - 1].X; - - bool isDifferentPoints = entryPointIndex < 0 || exitPointIndex < 0 || entryPointIndex < exitPointIndex; - if (isDifferentPoints && exitPointIndex > 0) - { - tempExitPointL = localGeometry.ElementAt(exitPointIndex).X; - } - if (isDifferentPoints && entryPointIndex > -1) - { - tempEntryPointL = localGeometry.ElementAt(entryPointIndex).X; - } - - ExitPointL = (RoundedDouble)tempExitPointL; - EntryPointL = (RoundedDouble)tempEntryPointL; - } - } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs =================================================================== diff -u -re4c1ee9fe5170ccf7794006d572461d3f88e7740 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision e4c1ee9fe5170ccf7794006d572461d3f88e7740) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -60,5 +60,10 @@ /// Gets the . /// public PipingSoilProfile SoilProfile { get; set; } + + public override string ToString() + { + return SoilProfile == null ? "" : SoilProfile.ToString(); + } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs =================================================================== diff -u -r5782c43794d78fe92cd8864cd8f8b0b53957ec06 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs (.../PipingCalculationConfigurationHelper.cs) (revision 5782c43794d78fe92cd8864cd8f8b0b53957ec06) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs (.../PipingCalculationConfigurationHelper.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -1,4 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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.Linq; using Core.Common.Base.Geometry; @@ -54,28 +75,28 @@ } /// - /// Gets the piping soil profiles matching the input of a calculation. + /// Gets the stochastic soil profiles matching the input of a calculation. /// /// The surface line used to match a . /// The available soil models. /// The (sub)set of soil profiles from /// or empty if no matching instances can be found /// or when there is not enough information to associate soil profiles to the calculation. - public static IEnumerable GetPipingSoilProfilesForSurfaceLine(RingtoetsPipingSurfaceLine surfaceLine, IEnumerable availableSoilModels) + public static IEnumerable GetStochasticSoilProfilesForSurfaceLine(RingtoetsPipingSurfaceLine surfaceLine, IEnumerable availableSoilModels) { if (surfaceLine == null) { - return Enumerable.Empty(); + return Enumerable.Empty(); } Segment2D[] surfaceLineSegments = Math2D.ConvertLinePointsToLineSegments(surfaceLine.Points.Select(p => new Point2D(p.X, p.Y))).ToArray(); - var soilProfileObjectsForCalculation = new List(); + var soilProfileObjectsForCalculation = new List(); foreach (StochasticSoilModel stochasticSoilModel in availableSoilModels.Where(sm => sm.StochasticSoilProfiles.Any())) { if (DoesSoilModelGeometryIntersectWithSurfaceLineGeometry(stochasticSoilModel, surfaceLineSegments)) { - soilProfileObjectsForCalculation.AddRange(stochasticSoilModel.StochasticSoilProfiles.Select(ssp => ssp.SoilProfile)); + soilProfileObjectsForCalculation.AddRange(stochasticSoilModel.StochasticSoilProfiles); } } return soilProfileObjectsForCalculation; @@ -85,17 +106,17 @@ { var pipingCalculationGroup = new PipingCalculationGroup(surfaceLine.Name, true); - foreach (var profile in GetPipingSoilProfilesForSurfaceLine(surfaceLine, soilModels)) + foreach (var profile in GetStochasticSoilProfilesForSurfaceLine(surfaceLine, soilModels)) { pipingCalculationGroup.Children.Add(CreatePipingCalculation(surfaceLine, profile, pipingCalculationGroup.Children, generalInput, semiProbabilisticInput)); } return pipingCalculationGroup; } - private static IPipingCalculationItem CreatePipingCalculation(RingtoetsPipingSurfaceLine surfaceLine, PipingSoilProfile profile, IEnumerable calculations, GeneralPipingInput generalInput, SemiProbabilisticPipingInput semiProbabilisticInput) + private static IPipingCalculationItem CreatePipingCalculation(RingtoetsPipingSurfaceLine surfaceLine, StochasticSoilProfile stochasticSoilProfile, IEnumerable calculations, GeneralPipingInput generalInput, SemiProbabilisticPipingInput semiProbabilisticInput) { - var nameBase = string.Format("{0} {1}", surfaceLine.Name, profile.Name); + var nameBase = string.Format("{0} {1}", surfaceLine.Name, stochasticSoilProfile); var name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name); return new PipingCalculation(generalInput, semiProbabilisticInput) @@ -104,7 +125,7 @@ InputParameters = { SurfaceLine = surfaceLine, - SoilProfile = profile + StochasticSoilProfile = stochasticSoilProfile } }; } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r6f069737c5a49402fc344e4f7e350c6d869b69f2 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6f069737c5a49402fc344e4f7e350c6d869b69f2) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1051,18 +1051,18 @@ /// /// Looks up a localized string similar to De ondergrondschematisering die voor de piping berekening gebruikt wordt.. /// - public static string PipingInput_SoilProfile_Description { + public static string PipingInput_StochasticSoilProfile_Description { get { - return ResourceManager.GetString("PipingInput_SoilProfile_Description", resourceCulture); + return ResourceManager.GetString("PipingInput_StochasticSoilProfile_Description", resourceCulture); } } /// /// Looks up a localized string similar to Ondergrondschematisering. /// - public static string PipingInput_SoilProfile_DisplayName { + public static string PipingInput_StochasticSoilProfile_DisplayName { get { - return ResourceManager.GetString("PipingInput_SoilProfile_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingInput_StochasticSoilProfile_DisplayName", resourceCulture); } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -r6f069737c5a49402fc344e4f7e350c6d869b69f2 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 6f069737c5a49402fc344e4f7e350c6d869b69f2) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -346,10 +346,10 @@ Topniveaus - + De ondergrondschematisering die voor de piping berekening gebruikt wordt. - + Ondergrondschematisering Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs =================================================================== diff -u -r16b01f208966fa77f73b7977db23da94786f08d1 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -71,11 +71,11 @@ } /// - /// Gets the available soil profiles on . + /// Gets the available stochastic soil profiles on . /// - public IEnumerable GetAvailableSoilProfiles() + public IEnumerable GetAvailableStochasticSoilProfiles() { - return PipingCalculationConfigurationHelper.GetPipingSoilProfilesForSurfaceLine(data.WrappedData.SurfaceLine, data.AvailableStochasticSoilModels); + return PipingCalculationConfigurationHelper.GetStochasticSoilProfilesForSurfaceLine(data.WrappedData.SurfaceLine, data.AvailableStochasticSoilModels); } /// @@ -163,25 +163,25 @@ if (!ReferenceEquals(value, data.WrappedData.SurfaceLine)) { data.WrappedData.SurfaceLine = value; - data.WrappedData.SoilProfile = null; + data.WrappedData.StochasticSoilProfile = null; data.WrappedData.NotifyObservers(); } } } - [Editor(typeof(PipingInputContextSoilProfileSelectionEditor), typeof(UITypeEditor))] + [Editor(typeof(PipingInputContextStochasticSoilProfileSelectionEditor), typeof(UITypeEditor))] [ResourcesCategory(typeof(Resources), "Categories_Schematization")] - [ResourcesDisplayName(typeof(Resources), "PipingInput_SoilProfile_DisplayName")] - [ResourcesDescription(typeof(Resources), "PipingInput_SoilProfile_Description")] - public PipingSoilProfile SoilProfile + [ResourcesDisplayName(typeof(Resources), "PipingInput_StochasticSoilProfile_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingInput_StochasticSoilProfile_Description")] + public StochasticSoilProfile StochasticSoilProfile { get { - return data.WrappedData.SoilProfile; + return data.WrappedData.StochasticSoilProfile; } set { - data.WrappedData.SoilProfile = value; + data.WrappedData.StochasticSoilProfile = value; data.WrappedData.NotifyObservers(); } } @@ -296,7 +296,7 @@ [ResourcesCategory(typeof(Resources), "Categories_SoilProperties")] [ResourcesDisplayName(typeof(Resources), "PipingInput_SaturatedVolumicWeightOfCoverageLayer_DisplayName")] [ResourcesDescription(typeof(Resources), "PipingInput_SaturatedVolumicWeightOfCoverageLayer_Description")] - public DesignVariable SaturatedVolumicWeightOfCoverageLayer + public DesignVariable SaturatedVolumicWeightOfCoverageLayer { get { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj =================================================================== diff -u -r6f069737c5a49402fc344e4f7e350c6d869b69f2 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 6f069737c5a49402fc344e4f7e350c6d869b69f2) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -93,7 +93,7 @@ - + UserControl Fisheye: Tag 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextSoilProfileSelectionEditor.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -0,0 +1,53 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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.Collections.Generic; +using System.ComponentModel; +using Core.Common.Utils.Reflection; +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.Forms.UITypeEditors +{ + /// + /// This class defines a drop down list edit-control from which the user can select a + /// from a collection. + /// + public class PipingInputContextStochasticSoilProfileSelectionEditor : PipingInputContextSelectionEditor + { + /// + /// Creates a new instance of . + /// + public PipingInputContextStochasticSoilProfileSelectionEditor() + { + DisplayMember = TypeUtils.GetMemberName(ssp => ssp.SoilProfile.Name); + } + + protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).GetAvailableStochasticSoilProfiles(); + } + + protected override StochasticSoilProfile GetCurrentOption(ITypeDescriptorContext context) + { + return GetPropertiesObject(context).StochasticSoilProfile; + } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs =================================================================== diff -u -rf132c3732b41ebd5837b63d44fa4c9401f6061c0 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision f132c3732b41ebd5837b63d44fa4c9401f6061c0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -48,12 +48,12 @@ private readonly RecursiveObserver pipingCalculationObserver; private readonly Observer pipingFailureMechanismObserver; private readonly RecursiveObserver pipingInputObserver; - private readonly Observer pipingSoilProfilesObserver; + private readonly Observer pipingStochasticSoilProfilesObserver; private IAssessmentSection assessmentSection; private DataGridViewComboBoxColumn hydraulicBoundaryLocationColumn; private PipingCalculationGroup pipingCalculationGroup; private PipingFailureMechanism pipingFailureMechanism; - private DataGridViewComboBoxColumn soilProfileColumn; + private DataGridViewComboBoxColumn stochasticSoilProfileColumn; private bool updatingDataSource; /// @@ -65,7 +65,7 @@ InitializeDataGridView(); InitializeListBox(); - pipingSoilProfilesObserver = new Observer(OnSoilProfilesUpdate); + pipingStochasticSoilProfilesObserver = new Observer(OnStochasticSoilProfilesUpdate); pipingFailureMechanismObserver = new Observer(OnPipingFailureMechanismUpdate); assessmentSectionObserver = new Observer(UpdateHydraulicBoundaryLocationsColumn); pipingInputObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children.Concat(pcg.Children.OfType().Select(pc => pc.InputParameters))); @@ -86,10 +86,10 @@ { pipingFailureMechanism = value; - pipingSoilProfilesObserver.Observable = pipingFailureMechanism != null ? pipingFailureMechanism.StochasticSoilModels : null; + pipingStochasticSoilProfilesObserver.Observable = pipingFailureMechanism != null ? pipingFailureMechanism.StochasticSoilModels : null; pipingFailureMechanismObserver.Observable = pipingFailureMechanism; - UpdateSoilProfileColumn(); + UpdateStochasticSoilProfileColumn(); UpdateSectionsListBox(); UpdateGenerateScenariosButtonState(); } @@ -171,10 +171,10 @@ Name = "column_Name" }; - soilProfileColumn = new DataGridViewComboBoxColumn + stochasticSoilProfileColumn = new DataGridViewComboBoxColumn { - DataPropertyName = "SoilProfile", - HeaderText = Resources.PipingInput_SoilProfile_DisplayName, + DataPropertyName = "StochasticSoilProfile", + HeaderText = Resources.PipingInput_StochasticSoilProfile_DisplayName, Name = "column_SoilProfile", ValueMember = "This", DisplayMember = "DisplayName" @@ -223,12 +223,12 @@ dataGridView.AutoGenerateColumns = false; dataGridView.Columns.AddRange( - nameColumn, - soilProfileColumn, - hydraulicBoundaryLocationColumn, - dampingFactorExitMeanColumn, - phreaticLevelExitMeanColumn, - entryPointLColumn, + nameColumn, + stochasticSoilProfileColumn, + hydraulicBoundaryLocationColumn, + dampingFactorExitMeanColumn, + phreaticLevelExitMeanColumn, + entryPointLColumn, exitPointLColumn); foreach (var column in dataGridView.Columns.OfType()) @@ -238,7 +238,7 @@ } UpdateHydraulicBoundaryLocationsColumn(); - UpdateSoilProfileColumn(); + UpdateStochasticSoilProfileColumn(); } private void InitializeListBox() @@ -259,25 +259,27 @@ } } - private void OnSoilProfilesUpdate() + private void OnStochasticSoilProfilesUpdate() { UpdateGenerateScenariosButtonState(); - UpdateSoilProfileColumn(); + UpdateStochasticSoilProfileColumn(); } - private void UpdateSoilProfileColumn() + private void UpdateStochasticSoilProfileColumn() { - using (new SuspendDataGridViewColumnResizes(soilProfileColumn)) + using (new SuspendDataGridViewColumnResizes(stochasticSoilProfileColumn)) + { foreach (DataGridViewRow dataGridViewRow in dataGridView.Rows) { FillAvailableSoilProfilesList(dataGridViewRow); } + } } private void UpdateGenerateScenariosButtonState() { - buttonGenerateScenarios.Enabled = pipingFailureMechanism != null && - pipingFailureMechanism.SurfaceLines.Any() && + buttonGenerateScenarios.Enabled = pipingFailureMechanism != null && + pipingFailureMechanism.SurfaceLines.Any() && pipingFailureMechanism.StochasticSoilModels.Any(); } @@ -317,7 +319,7 @@ .Select(pc => new PipingCalculationRow(pc)) .ToList(); - UpdateSoilProfileColumn(); + UpdateStochasticSoilProfileColumn(); updatingDataSource = false; } @@ -337,30 +339,30 @@ // Need to prefill for all possible data in order to guarantee 'combo box' columns // do not generate errors when their cell value is not present in the list of available // items. - using (new SuspendDataGridViewColumnResizes(soilProfileColumn)) + using (new SuspendDataGridViewColumnResizes(stochasticSoilProfileColumn)) { - var pipingSoilProfiles = GetPipingSoilProfilesFromStochasticSoilModels(); - SetItemsOnObjectCollection(soilProfileColumn.Items, GetSoilProfilesDataSource(pipingSoilProfiles).ToArray()); + var pipingSoilProfiles = GetPipingStochasticSoilProfilesFromStochasticSoilModels(); + SetItemsOnObjectCollection(stochasticSoilProfileColumn.Items, GetSoilProfilesDataSource(pipingSoilProfiles).ToArray()); } using (new SuspendDataGridViewColumnResizes(hydraulicBoundaryLocationColumn)) { var hydraulicBoundaryLocations = assessmentSection != null && assessmentSection.HydraulicBoundaryDatabase != null ? assessmentSection.HydraulicBoundaryDatabase.Locations : null; SetItemsOnObjectCollection( - hydraulicBoundaryLocationColumn.Items, + hydraulicBoundaryLocationColumn.Items, GetHydraulicBoundaryLocationsDataSource(hydraulicBoundaryLocations).ToArray()); } } - private PipingSoilProfile[] GetPipingSoilProfilesFromStochasticSoilModels() + private StochasticSoilProfile[] GetPipingStochasticSoilProfilesFromStochasticSoilModels() { if (pipingFailureMechanism != null) { return pipingFailureMechanism.StochasticSoilModels - .SelectMany(ssm => ssm.StochasticSoilProfiles.Select(ssp => ssp.SoilProfile)) - .Distinct() - .ToArray(); + .SelectMany(ssm => ssm.StochasticSoilProfiles) + .Distinct() + .ToArray(); } return null; } @@ -369,20 +371,20 @@ { var rowData = (PipingCalculationRow) dataGridViewRow.DataBoundItem; - IEnumerable pipingSoilProfiles = GetSoilProfilesForCalculation(rowData.PipingCalculation); + IEnumerable stochasticSoilProfiles = GetSoilProfilesForCalculation(rowData.PipingCalculation); - var cell = (DataGridViewComboBoxCell) dataGridViewRow.Cells[soilProfileColumn.Index]; - SetItemsOnObjectCollection(cell.Items, GetSoilProfilesDataSource(pipingSoilProfiles).ToArray()); + var cell = (DataGridViewComboBoxCell) dataGridViewRow.Cells[stochasticSoilProfileColumn.Index]; + SetItemsOnObjectCollection(cell.Items, GetSoilProfilesDataSource(stochasticSoilProfiles).ToArray()); } - private IEnumerable GetSoilProfilesForCalculation(PipingCalculation pipingCalculation) + private IEnumerable GetSoilProfilesForCalculation(PipingCalculation pipingCalculation) { if (pipingFailureMechanism == null) { - return Enumerable.Empty(); + return Enumerable.Empty(); } - return PipingCalculationConfigurationHelper.GetPipingSoilProfilesForSurfaceLine( - pipingCalculation.InputParameters.SurfaceLine, + return PipingCalculationConfigurationHelper.GetStochasticSoilProfilesForSurfaceLine( + pipingCalculation.InputParameters.SurfaceLine, pipingFailureMechanism.StochasticSoilModels); } @@ -409,15 +411,15 @@ } } - private static IEnumerable> GetSoilProfilesDataSource(IEnumerable soilProfiles = null) + private static IEnumerable> GetSoilProfilesDataSource(IEnumerable stochasticSoilProfile = null) { - yield return new DataGridViewComboBoxItemWrapper(null); + yield return new DataGridViewComboBoxItemWrapper(null); - if (soilProfiles != null) + if (stochasticSoilProfile != null) { - foreach (PipingSoilProfile profile in soilProfiles) + foreach (StochasticSoilProfile profile in stochasticSoilProfile) { - yield return new DataGridViewComboBoxItemWrapper(profile); + yield return new DataGridViewComboBoxItemWrapper(profile); } } } @@ -493,17 +495,17 @@ } } - public DataGridViewComboBoxItemWrapper SoilProfile + public DataGridViewComboBoxItemWrapper StochasticSoilProfile { get { - return new DataGridViewComboBoxItemWrapper(pipingCalculation.InputParameters.SoilProfile); + return new DataGridViewComboBoxItemWrapper(pipingCalculation.InputParameters.StochasticSoilProfile); } set { - pipingCalculation.InputParameters.SoilProfile = value != null - ? value.WrappedObject - : null; + pipingCalculation.InputParameters.StochasticSoilProfile = value != null + ? value.WrappedObject + : null; pipingCalculation.InputParameters.NotifyObservers(); } @@ -618,9 +620,9 @@ var dialog = new PipingSurfaceLineSelectionDialog(Parent, pipingFailureMechanism.SurfaceLines); dialog.ShowDialog(); var calculationsStructure = PipingCalculationConfigurationHelper.GenerateCalculationsStructure( - dialog.SelectedSurfaceLines, - pipingFailureMechanism.StochasticSoilModels, - pipingFailureMechanism.GeneralInput, + dialog.SelectedSurfaceLines, + pipingFailureMechanism.StochasticSoilModels, + pipingFailureMechanism.GeneralInput, pipingFailureMechanism.SemiProbabilisticInput); foreach (var item in calculationsStructure) { @@ -644,9 +646,9 @@ if (pipingCalculationRow != null) { selection = new PipingInputContext( - pipingCalculationRow.PipingCalculation.InputParameters, - pipingFailureMechanism.SurfaceLines, - pipingFailureMechanism.StochasticSoilModels, + pipingCalculationRow.PipingCalculation.InputParameters, + pipingFailureMechanism.SurfaceLines, + pipingFailureMechanism.StochasticSoilModels, assessmentSection); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs =================================================================== diff -u -r420c266df87245b9471d3794ef5043ee89cb482a -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 420c266df87245b9471d3794ef5043ee89cb482a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -157,7 +157,7 @@ inputParameters.BeddingAngle, inputParameters.ExitPointL, inputParameters.SurfaceLine, - inputParameters.SoilProfile + inputParameters.StochasticSoilProfile.SoilProfile ); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs =================================================================== diff -u -rbf334f50530164badedba45a78f3aab857ae1bf6 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -65,7 +65,7 @@ // Setup var input = new PipingInput(new GeneralPipingInput()); var derivedInput = new DerivedPipingInput(input); - + double testLevel = new Random(21).NextDouble(); input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0) @@ -118,17 +118,17 @@ // Setup var input = new PipingInput(new GeneralPipingInput()); var derivedInput = new DerivedPipingInput(input); - + using (new PipingSubCalculatorFactoryConfig()) { // Call var piezometricHead = derivedInput.PiezometricHeadExit; - + // Assert Assert.AreEqual(2, piezometricHead.NumberOfDecimalPlaces); Assert.IsFalse(double.IsNaN(piezometricHead)); - - var factory = (TestPipingSubCalculatorFactory)PipingSubCalculatorFactory.Instance; + + var factory = (TestPipingSubCalculatorFactory) PipingSubCalculatorFactory.Instance; var piezometricHeadAtExitCalculator = factory.LastCreatedPiezometricHeadAtExitCalculator; Assert.AreEqual(piezometricHeadAtExitCalculator.HRiver, derivedInput.AssessmentLevel, derivedInput.AssessmentLevel.GetAccuracy()); @@ -145,10 +145,10 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(1.0, 1.0); var derivedInput = new DerivedPipingInput(input); - + // Call var piezometricHead = derivedInput.PiezometricHeadExit; - + // Assert Assert.IsNaN(piezometricHead); } @@ -159,10 +159,10 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - + // Call var thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; - + // Assert Assert.AreEqual(1.0, thicknessAquiferLayer.Mean.Value); } @@ -186,7 +186,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = null; + input.StochasticSoilProfile = null; var derivedInput = new DerivedPipingInput(input); // Call @@ -201,12 +201,12 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = null; + input.StochasticSoilProfile = null; var derivedInput = new DerivedPipingInput(input); - + // Call var thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer; - + // Assert Assert.IsNaN(thicknessCoverageLayer.Mean); } @@ -253,10 +253,10 @@ // Setup var input = PipingCalculationFactory.CreateInputWithSingleAquiferLayerAboveSurfaceLine(deltaAboveSurfaceLine); var derivedInput = new DerivedPipingInput(input); - + // Call LognormalDistribution thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer; - + // Assert Assert.IsNaN(thicknessCoverageLayer.Mean); } @@ -299,11 +299,11 @@ var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); input.ExitPointL = (RoundedDouble) double.NaN; var derivedInput = new DerivedPipingInput(input); - + // Call LognormalDistribution thicknessAquiferLayer = null; Action call = () => thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; - + // Assert TestHelper.AssertLogMessagesCount(call, 0); Assert.IsNaN(thicknessAquiferLayer.Mean); @@ -316,10 +316,10 @@ var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); input.ExitPointL = (RoundedDouble) 3.0; var derivedInput = new DerivedPipingInput(input); - + // Call LognormalDistribution thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; - + // Assert Assert.IsNaN(thicknessAquiferLayer.Mean); } @@ -329,7 +329,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)3.0; + input.ExitPointL = (RoundedDouble) 3.0; var derivedInput = new DerivedPipingInput(input); // Call @@ -347,7 +347,7 @@ input.ThicknessCoverageLayer.Mean = new RoundedDouble(2, new Random(21).NextDouble() + 1); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call LognormalDistribution thicknessCoverageLayer = null; @@ -364,13 +364,16 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer; @@ -385,13 +388,16 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; @@ -436,7 +442,7 @@ var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call var thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; @@ -451,17 +457,20 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(0.0) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + }, + new PipingSoilLayer(0.0) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; @@ -476,17 +485,20 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(2.0) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + }, + new PipingSoilLayer(2.0) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessCoverageLayer = derivedInput.ThicknessCoverageLayer; @@ -501,17 +513,20 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); var derivedInput = new DerivedPipingInput(input); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.5) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = true - }, - new PipingSoilLayer(1.5) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.5) + { + IsAquifer = true + }, + new PipingSoilLayer(1.5) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call var thicknessAquiferLayer = derivedInput.ThicknessAquiferLayer; @@ -557,7 +572,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.EntryPointL = (RoundedDouble)double.NaN; + input.EntryPointL = (RoundedDouble) double.NaN; var derivedInput = new DerivedPipingInput(input); // Call @@ -573,7 +588,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)double.NaN; + input.ExitPointL = (RoundedDouble) double.NaN; var derivedInput = new DerivedPipingInput(input); // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs =================================================================== diff -u -rbf334f50530164badedba45a78f3aab857ae1bf6 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -1,5 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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 Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -45,7 +65,7 @@ Assert.AreEqual(3, inputParameters.DampingFactorExit.StandardDeviation.NumberOfDecimalPlaces); double defaultLogNormalMean = Math.Exp(-0.5); - double defaultLogNormalStandardDev = Math.Sqrt((Math.Exp(1) - 1) * Math.Exp(1)); + double defaultLogNormalStandardDev = Math.Sqrt((Math.Exp(1) - 1)*Math.Exp(1)); Assert.IsInstanceOf(inputParameters.Diameter70); Assert.AreEqual(defaultLogNormalMean, inputParameters.Diameter70.Mean, @@ -64,7 +84,7 @@ Assert.AreEqual(3, inputParameters.DarcyPermeability.StandardDeviation.NumberOfDecimalPlaces); Assert.IsNull(inputParameters.SurfaceLine); - Assert.IsNull(inputParameters.SoilProfile); + Assert.IsNull(inputParameters.StochasticSoilProfile); Assert.IsNull(inputParameters.HydraulicBoundaryLocation); Assert.AreEqual(generalInputParameters.UpliftModelFactor, inputParameters.UpliftModelFactor); @@ -115,11 +135,6 @@ Assert.IsNaN(inputParameters.AssessmentLevel); } - private static double GetErrorTolerance(RoundedDouble roundedDouble) - { - return Math.Pow(10.0, -roundedDouble.NumberOfDecimalPlaces); - } - [Test] public void Constructor_GeneralPipingInputIsNull_ArgumentNullException() { @@ -158,7 +173,7 @@ var pipingInput = new PipingInput(new GeneralPipingInput()); // Call - TestDelegate test = () => pipingInput.ExitPointL = (RoundedDouble)value; + TestDelegate test = () => pipingInput.ExitPointL = (RoundedDouble) value; // Assert TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Resources.PipingInput_ExitPointL_Value_must_be_greater_than_zero); @@ -173,7 +188,7 @@ var pipingInput = new PipingInput(new GeneralPipingInput()); // Call - TestDelegate test = () => pipingInput.EntryPointL = (RoundedDouble)value; + TestDelegate test = () => pipingInput.EntryPointL = (RoundedDouble) value; // Assert TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Resources.PipingInput_EntryPointL_Value_must_be_greater_than_or_equal_to_zero); @@ -204,8 +219,8 @@ var surfaceLine = new RingtoetsPipingSurfaceLine(); surfaceLine.SetGeometry(new[] { - new Point3D(0, 0, 0), - new Point3D(1, 0, 2), + new Point3D(0, 0, 0), + new Point3D(1, 0, 2), new Point3D(2, 0, 3) }); surfaceLine.SetDikeToeAtRiverAt(new Point3D(1, 0, 2)); @@ -228,16 +243,16 @@ var newValue = new NormalDistribution(5) { - Mean = (RoundedDouble)1.23456, - StandardDeviation = (RoundedDouble)7.89123 + Mean = (RoundedDouble) 1.23456, + StandardDeviation = (RoundedDouble) 7.89123 }; // Call inputs.PhreaticLevelExit = newValue; // Assert Assert.AreSame(originalPhreaticLevelExit, inputs.PhreaticLevelExit, - "Stochast instance hasn't changed to 'newValue'."); + "Stochast instance hasn't changed to 'newValue'."); Assert.AreEqual(3, originalPhreaticLevelExit.Mean.NumberOfDecimalPlaces); Assert.AreEqual(1.235, originalPhreaticLevelExit.Mean.Value); Assert.AreEqual(3, originalPhreaticLevelExit.StandardDeviation.NumberOfDecimalPlaces); @@ -253,16 +268,16 @@ var newValue = new LognormalDistribution(5) { - Mean = (RoundedDouble)4.56789, - StandardDeviation = (RoundedDouble)1.23456 + Mean = (RoundedDouble) 4.56789, + StandardDeviation = (RoundedDouble) 1.23456 }; // Call inputs.DampingFactorExit = newValue; // Assert Assert.AreSame(originalDampingFactorExit, inputs.DampingFactorExit, - "Stochast instance hasn't changed to 'newValue'."); + "Stochast instance hasn't changed to 'newValue'."); Assert.AreEqual(3, originalDampingFactorExit.Mean.NumberOfDecimalPlaces); Assert.AreEqual(4.568, originalDampingFactorExit.Mean.Value); Assert.AreEqual(3, originalDampingFactorExit.StandardDeviation.NumberOfDecimalPlaces); @@ -278,17 +293,17 @@ var newValue = new ShiftedLognormalDistribution(5) { - Mean = (RoundedDouble)1.11111, - StandardDeviation = (RoundedDouble)2.22222, - Shift = (RoundedDouble)(-3.33333) + Mean = (RoundedDouble) 1.11111, + StandardDeviation = (RoundedDouble) 2.22222, + Shift = (RoundedDouble) (-3.33333) }; // Call inputs.SaturatedVolumicWeightOfCoverageLayer = newValue; // Assert Assert.AreSame(originalSaturatedVolumicWeightOfCoverageLayer, inputs.SaturatedVolumicWeightOfCoverageLayer, - "Stochast instance hasn't changed to 'newValue'."); + "Stochast instance hasn't changed to 'newValue'."); Assert.AreEqual(2, originalSaturatedVolumicWeightOfCoverageLayer.Mean.NumberOfDecimalPlaces); Assert.AreEqual(1.11, originalSaturatedVolumicWeightOfCoverageLayer.Mean.Value); Assert.AreEqual(2, originalSaturatedVolumicWeightOfCoverageLayer.StandardDeviation.NumberOfDecimalPlaces); @@ -306,16 +321,16 @@ var newValue = new LognormalDistribution(5) { - Mean = (RoundedDouble)8.8888, - StandardDeviation = (RoundedDouble)9.14363 + Mean = (RoundedDouble) 8.8888, + StandardDeviation = (RoundedDouble) 9.14363 }; // Call inputs.Diameter70 = newValue; // Assert Assert.AreSame(originalDiameter70, inputs.Diameter70, - "Stochast instance hasn't changed to 'newValue'."); + "Stochast instance hasn't changed to 'newValue'."); Assert.AreEqual(2, originalDiameter70.Mean.NumberOfDecimalPlaces); Assert.AreEqual(8.89, originalDiameter70.Mean.Value); Assert.AreEqual(2, originalDiameter70.StandardDeviation.NumberOfDecimalPlaces); @@ -331,16 +346,16 @@ var newValue = new LognormalDistribution(5) { - Mean = (RoundedDouble)1.93753, - StandardDeviation = (RoundedDouble)859.49028 + Mean = (RoundedDouble) 1.93753, + StandardDeviation = (RoundedDouble) 859.49028 }; // Call inputs.DarcyPermeability = newValue; // Assert Assert.AreSame(originalDarcyPermeability, inputs.DarcyPermeability, - "Stochast instance hasn't changed to 'newValue'."); + "Stochast instance hasn't changed to 'newValue'."); Assert.AreEqual(3, originalDarcyPermeability.Mean.NumberOfDecimalPlaces); Assert.AreEqual(1.938, originalDarcyPermeability.Mean.Value); Assert.AreEqual(3, originalDarcyPermeability.StandardDeviation.NumberOfDecimalPlaces); @@ -382,7 +397,7 @@ Assert.AreEqual(2, piezometricHead.NumberOfDecimalPlaces); Assert.IsFalse(double.IsNaN(piezometricHead)); - var factory = (TestPipingSubCalculatorFactory)PipingSubCalculatorFactory.Instance; + var factory = (TestPipingSubCalculatorFactory) PipingSubCalculatorFactory.Instance; var piezometricHeadAtExitCalculator = factory.LastCreatedPiezometricHeadAtExitCalculator; Assert.AreEqual(piezometricHeadAtExitCalculator.HRiver, input.AssessmentLevel, input.AssessmentLevel.GetAccuracy()); @@ -424,7 +439,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call var thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -438,7 +453,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call var thicknessCoverageLayer = input.ThicknessCoverageLayer; @@ -524,7 +539,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)double.NaN; + input.ExitPointL = (RoundedDouble) double.NaN; // Call LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -538,7 +553,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)3.0; + input.ExitPointL = (RoundedDouble) 3.0; // Call LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -552,7 +567,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)3.0; + input.ExitPointL = (RoundedDouble) 3.0; // Call LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer; @@ -568,7 +583,7 @@ var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); input.ThicknessCoverageLayer.Mean = new RoundedDouble(2, new Random(21).NextDouble() + 1); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer; @@ -582,13 +597,16 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer; @@ -602,13 +620,16 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -650,7 +671,7 @@ // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = null; + input.StochasticSoilProfile = null; // Call var thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -664,17 +685,20 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(0.0) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + }, + new PipingSoilLayer(0.0) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -688,17 +712,20 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.0) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(2.0) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.0) + { + IsAquifer = false + }, + new PipingSoilLayer(2.0) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call LognormalDistribution thicknessCoverageLayer = input.ThicknessCoverageLayer; @@ -712,17 +739,20 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] + input.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(2.5) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = true - }, - new PipingSoilLayer(1.5) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(2.5) + { + IsAquifer = true + }, + new PipingSoilLayer(1.5) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; // Call var thicknessAquiferLayer = input.ThicknessAquiferLayer; @@ -750,8 +780,8 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)2; - input.EntryPointL = (RoundedDouble)3; + input.ExitPointL = (RoundedDouble) 2; + input.EntryPointL = (RoundedDouble) 3; // Call var seepageLength = input.SeepageLength; @@ -766,7 +796,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.EntryPointL = (RoundedDouble)double.NaN; + input.EntryPointL = (RoundedDouble) double.NaN; // Call var seepageLength = input.SeepageLength; @@ -781,7 +811,7 @@ { // Setup var input = PipingCalculationFactory.CreateInputWithAquiferAndCoverageLayer(); - input.ExitPointL = (RoundedDouble)double.NaN; + input.ExitPointL = (RoundedDouble) double.NaN; // Call var seepageLength = input.SeepageLength; @@ -790,5 +820,10 @@ Assert.IsNaN(seepageLength.Mean); Assert.IsNaN(seepageLength.StandardDeviation); } + + private static double GetErrorTolerance(RoundedDouble roundedDouble) + { + return Math.Pow(10.0, -roundedDouble.NumberOfDecimalPlaces); + } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs =================================================================== diff -u -rbf334f50530164badedba45a78f3aab857ae1bf6 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -20,7 +20,6 @@ // All rights reserved. using NUnit.Framework; - using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Data.Test @@ -42,5 +41,24 @@ Assert.AreEqual(soilProfileType, stochasticSoilProfileProbability.SoilProfileType); Assert.AreEqual(soilProfileId, stochasticSoilProfileProbability.SoilProfileId); } + + [Test] + [TestCase(null)] + [TestCase("")] + [TestCase("some name")] + public void ToString_WithName_ReturnsName(string name) + { + // Setup + var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) + { + SoilProfile = new PipingSoilProfile(name, 0.0, new[] + { + new PipingSoilLayer(0.0) + }, SoilProfileType.SoilProfile1D, 0) + }; + + // Call & Assert + Assert.AreEqual(name, stochasticSoilProfile.ToString()); + } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs =================================================================== diff -u -rbf334f50530164badedba45a78f3aab857ae1bf6 -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs (.../PipingCalculationFactory.cs) (revision bf334f50530164badedba45a78f3aab857ae1bf6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationFactory.cs (.../PipingCalculationFactory.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -1,4 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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 Core.Common.Base.Data; using Core.Common.Base.Geometry; using Ringtoets.HydraRing.Data; @@ -17,23 +38,26 @@ { var bottom = 1.12; var top = 10.56; - var soilProfile = new PipingSoilProfile(String.Empty, 0.0, new[] + var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(top) + SoilProfile = new PipingSoilProfile(String.Empty, 0.0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(top / 2) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(top) + { + IsAquifer = false + }, + new PipingSoilLayer(top/2) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; var surfaceLine = new RingtoetsPipingSurfaceLine(); - var firstCharacteristicPointLocation = new Point3D(0.2, 0.0, bottom + 3 * top/ 4); - var secondCharacteristicPointLocation = new Point3D(0.3, 0.0, bottom + 2 * top / 4); - var thirdCharacteristicPointLocation = new Point3D(0.4, 0.0, bottom + top / 4); - var fourthCharacteristicPointLocation = new Point3D(0.5, 0.0, bottom + 2 * top / 4); - var fifthCharacteristicPointLocation = new Point3D(0.6, 0.0, bottom + 3 * top / 4); + var firstCharacteristicPointLocation = new Point3D(0.2, 0.0, bottom + 3*top/4); + var secondCharacteristicPointLocation = new Point3D(0.3, 0.0, bottom + 2*top/4); + var thirdCharacteristicPointLocation = new Point3D(0.4, 0.0, bottom + top/4); + var fourthCharacteristicPointLocation = new Point3D(0.5, 0.0, bottom + 2*top/4); + var fifthCharacteristicPointLocation = new Point3D(0.6, 0.0, bottom + 3*top/4); surfaceLine.SetGeometry(new[] { new Point3D(0.0, 0.0, 0.0), @@ -87,7 +111,7 @@ Mean = (RoundedDouble) 1.0 }, SurfaceLine = surfaceLine, - SoilProfile = soilProfile, + StochasticSoilProfile = stochasticSoilProfile, HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; @@ -101,23 +125,26 @@ new Point3D(0, 0, thicknessCoverageLayer), new Point3D(1.0, 0, thicknessCoverageLayer) }); - var soilProfile = new PipingSoilProfile(String.Empty, -thicknessAquiferLayer, new[] + var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(thicknessCoverageLayer) + SoilProfile = new PipingSoilProfile(String.Empty, -thicknessAquiferLayer, new[] { - IsAquifer = false - }, - new PipingSoilLayer(0.0) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(thicknessCoverageLayer) + { + IsAquifer = false + }, + new PipingSoilLayer(0.0) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; return new PipingInput(new GeneralPipingInput()) { SurfaceLine = surfaceLine, - SoilProfile = soilProfile, - ExitPointL = (RoundedDouble)0.5 + StochasticSoilProfile = stochasticSoilProfile, + ExitPointL = (RoundedDouble) 0.5 }; } @@ -130,26 +157,29 @@ new Point3D(0, 0, surfaceLineTopLevel), new Point3D(1.0, 0, surfaceLineTopLevel), }); - var soilProfile = new PipingSoilProfile(String.Empty, 0, new[] + var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine + 2) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine + 1) - { - IsAquifer = true - }, - new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine) - { - IsAquifer = false - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine + 2) + { + IsAquifer = false + }, + new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine + 1) + { + IsAquifer = true + }, + new PipingSoilLayer(surfaceLineTopLevel + deltaAboveSurfaceLine) + { + IsAquifer = false + } + }, SoilProfileType.SoilProfile1D, 0) + }; var input = new PipingInput(new GeneralPipingInput()) { SurfaceLine = surfaceLine, - SoilProfile = soilProfile, - ExitPointL = (RoundedDouble)0.5 + StochasticSoilProfile = stochasticSoilProfile, + ExitPointL = (RoundedDouble) 0.5 }; return input; } @@ -162,26 +192,29 @@ new Point3D(0, 0, 3.3), new Point3D(1.0, 0, 3.3), }); - var soilProfile = new PipingSoilProfile(String.Empty, 0, new[] + var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - new PipingSoilLayer(4.3) + SoilProfile = new PipingSoilProfile(String.Empty, 0, new[] { - IsAquifer = false - }, - new PipingSoilLayer(3.3) - { - IsAquifer = true - }, - new PipingSoilLayer(1.1) - { - IsAquifer = true - } - }, SoilProfileType.SoilProfile1D, 0); + new PipingSoilLayer(4.3) + { + IsAquifer = false + }, + new PipingSoilLayer(3.3) + { + IsAquifer = true + }, + new PipingSoilLayer(1.1) + { + IsAquifer = true + } + }, SoilProfileType.SoilProfile1D, 0) + }; var input = new PipingInput(new GeneralPipingInput()) { SurfaceLine = surfaceLine, - SoilProfile = soilProfile, - ExitPointL = (RoundedDouble)0.5 + StochasticSoilProfile = stochasticSoilProfile, + ExitPointL = (RoundedDouble) 0.5 }; expectedThickness = 2.2; return input; Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj =================================================================== diff -u -r43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj (.../Ringtoets.Piping.Data.TestUtil.csproj) (revision 43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj (.../Ringtoets.Piping.Data.TestUtil.csproj) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) @@ -77,6 +77,11 @@ Ringtoets.Piping.KernelWrapper.TestUtil + + + Copying.licenseheader + +