/// <summary> /// Creates a new instance of <see cref="PipingSoilProfile"/>, with the given <paramref name="name"/>, /// <paramref name="bottom"/> and <paramref name="layers"/>. /// A new collection is created for <paramref name="layers"/> and used in the <see cref="PipingSoilProfile"/>. /// </summary> /// <param name="name">The name of the profile.</param> /// <param name="bottom">The bottom level of the profile.</param> /// <param name="layers">The collection of layers that should be part of the profile.</param> /// <param name="soilProfileSourceType">The type of soil profile used as data source /// to build this instance.</param> /// <exception cref="ArgumentException">Thrown when <paramref name="layers"/> contains no layers.</exception> /// <exception cref="ArgumentNullException">Thrown when <paramref name="name"/> or <paramref name="layers"/> /// is <c>null</c>.</exception> public PipingSoilProfile(string name, double bottom, IEnumerable <PipingSoilLayer> layers, SoilProfileType soilProfileSourceType) { if (name == null) { throw new ArgumentNullException(nameof(name)); } Name = name; Bottom = bottom; Layers = layers; SoilProfileSourceType = soilProfileSourceType; }
private static PipingSoilProfile CreateSingleLayerProfile(string name, double bottom, SoilProfileType type) { return(new PipingSoilProfile(name, bottom, new[] { new PipingSoilLayer(bottom + 1.0) }, type)); }
/// <summary> /// Creates a new instance of <see cref="PipingSoilProfile"/> that has: /// <list type="bullet"> /// <item><see cref="PipingSoilProfile.Name"/> set to <paramref name="name"/>;</item> /// <item><see cref="PipingSoilProfile.Bottom"/> set to <c>0.0</c>;</item> /// <item><see cref="PipingSoilProfile.Layers"/> set to a collection with a single <see cref="PipingSoilLayer"/> /// with <see cref="PipingSoilLayer.Top"/> set to <c>0.0</c>;</item> /// <item><see cref="PipingSoilProfile.SoilProfileSourceType"/> set to <paramref name="soilProfileType"/>.</item> /// </list> /// </summary> /// <param name="name">The name for the profile.</param> /// <param name="soilProfileType">The type of the profile.</param> /// <returns>The created <see cref="PipingSoilProfile"/>.</returns> public static PipingSoilProfile CreatePipingSoilProfile(string name = "name", SoilProfileType soilProfileType = SoilProfileType.SoilProfile1D) { return(new PipingSoilProfile(name, 0.0, new[] { new PipingSoilLayer(1.0) { IsAquifer = true } }, soilProfileType)); }