Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilLayer2D.cs =================================================================== diff -u -r751aaf9b7623bac357cbacf4e6ddae87b2b69f1f -rcb6877f670bacc7a6a896ab132d592eeef1107b5 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilLayer2D.cs (.../SoilLayer2D.cs) (revision 751aaf9b7623bac357cbacf4e6ddae87b2b69f1f) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Builders/SoilLayer2D.cs (.../SoilLayer2D.cs) (revision cb6877f670bacc7a6a896ab132d592eeef1107b5) @@ -35,7 +35,7 @@ /// Instances of this class are transient and are not to be used once the DSoilModel /// database has been imported. /// - internal class SoilLayer2D + internal class SoilLayer2D : GenericSoilLayerParameters { private readonly Collection innerLoops; private Segment2D[] outerLoop; @@ -55,105 +55,6 @@ public double? IsAquifer { get; set; } /// - /// Gets or sets the above phreatic level for the . - /// - public double? AbovePhreaticLevel { get; set; } - - /// - /// Gets or sets the distribution for the volumic weight of the below the - /// phreatic level. - /// [kN/m³] - /// - public double? BelowPhreaticLevelDistribution { get; set; } - - /// - /// Gets or sets the shift of the distribution for the volumic weight of the - /// below the phreatic level. - /// [kN/m³] - /// - public double? BelowPhreaticLevelShift { get; set; } - - /// - /// Gets or sets the mean of the distribution for the volumic weight of the - /// below the phreatic level. - /// [kN/m³] - /// - public double? BelowPhreaticLevelMean { get; set; } - - /// - /// Gets or sets the deviation of the distribution for the volumic weight of the below the phreatic level. - /// [kN/m³] - /// - public double? BelowPhreaticLevelDeviation { get; set; } - - /// - /// Gets or sets the distribution for the mean diameter of small scale tests applied to different kinds of sand, on which the - /// formula of Sellmeijer has been fit. - /// [m] - /// - public double? DiameterD70Distribution { get; set; } - - /// - /// Gets or sets the shift of the distribution for the mean diameter of small scale tests applied to different kinds of sand, - /// on which the formula of Sellmeijer has been fit. - /// [m] - /// - public double? DiameterD70Shift { get; set; } - - /// - /// Gets or sets the mean of the distribution for the mean diameter of small scale tests applied to different kinds of sand, - /// on which the formula of Sellmeijer has been fit. - /// [m] - /// - public double? DiameterD70Mean { get; set; } - - /// - /// Gets or sets the deviation of the distribution for the mean diameter of small scale tests applied to different kinds of sand, - /// on which the formula of Sellmeijer has been fit. - /// [m] - /// - public double? DiameterD70Deviation { get; set; } - - /// - /// Gets or sets the distribution for the Darcy-speed with which water flows through the aquifer layer. - /// [m/s] - /// - public double? PermeabilityDistribution { get; set; } - - /// - /// Gets or sets the shift of the distribution for the Darcy-speed with which water flows through the aquifer layer. - /// [m/s] - /// - public double? PermeabilityShift { get; set; } - - /// - /// Gets or sets the mean of the distribution for the the Darcy-speed with which water flows through the aquifer layer. - /// [m/s] - /// - public double? PermeabilityMean { get; set; } - - /// - /// Gets or sets the deviation of the distribution for the Darcy-speed with which water flows through the aquifer layer. - /// [m/s] - /// - public double? PermeabilityDeviation { get; set; } - - /// - /// Gets or sets the dry unit weight for the . - /// - public double? DryUnitWeight { get; set; } - - /// - /// Gets or sets the name of the material that was assigned to the . - /// - public string MaterialName { get; set; } - - /// - /// Gets or sets the value representing a color that was used to represent the . - /// - public double? Color { get; set; } - - /// /// Gets the outer loop of the as a of , /// for which each of the segments are connected to the next. /// @@ -204,10 +105,12 @@ /// The point from which to take a 1D profile. /// The bottom level of the . /// A of . - /// Thrown when any of the or + /// Thrown when any of the or /// contain a vertical line at . internal IEnumerable AsPipingSoilLayers(double atX, out double bottom) { + ValidateFieldsForPiping(); + bottom = Double.MaxValue; var result = new Collection(); if (OuterLoop != null) @@ -227,15 +130,16 @@ foreach (var height in heights.Where(height => !innerLoopIntersectionHeightPairs.Any(tuple => HeightInInnerLoop(tuple, height)))) { - result.Add(new PipingSoilLayer(height) + var pipingSoilLayer = new PipingSoilLayer(height) { IsAquifer = IsAquifer.HasValue && IsAquifer.Value.Equals(1.0), - BelowPhreaticLevel = BelowPhreaticLevelMean, - AbovePhreaticLevel = AbovePhreaticLevel, - DryUnitWeight = DryUnitWeight, MaterialName = MaterialName ?? string.Empty, Color = SoilLayerColorConversionHelper.ColorFromNullableDouble(Color) - }); + }; + + SetOptionalFields(pipingSoilLayer); + + result.Add(pipingSoilLayer); } bottom = EnsureBottomOutsideInnerLoop(innerLoopIntersectionHeightPairs, currentBottom); } @@ -328,15 +232,15 @@ /// The point on the x-axis where the vertical line is constructed do determine intersections with. /// A of , representing the height at which the /// intersects the vertical line at . - /// Thrown when a segment is vertical at and thus + /// Thrown when a segment is vertical at and thus /// no deterministic intersection points can be determined. private IEnumerable GetLoopIntersectionHeights(IEnumerable loop, double atX) { var segment2Ds = loop.ToArray(); if (segment2Ds.Any(segment => IsVerticalAtX(segment, atX))) { var message = string.Format(Resources.Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_, atX); - throw new SoilLayer2DConversionException(message); + throw new SoilLayerConversionException(message); } return Math2D.SegmentsIntersectionWithVerticalLine(segment2Ds, atX).Select(p => p.Y); }