private static void AssertYieldStressStatePoints(IEnumerable <MacroStabilityInwardsSoilLayer2D> layers, IEnumerable <IMacroStabilityInwardsPreconsolidationStress> preconsolidationStresses,
                                                         IEnumerable <PersistableStatePoint> yieldStressStatePoints)
        {
            Assert.AreEqual(preconsolidationStresses.Count(), yieldStressStatePoints.Count());

            for (var j = 0; j < preconsolidationStresses.Count(); j++)
            {
                IMacroStabilityInwardsPreconsolidationStress preconsolidationStress = preconsolidationStresses.ElementAt(j);

                MacroStabilityInwardsSoilLayer2D layerWithPreconsolidationStress = layers.Single(l => AdvancedMath2D.PointInPolygon(
                                                                                                     preconsolidationStress.Location,
                                                                                                     l.OuterRing.Points,
                                                                                                     l.NestedLayers.Select(nl => nl.OuterRing.Points)));
                PersistableStatePoint yieldStressStatePoint = yieldStressStatePoints.ElementAt(j);

                Assert.IsNotNull(yieldStressStatePoint.Id);
                Assert.AreEqual($"Grensspanning - {layerWithPreconsolidationStress.Data.MaterialName}", yieldStressStatePoint.Label);
                Assert.IsNotNull(yieldStressStatePoint.LayerId);
                Assert.IsFalse(yieldStressStatePoint.IsProbabilistic);

                Assert.AreEqual(preconsolidationStress.Location.X, yieldStressStatePoint.Point.X);
                Assert.AreEqual(preconsolidationStress.Location.Y, yieldStressStatePoint.Point.Z);

                Assert.AreEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPreconsolidationStress(preconsolidationStress).GetDesignValue(), yieldStressStatePoint.Stress.YieldStress);
            }
        }
 private static PersistableStress CreateYieldStress(IMacroStabilityInwardsPreconsolidationStress preconsolidationStress)
 {
     return(new PersistableStress
     {
         YieldStress = MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPreconsolidationStress(preconsolidationStress).GetDesignValue(),
         StateType = PersistableStateType.YieldStress
     });
 }
示例#3
0
        /// <summary>
        /// Gets the <see cref="MacroStabilityInwardsSoilLayer2D"/> the <paramref name="preconsolidationStress"/> is placed on.
        /// </summary>
        /// <param name="layers">The layers of the profile.</param>
        /// <param name="preconsolidationStress">The <see cref="IMacroStabilityInwardsPreconsolidationStress"/> to get the layer for.</param>
        /// <returns>The <see cref="MacroStabilityInwardsSoilLayer2D"/> the <paramref name="preconsolidationStress"/> is placed on;
        /// or <c>null</c> when no layer can be found.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static MacroStabilityInwardsSoilLayer2D GetLayerForPreconsolidationStress(
            IEnumerable <MacroStabilityInwardsSoilLayer2D> layers, IMacroStabilityInwardsPreconsolidationStress preconsolidationStress)
        {
            if (layers == null)
            {
                throw new ArgumentNullException(nameof(layers));
            }

            if (preconsolidationStress == null)
            {
                throw new ArgumentNullException(nameof(preconsolidationStress));
            }

            return(layers.SingleOrDefault(l => AdvancedMath2D.PointInPolygon(
                                              preconsolidationStress.Location,
                                              l.OuterRing.Points,
                                              l.NestedLayers.Select(nl => nl.OuterRing.Points))));
        }
 private static PersistableStatePoint CreateYieldStressStatePoint(MacroStabilityInwardsSoilLayer2D layer, IMacroStabilityInwardsPreconsolidationStress preconsolidationStress,
                                                                  MacroStabilityInwardsExportStageType stageType, IdFactory idFactory, MacroStabilityInwardsExportRegistry registry)
 {
     return(new PersistableStatePoint
     {
         Id = idFactory.Create(),
         LayerId = registry.GeometryLayers[stageType][layer],
         IsProbabilistic = false,
         Point = new PersistablePoint(preconsolidationStress.Location.X, preconsolidationStress.Location.Y),
         Stress = CreateYieldStress(preconsolidationStress),
         Label = string.Format(Resources.PersistableStateFactory_CreateStatePoint_PreconsolidationStress_LayerName_0, layer.Data.MaterialName)
     });
 }
示例#5
0
 /// <summary>
 /// Creates the design variable for a preconsolidation stress definition.
 /// </summary>
 public static VariationCoefficientDesignVariable <VariationCoefficientLogNormalDistribution> GetPreconsolidationStress(IMacroStabilityInwardsPreconsolidationStress preconsolidationStressUnderSurfaceLine)
 {
     return(new VariationCoefficientLogNormalDistributionDesignVariable(preconsolidationStressUnderSurfaceLine.Stress)
     {
         Percentile = 0.05
     });
 }