diff --git a/Structure_Engine/Query/Description.cs b/Structure_Engine/Query/Description.cs index 866a17860..c251d7314 100644 --- a/Structure_Engine/Query/Description.cs +++ b/Structure_Engine/Query/Description.cs @@ -369,6 +369,19 @@ public static string Description(this BuiltUpRibbed property) /***************************************************/ + [Description("Generates a default description for the SurfaceProperty.")] + [Input("property", "The SurfaceProperty to get a default description for.")] + [Output("desc", "The generated description for the property based on its dimensions, material and type.")] + public static string Description(this BuiltUpDoubleRibbed property) + { + if (property == null) + return "null property"; + + return $"Ribbed: {property.TopThickness:G3} THK slab {CheckGetMaterialName(property.Material)} on double {property.RibHeight:G3}x{property.RibThickness:G3} ribs {CheckGetMaterialName(property.RibMaterial ?? property.Material)} spaced {property.RibSpacing:G3}"; + } + + /***************************************************/ + [Description("Generates a default description for the SurfaceProperty.")] [Input("property", "The SurfaceProperty to get a default description for.")] [Output("desc", "The generated description for the property based on its dimensions, material and type.")] diff --git a/Structure_Engine/Query/MassPerArea.cs b/Structure_Engine/Query/MassPerArea.cs index c1345d533..3b22ee3f3 100644 --- a/Structure_Engine/Query/MassPerArea.cs +++ b/Structure_Engine/Query/MassPerArea.cs @@ -185,6 +185,26 @@ public static double MassPerArea(this BuiltUpRibbed property) volPerAreaRibZone * (property.RibMaterial ?? property.Material).Density; } + /***************************************************/ + + [Description("Gets the mass per area for a BuiltUpRibbed.")] + [Input("property", "The BuiltUpRibbed property to calculate the mass per area for.")] + [Output("massPerArea", "The mass per area for the property.", typeof(MassPerUnitArea))] + public static double MassPerArea(this BuiltUpDoubleRibbed property) + { + if (property.IsNull() || property.Material.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness * 2) + { + Base.Compute.RecordError($"The {nameof(BuiltUpDoubleRibbed.RibThickness)} is 0 or {nameof(BuiltUpDoubleRibbed.RibSpacing)} smaller than twice the {nameof(BuiltUpDoubleRibbed.RibThickness)}. The {nameof(BuiltUpDoubleRibbed)} is invalid and mass per area cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness * 2 / property.RibSpacing); + return property.TopThickness * property.Material.Density + + volPerAreaRibZone * (property.RibMaterial ?? property.Material).Density; + } /***************************************************/ /**** Public Methods - Interfaces ****/ diff --git a/Structure_Engine/Query/MaterialComposition.cs b/Structure_Engine/Query/MaterialComposition.cs index 6b91be6a6..c85a6ea95 100644 --- a/Structure_Engine/Query/MaterialComposition.cs +++ b/Structure_Engine/Query/MaterialComposition.cs @@ -145,7 +145,7 @@ public static MaterialComposition MaterialComposition(this ConcreteSection prope [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this Layered property, ReinforcementDensity reinforcementDensity = null) { @@ -172,7 +172,7 @@ public static MaterialComposition MaterialComposition(this Layered property, Rei [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this CorrugatedDeck property, ReinforcementDensity reinforcementDensity = null) { @@ -189,7 +189,7 @@ public static MaterialComposition MaterialComposition(this CorrugatedDeck proper [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this ToppedSlab property, ReinforcementDensity reinforcementDensity = null) { @@ -215,7 +215,7 @@ public static MaterialComposition MaterialComposition(this ToppedSlab property, [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this SlabOnDeck property, ReinforcementDensity reinforcementDensity = null) { @@ -257,7 +257,7 @@ public static MaterialComposition MaterialComposition(this SlabOnDeck property, [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this Cassette property, ReinforcementDensity reinforcementDensity = null) { @@ -286,7 +286,7 @@ public static MaterialComposition MaterialComposition(this Cassette property, Re [Description("Returns a SurfaceProperty's MaterialComposition.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] public static MaterialComposition MaterialComposition(this BuiltUpRibbed property, ReinforcementDensity reinforcementDensity = null) { @@ -308,6 +308,63 @@ public static MaterialComposition MaterialComposition(this BuiltUpRibbed propert new List { property.TopThickness, volPerAreaRibZone }); } + /***************************************************/ + + [Description("Returns a SurfaceProperty's MaterialComposition.")] + [Input("property", "The SurfaceProperty to query.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] + [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] + public static MaterialComposition MaterialComposition(this BuiltUpDoubleRibbed property, ReinforcementDensity reinforcementDensity = null) + { + if (property.IsNull() || property.Material.IsNull()) + return null; + + IMaterialFragment topMat = property.Material; + IMaterialFragment ribMat = property.RibMaterial ?? property.Material; + + bool reinfToSlab = false; + bool reinfToRib = false; + if (reinforcementDensity != null) + { + bool ribIsConcrete = ribMat is Concrete; + bool topIsConcrete = topMat is Concrete; + + if (ribIsConcrete && topIsConcrete) //Both concrete + { + reinfToSlab = true; + reinfToRib = true; + } + else if (ribIsConcrete) //Only rib concrete + { + reinfToRib = true; + Base.Compute.RecordNote($"Only the ribs in the in the {nameof(BuiltUpDoubleRibbed)} is Concrete. Provided {nameof(ReinforcementDensity)} is only applied to the ribs."); + } + else if (topIsConcrete) //Only slab concrete + { + reinfToRib = true; + Base.Compute.RecordNote($"Only the slab in the in the {nameof(BuiltUpDoubleRibbed)} is Concrete. Provided {nameof(ReinforcementDensity)} is only applied to the slab."); + } + else //Neither is concrete. Add to both and record a note + { + reinfToSlab = true; + reinfToRib = true; + Base.Compute.RecordNote($"Neither ribs or slab in the {nameof(BuiltUpDoubleRibbed)} is Concrete. Provided {nameof(ReinforcementDensity)} is applied to both."); + + } + } + + //If only main material provided, use it for all parts + if (property.RibMaterial == null) + return property.Material.MaterialComposition(reinforcementDensity); + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness * 2 / property.RibSpacing); + return Matter.Compute.AggregateMaterialComposition(new List + { + topMat.MaterialComposition(reinfToSlab ? reinforcementDensity : null), + ribMat.MaterialComposition(reinfToRib ? reinforcementDensity : null) + }, + new List { property.TopThickness, volPerAreaRibZone }); + } /***************************************************/ @@ -388,7 +445,7 @@ private static MaterialComposition MaterialComposition(this ISectionProperty sec [Description("Gets the MaterialComposition for homogenous SurfaceProperties. Multi-material properties will not be reported correctly.")] [Input("property", "The SurfaceProperty to query.")] - [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the Panel.")] [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] private static MaterialComposition MaterialComposition(this ISurfaceProperty property, ReinforcementDensity reinforcementDensity = null) { diff --git a/Structure_Engine/Query/TotalThickness.cs b/Structure_Engine/Query/TotalThickness.cs index 99ef4c3f5..c1588c7e2 100644 --- a/Structure_Engine/Query/TotalThickness.cs +++ b/Structure_Engine/Query/TotalThickness.cs @@ -38,7 +38,7 @@ public static partial class Query [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this ConstantThickness property) { return property.IsNull() ? 0 : property.Thickness; @@ -48,7 +48,7 @@ public static double TotalThickness(this ConstantThickness property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this Ribbed property) { return property.IsNull() ? 0 : property.TotalDepth; @@ -58,7 +58,7 @@ public static double TotalThickness(this Ribbed property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this Waffle property) { return property.IsNull() ? 0 : Math.Max(property.TotalDepthX, property.TotalDepthY); @@ -68,7 +68,7 @@ public static double TotalThickness(this Waffle property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this LoadingPanelProperty property) { Base.Compute.RecordWarning("LoadingPanelProperties do not have a thickness."); @@ -79,7 +79,7 @@ public static double TotalThickness(this LoadingPanelProperty property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this Layered property) { if (property.IsNull()) @@ -95,7 +95,7 @@ public static double TotalThickness(this Layered property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this SlabOnDeck property) { if (property.IsNull()) @@ -111,7 +111,7 @@ public static double TotalThickness(this SlabOnDeck property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this CorrugatedDeck property) { if (property.IsNull()) @@ -124,7 +124,7 @@ public static double TotalThickness(this CorrugatedDeck property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this OneDirectionalVoided property) { if (property.IsNull()) @@ -137,7 +137,7 @@ public static double TotalThickness(this OneDirectionalVoided property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this BiDirectionalVoided property) { if (property.IsNull()) @@ -150,7 +150,7 @@ public static double TotalThickness(this BiDirectionalVoided property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this HollowCore property) { if (property.IsNull()) @@ -163,7 +163,7 @@ public static double TotalThickness(this HollowCore property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this ToppedSlab property) { if (property.IsNull()) @@ -176,7 +176,7 @@ public static double TotalThickness(this ToppedSlab property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this Cassette property) { if (property.IsNull()) @@ -189,7 +189,7 @@ public static double TotalThickness(this Cassette property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double TotalThickness(this BuiltUpRibbed property) { if (property.IsNull()) @@ -198,6 +198,18 @@ public static double TotalThickness(this BuiltUpRibbed property) return property.TopThickness + property.RibHeight; } + /***************************************************/ + + [Description("Gets the total thickness of the SurfaceProperty.")] + [Input("property", "The property to evaluate.")] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + public static double TotalThickness(this BuiltUpDoubleRibbed property) + { + if (property.IsNull()) + return 0; + + return property.TopThickness + property.RibHeight; + } /***************************************************/ /**** Public Methods - Interfaces ****/ @@ -205,7 +217,7 @@ public static double TotalThickness(this BuiltUpRibbed property) [Description("Gets the total thickness of the surface property.")] [Input("property", "The property to evaluate.")] - [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + [Output("totalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] public static double ITotalThickness(this ISurfaceProperty property) { return property.IsNull() ? 0 : TotalThickness(property as dynamic); diff --git a/Structure_Engine/Query/VolumePerArea.cs b/Structure_Engine/Query/VolumePerArea.cs index 90ac55127..e93fd022d 100644 --- a/Structure_Engine/Query/VolumePerArea.cs +++ b/Structure_Engine/Query/VolumePerArea.cs @@ -294,6 +294,27 @@ public static double VolumePerArea(this BuiltUpRibbed property) double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); return property.TopThickness + volPerAreaRibZone; } + + /***************************************************/ + + [Description("Gets the volume per area of the property for the purpose of calculating solid volume.")] + [Input("property", "The property to evaluate the volume per area of.")] + [Output("volumePerArea", "The volume per area of the property for the purpose of calculating solid volume.", typeof(Length))] + public static double VolumePerArea(this BuiltUpDoubleRibbed property) + { + if (property.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness * 2) + { + Base.Compute.RecordError($"The {nameof(BuiltUpDoubleRibbed.RibThickness)} is 0 or {nameof(BuiltUpDoubleRibbed.RibSpacing)} smaller than twice the {nameof(BuiltUpDoubleRibbed.RibThickness)}. The {nameof(BuiltUpDoubleRibbed)} is invalid and volume cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness * 2 / property.RibSpacing); + return property.TopThickness + volPerAreaRibZone; + } + /***************************************************/ /**** Public Methods - Interfaces ****/ /***************************************************/